diff options
-rw-r--r-- | src/gui/windows/chatwindow.cpp | 3 | ||||
-rw-r--r-- | src/gui/windows/emotewindow.cpp | 3 | ||||
-rw-r--r-- | src/gui/windows/minimap.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/setupwindow.cpp | 9 | ||||
-rw-r--r-- | src/gui/windows/setupwindow.h | 2 | ||||
-rw-r--r-- | src/gui/windows/shortcutwindow.cpp | 5 | ||||
-rw-r--r-- | src/progs/manaplus/actions/actions.cpp | 8 |
7 files changed, 16 insertions, 16 deletions
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index a3b777655..56c9617b0 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -136,9 +136,6 @@ ChatWindow::ChatWindow(const std::string &name) : { setWindowName(name); - if (setupWindow != nullptr) - setupWindow->registerWindowForReset(this); - setShowTitle(false); setResizable(true); setDefaultVisible(true); diff --git a/src/gui/windows/emotewindow.cpp b/src/gui/windows/emotewindow.cpp index 628cdb53c..ac6773ece 100644 --- a/src/gui/windows/emotewindow.cpp +++ b/src/gui/windows/emotewindow.cpp @@ -79,9 +79,6 @@ EmoteWindow::EmoteWindow() : setShowTitle(false); setResizable(true); - if (setupWindow != nullptr) - setupWindow->registerWindowForReset(this); - addMouseListener(this); } diff --git a/src/gui/windows/minimap.cpp b/src/gui/windows/minimap.cpp index d40efd032..f45de81d4 100644 --- a/src/gui/windows/minimap.cpp +++ b/src/gui/windows/minimap.cpp @@ -82,8 +82,6 @@ Minimap::Minimap() : // set this to false as the minimap window size is changed // depending on the map size setResizable(true); - if (setupWindow != nullptr) - setupWindow->registerWindowForReset(this); setDefaultVisible(true); setSaveVisible(true); diff --git a/src/gui/windows/setupwindow.cpp b/src/gui/windows/setupwindow.cpp index aa96feaf6..804e46b32 100644 --- a/src/gui/windows/setupwindow.cpp +++ b/src/gui/windows/setupwindow.cpp @@ -287,15 +287,22 @@ void SetupWindow::unregisterWindowForReset(const Window *const window) } } -void SetupWindow::hideWindows() +bool SetupWindow::hideWindows() { + bool wasVisible = false; FOR_EACH (std::list<Window*>::const_iterator, it, mWindowsToReset) { Window *const window = *it; if ((window != nullptr) && !window->isSticky()) + { + wasVisible = wasVisible || window->isVisible(); window->setVisible(Visible_false); + } } + wasVisible = wasVisible || isVisible(); setVisible(Visible_false); + + return wasVisible; } void SetupWindow::doCancel() diff --git a/src/gui/windows/setupwindow.h b/src/gui/windows/setupwindow.h index 192df546e..dd825d1f5 100644 --- a/src/gui/windows/setupwindow.h +++ b/src/gui/windows/setupwindow.h @@ -63,7 +63,7 @@ class SetupWindow final : public Window, void unregisterWindowForReset(const Window *const window); - void hideWindows(); + bool hideWindows(); void clearWindowsForReset() { mWindowsToReset.clear(); } diff --git a/src/gui/windows/shortcutwindow.cpp b/src/gui/windows/shortcutwindow.cpp index d701cd927..9122220f4 100644 --- a/src/gui/windows/shortcutwindow.cpp +++ b/src/gui/windows/shortcutwindow.cpp @@ -74,8 +74,6 @@ ShortcutWindow::ShortcutWindow(const std::string &restrict title, if (content != nullptr) content->setSkin(this, mSkin); - if (setupWindow != nullptr) - setupWindow->registerWindowForReset(this); setMinWidth(32); setMinHeight(32); @@ -132,9 +130,6 @@ ShortcutWindow::ShortcutWindow(const std::string &restrict title, mDragOffsetX = 0; mDragOffsetY = 0; - if (setupWindow != nullptr) - setupWindow->registerWindowForReset(this); - if ((width != 0) && (height != 0)) setDefaultSize(width, height, ImagePosition::LOWER_RIGHT, 0, 0); diff --git a/src/progs/manaplus/actions/actions.cpp b/src/progs/manaplus/actions/actions.cpp index 92c0f0050..6b7965957 100644 --- a/src/progs/manaplus/actions/actions.cpp +++ b/src/progs/manaplus/actions/actions.cpp @@ -433,7 +433,13 @@ impHandler0(quit) PopupManager::closePopupMenu(); return true; } - else if (quitDialog == nullptr) + else if (setupWindow != nullptr) + { + bool wasVisible = setupWindow->hideWindows(); + if (wasVisible) + return true; + } + if (quitDialog == nullptr) { CREATEWIDGETV(quitDialog, QuitDialog, &quitDialog); |