mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Common/MsgHandler: Namespace code within the Common namespace
Closes another gap in the Common library where code isn't being namespaced under it.
This commit is contained in:
@ -6,6 +6,8 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace Common
|
||||
{
|
||||
// Message alerts
|
||||
enum class MsgType
|
||||
{
|
||||
@ -28,30 +30,69 @@ bool MsgAlert(bool yes_no, MsgType style, const char* format, ...)
|
||||
#endif
|
||||
;
|
||||
void SetEnableAlert(bool enable);
|
||||
} // namespace Common
|
||||
|
||||
#ifdef _WIN32
|
||||
#define SuccessAlert(format, ...) MsgAlert(false, MsgType::Information, format, __VA_ARGS__)
|
||||
#define PanicAlert(format, ...) MsgAlert(false, MsgType::Warning, format, __VA_ARGS__)
|
||||
#define PanicYesNo(format, ...) MsgAlert(true, MsgType::Warning, format, __VA_ARGS__)
|
||||
#define AskYesNo(format, ...) MsgAlert(true, MsgType::Question, format, __VA_ARGS__)
|
||||
#define CriticalAlert(format, ...) MsgAlert(false, MsgType::Critical, format, __VA_ARGS__)
|
||||
#define SuccessAlert(format, ...) \
|
||||
Common::MsgAlert(false, Common::MsgType::Information, format, __VA_ARGS__)
|
||||
|
||||
#define PanicAlert(format, ...) \
|
||||
Common::MsgAlert(false, Common::MsgType::Warning, format, __VA_ARGS__)
|
||||
|
||||
#define PanicYesNo(format, ...) \
|
||||
Common::MsgAlert(true, Common::MsgType::Warning, format, __VA_ARGS__)
|
||||
|
||||
#define AskYesNo(format, ...) Common::MsgAlert(true, Common::MsgType::Question, format, __VA_ARGS__)
|
||||
|
||||
#define CriticalAlert(format, ...) \
|
||||
Common::MsgAlert(false, Common::MsgType::Critical, format, __VA_ARGS__)
|
||||
|
||||
// Use these macros (that do the same thing) if the message should be translated.
|
||||
#define SuccessAlertT(format, ...) MsgAlert(false, MsgType::Information, format, __VA_ARGS__)
|
||||
#define PanicAlertT(format, ...) MsgAlert(false, MsgType::Warning, format, __VA_ARGS__)
|
||||
#define PanicYesNoT(format, ...) MsgAlert(true, MsgType::Warning, format, __VA_ARGS__)
|
||||
#define AskYesNoT(format, ...) MsgAlert(true, MsgType::Question, format, __VA_ARGS__)
|
||||
#define CriticalAlertT(format, ...) MsgAlert(false, MsgType::Critical, format, __VA_ARGS__)
|
||||
|
||||
#define SuccessAlertT(format, ...) \
|
||||
Common::MsgAlert(false, Common::MsgType::Information, format, __VA_ARGS__)
|
||||
|
||||
#define PanicAlertT(format, ...) \
|
||||
Common::MsgAlert(false, Common::MsgType::Warning, format, __VA_ARGS__)
|
||||
|
||||
#define PanicYesNoT(format, ...) \
|
||||
Common::MsgAlert(true, Common::MsgType::Warning, format, __VA_ARGS__)
|
||||
|
||||
#define AskYesNoT(format, ...) \
|
||||
Common::MsgAlert(true, Common::MsgType::Question, format, __VA_ARGS__)
|
||||
|
||||
#define CriticalAlertT(format, ...) \
|
||||
Common::MsgAlert(false, Common::MsgType::Critical, format, __VA_ARGS__)
|
||||
|
||||
#else
|
||||
#define SuccessAlert(format, ...) MsgAlert(false, MsgType::Information, format, ##__VA_ARGS__)
|
||||
#define PanicAlert(format, ...) MsgAlert(false, MsgType::Warning, format, ##__VA_ARGS__)
|
||||
#define PanicYesNo(format, ...) MsgAlert(true, MsgType::Warning, format, ##__VA_ARGS__)
|
||||
#define AskYesNo(format, ...) MsgAlert(true, MsgType::Question, format, ##__VA_ARGS__)
|
||||
#define CriticalAlert(format, ...) MsgAlert(false, MsgType::Critical, format, ##__VA_ARGS__)
|
||||
#define SuccessAlert(format, ...) \
|
||||
Common::MsgAlert(false, Common::MsgType::Information, format, ##__VA_ARGS__)
|
||||
|
||||
#define PanicAlert(format, ...) \
|
||||
Common::MsgAlert(false, Common::MsgType::Warning, format, ##__VA_ARGS__)
|
||||
|
||||
#define PanicYesNo(format, ...) \
|
||||
Common::MsgAlert(true, Common::MsgType::Warning, format, ##__VA_ARGS__)
|
||||
|
||||
#define AskYesNo(format, ...) \
|
||||
Common::MsgAlert(true, Common::MsgType::Question, format, ##__VA_ARGS__)
|
||||
|
||||
#define CriticalAlert(format, ...) \
|
||||
Common::MsgAlert(false, Common::MsgType::Critical, format, ##__VA_ARGS__)
|
||||
|
||||
// Use these macros (that do the same thing) if the message should be translated.
|
||||
#define SuccessAlertT(format, ...) MsgAlert(false, MsgType::Information, format, ##__VA_ARGS__)
|
||||
#define PanicAlertT(format, ...) MsgAlert(false, MsgType::Warning, format, ##__VA_ARGS__)
|
||||
#define PanicYesNoT(format, ...) MsgAlert(true, MsgType::Warning, format, ##__VA_ARGS__)
|
||||
#define AskYesNoT(format, ...) MsgAlert(true, MsgType::Question, format, ##__VA_ARGS__)
|
||||
#define CriticalAlertT(format, ...) MsgAlert(false, MsgType::Critical, format, ##__VA_ARGS__)
|
||||
#define SuccessAlertT(format, ...) \
|
||||
Common::MsgAlert(false, Common::MsgType::Information, format, ##__VA_ARGS__)
|
||||
|
||||
#define PanicAlertT(format, ...) \
|
||||
Common::MsgAlert(false, Common::MsgType::Warning, format, ##__VA_ARGS__)
|
||||
|
||||
#define PanicYesNoT(format, ...) \
|
||||
Common::MsgAlert(true, Common::MsgType::Warning, format, ##__VA_ARGS__)
|
||||
|
||||
#define AskYesNoT(format, ...) \
|
||||
Common::MsgAlert(true, Common::MsgType::Question, format, ##__VA_ARGS__)
|
||||
|
||||
#define CriticalAlertT(format, ...) \
|
||||
Common::MsgAlert(false, Common::MsgType::Critical, format, ##__VA_ARGS__)
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user