add last backwards-compatible version
This commit is contained in:
@@ -22,16 +22,6 @@ void popup_message::g_complain(const char * p_whatFailed, const char * msg) {
|
||||
g_complain( PFC_string_formatter() << p_whatFailed << ": " << msg );
|
||||
}
|
||||
|
||||
#if FOOBAR2000_TARGET_VERSION >= 80
|
||||
void popup_message_v3::show_query( const char * title, const char * msg, unsigned buttons, completion_notify::ptr reply) {
|
||||
query_t q;
|
||||
q.title = title; q.msg = msg; q.buttons = buttons; q.reply = reply;
|
||||
this->show_query( q );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef FOOBAR2000_DESKTOP_WINDOWS
|
||||
void popup_message_v2::g_show(HWND parent, const char * msg, const char * title) {
|
||||
service_enum_t< popup_message_v2 > e;
|
||||
service_ptr_t< popup_message_v2 > m;
|
||||
@@ -47,91 +37,3 @@ void popup_message_v2::g_complain(HWND parent, const char * whatFailed, const ch
|
||||
void popup_message_v2::g_complain(HWND parent, const char * whatFailed, const std::exception & e) {
|
||||
g_complain(parent, whatFailed, e.what());
|
||||
}
|
||||
#endif // FOOBAR2000_DESKTOP_WINDOWS
|
||||
|
||||
#ifdef FOOBAR2000_MODERN
|
||||
void fb2k::showToast( const char * msg ) {
|
||||
fb2k::popup_toast::arg_t arg;
|
||||
fb2k::popup_toast::get()->show_toast(msg, arg);
|
||||
}
|
||||
|
||||
void fb2k::showToastLongDuration( const char * msg ) {
|
||||
fb2k::popup_toast::arg_t arg;
|
||||
arg.longDuration = true;
|
||||
fb2k::popup_toast::get()->show_toast(msg, arg);
|
||||
}
|
||||
void popup_message::g_showToast(const char * msg) {
|
||||
fb2k::showToast( msg );
|
||||
}
|
||||
void popup_message::g_showToastLongDuration(const char * msg) {
|
||||
fb2k::showToastLongDuration( msg );
|
||||
}
|
||||
|
||||
#endif // FOOBAR2000_MODERN
|
||||
|
||||
#if defined(FOOBAR2000_DESKTOP_WINDOWS) && FOOBAR2000_TARGET_VERSION >= 80
|
||||
int popup_message_v3::messageBox(HWND parent, const char* msg, const char* title, UINT flags) {
|
||||
query_t q = {};
|
||||
q.title = title;
|
||||
q.msg = msg;
|
||||
q.wndParent = parent;
|
||||
|
||||
switch (flags & 0xF) {
|
||||
default:
|
||||
case MB_OK:
|
||||
q.buttons = buttonOK;
|
||||
q.defButton = buttonOK;
|
||||
break;
|
||||
case MB_OKCANCEL:
|
||||
q.buttons = buttonOK | buttonCancel;
|
||||
q.defButton = (flags & MB_DEFBUTTON2) ? buttonCancel : buttonOK;
|
||||
break;
|
||||
case MB_ABORTRETRYIGNORE:
|
||||
q.buttons = buttonAbort | buttonRetry | buttonIgnore;
|
||||
if (flags & MB_DEFBUTTON3) q.defButton = buttonIgnore;
|
||||
else if (flags & MB_DEFBUTTON2) q.defButton = buttonRetry;
|
||||
else q.defButton = buttonAbort;
|
||||
break;
|
||||
case MB_YESNOCANCEL:
|
||||
q.buttons = buttonYes | buttonNo | buttonCancel;
|
||||
if (flags & MB_DEFBUTTON3) q.defButton = buttonCancel;
|
||||
else if (flags & MB_DEFBUTTON2) q.defButton = buttonNo;
|
||||
else q.defButton = buttonYes;
|
||||
break;
|
||||
case MB_YESNO:
|
||||
q.buttons = buttonYes | buttonNo;
|
||||
q.defButton = (flags & MB_DEFBUTTON2) ? buttonNo : buttonYes;
|
||||
break;
|
||||
case MB_RETRYCANCEL:
|
||||
q.buttons = buttonRetry | buttonCancel;
|
||||
q.defButton = (flags & MB_DEFBUTTON2) ? buttonCancel : buttonRetry;
|
||||
break;
|
||||
}
|
||||
switch (flags & 0xF0) {
|
||||
case MB_ICONHAND:
|
||||
q.icon = iconWarning;
|
||||
break;
|
||||
case MB_ICONQUESTION:
|
||||
q.icon = iconQuestion;
|
||||
break;
|
||||
case MB_ICONEXCLAMATION:
|
||||
q.icon = iconError;
|
||||
break;
|
||||
case MB_ICONASTERISK:
|
||||
q.icon = iconInformation;
|
||||
break;
|
||||
}
|
||||
|
||||
uint32_t status = this->show_query_modal(q);
|
||||
|
||||
if (status & buttonOK) return IDOK;
|
||||
if (status & buttonCancel) return IDCANCEL;
|
||||
if (status & buttonYes) return IDYES;
|
||||
if (status & buttonNo) return IDNO;
|
||||
if (status & buttonRetry) return IDRETRY;
|
||||
if (status & buttonAbort) return IDABORT;
|
||||
if (status & buttonIgnore) return IDIGNORE;
|
||||
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user