diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-18 21:52:57 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-18 22:06:50 +0300 |
commit | 7272851afd9e3a8fcdb531900a8e5c43af417a4b (patch) | |
tree | 4c39553287cf3f6edc1d5ca620f3c4e780d69df6 /src/gui | |
parent | e21479ccc48ed8383a6ab72f45c43e12e8dffa69 (diff) | |
download | manaplus-7272851afd9e3a8fcdb531900a8e5c43af417a4b.tar.gz manaplus-7272851afd9e3a8fcdb531900a8e5c43af417a4b.tar.bz2 manaplus-7272851afd9e3a8fcdb531900a8e5c43af417a4b.tar.xz manaplus-7272851afd9e3a8fcdb531900a8e5c43af417a4b.zip |
Add parameter for button name in okdialog.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/dialogsmanager.cpp | 5 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_input.cpp | 5 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_theme.cpp | 10 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_video.cpp | 23 | ||||
-rw-r--r-- | src/gui/windows/changeemaildialog.cpp | 5 | ||||
-rw-r--r-- | src/gui/windows/changepassworddialog.cpp | 5 | ||||
-rw-r--r-- | src/gui/windows/charcreatedialog.cpp | 5 | ||||
-rw-r--r-- | src/gui/windows/charselectdialog.cpp | 10 | ||||
-rw-r--r-- | src/gui/windows/editserverdialog.cpp | 5 | ||||
-rw-r--r-- | src/gui/windows/okdialog.cpp | 5 | ||||
-rw-r--r-- | src/gui/windows/okdialog.h | 1 | ||||
-rw-r--r-- | src/gui/windows/registerdialog.cpp | 3 | ||||
-rw-r--r-- | src/gui/windows/socialwindow.cpp | 5 | ||||
-rw-r--r-- | src/gui/windows/unregisterdialog.cpp | 5 |
14 files changed, 72 insertions, 20 deletions
diff --git a/src/gui/dialogsmanager.cpp b/src/gui/dialogsmanager.cpp index e456b254f..f11c7d9a1 100644 --- a/src/gui/dialogsmanager.cpp +++ b/src/gui/dialogsmanager.cpp @@ -73,7 +73,10 @@ Window *DialogsManager::openErrorDialog(const std::string &header, { if (settings.supportUrl.empty() || config.getBoolValue("hidesupport")) { - return new OkDialog(header, message, DialogType::ERROR, + return new OkDialog(header, message, + // TRANSLATORS: ok dialog button + _("OK"), + DialogType::ERROR, modal, true, nullptr, 260); } else diff --git a/src/gui/widgets/tabs/setup_input.cpp b/src/gui/widgets/tabs/setup_input.cpp index 50bdf96ec..b6e245c2b 100644 --- a/src/gui/widgets/tabs/setup_input.cpp +++ b/src/gui/widgets/tabs/setup_input.cpp @@ -150,7 +150,10 @@ void Setup_Input::apply() // TRANSLATORS: input settings error strprintf(_("Conflict \"%s\" and \"%s\" keys. " "Resolve them, or gameplay may result in strange behaviour."), - gettext(str1.c_str()), gettext(str2.c_str())), DialogType::ERROR, + gettext(str1.c_str()), gettext(str2.c_str())), + // TRANSLATORS: ok dialog button + _("OK"), + DialogType::ERROR, true, true, nullptr, 260); } keyboard.setEnabled(true); diff --git a/src/gui/widgets/tabs/setup_theme.cpp b/src/gui/widgets/tabs/setup_theme.cpp index b719537f7..c74a8bade 100644 --- a/src/gui/widgets/tabs/setup_theme.cpp +++ b/src/gui/widgets/tabs/setup_theme.cpp @@ -306,7 +306,10 @@ void Setup_Theme::action(const ActionEvent &event) else if (eventId == ACTION_INFO) { // TRANSLATORS: theme info dialog header - new OkDialog(_("Theme info"), mThemeInfo, DialogType::OK, + new OkDialog(_("Theme info"), mThemeInfo, + // TRANSLATORS: ok dialog button + _("OK"), + DialogType::OK, false, true, nullptr, 600); } } @@ -334,7 +337,10 @@ void Setup_Theme::apply() { // TRANSLATORS: theme message dialog new OkDialog(_("Theme Changed"), _("Restart your client for " - "the change to take effect."), DialogType::OK, + "the change to take effect."), + // TRANSLATORS: ok dialog button + _("OK"), + DialogType::OK, true, true, nullptr, 260); } diff --git a/src/gui/widgets/tabs/setup_video.cpp b/src/gui/widgets/tabs/setup_video.cpp index 116541d2d..41cf19a7f 100644 --- a/src/gui/widgets/tabs/setup_video.cpp +++ b/src/gui/widgets/tabs/setup_video.cpp @@ -242,7 +242,11 @@ void Setup_Video::apply() // TRANSLATORS: video settings warning new OkDialog(_("Switching to Full Screen"), // TRANSLATORS: video settings warning - _("Restart needed for changes to take effect.")); + _("Restart needed for changes to take effect."), + // TRANSLATORS: ok dialog button + _("OK"), + DialogType::OK, + true, true, nullptr, 260); } #endif config.setValue("screen", fullscreen); @@ -263,7 +267,10 @@ void Setup_Video::apply() new OkDialog(_("Changing to OpenGL"), // TRANSLATORS: video settings warning _("Applying change to OpenGL requires restart."), - DialogType::OK, true, true, nullptr, 260); + // TRANSLATORS: ok dialog button + _("OK"), + DialogType::OK, + true, true, nullptr, 260); } mFps = mFpsCheckBox->isSelected() ? @@ -374,7 +381,11 @@ void Setup_Video::action(const ActionEvent &event) // TRANSLATORS: video settings warning _("Restart your client for the change to take effect.") + std::string("\n") + _("Some windows may be moved to " - "fit the lowered resolution.")); + "fit the lowered resolution."), + // TRANSLATORS: ok dialog button + _("OK"), + DialogType::OK, + true, true, nullptr, 260); } else { @@ -382,7 +393,11 @@ void Setup_Video::action(const ActionEvent &event) new OkDialog(_("Screen Resolution Changed"), // TRANSLATORS: video settings warning _("Restart your client for the change" - " to take effect.")); + " to take effect."), + // TRANSLATORS: ok dialog button + _("OK"), + DialogType::OK, + true, true, nullptr, 260); } } #else diff --git a/src/gui/windows/changeemaildialog.cpp b/src/gui/windows/changeemaildialog.cpp index d7dcbacbf..3df98f589 100644 --- a/src/gui/windows/changeemaildialog.cpp +++ b/src/gui/windows/changeemaildialog.cpp @@ -166,7 +166,10 @@ void ChangeEmailDialog::action(const ActionEvent &event) // TRANSLATORS: change email error header OkDialog *const dlg = new OkDialog(_("Error"), - errorMsg.str(), DialogType::ERROR, + errorMsg.str(), + // TRANSLATORS: ok dialog button + _("OK"), + DialogType::ERROR, true, true, nullptr, 260); dlg->addActionListener(mWrongDataNoticeListener); } diff --git a/src/gui/windows/changepassworddialog.cpp b/src/gui/windows/changepassworddialog.cpp index b2ca3ebad..0ec8999dc 100644 --- a/src/gui/windows/changepassworddialog.cpp +++ b/src/gui/windows/changepassworddialog.cpp @@ -156,7 +156,10 @@ void ChangePasswordDialog::action(const ActionEvent &event) // TRANSLATORS: change password error header OkDialog *const dlg = new OkDialog(_("Error"), - errorMsg.str(), DialogType::ERROR, + errorMsg.str(), + // TRANSLATORS: ok dialog button + _("OK"), + DialogType::ERROR, true, true, nullptr, 260); dlg->addActionListener(mWrongDataNoticeListener); } diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp index 75e552f54..765436ffb 100644 --- a/src/gui/windows/charcreatedialog.cpp +++ b/src/gui/windows/charcreatedialog.cpp @@ -368,7 +368,10 @@ void CharCreateDialog::action(const ActionEvent &event) new OkDialog(_("Error"), // TRANSLATORS: char creation error _("Your name needs to be at least 4 characters."), - DialogType::ERROR, true, this, nullptr, 260); + // TRANSLATORS: ok dialog button + _("OK"), + DialogType::ERROR, + true, this, nullptr, 260); } } else if (id == "cancel") diff --git a/src/gui/windows/charselectdialog.cpp b/src/gui/windows/charselectdialog.cpp index 678fe09f7..17e2510bb 100644 --- a/src/gui/windows/charselectdialog.cpp +++ b/src/gui/windows/charselectdialog.cpp @@ -240,7 +240,10 @@ void CharSelectDialog::action(const ActionEvent &event) character->data.mAttributes[Attributes::EXP]), Units::formatCurrency( character->data.mAttributes[Attributes::MONEY]).c_str()); - new OkDialog(data->getName(), msg, DialogType::SILENCE, + new OkDialog(data->getName(), msg, + // TRANSLATORS: ok dialog button + _("OK"), + DialogType::SILENCE, true, true, nullptr, 260); } } @@ -274,7 +277,10 @@ void CharSelectDialog::action(const ActionEvent &event) { // TRANSLATORS: error message new OkDialog(_("Error"), _("Incorrect password"), - DialogType::ERROR, true, true, nullptr, 260); + // TRANSLATORS: ok dialog button + _("OK"), + DialogType::ERROR, + true, true, nullptr, 260); } mDeleteIndex = -1; } diff --git a/src/gui/windows/editserverdialog.cpp b/src/gui/windows/editserverdialog.cpp index 1b8127eaf..a89b36562 100644 --- a/src/gui/windows/editserverdialog.cpp +++ b/src/gui/windows/editserverdialog.cpp @@ -194,7 +194,10 @@ void EditServerDialog::action(const ActionEvent &event) OkDialog *const dlg = new OkDialog(_("Error"), // TRANSLATORS: edit server dialog error message _("Please at least type both the address and the port " - "of the server."), DialogType::ERROR, + "of the server."), + // TRANSLATORS: ok dialog button + _("OK"), + DialogType::ERROR, true, true, nullptr, 260); dlg->addActionListener(this); } diff --git a/src/gui/windows/okdialog.cpp b/src/gui/windows/okdialog.cpp index bdb41e6a1..549723e14 100644 --- a/src/gui/windows/okdialog.cpp +++ b/src/gui/windows/okdialog.cpp @@ -30,8 +30,6 @@ #include "gui/fonts/font.h" -#include "utils/gettext.h" - #include "debug.h" OkDialog *weightNotice = nullptr; @@ -39,6 +37,7 @@ OkDialog *deathNotice = nullptr; OkDialog::OkDialog(const std::string &restrict title, const std::string &restrict msg, + const std::string &restrict button, const int soundEvent, const bool modal, const bool showCenter, Window *const parent, const int minWidth) : @@ -51,7 +50,7 @@ OkDialog::OkDialog(const std::string &restrict title, mTextBox->setTextWrapped(msg, minWidth); // TRANSLATORS: ok dialog button - Button *const okButton = new Button(this, _("OK"), "ok", this); + Button *const okButton = new Button(this, button, "ok", this); int width = getFont()->getWidth(title); if (width < mTextBox->getMinWidth()) diff --git a/src/gui/windows/okdialog.h b/src/gui/windows/okdialog.h index 9db759937..f3fb09030 100644 --- a/src/gui/windows/okdialog.h +++ b/src/gui/windows/okdialog.h @@ -49,6 +49,7 @@ class OkDialog final : public Window, */ OkDialog(const std::string &restrict title, const std::string &restrict msg, + const std::string &restrict button, const int soundEvent, const bool modal, const bool showCenter, diff --git a/src/gui/windows/registerdialog.cpp b/src/gui/windows/registerdialog.cpp index 9f19cbcf1..aca34dd5d 100644 --- a/src/gui/windows/registerdialog.cpp +++ b/src/gui/windows/registerdialog.cpp @@ -244,7 +244,8 @@ void RegisterDialog::action(const ActionEvent &event) OkDialog *const dlg = new OkDialog( // TRANSLATORS: error message - _("Error"), errorMsg, DialogType::ERROR, + _("Error"), errorMsg, _("OK"), + DialogType::ERROR, true, true, nullptr, 260); dlg->addActionListener(mWrongDataNoticeListener); } diff --git a/src/gui/windows/socialwindow.cpp b/src/gui/windows/socialwindow.cpp index aa74ad200..790bad68d 100644 --- a/src/gui/windows/socialwindow.cpp +++ b/src/gui/windows/socialwindow.cpp @@ -496,7 +496,10 @@ void SocialWindow::showPartyCreate() // TRANSLATORS: party creation message new OkDialog(_("Create Party"), _("Cannot create party. You are already in a party"), - DialogType::ERROR, true, true, this, 260); + // TRANSLATORS: ok dialog button + _("OK"), + DialogType::ERROR, + true, true, this, 260); return; } diff --git a/src/gui/windows/unregisterdialog.cpp b/src/gui/windows/unregisterdialog.cpp index 40ef9d57a..aa7c67148 100644 --- a/src/gui/windows/unregisterdialog.cpp +++ b/src/gui/windows/unregisterdialog.cpp @@ -145,7 +145,10 @@ void UnRegisterDialog::action(const ActionEvent &event) // TRANSLATORS: unregister dialog. error message. OkDialog *const dlg = new OkDialog(_("Error"), - errorMsg.str(), DialogType::ERROR, + errorMsg.str(), + // TRANSLATORS: ok dialog button + _("OK"), + DialogType::ERROR, true, true, nullptr, 260); dlg->addActionListener(mWrongDataNoticeListener); } |