summaryrefslogtreecommitdiff
path: root/src/gui/windows/confirmdialog.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-10-17 23:53:38 +0300
committerAndrei Karas <akaras@inbox.ru>2013-10-19 15:12:18 +0300
commit649348f19cdb3d65f825a2a3270b185fc9d83c75 (patch)
tree3a31f64178d266383899c67782843736578e580e /src/gui/windows/confirmdialog.cpp
parent0c6d457fe227ba9fd0a7c4c51cc2eb5995ca2c19 (diff)
downloadmv-649348f19cdb3d65f825a2a3270b185fc9d83c75.tar.gz
mv-649348f19cdb3d65f825a2a3270b185fc9d83c75.tar.bz2
mv-649348f19cdb3d65f825a2a3270b185fc9d83c75.tar.xz
mv-649348f19cdb3d65f825a2a3270b185fc9d83c75.zip
move virtual member calls from confirmdialog constuctor into postInit.
Diffstat (limited to 'src/gui/windows/confirmdialog.cpp')
-rw-r--r--src/gui/windows/confirmdialog.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gui/windows/confirmdialog.cpp b/src/gui/windows/confirmdialog.cpp
index 34c54582c..863cb1cf3 100644
--- a/src/gui/windows/confirmdialog.cpp
+++ b/src/gui/windows/confirmdialog.cpp
@@ -38,17 +38,22 @@ ConfirmDialog::ConfirmDialog(const std::string &title, const std::string &msg,
const bool modal, Window *const parent):
Window(title, modal, parent, "confirm.xml"),
gcn::ActionListener(),
- mTextBox(new TextBox(this))
+ mTextBox(new TextBox(this)),
+ mIgnore(ignore)
{
mTextBox->setEditable(false);
mTextBox->setOpaque(false);
mTextBox->setTextWrapped(msg, 260);
+ soundManager.playGuiSound(soundEvent);
+}
+void ConfirmDialog::postInit()
+{
// TRANSLATORS: confirm dialog button
Button *const yesButton = new Button(this, _("Yes"), "yes", this);
// TRANSLATORS: confirm dialog button
Button *const noButton = new Button(this, _("No"), "no", this);
- Button *const ignoreButton = ignore ? new Button(
+ Button *const ignoreButton = mIgnore ? new Button(
// TRANSLATORS: confirm dialog button
this, _("Ignore"), "ignore", this) : nullptr;
@@ -61,7 +66,7 @@ ConfirmDialog::ConfirmDialog(const std::string &title, const std::string &msg,
const int fontHeight = getFont()->getHeight();
const int height = numRows * fontHeight;
- int width = getFont()->getWidth(title);
+ int width = getFont()->getWidth(getCaption());
if (width < mTextBox->getMinWidth())
width = mTextBox->getMinWidth();
@@ -88,7 +93,7 @@ ConfirmDialog::ConfirmDialog(const std::string &title, const std::string &msg,
add(yesButton);
add(noButton);
- if (ignore && ignoreButton)
+ if (mIgnore && ignoreButton)
add(ignoreButton);
if (getParent())
@@ -98,7 +103,6 @@ ConfirmDialog::ConfirmDialog(const std::string &title, const std::string &msg,
}
setVisible(true);
yesButton->requestFocus();
- soundManager.playGuiSound(soundEvent);
}
void ConfirmDialog::action(const gcn::ActionEvent &event)