mirror of
https://github.com/tnodir/fort
synced 2024-11-15 01:55:44 +00:00
UI: Form windows should be deleted on close
This commit is contained in:
parent
0ebb70eb6e
commit
43893f60ed
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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());
|
||||
|
@ -24,8 +24,6 @@ public:
|
||||
|
||||
void selectTab(int index);
|
||||
|
||||
void cancelChanges();
|
||||
|
||||
void saveWindowState(bool wasVisible) override;
|
||||
void restoreWindowState() override;
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user