diff --git a/src/ui/form/controls/formwindow.h b/src/ui/form/controls/formwindow.h index 6a7681ea..79566ad5 100644 --- a/src/ui/form/controls/formwindow.h +++ b/src/ui/form/controls/formwindow.h @@ -27,9 +27,6 @@ public: virtual WindowCode windowCode() const { return WindowNone; } - bool deleteOnClose() const override { return m_deleteOnClose; } - void setDeleteOnClose(bool v) { m_deleteOnClose = v; } - bool excludeFromCapture() const { return m_excludeFromCapture; } void setExcludeFromCapture(bool v); @@ -46,7 +43,6 @@ private: void setupWindowCapture(IniUser *iniUser, const QString &iniGroup); private: - bool m_deleteOnClose : 1 = false; bool m_excludeFromCapture : 1 = false; WidgetWindowStateWatcher *m_stateWatcher = nullptr; diff --git a/src/ui/form/graph/graphwindow.cpp b/src/ui/form/graph/graphwindow.cpp index bf348bee..d0c4294b 100644 --- a/src/ui/form/graph/graphwindow.cpp +++ b/src/ui/form/graph/graphwindow.cpp @@ -94,7 +94,7 @@ GraphWindow::GraphWindow(QWidget *parent) : FormWindow(parent) bool GraphWindow::deleteOnClose() const { - return !iniUser()->graphWindowHideOnClose() || FormWindow::deleteOnClose(); + return !iniUser()->graphWindowHideOnClose(); } ConfManager *GraphWindow::confManager() const diff --git a/src/ui/form/opt/optionswindow.cpp b/src/ui/form/opt/optionswindow.cpp index bf2ab41b..96ca199e 100644 --- a/src/ui/form/opt/optionswindow.cpp +++ b/src/ui/form/opt/optionswindow.cpp @@ -41,13 +41,6 @@ void OptionsWindow::selectTab(int index) m_mainPage->selectTab(index); } -void OptionsWindow::cancelChanges() -{ - if (ctrl()->confToEdit() && ctrl()->anyEdited()) { - ctrl()->resetEdited(); - } -} - void OptionsWindow::saveWindowState(bool /*wasVisible*/) { iniUser()->setOptWindowGeometry(stateWatcher()->geometry()); diff --git a/src/ui/form/opt/optionswindow.h b/src/ui/form/opt/optionswindow.h index fd854a7a..85437fb3 100644 --- a/src/ui/form/opt/optionswindow.h +++ b/src/ui/form/opt/optionswindow.h @@ -24,8 +24,6 @@ public: void selectTab(int index); - void cancelChanges(); - void saveWindowState(bool wasVisible) override; void restoreWindowState() override; diff --git a/src/ui/manager/windowmanager.cpp b/src/ui/manager/windowmanager.cpp index 8ac4a7d8..5df08fb4 100644 --- a/src/ui/manager/windowmanager.cpp +++ b/src/ui/manager/windowmanager.cpp @@ -428,7 +428,6 @@ void WindowManager::showOptionsWindow() void WindowManager::closeOptionsWindow() { if (closeWindow(m_optWindow)) { - m_optWindow->cancelChanges(); m_optWindow = nullptr; } } @@ -438,16 +437,11 @@ void WindowManager::reloadOptionsWindow(const QString &reason) if (!m_optWindow) return; - const bool wasVisible = m_optWindow->isVisible(); - // Unsaved changes are lost - m_optWindow->setDeleteOnClose(true); closeOptionsWindow(); - if (wasVisible) { - // Show after new conf initialization - QMetaObject::invokeMethod(this, &WindowManager::showOptionsWindow, Qt::QueuedConnection); - } + // Show after new conf initialization + QMetaObject::invokeMethod(this, &WindowManager::showOptionsWindow, Qt::QueuedConnection); showTrayMessage(reason); }