diff options
| author | Léo Lam <leo@innovatetechnologi.es> | 2019-06-20 13:37:24 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-06-20 13:37:24 +0200 |
| commit | 4885130799a357eee8e279ed68dac60d6bcd78ca (patch) | |
| tree | 01260bc72811143b0153b747d0d8b860638325eb /Source/Core/DolphinQt/Main.cpp | |
| parent | baf02194c1bf4a55620e3aee7d9c0a1658a61168 (diff) | |
| parent | 4f1f55093fcf98aa1592b6b8b1ad0d33c4461b50 (diff) | |
Merge pull request #8194 from lioncash/common-msg
Common/MsgHandler: Tidy up interface and namespace code
Diffstat (limited to 'Source/Core/DolphinQt/Main.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/Main.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/Core/DolphinQt/Main.cpp b/Source/Core/DolphinQt/Main.cpp index 038fed9c89..ee30defcf7 100644 --- a/Source/Core/DolphinQt/Main.cpp +++ b/Source/Core/DolphinQt/Main.cpp @@ -35,7 +35,8 @@ #include "UICommon/CommandLineParse.h" #include "UICommon/UICommon.h" -static bool QtMsgAlertHandler(const char* caption, const char* text, bool yes_no, MsgType style) +static bool QtMsgAlertHandler(const char* caption, const char* text, bool yes_no, + Common::MsgType style) { std::optional<bool> r = RunOnObject(QApplication::instance(), [&] { ModalMessageBox message_box(QApplication::activeWindow()); @@ -43,19 +44,19 @@ static bool QtMsgAlertHandler(const char* caption, const char* text, bool yes_no message_box.setText(QString::fromUtf8(text)); message_box.setStandardButtons(yes_no ? QMessageBox::Yes | QMessageBox::No : QMessageBox::Ok); - if (style == MsgType::Warning) + if (style == Common::MsgType::Warning) message_box.addButton(QMessageBox::Ignore)->setText(QObject::tr("Ignore for this session")); message_box.setIcon([&] { switch (style) { - case MsgType::Information: + case Common::MsgType::Information: return QMessageBox::Information; - case MsgType::Question: + case Common::MsgType::Question: return QMessageBox::Question; - case MsgType::Warning: + case Common::MsgType::Warning: return QMessageBox::Warning; - case MsgType::Critical: + case Common::MsgType::Critical: return QMessageBox::Critical; } // appease MSVC @@ -67,7 +68,7 @@ static bool QtMsgAlertHandler(const char* caption, const char* text, bool yes_no return true; if (button == QMessageBox::Ignore) - SetEnableAlert(false); + Common::SetEnableAlert(false); return false; }); @@ -137,7 +138,7 @@ int main(int argc, char* argv[]) Settings::Instance().SetBatchModeEnabled(options.is_set("batch")); // Hook up alerts from core - RegisterMsgAlertHandler(QtMsgAlertHandler); + Common::RegisterMsgAlertHandler(QtMsgAlertHandler); // Hook up translations Translation::Initialize(); |
