diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-05 18:40:31 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-05 18:40:31 +0300 |
commit | e6d251345a48108495d39d82b0ec79deac63d86d (patch) | |
tree | e7a8ecf138b30b091146f51e1b13f0e0e7c0359b /src/gui | |
parent | 71fd4e8d3255e15c16a4f4b51c87222c661a5b33 (diff) | |
download | manaplus-e6d251345a48108495d39d82b0ec79deac63d86d.tar.gz manaplus-e6d251345a48108495d39d82b0ec79deac63d86d.tar.bz2 manaplus-e6d251345a48108495d39d82b0ec79deac63d86d.tar.xz manaplus-e6d251345a48108495d39d82b0ec79deac63d86d.zip |
Add strong typed bool type in OkDialog.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/dialogsmanager.cpp | 14 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_input.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_theme.cpp | 9 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_video.cpp | 8 | ||||
-rw-r--r-- | src/gui/windows/changeemaildialog.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/changepassworddialog.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/charcreatedialog.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/charselectdialog.cpp | 4 | ||||
-rw-r--r-- | src/gui/windows/editserverdialog.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/okdialog.cpp | 4 | ||||
-rw-r--r-- | src/gui/windows/okdialog.h | 2 | ||||
-rw-r--r-- | src/gui/windows/registerdialog.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/socialwindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/windows/unregisterdialog.cpp | 2 |
14 files changed, 32 insertions, 25 deletions
diff --git a/src/gui/dialogsmanager.cpp b/src/gui/dialogsmanager.cpp index b71a27664..9d2bcb057 100644 --- a/src/gui/dialogsmanager.cpp +++ b/src/gui/dialogsmanager.cpp @@ -105,7 +105,10 @@ Window *DialogsManager::openErrorDialog(const std::string &header, // TRANSLATORS: ok dialog button _("Close"), DialogType::ERROR, - modal, true, nullptr, 260); + modal, + ShowCenter_true, + nullptr, + 260); } else { @@ -129,7 +132,10 @@ void DialogsManager::playerDeath() // TRANSLATORS: ok dialog button _("Revive"), DialogType::OK, - Modal_false, true, nullptr, 260); + Modal_false, + ShowCenter_true, + nullptr, + 260); deathNotice->addActionListener(&postDeathListener); } } @@ -158,7 +164,7 @@ void DialogsManager::attributeChanged(const int id, _("OK"), DialogType::OK, Modal_false, - true, + ShowCenter_true, nullptr, 260); weightNotice->addActionListener( @@ -177,7 +183,7 @@ void DialogsManager::attributeChanged(const int id, _("OK"), DialogType::OK, Modal_false, - true, + ShowCenter_true, nullptr, 260); weightNotice->addActionListener( diff --git a/src/gui/widgets/tabs/setup_input.cpp b/src/gui/widgets/tabs/setup_input.cpp index 3328cdb28..4eb81bc4a 100644 --- a/src/gui/widgets/tabs/setup_input.cpp +++ b/src/gui/widgets/tabs/setup_input.cpp @@ -164,7 +164,7 @@ void Setup_Input::apply() _("OK"), DialogType::ERROR, Modal_true, - true, + ShowCenter_true, nullptr, 260); } diff --git a/src/gui/widgets/tabs/setup_theme.cpp b/src/gui/widgets/tabs/setup_theme.cpp index e795b0928..9efba0897 100644 --- a/src/gui/widgets/tabs/setup_theme.cpp +++ b/src/gui/widgets/tabs/setup_theme.cpp @@ -312,7 +312,7 @@ void Setup_Theme::action(const ActionEvent &event) _("OK"), DialogType::OK, Modal_false, - true, + ShowCenter_true, nullptr, 600); } @@ -340,13 +340,14 @@ void Setup_Theme::apply() if (config.getStringValue("theme") != mTheme) { // TRANSLATORS: theme message dialog - new OkDialog(_("Theme Changed"), _("Restart your client for " - "the change to take effect."), + new OkDialog(_("Theme Changed"), + // TRANSLATORS: ok dialog message + _("Restart your client for the change to take effect."), // TRANSLATORS: ok dialog button _("OK"), DialogType::OK, Modal_true, - true, + ShowCenter_true, nullptr, 260); } diff --git a/src/gui/widgets/tabs/setup_video.cpp b/src/gui/widgets/tabs/setup_video.cpp index 8c4be5f85..c2ee237e5 100644 --- a/src/gui/widgets/tabs/setup_video.cpp +++ b/src/gui/widgets/tabs/setup_video.cpp @@ -250,7 +250,7 @@ void Setup_Video::apply() _("OK"), DialogType::OK, Modal_true, - true, + ShowCenter_true, nullptr, 260); } @@ -277,7 +277,7 @@ void Setup_Video::apply() _("OK"), DialogType::OK, Modal_true, - true, + ShowCenter_true, nullptr, 260); } @@ -395,7 +395,7 @@ void Setup_Video::action(const ActionEvent &event) _("OK"), DialogType::OK, Modal_true, - true, + ShowCenter_true, nullptr, 260); } @@ -410,7 +410,7 @@ void Setup_Video::action(const ActionEvent &event) _("OK"), DialogType::OK, Modal_true, - true, + ShowCenter_true, nullptr, 260); } diff --git a/src/gui/windows/changeemaildialog.cpp b/src/gui/windows/changeemaildialog.cpp index 953f8e75c..fcfd0bfd3 100644 --- a/src/gui/windows/changeemaildialog.cpp +++ b/src/gui/windows/changeemaildialog.cpp @@ -167,7 +167,7 @@ void ChangeEmailDialog::action(const ActionEvent &event) _("OK"), DialogType::ERROR, Modal_true, - true, + ShowCenter_true, nullptr, 260); dlg->addActionListener(mWrongDataNoticeListener); diff --git a/src/gui/windows/changepassworddialog.cpp b/src/gui/windows/changepassworddialog.cpp index 24f8055f6..3fae963ed 100644 --- a/src/gui/windows/changepassworddialog.cpp +++ b/src/gui/windows/changepassworddialog.cpp @@ -157,7 +157,7 @@ void ChangePasswordDialog::action(const ActionEvent &event) _("OK"), DialogType::ERROR, Modal_true, - true, + ShowCenter_true, nullptr, 260); dlg->addActionListener(mWrongDataNoticeListener); diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp index 065e6db15..4b10d5cf3 100644 --- a/src/gui/windows/charcreatedialog.cpp +++ b/src/gui/windows/charcreatedialog.cpp @@ -380,7 +380,7 @@ void CharCreateDialog::action(const ActionEvent &event) _("OK"), DialogType::ERROR, Modal_true, - this, + ShowCenter_true, nullptr, 260); } diff --git a/src/gui/windows/charselectdialog.cpp b/src/gui/windows/charselectdialog.cpp index 6d3c75e87..4dc0440aa 100644 --- a/src/gui/windows/charselectdialog.cpp +++ b/src/gui/windows/charselectdialog.cpp @@ -280,7 +280,7 @@ void CharSelectDialog::action(const ActionEvent &event) _("OK"), DialogType::SILENCE, Modal_true, - true, + ShowCenter_true, nullptr, 260); } @@ -325,7 +325,7 @@ void CharSelectDialog::action(const ActionEvent &event) _("OK"), DialogType::ERROR, Modal_true, - true, + ShowCenter_true, nullptr, 260); } diff --git a/src/gui/windows/editserverdialog.cpp b/src/gui/windows/editserverdialog.cpp index 5ad5c9c32..a9be34595 100644 --- a/src/gui/windows/editserverdialog.cpp +++ b/src/gui/windows/editserverdialog.cpp @@ -217,7 +217,7 @@ void EditServerDialog::action(const ActionEvent &event) _("OK"), DialogType::ERROR, Modal_true, - true, + ShowCenter_true, nullptr, 260); dlg->addActionListener(this); diff --git a/src/gui/windows/okdialog.cpp b/src/gui/windows/okdialog.cpp index 1f77af3f9..1a6c0c3c8 100644 --- a/src/gui/windows/okdialog.cpp +++ b/src/gui/windows/okdialog.cpp @@ -39,7 +39,7 @@ OkDialog::OkDialog(const std::string &restrict title, const std::string &restrict button, const int soundEvent, const Modal modal, - const bool showCenter, + const ShowCenter showCenter, Window *const parent, const int minWidth) : Window(title, modal, parent, "ok.xml"), @@ -73,7 +73,7 @@ OkDialog::OkDialog(const std::string &restrict title, add(mTextBox); add(okButton); - if (showCenter) + if (showCenter == ShowCenter_true) center(); else centerHorisontally(); diff --git a/src/gui/windows/okdialog.h b/src/gui/windows/okdialog.h index 3d7fd140b..1a6b022d9 100644 --- a/src/gui/windows/okdialog.h +++ b/src/gui/windows/okdialog.h @@ -50,7 +50,7 @@ class OkDialog final : public Window, const std::string &restrict button, const int soundEvent, const Modal modal, - const bool showCenter, + const ShowCenter showCenter, Window *const parent, const int minWidth); diff --git a/src/gui/windows/registerdialog.cpp b/src/gui/windows/registerdialog.cpp index dca38dad6..70537bd95 100644 --- a/src/gui/windows/registerdialog.cpp +++ b/src/gui/windows/registerdialog.cpp @@ -243,7 +243,7 @@ void RegisterDialog::action(const ActionEvent &event) _("Error"), errorMsg, _("OK"), DialogType::ERROR, Modal_true, - true, + ShowCenter_true, nullptr, 260); dlg->addActionListener(mWrongDataNoticeListener); diff --git a/src/gui/windows/socialwindow.cpp b/src/gui/windows/socialwindow.cpp index f1d5550dd..ffe9688c6 100644 --- a/src/gui/windows/socialwindow.cpp +++ b/src/gui/windows/socialwindow.cpp @@ -507,7 +507,7 @@ void SocialWindow::showPartyCreate() _("OK"), DialogType::ERROR, Modal_true, - true, + ShowCenter_true, this, 260); return; diff --git a/src/gui/windows/unregisterdialog.cpp b/src/gui/windows/unregisterdialog.cpp index 7dc18da4e..32b2e9555 100644 --- a/src/gui/windows/unregisterdialog.cpp +++ b/src/gui/windows/unregisterdialog.cpp @@ -146,7 +146,7 @@ void UnRegisterDialog::action(const ActionEvent &event) _("OK"), DialogType::ERROR, Modal_true, - true, + ShowCenter_true, nullptr, 260); dlg->addActionListener(mWrongDataNoticeListener); |