diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-29 00:27:29 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-29 12:56:42 +0300 |
commit | 7c74dc533ce120a27ac4b68acb1c5b2f6c5cc680 (patch) | |
tree | c9689b1b707b73a8a4e3cc5b24d9ca67765ef217 /src/gui/dialogsmanager.cpp | |
parent | 1b500cb24655e2ad3e6c6fd20143ce0d2d070d6f (diff) | |
download | manaplus-7c74dc533ce120a27ac4b68acb1c5b2f6c5cc680.tar.gz manaplus-7c74dc533ce120a27ac4b68acb1c5b2f6c5cc680.tar.bz2 manaplus-7c74dc533ce120a27ac4b68acb1c5b2f6c5cc680.tar.xz manaplus-7c74dc533ce120a27ac4b68acb1c5b2f6c5cc680.zip |
Move openErrorDialog into DialogsManager.
Diffstat (limited to 'src/gui/dialogsmanager.cpp')
-rw-r--r-- | src/gui/dialogsmanager.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/gui/dialogsmanager.cpp b/src/gui/dialogsmanager.cpp index b23152605..ac15d960d 100644 --- a/src/gui/dialogsmanager.cpp +++ b/src/gui/dialogsmanager.cpp @@ -22,8 +22,10 @@ #include "gui/dialogsmanager.h" +#include "configuration.h" #include "settings.h" +#include "gui/windows/confirmdialog.h" #include "gui/windows/buyselldialog.h" #include "gui/windows/buydialog.h" #include "gui/windows/npcdialog.h" @@ -34,6 +36,8 @@ #include "net/inventoryhandler.h" #include "net/net.h" +#include "utils/gettext.h" + #include "debug.h" extern OkDialog *deathNotice; @@ -62,3 +66,23 @@ void DialogsManager::createUpdaterWindow() 0); updaterWindow->postInit(); } + +Window *DialogsManager::openErrorDialog(const std::string &header, + const std::string &message, + const bool modal) +{ + if (settings.supportUrl.empty() || config.getBoolValue("hidesupport")) + { + return new OkDialog(header, message, DialogType::ERROR, modal); + } + else + { + ConfirmDialog *const dialog = new ConfirmDialog( + header, strprintf("%s %s", message.c_str(), + // TRANSLATORS: error message question + _("Do you want to open support page?")), + SOUND_ERROR, false, modal); + dialog->postInit(); + return dialog; + } +} |