From 53f5801d6f8b251b0c9ef0cc16a532852f1da961 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 22 Jan 2014 12:37:21 +0100 Subject: [PATCH] - adapt ShowMsg handling from martii's neutrino-mp --- src/driver/record.cpp | 8 ++--- src/gui/audioplayer.cpp | 2 +- src/gui/bedit/bouqueteditor_bouquets.cpp | 4 +-- src/gui/bedit/bouqueteditor_channels.cpp | 2 +- src/gui/channellist.cpp | 2 +- src/gui/epgplus.cpp | 4 +-- src/gui/epgview.cpp | 6 ++-- src/gui/eventlist.cpp | 6 ++-- src/gui/favorites.cpp | 6 ++-- src/gui/filebrowser.cpp | 2 +- src/gui/hdd_menu.cpp | 2 +- src/gui/keybind_setup.cpp | 2 +- src/gui/luainstance.cpp | 2 +- src/gui/miscsettings_menu.cpp | 2 +- src/gui/motorcontrol.cpp | 2 +- src/gui/moviebrowser.cpp | 26 ++++++++-------- src/gui/network_setup.cpp | 12 ++++---- src/gui/personalize.cpp | 4 +-- src/gui/pictureviewer.cpp | 2 +- src/gui/pluginlist.cpp | 4 +-- src/gui/rc_lock.cpp | 4 +-- src/gui/record_setup.cpp | 2 +- src/gui/scan.cpp | 2 +- src/gui/screensetup.cpp | 2 +- src/gui/settings_manager.cpp | 4 +-- src/gui/start_wizard.cpp | 4 +-- src/gui/test_menu.cpp | 24 +++++++-------- src/gui/themes.cpp | 2 +- src/gui/timerlist.cpp | 4 +-- src/gui/update.cpp | 24 +++++++-------- src/gui/update_ext.cpp | 6 ++-- src/gui/upnpbrowser.cpp | 6 ++-- src/gui/videosettings.cpp | 2 +- src/gui/widget/colorchooser.cpp | 2 +- src/gui/widget/messagebox.cpp | 38 +++++++++++++++--------- src/gui/widget/messagebox.h | 10 ++++--- src/gui/widget/stringinput.cpp | 2 +- src/gui/widget/stringinput_ext.cpp | 2 +- src/neutrino.cpp | 22 +++++++------- src/system/setting_helpers.cpp | 2 +- 40 files changed, 138 insertions(+), 126 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 13f796c28..f7aba8256 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -1382,7 +1382,7 @@ int CRecordManager::exec(CMenuTarget* parent, const std::string & actionKey ) snprintf(rec_msg1, sizeof(rec_msg1)-1, "%s", g_Locale->getText(LOCALE_RECORDINGMENU_MULTIMENU_ASK_STOP_ALL)); snprintf(rec_msg, sizeof(rec_msg)-1, rec_msg1, records); - if(ShowMsgUTF(LOCALE_SHUTDOWN_RECODING_QUERY, rec_msg, + if(ShowMsg(LOCALE_SHUTDOWN_RECODING_QUERY, rec_msg, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrYes) { snprintf(rec_msg1, sizeof(rec_msg1)-1, "%s", g_Locale->getText(LOCALE_RECORDINGMENU_MULTIMENU_INFO_STOP_ALL)); @@ -1415,7 +1415,7 @@ int CRecordManager::exec(CMenuTarget* parent, const std::string & actionKey ) std::string title, duration; inst->GetRecordString(title, duration); title += duration; - tostart = (ShowMsgUTF(LOCALE_RECORDING_IS_RUNNING, title.c_str(), + tostart = (ShowMsg(LOCALE_RECORDING_IS_RUNNING, title.c_str(), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrYes); } if (tostart) { @@ -1569,7 +1569,7 @@ bool CRecordManager::AskToStop(const t_channel_id channel_id, const int recid) if(inst == NULL) return false; - if(ShowMsgUTF(LOCALE_SHUTDOWN_RECODING_QUERY, title.c_str(), + if(ShowMsg(LOCALE_SHUTDOWN_RECODING_QUERY, title.c_str(), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrYes) { #if 0 g_Timerd->stopTimerEvent(recording_id); @@ -1864,7 +1864,7 @@ bool CRecordManager::MountDirectory(const char *recordingDir) strcat(msg,"\nDir: "); strcat(msg,recordingDir); - ShowMsgUTF(LOCALE_MESSAGEBOX_ERROR, msg, + ShowMsg(LOCALE_MESSAGEBOX_ERROR, msg, CMessageBox::mbrBack, CMessageBox::mbBack,NEUTRINO_ICON_ERROR, 450, 10); // UTF-8 ret = false; } diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index fbd81df70..8f082c969 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -2702,7 +2702,7 @@ bool CAudioPlayerGui::askToOverwriteFile(const std::string& filename) "%s\n%s", g_Locale->getText(LOCALE_AUDIOPLAYER_PLAYLIST_FILEOVERWRITE_MSG), filename.c_str()); - bool res = (ShowMsgUTF(LOCALE_AUDIOPLAYER_PLAYLIST_FILEOVERWRITE_TITLE, + bool res = (ShowMsg(LOCALE_AUDIOPLAYER_PLAYLIST_FILEOVERWRITE_TITLE, msg,CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes); this->paint(); diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index e57b7c7c3..e8d112740 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -255,7 +255,7 @@ int CBEBouquetWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* { if (bouquetsChanged) { - int result = ShowLocalizedMessage(LOCALE_BOUQUETEDITOR_NAME, LOCALE_BOUQUETEDITOR_SAVECHANGES, CMessageBox::mbrYes, CMessageBox::mbAll); + int result = ShowMsg(LOCALE_BOUQUETEDITOR_NAME, LOCALE_BOUQUETEDITOR_SAVECHANGES, CMessageBox::mbrYes, CMessageBox::mbAll); switch( result ) { @@ -429,7 +429,7 @@ void CBEBouquetWidget::deleteBouquet() if (selected >= Bouquets->size()) /* Bouquets->size() might be 0 */ return; - if (ShowMsgUTF(LOCALE_FILEBROWSER_DELETE, (*Bouquets)[selected]->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : (*Bouquets)[selected]->Name, CMessageBox::mbrNo, CMessageBox::mbYes|CMessageBox::mbNo)!=CMessageBox::mbrYes) + if (ShowMsg(LOCALE_FILEBROWSER_DELETE, (*Bouquets)[selected]->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : (*Bouquets)[selected]->Name, CMessageBox::mbrNo, CMessageBox::mbYes|CMessageBox::mbNo)!=CMessageBox::mbrYes) return; g_bouquetManager->deleteBouquet(selected); diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 24029c475..2095ceebb 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -447,7 +447,7 @@ void CBEChannelWidget::deleteChannel() if (selected >= Channels->size()) /* Channels.size() might be 0 */ return; - if (ShowMsgUTF(LOCALE_FILEBROWSER_DELETE, (*Channels)[selected]->getName(), CMessageBox::mbrNo, CMessageBox::mbYes|CMessageBox::mbNo)!=CMessageBox::mbrYes) + if (ShowMsg(LOCALE_FILEBROWSER_DELETE, (*Channels)[selected]->getName(), CMessageBox::mbrNo, CMessageBox::mbYes|CMessageBox::mbNo)!=CMessageBox::mbrYes) return; g_bouquetManager->Bouquets[bouquet]->removeService((*Channels)[selected]->channel_id); diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index ac7141cc1..997e4a25c 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -383,7 +383,7 @@ int CChannelList::doChannelMenu(void) switch(select) { case 0: { hide(); - int result = ShowMsgUTF ( LOCALE_BOUQUETEDITOR_DELETE, g_Locale->getText(LOCALE_BOUQUETEDITOR_DELETE_QUESTION), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo ); + int result = ShowMsg ( LOCALE_BOUQUETEDITOR_DELETE, g_Locale->getText(LOCALE_BOUQUETEDITOR_DELETE_QUESTION), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo ); if(result == CMessageBox::mbrYes) { bouquet_id = bouquetList->getActiveBouquetNumber(); diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 670917254..9e899fe7b 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -1285,7 +1285,7 @@ int EpgPlus::MenuTargetAddReminder::exec (CMenuTarget * /*parent*/, const std::s if (g_Timerd->isTimerdAvailable()) { g_Timerd->addZaptoTimerEvent (this->epgPlus->selectedChannelEntry->channel->channel_id, (*It)->channelEvent.startTime - (g_settings.zapto_pre_time * 60), (*It)->channelEvent.startTime - ANNOUNCETIME - (g_settings.zapto_pre_time * 60), 0, (*It)->channelEvent.eventID, (*It)->channelEvent.startTime, 0); - ShowMsgUTF (LOCALE_TIMER_EVENTTIMED_TITLE, g_Locale->getText (LOCALE_TIMER_EVENTTIMED_MSG) + ShowMsg (LOCALE_TIMER_EVENTTIMED_TITLE, g_Locale->getText (LOCALE_TIMER_EVENTTIMED_MSG) , CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); // UTF-8 } else printf ("timerd not available\n"); @@ -1308,7 +1308,7 @@ int EpgPlus::MenuTargetAddRecordTimer::exec (CMenuTarget * /*parent*/, const std g_Timerd->addRecordTimerEvent (this->epgPlus->selectedChannelEntry->channel->channel_id, (*It)->channelEvent.startTime, (*It)->channelEvent.startTime + (*It)->channelEvent.duration, (*It)->channelEvent.eventID, (*It)->channelEvent.startTime, (*It)->channelEvent.startTime - (ANNOUNCETIME + 120) , TIMERD_APIDS_CONF, true); - ShowMsgUTF (LOCALE_TIMER_EVENTRECORD_TITLE, g_Locale->getText (LOCALE_TIMER_EVENTRECORD_MSG) + ShowMsg (LOCALE_TIMER_EVENTRECORD_TITLE, g_Locale->getText (LOCALE_TIMER_EVENTRECORD_MSG) , CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); // UTF-8 } else printf ("timerd not available\n"); diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index f90515da1..7e687d5d6 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -843,11 +843,11 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start epgData.eventID, epgData.epg_times.startzeit, epgData.epg_times.startzeit - (ANNOUNCETIME + 120 ), TIMERD_APIDS_CONF, true, recDir,true); - ShowLocalizedMessage(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } } else { - ShowLocalizedMessage(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } } @@ -867,7 +867,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start epgData.epg_times.startzeit - (g_settings.zapto_pre_time * 60), epgData.epg_times.startzeit - ANNOUNCETIME - (g_settings.zapto_pre_time * 60), 0, epgData.eventID, epgData.epg_times.startzeit, 0); - ShowLocalizedMessage(LOCALE_TIMER_EVENTTIMED_TITLE, LOCALE_TIMER_EVENTTIMED_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_TIMER_EVENTTIMED_TITLE, LOCALE_TIMER_EVENTTIMED_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } else diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index ae9816c14..7c808e6ba 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -493,13 +493,13 @@ int CNeutrinoEventList::exec(const t_channel_id channel_id, const std::string& c TIMERD_APIDS_CONF, true, recDir,true); //ask user whether the timer event should be set anyway - ShowLocalizedMessage(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } } else { - //ShowLocalizedMessage(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + //ShowMsg(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } } @@ -526,7 +526,7 @@ int CNeutrinoEventList::exec(const t_channel_id channel_id, const std::string& c evtlist[selected].startTime - (g_settings.zapto_pre_time * 60), evtlist[selected].startTime - ANNOUNCETIME - (g_settings.zapto_pre_time * 60), 0, evtlist[selected].eventID, evtlist[selected].startTime, 0); - //ShowLocalizedMessage(LOCALE_TIMER_EVENTTIMED_TITLE, LOCALE_TIMER_EVENTTIMED_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + //ShowMsg(LOCALE_TIMER_EVENTTIMED_TITLE, LOCALE_TIMER_EVENTTIMED_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); timerlist.clear(); g_Timerd->getTimerList (timerlist); paint(evtlist[selected].channelID ); diff --git a/src/gui/favorites.cpp b/src/gui/favorites.cpp index a6703fd27..c3d978f99 100644 --- a/src/gui/favorites.cpp +++ b/src/gui/favorites.cpp @@ -122,7 +122,7 @@ int CFavorites::exec(CMenuTarget* parent, const std::string & actionKey) #if 0 if (!bouquetList) { - ShowLocalizedMessage(LOCALE_FAVORITES_BOUQUETNAME, LOCALE_FAVORITES_NOBOUQUETS, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_FAVORITES_BOUQUETNAME, LOCALE_FAVORITES_NOBOUQUETS, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); return res; } #endif @@ -147,7 +147,7 @@ int CFavorites::exec(CMenuTarget* parent, const std::string & actionKey) { if (status & 2) str += g_Locale->getText(LOCALE_EXTRA_CHADDED); else str += g_Locale->getText(LOCALE_EXTRA_CHALREADYINBQ); - ShowMsgUTF(LOCALE_EXTRA_ADD_TO_BOUQUET, str, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); // UTF-8 + ShowMsg(LOCALE_EXTRA_ADD_TO_BOUQUET, str, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); // UTF-8 } else { @@ -155,7 +155,7 @@ int CFavorites::exec(CMenuTarget* parent, const std::string & actionKey) if (status & 2) str += g_Locale->getText(LOCALE_FAVORITES_CHADDED); else str += g_Locale->getText(LOCALE_FAVORITES_CHALREADYINBQ); if (status) str += g_Locale->getText(LOCALE_FAVORITES_FINALHINT); - ShowMsgUTF(LOCALE_FAVORITES_BOUQUETNAME, str, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); // UTF-8 + ShowMsg(LOCALE_FAVORITES_BOUQUETNAME, str, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); // UTF-8 } diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 2967377c4..0fb560727 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -932,7 +932,7 @@ bool CFileBrowser::exec(const char * const dirname) _msg << filelist[selected].getFileName(); _msg << " " << g_Locale->getText(LOCALE_FILEBROWSER_DODELETE2); - if (ShowMsgUTF(LOCALE_FILEBROWSER_DELETE, _msg.str(), CMessageBox::mbrNo, CMessageBox::mbYes|CMessageBox::mbNo)==CMessageBox::mbrYes) + if (ShowMsg(LOCALE_FILEBROWSER_DELETE, _msg.str(), CMessageBox::mbrNo, CMessageBox::mbYes|CMessageBox::mbNo)==CMessageBox::mbrYes) { std::string n = filelist[selected].Name; recursiveDelete(n.c_str()); diff --git a/src/gui/hdd_menu.cpp b/src/gui/hdd_menu.cpp index 5f8b7d6d6..f0459a8dc 100644 --- a/src/gui/hdd_menu.cpp +++ b/src/gui/hdd_menu.cpp @@ -356,7 +356,7 @@ int CHDDFmtExec::exec(CMenuTarget* /*parent*/, const std::string& key) printf("CHDDFmtExec: key %s\n", key.c_str()); - res = ShowMsgUTF ( LOCALE_HDD_FORMAT, g_Locale->getText(LOCALE_HDD_FORMAT_WARN), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo ); + res = ShowMsg ( LOCALE_HDD_FORMAT, g_Locale->getText(LOCALE_HDD_FORMAT_WARN), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo ); if(res != CMessageBox::mbrYes) return 0; diff --git a/src/gui/keybind_setup.cpp b/src/gui/keybind_setup.cpp index f41534c1f..08bd0ac0e 100644 --- a/src/gui/keybind_setup.cpp +++ b/src/gui/keybind_setup.cpp @@ -266,7 +266,7 @@ int CKeybindSetup::showKeySetup() strcat(RC_HW_msg, g_Locale->getText(LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE_MSG_PART2)); strcat(RC_HW_msg, RC_HW_str[g_settings.remote_control_hardware]); strcat(RC_HW_msg, g_Locale->getText(LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE_MSG_PART3)); - if(ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, RC_HW_msg, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_INFO, 450, 15, true) == CMessageBox::mbrNo) { + if(ShowMsg(LOCALE_MESSAGEBOX_INFO, RC_HW_msg, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_INFO, 450, 15, true) == CMessageBox::mbrNo) { g_settings.remote_control_hardware = org_remote_control_hardware; g_RCInput->CRCInput::set_rc_hw(); } diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index 09fb48f9d..39cdcd8ca 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -1271,7 +1271,7 @@ int CLuaInstance::MessageboxExec(lua_State *L) } } - int res = ShowMsgUTF(name, text, (CMessageBox::result_) default_button, (CMessageBox::buttons_) show_buttons, icon.empty() ? NULL : icon.c_str(), width, timeout, return_default_on_timeout); + int res = ShowMsg(name, text, (CMessageBox::result_) default_button, (CMessageBox::buttons_) show_buttons, icon.empty() ? NULL : icon.c_str(), width, timeout, return_default_on_timeout); tmp = "cancel"; for (int i = 0; mbr[i].name; i++) diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index ba38027e2..0ad001558 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -125,7 +125,7 @@ int CMiscMenue::exec(CMenuTarget* parent, const std::string &actionKey) unsigned num = CEitManager::getInstance()->getEventsCount(); char str[128]; sprintf(str, "Event count: %d", num); - ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, str, CMessageBox::mbrBack, CMessageBox::mbBack); + ShowMsg(LOCALE_MESSAGEBOX_INFO, str, CMessageBox::mbrBack, CMessageBox::mbBack); return menu_return::RETURN_REPAINT; } else if(actionKey == "energy") diff --git a/src/gui/motorcontrol.cpp b/src/gui/motorcontrol.cpp index fbe2581bc..954aad025 100644 --- a/src/gui/motorcontrol.cpp +++ b/src/gui/motorcontrol.cpp @@ -223,7 +223,7 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &) buf += " "; buf += satname; buf += " ?"; - store = (ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, buf,CMessageBox::mbrNo,CMessageBox::mbNo|CMessageBox::mbYes) == CMessageBox::mbrYes); + store = (ShowMsg(LOCALE_MESSAGEBOX_INFO, buf,CMessageBox::mbrNo,CMessageBox::mbNo|CMessageBox::mbYes) == CMessageBox::mbrYes); } } if(store) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index eff2d9506..013d750fc 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1836,7 +1836,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) char buf1[1024]; memset(buf1, '\0', sizeof(buf1)); snprintf(buf1, sizeof(buf1)-1, g_Locale->getText(LOCALE_MOVIEBROWSER_ASK_REC_TO_DELETE), delName.c_str()); - if(ShowMsgUTF(LOCALE_RECORDINGMENU_RECORD_IS_RUNNING, buf1, + if(ShowMsg(LOCALE_RECORDINGMENU_RECORD_IS_RUNNING, buf1, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrNo) onDelete = false; else { @@ -1872,7 +1872,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) } else if (msg == CRCInput::RC_text || msg == CRCInput::RC_radio) { if((show_mode == MB_SHOW_RECORDS) && - (ShowMsgUTF (LOCALE_MESSAGEBOX_INFO, msg == CRCInput::RC_radio ? "Copy jumps from movie to new file ?" : "Copy jumps from movie to new files ?", CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes)) { + (ShowMsg (LOCALE_MESSAGEBOX_INFO, msg == CRCInput::RC_radio ? "Copy jumps from movie to new file ?" : "Copy jumps from movie to new files ?", CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes)) { CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, "Coping, please wait"); hintBox->paint(); sleep(1); @@ -1882,7 +1882,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) off64_t res = copy_movie(m_movieSelectionHandler, &m_movieInfo, msg == CRCInput::RC_radio); //g_RCInput->clearRCMsg(); if(res == 0) - ShowMsgUTF(LOCALE_MESSAGEBOX_ERROR, "Copy failed, is there jump bookmarks ? Or check free space.", CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); + ShowMsg(LOCALE_MESSAGEBOX_ERROR, "Copy failed, is there jump bookmarks ? Or check free space.", CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); else loadMovies(); refresh(); @@ -1891,11 +1891,11 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) else if (msg == CRCInput::RC_audio) { #if 0 if((m_movieSelectionHandler == playing_info) && (NeutrinoMessages::mode_ts == CNeutrinoApp::getInstance()->getMode())) - ShowMsgUTF(LOCALE_MESSAGEBOX_ERROR, "Impossible to cut playing movie.", CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); + ShowMsg(LOCALE_MESSAGEBOX_ERROR, "Impossible to cut playing movie.", CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); else #endif if((show_mode == MB_SHOW_RECORDS) && - (ShowMsgUTF (LOCALE_MESSAGEBOX_INFO, "Cut jumps from movie ?", CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes)) { + (ShowMsg (LOCALE_MESSAGEBOX_INFO, "Cut jumps from movie ?", CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes)) { CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, "Cutting, please wait"); hintBox->paint(); sleep(1); @@ -1905,7 +1905,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) off64_t res = cut_movie(m_movieSelectionHandler, &m_movieInfo); //g_RCInput->clearRCMsg(); if(res == 0) - ShowMsgUTF(LOCALE_MESSAGEBOX_ERROR, "Cut failed, is there jump bookmarks ? Or check free space.", CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); + ShowMsg(LOCALE_MESSAGEBOX_ERROR, "Cut failed, is there jump bookmarks ? Or check free space.", CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); else { loadMovies(); } @@ -1915,11 +1915,11 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) else if (msg == CRCInput::RC_games) { if((show_mode == MB_SHOW_RECORDS) && m_movieSelectionHandler != NULL) { if((m_movieSelectionHandler == playing_info) && (NeutrinoMessages::mode_ts == CNeutrinoApp::getInstance()->getMode())) - ShowMsgUTF(LOCALE_MESSAGEBOX_ERROR, "Impossible to truncate playing movie.", CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); + ShowMsg(LOCALE_MESSAGEBOX_ERROR, "Impossible to truncate playing movie.", CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); else if(m_movieSelectionHandler->bookmarks.end == 0) - ShowMsgUTF(LOCALE_MESSAGEBOX_ERROR, "No End bookmark defined!", CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); + ShowMsg(LOCALE_MESSAGEBOX_ERROR, "No End bookmark defined!", CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); else { - if(ShowMsgUTF (LOCALE_MESSAGEBOX_INFO, "Truncate movie ?", CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { + if(ShowMsg (LOCALE_MESSAGEBOX_INFO, "Truncate movie ?", CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, "Truncating, please wait"); hintBox->paint(); off64_t res = truncate_movie(m_movieSelectionHandler); @@ -1927,7 +1927,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) delete hintBox; g_RCInput->clearRCMsg(); if(res == 0) - ShowMsgUTF(LOCALE_MESSAGEBOX_ERROR, "Truncate failed.", CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); + ShowMsg(LOCALE_MESSAGEBOX_ERROR, "Truncate failed.", CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); else { //printf("New movie info: size %lld len %d\n", res, m_movieSelectionHandler->bookmarks.end/60); m_movieInfo.saveMovieInfo( *m_movieSelectionHandler); @@ -1939,7 +1939,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) } } else if (msg == CRCInput::RC_topleft) { if (m_movieSelectionHandler != NULL) { - if(ShowMsgUTF (LOCALE_MESSAGEBOX_INFO, "Remove screenshot ?", CMessageBox::mbrNo, CMessageBox:: mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { + if(ShowMsg (LOCALE_MESSAGEBOX_INFO, "Remove screenshot ?", CMessageBox::mbrNo, CMessageBox:: mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { std::string fname = getScreenshotName(m_movieSelectionHandler->file.Name); if (fname != "") unlink(fname.c_str()); @@ -2185,7 +2185,7 @@ void CMovieBrowser::onDeleteFile(MI_MOVIE_INFO& movieSelectionHandler, bool skip msg += "\r\n "; msg += g_Locale->getText(LOCALE_FILEBROWSER_DODELETE2); - if ((skipAsk) || (ShowMsgUTF(LOCALE_FILEBROWSER_DELETE, msg, CMessageBox::mbrYes, CMessageBox::mbYes|CMessageBox::mbNo)==CMessageBox::mbrYes)) + if ((skipAsk) || (ShowMsg(LOCALE_FILEBROWSER_DELETE, msg, CMessageBox::mbrYes, CMessageBox::mbYes|CMessageBox::mbNo)==CMessageBox::mbrYes)) { CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_MOVIEBROWSER_DELETE_INFO)); hintBox->paint(); @@ -4338,7 +4338,7 @@ static int get_input(bool * stop) * stop = false; g_RCInput->getMsg(&msg, &data, 1, false); if(msg == CRCInput::RC_home) { - if(ShowMsgUTF (LOCALE_MESSAGEBOX_INFO, "Cancel movie cut/split ?", CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { + if(ShowMsg (LOCALE_MESSAGEBOX_INFO, "Cancel movie cut/split ?", CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { * stop = true; } } diff --git a/src/gui/network_setup.cpp b/src/gui/network_setup.cpp index cb834807b..fbd91f73e 100644 --- a/src/gui/network_setup.cpp +++ b/src/gui/network_setup.cpp @@ -127,7 +127,7 @@ int CNetworkSetup::exec(CMenuTarget* parent, const std::string &actionKey) } else if(actionKey=="restore") { - int result = ShowMsgUTF(LOCALE_MAINSETTINGS_NETWORK, g_Locale->getText(LOCALE_NETWORKMENU_RESET_SETTINGS_NOW), CMessageBox::mbrNo, + int result = ShowMsg(LOCALE_MAINSETTINGS_NETWORK, g_Locale->getText(LOCALE_NETWORKMENU_RESET_SETTINGS_NOW), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo , NEUTRINO_ICON_QUESTION, @@ -535,7 +535,7 @@ bool CNetworkSetup::checkForIP() printf("[network setup] empty address %s\n", g_Locale->getText(n_settings[i].addr_name)); char msg[64]; snprintf(msg, 64, g_Locale->getText(LOCALE_NETWORKMENU_ERROR_NO_ADDRESS), g_Locale->getText(n_settings[i].addr_name)); - ShowMsgUTF(LOCALE_MAINSETTINGS_NETWORK, msg, CMessageBox::mbrOk, CMessageBox::mbOk, NEUTRINO_ICON_ERROR, width); + ShowMsg(LOCALE_MAINSETTINGS_NETWORK, msg, CMessageBox::mbrOk, CMessageBox::mbOk, NEUTRINO_ICON_ERROR, width); return false; } } @@ -578,7 +578,7 @@ void CNetworkSetup::applyNetworkSettings() int CNetworkSetup::saveChangesDialog() { // Save the settings after changes, if user wants to! - int result = ShowMsgUTF(LOCALE_MAINSETTINGS_NETWORK, g_Locale->getText(LOCALE_NETWORKMENU_APPLY_SETTINGS_NOW), CMessageBox::mbrYes, + int result = ShowMsg(LOCALE_MAINSETTINGS_NETWORK, g_Locale->getText(LOCALE_NETWORKMENU_APPLY_SETTINGS_NOW), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo , NEUTRINO_ICON_QUESTION, @@ -696,7 +696,7 @@ void CNetworkSetup::showCurrentNetworkSettings() + g_Locale->getText(LOCALE_NETWORKMENU_NAMESERVER) + ": " + nameserver + '\n' + g_Locale->getText(LOCALE_NETWORKMENU_GATEWAY ) + ": " + router; } - ShowMsgUTF(LOCALE_NETWORKMENU_SHOW, text, CMessageBox::mbrBack, CMessageBox::mbBack); // UTF-8 + ShowMsg(LOCALE_NETWORKMENU_SHOW, text, CMessageBox::mbrBack, CMessageBox::mbBack); // UTF-8 } const char * CNetworkSetup::mypinghost(std::string &host) @@ -792,7 +792,7 @@ void CNetworkSetup::testNetworkSettings() } } - ShowMsgUTF(LOCALE_NETWORKMENU_TEST, text, CMessageBox::mbrBack, CMessageBox::mbBack); // UTF-8 + ShowMsg(LOCALE_NETWORKMENU_TEST, text, CMessageBox::mbrBack, CMessageBox::mbBack); // UTF-8 } int CNetworkSetup::showWlanList() @@ -806,7 +806,7 @@ int CNetworkSetup::showWlanList() bool found = get_wlan_list(g_settings.ifname, networks); hintBox.hide(); if (!found) { - ShowMsgUTF(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_NETWORKMENU_SSID_SCAN_ERROR), CMessageBox::mbrBack, CMessageBox::mbBack); // UTF-8 + ShowMsg(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_NETWORKMENU_SSID_SCAN_ERROR), CMessageBox::mbrBack, CMessageBox::mbBack); // UTF-8 return res; } diff --git a/src/gui/personalize.cpp b/src/gui/personalize.cpp index b8098cbf5..f8c9b2584 100644 --- a/src/gui/personalize.cpp +++ b/src/gui/personalize.cpp @@ -649,7 +649,7 @@ void CPersonalizeGui::SaveAndExit() ApplySettings(); return; } - if (ShowMsgUTF(LOCALE_PERSONALIZE_HEAD, g_Locale->getText(LOCALE_PERSONALIZE_APPLY_SETTINGS), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_QUESTION) == CMessageBox::mbrYes) + if (ShowMsg(LOCALE_PERSONALIZE_HEAD, g_Locale->getText(LOCALE_PERSONALIZE_APPLY_SETTINGS), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_QUESTION) == CMessageBox::mbrYes) { CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_MAINSETTINGS_SAVESETTINGSNOW_HINT)); // UTF-8 hintBox.paint(); @@ -658,7 +658,7 @@ void CPersonalizeGui::SaveAndExit() } else { - if (ShowMsgUTF(LOCALE_PERSONALIZE_HEAD, g_Locale->getText(LOCALE_MESSAGEBOX_DISCARD), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_QUESTION) == CMessageBox::mbrYes) + if (ShowMsg(LOCALE_PERSONALIZE_HEAD, g_Locale->getText(LOCALE_MESSAGEBOX_DISCARD), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_QUESTION) == CMessageBox::mbrYes) exec(NULL, "restore"); } } diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index f491d67a3..99b8ae043 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -842,7 +842,7 @@ void CPictureViewerGui::endView() void CPictureViewerGui::deletePicFile(unsigned int index, bool mode) { CVFD::getInstance()->showMenuText(0, playlist[index].Name.c_str()); - if (ShowMsgUTF(LOCALE_FILEBROWSER_DELETE, playlist[index].Filename, CMessageBox::mbrNo, CMessageBox::mbYes|CMessageBox::mbNo)==CMessageBox::mbrYes) + if (ShowMsg(LOCALE_FILEBROWSER_DELETE, playlist[index].Filename, CMessageBox::mbrNo, CMessageBox::mbYes|CMessageBox::mbNo)==CMessageBox::mbrYes) { unlink(playlist[index].Filename.c_str()); printf("[ %s ] delete file: %s\r\n",__FUNCTION__,playlist[index].Filename.c_str()); diff --git a/src/gui/pluginlist.cpp b/src/gui/pluginlist.cpp index 6d0c5f1c1..3855d78fb 100644 --- a/src/gui/pluginlist.cpp +++ b/src/gui/pluginlist.cpp @@ -360,8 +360,8 @@ CPluginList::result_ CPluginList::pluginSelected() if (!g_PluginList->getScriptOutput().empty()) { hide(); - //ShowMsgUTF(LOCALE_PLUGINS_RESULT, Latin1_to_UTF8(g_PluginList->getScriptOutput()), CMessageBox::mbrBack,CMessageBox::mbBack,NEUTRINO_ICON_SHELL); - ShowMsgUTF(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMessageBox::mbrBack,CMessageBox::mbBack,NEUTRINO_ICON_SHELL); + //ShowMsg(LOCALE_PLUGINS_RESULT, Latin1_to_UTF8(g_PluginList->getScriptOutput()), CMessageBox::mbrBack,CMessageBox::mbBack,NEUTRINO_ICON_SHELL); + ShowMsg(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMessageBox::mbrBack,CMessageBox::mbBack,NEUTRINO_ICON_SHELL); } paint(); return resume; diff --git a/src/gui/rc_lock.cpp b/src/gui/rc_lock.cpp index 2b7177692..f8ee6b28a 100644 --- a/src/gui/rc_lock.cpp +++ b/src/gui/rc_lock.cpp @@ -53,7 +53,7 @@ int CRCLock::exec(CMenuTarget* parent, const std::string &actionKey) parent->hide(); bool no_input = (actionKey == NO_USER_INPUT); - if (ShowLocalizedMessage(LOCALE_RCLOCK_TITLE, LOCALE_RCLOCK_LOCKMSG, + if (ShowMsg(LOCALE_RCLOCK_TITLE, LOCALE_RCLOCK_LOCKMSG, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbCancel, NEUTRINO_ICON_INFO,450,no_input ? 5 : -1,no_input) == CMessageBox::mbrCancel) return menu_return::RETURN_EXIT_ALL; @@ -63,7 +63,7 @@ int CRCLock::exec(CMenuTarget* parent, const std::string &actionKey) lockBox(); locked = false; - ShowLocalizedMessage(LOCALE_RCLOCK_TITLE, LOCALE_RCLOCK_UNLOCKMSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO,450, no_input ? 5 : -1); + ShowMsg(LOCALE_RCLOCK_TITLE, LOCALE_RCLOCK_UNLOCKMSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO,450, no_input ? 5 : -1); return menu_return::RETURN_EXIT_ALL; } diff --git a/src/gui/record_setup.cpp b/src/gui/record_setup.cpp index 97812d6d7..207b6ea94 100644 --- a/src/gui/record_setup.cpp +++ b/src/gui/record_setup.cpp @@ -83,7 +83,7 @@ int CRecordSetup::exec(CMenuTarget* parent, const std::string &actionKey) } else if(actionKey == "help_recording") { - ShowLocalizedMessage(LOCALE_SETTINGS_HELP, LOCALE_RECORDINGMENU_HELP, CMessageBox::mbrBack, CMessageBox::mbBack); + ShowMsg(LOCALE_SETTINGS_HELP, LOCALE_RECORDINGMENU_HELP, CMessageBox::mbrBack, CMessageBox::mbBack); return res; } else if(actionKey == "recordingdir") diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index d0f0493d8..f7d9baa9e 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -307,7 +307,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) else if(msg == CRCInput::RC_home) { if(manual && !scansettings.scan_nit_manual) continue; - if (ShowLocalizedMessage(LOCALE_SCANTS_ABORT_HEADER, LOCALE_SCANTS_ABORT_BODY, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { + if (ShowMsg(LOCALE_SCANTS_ABORT_HEADER, LOCALE_SCANTS_ABORT_BODY, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { g_Zapit->stopScan(); } } diff --git a/src/gui/screensetup.cpp b/src/gui/screensetup.cpp index b1662e478..6e98f1409 100644 --- a/src/gui/screensetup.cpp +++ b/src/gui/screensetup.cpp @@ -135,7 +135,7 @@ int CScreenSetup::exec(CMenuTarget* parent, const std::string &) ( g_settings.screen_EndX != x_coord[1] ) || ( g_settings.screen_StartY != y_coord[0] ) || ( g_settings.screen_EndY != y_coord[1] ) ) && - (ShowLocalizedMessage(LOCALE_VIDEOMENU_SCREENSETUP, LOCALE_MESSAGEBOX_DISCARD, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbCancel) == CMessageBox::mbrCancel)) + (ShowMsg(LOCALE_VIDEOMENU_SCREENSETUP, LOCALE_MESSAGEBOX_DISCARD, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbCancel) == CMessageBox::mbrCancel)) break; case CRCInput::RC_timeout: diff --git a/src/gui/settings_manager.cpp b/src/gui/settings_manager.cpp index 46ef84f34..c7ed3990d 100644 --- a/src/gui/settings_manager.cpp +++ b/src/gui/settings_manager.cpp @@ -112,7 +112,7 @@ int CSettingsManager::exec(CMenuTarget* parent, const std::string &actionKey) my_system(2, backup_sh, fileBrowser.getSelectedFile()->Name.c_str()); } else - ShowMsgUTF(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_SETTINGS_BACKUP_FAILED),CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_ERROR); + ShowMsg(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_SETTINGS_BACKUP_FAILED),CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_ERROR); } return res; } @@ -122,7 +122,7 @@ int CSettingsManager::exec(CMenuTarget* parent, const std::string &actionKey) fileBrowser.Filter = &fileFilter; if (fileBrowser.exec("/media") == true) { - int result = ShowMsgUTF(LOCALE_SETTINGS_RESTORE, g_Locale->getText(LOCALE_SETTINGS_RESTORE_WARN), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo); + int result = ShowMsg(LOCALE_SETTINGS_RESTORE, g_Locale->getText(LOCALE_SETTINGS_RESTORE_WARN), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo); if(result == CMessageBox::mbrYes) { const char restore_sh[] = "/bin/restore.sh"; diff --git a/src/gui/start_wizard.cpp b/src/gui/start_wizard.cpp index 827781abf..56d544b0a 100644 --- a/src/gui/start_wizard.cpp +++ b/src/gui/start_wizard.cpp @@ -90,7 +90,7 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/) languageSettings.showLanguageSetup(&osdl_setup); osdl_setup.exec(NULL, ""); - if(ShowMsgUTF (LOCALE_WIZARD_WELCOME_HEAD, g_Locale->getText(LOCALE_WIZARD_WELCOME_TEXT), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbrCancel) == CMessageBox::mbrYes) + if(ShowMsg (LOCALE_WIZARD_WELCOME_HEAD, g_Locale->getText(LOCALE_WIZARD_WELCOME_TEXT), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbrCancel) == CMessageBox::mbrYes) { int advanced = 1; #ifdef ENABLE_FASTSCAN @@ -129,7 +129,7 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/) if(advanced && init_settings && (res != menu_return::RETURN_EXIT_ALL)) { - if (ShowMsgUTF(LOCALE_WIZARD_INITIAL_SETTINGS, g_Locale->getText(LOCALE_WIZARD_INSTALL_SETTINGS), + if (ShowMsg(LOCALE_WIZARD_INITIAL_SETTINGS, g_Locale->getText(LOCALE_WIZARD_INSTALL_SETTINGS), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrYes) { system("/bin/cp " CONFIGDIR "/initial/* " CONFIGDIR "/zapit/"); CFEManager::getInstance()->loadSettings(); diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 4c50d7e83..ef833b272 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -133,7 +133,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) text[12*len] = 0; CVFD::getInstance()->ShowText(text); - ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, "VFD test, Press OK to return", CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_MESSAGEBOX_INFO, "VFD test, Press OK to return", CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); CVFD::getInstance()->Clear(); return res; @@ -173,7 +173,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) close(fd); - ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, str, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_MESSAGEBOX_INFO, str, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); return res; } @@ -184,17 +184,17 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) switch(ret) { case 0: - ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, str, CMessageBox::mbrBack, CMessageBox::mbBack, "info.raw"); + ShowMsg(LOCALE_MESSAGEBOX_INFO, str, CMessageBox::mbrBack, CMessageBox::mbBack, "info.raw"); break; case -1: - ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, "Smardcard 1 ATR read failed", CMessageBox::mbrBack, CMessageBox::mbBack, "info"); + ShowMsg(LOCALE_MESSAGEBOX_INFO, "Smardcard 1 ATR read failed", CMessageBox::mbrBack, CMessageBox::mbBack, "info"); break; case -2: - ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, "Smardcard 1 reset failed", CMessageBox::mbrBack, CMessageBox::mbBack, "info"); + ShowMsg(LOCALE_MESSAGEBOX_INFO, "Smardcard 1 reset failed", CMessageBox::mbrBack, CMessageBox::mbBack, "info"); break; default: case -3: - ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, "Smardcard 1 open failed", CMessageBox::mbrBack, CMessageBox::mbBack, "info"); + ShowMsg(LOCALE_MESSAGEBOX_INFO, "Smardcard 1 open failed", CMessageBox::mbrBack, CMessageBox::mbBack, "info"); break; } @@ -207,17 +207,17 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) switch(ret) { case 0: - ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, str, CMessageBox::mbrBack, CMessageBox::mbBack, "info.raw"); + ShowMsg(LOCALE_MESSAGEBOX_INFO, str, CMessageBox::mbrBack, CMessageBox::mbBack, "info.raw"); break; case -1: - ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, "Smardcard 2 ATR read failed", CMessageBox::mbrBack, CMessageBox::mbBack, "info"); + ShowMsg(LOCALE_MESSAGEBOX_INFO, "Smardcard 2 ATR read failed", CMessageBox::mbrBack, CMessageBox::mbBack, "info"); break; case -2: - ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, "Smardcard 2 reset failed", CMessageBox::mbrBack, CMessageBox::mbBack, "info"); + ShowMsg(LOCALE_MESSAGEBOX_INFO, "Smardcard 2 reset failed", CMessageBox::mbrBack, CMessageBox::mbBack, "info"); break; default: case -3: - ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, "Smardcard 2 open failed", CMessageBox::mbrBack, CMessageBox::mbBack, "info"); + ShowMsg(LOCALE_MESSAGEBOX_INFO, "Smardcard 2 open failed", CMessageBox::mbrBack, CMessageBox::mbBack, "info"); break; } @@ -240,7 +240,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) sprintf(buffer, "HDD: /dev/sda1 is %s", mounted ? "mounted" : "NOT mounted"); printf("%s\n", buffer); - ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, buffer, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_MESSAGEBOX_INFO, buffer, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); return res; } @@ -261,7 +261,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) sprintf(buffer, "MMC: /dev/mmcblk0p1 is %s", mounted ? "mounted" : "NOT mounted"); printf("%s\n", buffer); - ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, buffer, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_MESSAGEBOX_INFO, buffer, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); return res; } diff --git a/src/gui/themes.cpp b/src/gui/themes.cpp index 64644e555..4f864b1ba 100644 --- a/src/gui/themes.cpp +++ b/src/gui/themes.cpp @@ -180,7 +180,7 @@ int CThemes::Show() } if (hasThemeChanged) { - if (ShowLocalizedMessage(LOCALE_MESSAGEBOX_INFO, LOCALE_COLORTHEMEMENU_QUESTION, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_SETTINGS) != CMessageBox::mbrYes) + if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_COLORTHEMEMENU_QUESTION, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_SETTINGS) != CMessageBox::mbrYes) rememberOldTheme( false ); else hasThemeChanged = false; diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index d3b42a66f..90e530189 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -598,7 +598,7 @@ int CTimerList::show() if (epgdata.title != "") title = "(" + epgdata.title + ")\n"; snprintf(buf1, sizeof(buf1)-1, g_Locale->getText(LOCALE_TIMERLIST_ASK_TO_DELETE), title.c_str()); - if(ShowMsgUTF(LOCALE_RECORDINGMENU_RECORD_IS_RUNNING, buf1, + if(ShowMsg(LOCALE_RECORDINGMENU_RECORD_IS_RUNNING, buf1, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrNo) { killTimer = false; update = false; @@ -1313,7 +1313,7 @@ bool askUserOnTimerConflict(time_t announceTime, time_t stopTime) // todo: localize message //g_Locale->getText(TIMERLIST_OVERLAPPING_MESSAGE); - return (ShowMsgUTF(LOCALE_MESSAGEBOX_INFO,timerbuf,CMessageBox::mbrNo,CMessageBox::mbNo|CMessageBox::mbYes) == CMessageBox::mbrYes); + return (ShowMsg(LOCALE_MESSAGEBOX_INFO,timerbuf,CMessageBox::mbrNo,CMessageBox::mbNo|CMessageBox::mbYes) == CMessageBox::mbrYes); } else return true; diff --git a/src/gui/update.cpp b/src/gui/update.cpp index 4e3ee8b91..de2948901 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -243,13 +243,13 @@ bool CFlashUpdate::selectHttpImage(void) if (urls.empty()) { - ShowMsgUTF(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_FLASHUPDATE_GETINFOFILEERROR), CMessageBox::mbrOk, CMessageBox::mbOk); // UTF-8 + ShowMsg(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_FLASHUPDATE_GETINFOFILEERROR), CMessageBox::mbrOk, CMessageBox::mbOk); // UTF-8 return false; } if(newfound) - ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_NEW_FOUND), CMessageBox::mbrOk, CMessageBox::mbOk, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_NEW_FOUND), CMessageBox::mbrOk, CMessageBox::mbOk, NEUTRINO_ICON_INFO); else - ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_NEW_NOTFOUND), CMessageBox::mbrOk, CMessageBox::mbOk, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_NEW_NOTFOUND), CMessageBox::mbrOk, CMessageBox::mbOk, NEUTRINO_ICON_INFO); menu_ret = SelectionWidget.exec(NULL, ""); @@ -329,7 +329,7 @@ printf("[update] mode is %d\n", softupdate_mode); if(fileType < '3') { if ((strncmp(RELEASE_CYCLE, versionInfo->getReleaseCycle(), 2) != 0) && - (ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_WRONGBASE), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) != CMessageBox::mbrYes)) + (ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_WRONGBASE), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) != CMessageBox::mbrYes)) { delete versionInfo; //ShowHint(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_FLASHUPDATE_WRONGBASE)); // UTF-8 @@ -337,8 +337,8 @@ printf("[update] mode is %d\n", softupdate_mode); } if ((strcmp("Release", versionInfo->getType()) != 0) && - //(ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_EXPERIMENTALIMAGE), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) != CMessageBox::mbrYes)) // UTF-8 - (ShowLocalizedMessage(LOCALE_MESSAGEBOX_INFO, LOCALE_FLASHUPDATE_EXPERIMENTALIMAGE, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) != CMessageBox::mbrYes)) + //(ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_EXPERIMENTALIMAGE), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) != CMessageBox::mbrYes)) // UTF-8 + (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_FLASHUPDATE_EXPERIMENTALIMAGE, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) != CMessageBox::mbrYes)) { delete versionInfo; return false; @@ -397,7 +397,7 @@ printf("[update] mode is %d\n", softupdate_mode); strcpy(msg, g_Locale->getText(LOCALE_FLASHUPDATE_NOVERSION)); msg_body = LOCALE_FLASHUPDATE_MSGBOX_MANUAL; } - return (ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, msg, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) == CMessageBox::mbrYes); // UTF-8 + return (ShowMsg(LOCALE_MESSAGEBOX_INFO, msg, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) == CMessageBox::mbrYes); // UTF-8 } int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey) @@ -461,7 +461,7 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey) return menu_return::RETURN_REPAINT; } if(softupdate_mode==1) { //internet-update - if ( ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, (fileType < '3') ? "Flash downloaded image ?" : "Install downloaded pack ?", CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) != CMessageBox::mbrYes) // UTF-8 + if ( ShowMsg(LOCALE_MESSAGEBOX_INFO, (fileType < '3') ? "Flash downloaded image ?" : "Install downloaded pack ?", CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) != CMessageBox::mbrYes) // UTF-8 { hide(); return menu_return::RETURN_REPAINT; @@ -477,7 +477,7 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey) //flash it... #ifndef BOXMODEL_APOLLO if (g_settings.apply_settings) { - if (ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_APPLY_SETTINGS), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) == CMessageBox::mbrYes) + if (ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_APPLY_SETTINGS), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) == CMessageBox::mbrYes) if (!CExtUpdate::getInstance()->applySettings(filename, CExtUpdate::MODE_SOFTUPDATE)) { hide(); return menu_return::RETURN_REPAINT; @@ -514,7 +514,7 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey) fread(buffer, (uint32_t)filesize, 1, fd); fclose(fd); buffer[filesize] = 0; - ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, buffer, CMessageBox::mbrBack, CMessageBox::mbBack); // UTF-8 + ShowMsg(LOCALE_MESSAGEBOX_INFO, buffer, CMessageBox::mbrBack, CMessageBox::mbBack); // UTF-8 free(buffer); } } @@ -762,7 +762,7 @@ void CFlashExpert::writemtd(const std::string & filename, int mtdNumber) FILESYSTEM_ENCODING_TO_UTF8_STRING(filename).c_str(), CMTDInfo::getInstance()->getMTDName(mtdNumber).c_str()); - if (ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, message, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) != CMessageBox::mbrYes) // UTF-8 + if (ShowMsg(LOCALE_MESSAGEBOX_INFO, message, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) != CMessageBox::mbrYes) // UTF-8 return; #ifdef VFD_UPDATE CVFD::getInstance()->showProgressBar2(0,"checking",0,"Update Neutrino"); @@ -949,7 +949,7 @@ int CFlashExpertSetup::exec(CMenuTarget* parent, const std::string &actionKey) // create image warning const char *box = (mtdInfo->getMTDEraseSize(mtdInfo->findMTDsystem()) == 0x40000) ? "Trinity" : "Tank"; snprintf(message, sizeof(message)-1, g_Locale->getText(LOCALE_FLASHUPDATE_CREATEIMAGE_WARNING), box, box); - if (ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, message, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) != CMessageBox::mbrYes) + if (ShowMsg(LOCALE_MESSAGEBOX_INFO, message, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) != CMessageBox::mbrYes) skipImage = true; } if (!skipImage) { diff --git a/src/gui/update_ext.cpp b/src/gui/update_ext.cpp index f8cc39f7c..06b107b5f 100644 --- a/src/gui/update_ext.cpp +++ b/src/gui/update_ext.cpp @@ -549,7 +549,7 @@ bool CExtUpdate::checkSpecialFolders(std::string line, bool copy) neutrino_locale_t msg = (copy) ? LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_SKIPPED : LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_DEL_SKIPPED; snprintf(buf, sizeof(buf), g_Locale->getText(msg), line.c_str()); WRITE_UPDATE_LOG("%s%s", buf, "\n"); - ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, buf, CMessageBox::mbrOk, CMessageBox::mbOk, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_MESSAGEBOX_INFO, buf, CMessageBox::mbrOk, CMessageBox::mbOk, NEUTRINO_ICON_INFO); return true; } return false; @@ -719,13 +719,13 @@ bool CExtUpdate::readBackupList(const std::string & dstPath) memset(buf1, '\0', sizeof(buf1)); if (free3 <= flashError) { snprintf(buf1, sizeof(buf1)-1, g_Locale->getText(LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_ERROR), free3, total); - ShowMsgUTF(LOCALE_MESSAGEBOX_ERROR, buf1, CMessageBox::mbrOk, CMessageBox::mbOk, NEUTRINO_ICON_ERROR); + ShowMsg(LOCALE_MESSAGEBOX_ERROR, buf1, CMessageBox::mbrOk, CMessageBox::mbOk, NEUTRINO_ICON_ERROR); flashErrorFlag = true; return false; } else if (free3 <= flashWarning) { snprintf(buf1, sizeof(buf1)-1, g_Locale->getText(LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_WARNING), free3, total); - if (ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, buf1, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_INFO) != CMessageBox::mbrYes) { + if (ShowMsg(LOCALE_MESSAGEBOX_INFO, buf1, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_INFO) != CMessageBox::mbrYes) { flashErrorFlag = true; return false; } diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index c240b85cb..9486289eb 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -202,13 +202,13 @@ bool CUpnpBrowserGui::discoverDevices() catch (std::runtime_error error) { delete scanBox; - ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, error.what(), CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_MESSAGEBOX_INFO, error.what(), CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); return false; } delete scanBox; if (m_devices.empty()) { - ShowLocalizedMessage(LOCALE_MESSAGEBOX_INFO, LOCALE_UPNPBROWSER_NOSERVERS, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_UPNPBROWSER_NOSERVERS, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); return false; } return true; @@ -236,7 +236,7 @@ bool CUpnpBrowserGui::getResults(std::string id, unsigned int start, unsigned in } catch (std::runtime_error error) { - ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, error.what(), CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_MESSAGEBOX_INFO, error.what(), CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); return false; } return true; diff --git a/src/gui/videosettings.cpp b/src/gui/videosettings.cpp index 60a3d8329..7be331eba 100644 --- a/src/gui/videosettings.cpp +++ b/src/gui/videosettings.cpp @@ -394,7 +394,7 @@ void CVideoSettings::setupVideoSystem(bool do_ask) if (prev_video_mode != g_settings.video_Mode) { frameBuffer->paintBackground(); - if (ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_VIDEO_MODE_OK), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_INFO) != CMessageBox::mbrYes) + if (ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_VIDEO_MODE_OK), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_INFO) != CMessageBox::mbrYes) { g_settings.video_Mode = prev_video_mode; videoDecoder->SetVideoSystem(g_settings.video_Mode); diff --git a/src/gui/widget/colorchooser.cpp b/src/gui/widget/colorchooser.cpp index 4269fc328..758cce4a7 100644 --- a/src/gui/widget/colorchooser.cpp +++ b/src/gui/widget/colorchooser.cpp @@ -201,7 +201,7 @@ int CColorChooser::exec(CMenuTarget* parent, const std::string &) } case CRCInput::RC_home: if (((*value[VALUE_R] != r_alt) || (*value[VALUE_G] != g_alt) || (*value[VALUE_B] != b_alt) || ((value[VALUE_ALPHA]) && (*(value[VALUE_ALPHA]) != a_alt))) && - (ShowLocalizedMessage(name, LOCALE_MESSAGEBOX_DISCARD, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbCancel) == CMessageBox::mbrCancel)) + (ShowMsg(name, LOCALE_MESSAGEBOX_DISCARD, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbCancel) == CMessageBox::mbrCancel)) break; // sonst abbruch... diff --git a/src/gui/widget/messagebox.cpp b/src/gui/widget/messagebox.cpp index 5e8d3e5c6..cb88930de 100644 --- a/src/gui/widget/messagebox.cpp +++ b/src/gui/widget/messagebox.cpp @@ -287,7 +287,18 @@ int CMessageBox::exec(int timeout) return res; } -int ShowMsgUTF(const neutrino_locale_t Caption, const char * const Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon, const int Width, const int timeout, bool returnDefaultOnTimeout) +int ShowMsg(const neutrino_locale_t Caption, const char * const Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon, const int Width, const int timeout, bool returnDefaultOnTimeout) +{ + CMessageBox* messageBox = new CMessageBox(Caption, Text, Width, Icon, Default, ShowButtons); + messageBox->returnDefaultValueOnTimeout(returnDefaultOnTimeout); + messageBox->exec(timeout); + int res = messageBox->result; + delete messageBox; + + return res; +} + +int ShowMsg(const std::string &Caption, const char * const Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon, const int Width, const int timeout, bool returnDefaultOnTimeout) { CMessageBox* messageBox = new CMessageBox(Caption, Text, Width, Icon, Default, ShowButtons); messageBox->returnDefaultValueOnTimeout(returnDefaultOnTimeout); @@ -298,33 +309,32 @@ int ShowMsgUTF(const neutrino_locale_t Caption, const char * const Text, const C return res; } -int ShowLocalizedMessage(const neutrino_locale_t Caption, const neutrino_locale_t Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon, const int Width, const int timeout, bool returnDefaultOnTimeout) +int ShowMsg(const neutrino_locale_t Caption, const neutrino_locale_t Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon, const int Width, const int timeout, bool returnDefaultOnTimeout) { - return ShowMsgUTF(Caption, g_Locale->getText(Text), Default, ShowButtons, Icon, Width, timeout,returnDefaultOnTimeout); + return ShowMsg(Caption, g_Locale->getText(Text), Default, ShowButtons, Icon, Width, timeout, returnDefaultOnTimeout); } -int ShowMsgUTF(const neutrino_locale_t Caption, const std::string & Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon, const int Width, const int timeout, bool returnDefaultOnTimeout) +int ShowMsg(const std::string &Caption, const neutrino_locale_t Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon, const int Width, const int timeout, bool returnDefaultOnTimeout) { - return ShowMsgUTF(Caption, Text.c_str(), Default, ShowButtons, Icon, Width, timeout,returnDefaultOnTimeout); + return ShowMsg(Caption, g_Locale->getText(Text), Default, ShowButtons, Icon, Width, timeout, returnDefaultOnTimeout); } -int ShowMsgUTF(const std::string & Caption, const std::string & Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon, const int Width, const int timeout, bool returnDefaultOnTimeout) +int ShowMsg(const neutrino_locale_t Caption, const std::string & Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon, const int Width, const int timeout, bool returnDefaultOnTimeout) { - CMessageBox* messageBox = new CMessageBox(Caption, Text.c_str(), Width, Icon, Default, ShowButtons); - messageBox->returnDefaultValueOnTimeout(returnDefaultOnTimeout); - messageBox->exec(timeout); - int res = messageBox->result; - delete messageBox; + return ShowMsg(Caption, Text.c_str(), Default, ShowButtons, Icon, Width, timeout,returnDefaultOnTimeout); +} - return res; +int ShowMsg(const std::string &Caption, const std::string & Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon, const int Width, const int timeout, bool returnDefaultOnTimeout) +{ + return ShowMsg(Caption, Text.c_str(), Default, ShowButtons, Icon, Width, timeout,returnDefaultOnTimeout); } void DisplayErrorMessage(const char * const ErrorMsg) { - ShowMsgUTF(LOCALE_MESSAGEBOX_ERROR, ErrorMsg, CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); + ShowMsg(LOCALE_MESSAGEBOX_ERROR, ErrorMsg, CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); } void DisplayInfoMessage(const char * const ErrorMsg) { - ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, ErrorMsg, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_MESSAGEBOX_INFO, ErrorMsg, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); } diff --git a/src/gui/widget/messagebox.h b/src/gui/widget/messagebox.h index 2fac497e2..9c63d70bc 100644 --- a/src/gui/widget/messagebox.h +++ b/src/gui/widget/messagebox.h @@ -100,10 +100,12 @@ class CMessageBox : public CHintBoxExt }; // Text is always UTF-8 encoded -int ShowLocalizedMessage(const neutrino_locale_t Caption, const neutrino_locale_t Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = 450, const int timeout = -1, bool returnDefaultOnTimeout = false); -int ShowMsgUTF(const neutrino_locale_t Caption, const char * const Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = 450, const int timeout = -1, bool returnDefaultOnTimeout = false); // UTF-8 -int ShowMsgUTF(const neutrino_locale_t Caption, const std::string & Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = 450, const int timeout = -1, bool returnDefaultOnTimeout = false); // UTF-8 -int ShowMsgUTF(const std::string & Caption, const std::string & Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = 450, const int timeout = -1, bool returnDefaultOnTimeout = false); // UTF-8 +int ShowMsg(const neutrino_locale_t Caption, const char * const Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = 450, const int timeout = -1, bool returnDefaultOnTimeout = false); // UTF-8 +int ShowMsg(const neutrino_locale_t Caption, const std::string & Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = 450, const int timeout = -1, bool returnDefaultOnTimeout = false); // UTF-8 +int ShowMsg(const neutrino_locale_t Caption, const neutrino_locale_t Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = 450, const int timeout = -1, bool returnDefaultOnTimeout = false); // UTF-8 +int ShowMsg(const std::string &Caption, const char * const Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = 450, const int timeout = -1, bool returnDefaultOnTimeout = false); // UTF-8 +int ShowMsg(const std::string &Caption, const std::string & Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = 450, const int timeout = -1, bool returnDefaultOnTimeout = false); // UTF-8 +int ShowMsg(const std::string &Caption, const neutrino_locale_t Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = 450, const int timeout = -1, bool returnDefaultOnTimeout = false); // UTF-8 void DisplayErrorMessage(const char * const ErrorMsg); // UTF-8 void DisplayInfoMessage(const char * const InfoMsg); // UTF-8 diff --git a/src/gui/widget/stringinput.cpp b/src/gui/widget/stringinput.cpp index c7f0970e0..04e2b769c 100644 --- a/src/gui/widget/stringinput.cpp +++ b/src/gui/widget/stringinput.cpp @@ -483,7 +483,7 @@ int CStringInput::exec( CMenuTarget* parent, const std::string & ) else if ( (msg==CRCInput::RC_home) || (msg==CRCInput::RC_timeout) ) { if ((*valueString != oldval) && - (ShowLocalizedMessage(name, LOCALE_MESSAGEBOX_DISCARD, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbCancel) == CMessageBox::mbrCancel)) + (ShowMsg(name, LOCALE_MESSAGEBOX_DISCARD, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbCancel) == CMessageBox::mbrCancel)) continue; *valueString = oldval; diff --git a/src/gui/widget/stringinput_ext.cpp b/src/gui/widget/stringinput_ext.cpp index 56f8410dd..82abac222 100644 --- a/src/gui/widget/stringinput_ext.cpp +++ b/src/gui/widget/stringinput_ext.cpp @@ -233,7 +233,7 @@ int CExtendedInput::exec( CMenuTarget* parent, const std::string & ) else if ( (msg==CRCInput::RC_home) || (msg==CRCInput::RC_timeout) ) { if(*valueString != oldval){ - int erg = ShowLocalizedMessage(name, LOCALE_MESSAGEBOX_DISCARD, CMessageBox::mbrYes, CMessageBox::mbNo | CMessageBox::mbYes | CMessageBox::mbCancel); + int erg = ShowMsg(name, LOCALE_MESSAGEBOX_DISCARD, CMessageBox::mbrYes, CMessageBox::mbNo | CMessageBox::mbYes | CMessageBox::mbCancel); if(erg==CMessageBox::mbrYes){ *valueString = oldval; loop=false; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index f58b548ae..2761eec41 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1858,7 +1858,7 @@ TIMER_START(); /* later on, we'll crash anyway, so tell about it. */ if (! zapit_init) - ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, + ShowMsg(LOCALE_MESSAGEBOX_INFO, "Zapit initialization failed.\nThis is a fatal error, sorry.", CMessageBox::mbrBack, CMessageBox::mbBack); @@ -2054,7 +2054,7 @@ void CNeutrinoApp::RealRun(CMenuWidget &mainMenu) g_PluginList->startPlugin("startup.cfg"); if (!g_PluginList->getScriptOutput().empty()) { - ShowMsgUTF(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMessageBox::mbrBack,CMessageBox::mbBack,NEUTRINO_ICON_SHELL); + ShowMsg(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMessageBox::mbrBack,CMessageBox::mbBack,NEUTRINO_ICON_SHELL); } g_RCInput->clearRCMsg(); @@ -2854,13 +2854,13 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) } else if( msg == NeutrinoMessages::ANNOUNCE_SLEEPTIMER) { if( mode != mode_scart && mode != mode_standby) - skipSleepTimer = (ShowLocalizedMessage(LOCALE_MESSAGEBOX_INFO, g_settings.shutdown_real ? LOCALE_SHUTDOWNTIMER_ANNOUNCE:LOCALE_SLEEPTIMERBOX_ANNOUNCE,CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, true) == CMessageBox::mbrYes); + skipSleepTimer = (ShowMsg(LOCALE_MESSAGEBOX_INFO, g_settings.shutdown_real ? LOCALE_SHUTDOWNTIMER_ANNOUNCE:LOCALE_SLEEPTIMERBOX_ANNOUNCE,CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, true) == CMessageBox::mbrYes); return messages_return::handled; } else if( msg == NeutrinoMessages::SLEEPTIMER) { if(data) {//INACTIVITY SLEEPTIMER skipShutdownTimer = - (ShowLocalizedMessage(LOCALE_MESSAGEBOX_INFO, g_settings.shutdown_real ? LOCALE_SHUTDOWNTIMER_ANNOUNCE:LOCALE_SLEEPTIMERBOX_ANNOUNCE, + (ShowMsg(LOCALE_MESSAGEBOX_INFO, g_settings.shutdown_real ? LOCALE_SHUTDOWNTIMER_ANNOUNCE:LOCALE_SLEEPTIMERBOX_ANNOUNCE, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, true) == CMessageBox::mbrYes);//FIXME if(skipShutdownTimer) { printf("NeutrinoMessages::INACTIVITY SLEEPTIMER: skiping\n"); @@ -2909,7 +2909,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) } else if( msg == NeutrinoMessages::ANNOUNCE_SHUTDOWN) { if( mode != mode_scart ) - skipShutdownTimer = (ShowLocalizedMessage(LOCALE_MESSAGEBOX_INFO, LOCALE_SHUTDOWNTIMER_ANNOUNCE, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 5) == CMessageBox::mbrYes); + skipShutdownTimer = (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_SHUTDOWNTIMER_ANNOUNCE, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 5) == CMessageBox::mbrYes); } else if( msg == NeutrinoMessages::SHUTDOWN ) { if(!skipShutdownTimer) { @@ -2940,7 +2940,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) if (msg == NeutrinoMessages::EVT_POPUP) ShowHint(LOCALE_MESSAGEBOX_INFO, text.c_str(), 0, atoi(timeout.c_str())); else if (msg == NeutrinoMessages::EVT_EXTMSG) - ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, text, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO, 0, atoi(timeout.c_str())); + ShowMsg(LOCALE_MESSAGEBOX_INFO, text, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO, 0, atoi(timeout.c_str())); } delete[] (unsigned char*) data; @@ -2962,7 +2962,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) text[pos] = '\n'; } if( mode != mode_scart ) - ShowMsgUTF(LOCALE_TIMERLIST_TYPE_REMIND, text, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); // UTF-8 + ShowMsg(LOCALE_TIMERLIST_TYPE_REMIND, text, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); // UTF-8 delete[] (unsigned char*) data; return messages_return::handled; } @@ -3019,7 +3019,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) else if (msg == NeutrinoMessages::EVT_START_PLUGIN) { g_PluginList->startPlugin((const char *)data); if (!g_PluginList->getScriptOutput().empty()) { - ShowMsgUTF(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMessageBox::mbrBack,CMessageBox::mbBack,NEUTRINO_ICON_SHELL); + ShowMsg(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMessageBox::mbrBack,CMessageBox::mbBack,NEUTRINO_ICON_SHELL); } delete[] (unsigned char*) data; @@ -3051,7 +3051,7 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) CRecordManager::getInstance()->StopAutoRecord(); if(CRecordManager::getInstance()->RecordingStatus()) { do_shutdown = - (ShowLocalizedMessage(LOCALE_MESSAGEBOX_INFO, LOCALE_SHUTDOWN_RECODING_QUERY, CMessageBox::mbrNo, + (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_SHUTDOWN_RECODING_QUERY, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, true) == CMessageBox::mbrYes); } @@ -3504,7 +3504,7 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) int returnval = menu_return::RETURN_REPAINT; if(actionKey == "help_recording") { - ShowLocalizedMessage(LOCALE_SETTINGS_HELP, LOCALE_RECORDINGMENU_HELP, CMessageBox::mbrBack, CMessageBox::mbBack); + ShowMsg(LOCALE_SETTINGS_HELP, LOCALE_RECORDINGMENU_HELP, CMessageBox::mbrBack, CMessageBox::mbBack); } else if(actionKey=="shutdown") { ExitRun(true, 1); @@ -3647,7 +3647,7 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) g_settings.easymenu = (g_settings.easymenu == 0) ? 1 : 0; INFO("change easymenu to %d\n", g_settings.easymenu); const char * text = g_settings.easymenu ? "Easy menu switched ON, restart box ?" : "Easy menu switched OFF, restart box ?"; - if (ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, text, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_INFO, 0) == CMessageBox::mbrYes) + if (ShowMsg(LOCALE_MESSAGEBOX_INFO, text, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_INFO, 0) == CMessageBox::mbrYes) g_RCInput->postMsg(NeutrinoMessages::REBOOT, 0); } } diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index 8ffd94536..e94306ecd 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -526,7 +526,7 @@ int CDataResetNotifier::exec(CMenuTarget* /*parent*/, const std::string& actionK /* no need to confirm if we only remove deleted channels */ if (!delete_removed) { - int result = ShowMsgUTF(msg, g_Locale->getText(LOCALE_RESET_CONFIRM), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo); + int result = ShowMsg(msg, g_Locale->getText(LOCALE_RESET_CONFIRM), CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo); if (result != CMessageBox::mbrYes) return true; }