summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-13 21:53:58 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-13 21:53:58 +0300
commit2980c3ca3737afaf39cc8a8595737f131adacf5d (patch)
tree89c3d917c87cb3cbde37d285eac319920f8a4307
parent1cda5b8f7fd7d2cb6eeca4e15ee14909aa3387c2 (diff)
downloadmv-2980c3ca3737afaf39cc8a8595737f131adacf5d.tar.gz
mv-2980c3ca3737afaf39cc8a8595737f131adacf5d.tar.bz2
mv-2980c3ca3737afaf39cc8a8595737f131adacf5d.tar.xz
mv-2980c3ca3737afaf39cc8a8595737f131adacf5d.zip
Fix virtual member call in Window constructor.
-rw-r--r--src/gui/widgets/widget.h2
-rw-r--r--src/gui/widgets/window.cpp13
-rw-r--r--src/gui/widgets/window.h3
3 files changed, 14 insertions, 4 deletions
diff --git a/src/gui/widgets/widget.h b/src/gui/widgets/widget.h
index bbb1bc103..bb41054d2 100644
--- a/src/gui/widgets/widget.h
+++ b/src/gui/widgets/widget.h
@@ -730,7 +730,7 @@ class Widget notfinal : public Widget2
* @throws Exception if another widget already has modal focus.
* @see releaseModalFocus, isModalFocused
*/
- virtual void requestModalFocus();
+ void requestModalFocus();
/**
* Requests modal mouse input focus. When a widget has modal input focus
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp
index 874a0ae14..5d48cfad3 100644
--- a/src/gui/widgets/window.cpp
+++ b/src/gui/widgets/window.cpp
@@ -230,7 +230,7 @@ Window::Window(const std::string &caption,
}
// Windows are invisible by default
- setVisible(Visible_false);
+ setVisible(Visible_false, false);
addWidgetListener(this);
mForegroundColor = getThemeColor(ThemeColorId::WINDOW);
@@ -238,6 +238,17 @@ Window::Window(const std::string &caption,
setPalette(childPalette);
}
+void Window::postInit()
+{
+ if (mInit)
+ {
+ reportAlways("error: Window created with calling postInit() "
+ "more than once: %s",
+ mWindowName.c_str());
+ }
+ mInit = true;
+}
+
Window::~Window()
{
logger->log("Window::~Window(\"%s\")", getCaption().c_str());
diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h
index e371de36f..d089680af 100644
--- a/src/gui/widgets/window.h
+++ b/src/gui/widgets/window.h
@@ -298,8 +298,7 @@ class Window notfinal : public BasicContainer2,
void setSaveVisible(const bool save)
{ mSaveVisible = save; }
- void postInit() override
- { mInit = true; }
+ void postInit() override;
/**
* Returns the parent window.