mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 17:01:08 +02:00
CMsgBox: rework msgbox classes with Window class implementation
Replacing messagebox, hintbox_ext and some derivated parts with
basic class hintbox and derivated class CMsgBox. This should unify
window handling and avoids maintain of multiple classes with quasi
same purpose and adds more functionality.
TODO: fix and optimize details
Origin commit data
------------------
Branch: ni/coolstream
Commit: dde298b1b7
Author: Thilo Graf <dbt@novatux.de>
Date: 2016-04-04 (Mon, 04 Apr 2016)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -98,7 +98,7 @@
|
||||
#include "gui/widget/hintbox.h"
|
||||
#include "gui/widget/icons.h"
|
||||
#include "gui/widget/menue.h"
|
||||
#include "gui/widget/messagebox.h"
|
||||
#include "gui/widget/msgbox.h"
|
||||
#include "gui/infoclock.h"
|
||||
#include "gui/parentallock_setup.h"
|
||||
#ifdef ENABLE_PIP
|
||||
@@ -2314,7 +2314,7 @@ void CNeutrinoApp::RealRun()
|
||||
#endif
|
||||
g_PluginList->startPlugin("startup");
|
||||
if (!g_PluginList->getScriptOutput().empty()) {
|
||||
ShowMsg(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMessageBox::mbrBack,CMessageBox::mbBack,NEUTRINO_ICON_SHELL);
|
||||
ShowMsg(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_SHELL);
|
||||
}
|
||||
g_RCInput->clearRCMsg();
|
||||
|
||||
@@ -3240,14 +3240,14 @@ 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 = (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);
|
||||
skipSleepTimer = (ShowMsg(LOCALE_MESSAGEBOX_INFO, g_settings.shutdown_real ? LOCALE_SHUTDOWNTIMER_ANNOUNCE:LOCALE_SLEEPTIMERBOX_ANNOUNCE,CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NULL, 450, 30, true) == CMsgBox::mbrYes);
|
||||
return messages_return::handled;
|
||||
}
|
||||
else if( msg == NeutrinoMessages::SLEEPTIMER) {
|
||||
if(data) {//INACTIVITY SLEEPTIMER
|
||||
skipShutdownTimer =
|
||||
(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
|
||||
CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NULL, 450, 30, true) == CMsgBox::mbrYes);//FIXME
|
||||
if(skipShutdownTimer) {
|
||||
printf("NeutrinoMessages::INACTIVITY SLEEPTIMER: skiping\n");
|
||||
skipShutdownTimer = false;
|
||||
@@ -3301,7 +3301,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 = (ShowMsg(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, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NULL, 450, 5) == CMsgBox::mbrYes);
|
||||
}
|
||||
else if( msg == NeutrinoMessages::SHUTDOWN ) {
|
||||
if(!skipShutdownTimer) {
|
||||
@@ -3319,21 +3319,21 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
|
||||
}
|
||||
else if (msg == NeutrinoMessages::EVT_POPUP || msg == NeutrinoMessages::EVT_EXTMSG) {
|
||||
if (mode != mode_scart && mode != mode_standby) {
|
||||
std::string timeout="-1";
|
||||
int timeout = HINTBOX_DEFAULT_TIMEOUT;
|
||||
std::string text = (char*)data;
|
||||
std::string::size_type pos;
|
||||
|
||||
pos = text.find("&timeout=", 0);
|
||||
if (pos != std::string::npos) {
|
||||
timeout = text.substr( pos+9, text.length()+1 );
|
||||
std::string tmp = text.substr( pos+9, text.length()+1 );
|
||||
text[pos] = '\0';
|
||||
timeout = atoi(tmp.c_str());
|
||||
}
|
||||
|
||||
if (msg == NeutrinoMessages::EVT_POPUP)
|
||||
ShowHint(LOCALE_MESSAGEBOX_INFO, text.c_str(), 0, atoi(timeout.c_str()));
|
||||
ShowHint(LOCALE_MESSAGEBOX_INFO, text.c_str(), 0, timeout);
|
||||
else if (msg == NeutrinoMessages::EVT_EXTMSG)
|
||||
ShowMsg(LOCALE_MESSAGEBOX_INFO, text, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO, 0, atoi(timeout.c_str()));
|
||||
|
||||
ShowMsg(LOCALE_MESSAGEBOX_INFO, text, CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_INFO, 500, timeout);
|
||||
}
|
||||
delete[] (unsigned char*) data;
|
||||
return messages_return::handled;
|
||||
@@ -3354,7 +3354,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
|
||||
text[pos] = '\n';
|
||||
}
|
||||
if( mode != mode_scart )
|
||||
ShowMsg(LOCALE_TIMERLIST_TYPE_REMIND, text, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); // UTF-8
|
||||
ShowMsg(LOCALE_TIMERLIST_TYPE_REMIND, text, CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_INFO); // UTF-8
|
||||
delete[] (unsigned char*) data;
|
||||
return messages_return::handled;
|
||||
}
|
||||
@@ -3426,7 +3426,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()) {
|
||||
ShowMsg(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMessageBox::mbrBack,CMessageBox::mbBack,NEUTRINO_ICON_SHELL);
|
||||
ShowMsg(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMsgBox::mbrBack,CMsgBox::mbBack,NEUTRINO_ICON_SHELL);
|
||||
}
|
||||
|
||||
delete[] (unsigned char*) data;
|
||||
@@ -3440,7 +3440,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
|
||||
}
|
||||
return messages_return::handled;
|
||||
// ShowHint(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_EXTRA_ZAPIT_SDT_CHANGED),
|
||||
// CMessageBox::mbrBack,CMessageBox::mbBack, NEUTRINO_ICON_INFO);
|
||||
// CMsgBox::mbrBack,CMsgBox::mbBack, NEUTRINO_ICON_INFO);
|
||||
}
|
||||
else if (msg == NeutrinoMessages::EVT_HDMI_CEC_VIEW_ON) {
|
||||
if(g_settings.hdmi_cec_view_on)
|
||||
@@ -3480,8 +3480,8 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode)
|
||||
CRecordManager::getInstance()->StopAutoRecord();
|
||||
if(CRecordManager::getInstance()->RecordingStatus() || cYTCache::getInstance()->isActive()) {
|
||||
do_shutdown =
|
||||
(ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_SHUTDOWN_RECORDING_QUERY, CMessageBox::mbrNo,
|
||||
CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, true) == CMessageBox::mbrYes);
|
||||
(ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_SHUTDOWN_RECORDING_QUERY, CMsgBox::mbrNo,
|
||||
CMsgBox::mbYes | CMsgBox::mbNo, NULL, 450, 30, true) == CMsgBox::mbrYes);
|
||||
}
|
||||
|
||||
if(do_shutdown) {
|
||||
@@ -3957,7 +3957,7 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey)
|
||||
int returnval = menu_return::RETURN_REPAINT;
|
||||
|
||||
if(actionKey == "help_recording") {
|
||||
ShowMsg(LOCALE_SETTINGS_HELP, LOCALE_RECORDINGMENU_HELP, CMessageBox::mbrBack, CMessageBox::mbBack);
|
||||
ShowMsg(LOCALE_SETTINGS_HELP, LOCALE_RECORDINGMENU_HELP, CMsgBox::mbrBack, CMsgBox::mbBack);
|
||||
}
|
||||
else if(actionKey=="shutdown") {
|
||||
ExitRun(true, 1);
|
||||
@@ -4051,8 +4051,8 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey)
|
||||
if (recordingstatus)
|
||||
DisplayErrorMessage(g_Locale->getText(LOCALE_SERVICEMENU_RESTART_REFUSED_RECORDING));
|
||||
else {
|
||||
CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_SERVICEMENU_RESTART_HINT));
|
||||
hintBox->paint();
|
||||
CHint * hint = new CHint(LOCALE_SERVICEMENU_RESTART_HINT);
|
||||
hint->paint();
|
||||
|
||||
saveSetup(NEUTRINO_SETTINGS_FILE);
|
||||
|
||||
@@ -4063,7 +4063,7 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey)
|
||||
delete g_fontRenderer;
|
||||
delete g_dynFontRenderer;
|
||||
|
||||
delete hintBox;
|
||||
delete hint;
|
||||
|
||||
stop_daemons(true);
|
||||
stop_video();
|
||||
@@ -4104,7 +4104,7 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey)
|
||||
parent->hide();
|
||||
|
||||
std::string text = "Easy menu switched " + string(g_settings.easymenu?"OFF":"ON") + string(", when restart box.\nRestart now?");
|
||||
if (ShowMsg(LOCALE_MESSAGEBOX_INFO, text, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_INFO, 0) == CMessageBox::mbrYes) {
|
||||
if (ShowMsg(LOCALE_MESSAGEBOX_INFO, text, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_INFO, 0) == CMsgBox::mbrYes) {
|
||||
g_settings.easymenu = (g_settings.easymenu == 0) ? 1 : 0;
|
||||
INFO("change easymenu to %d\n", g_settings.easymenu);
|
||||
g_RCInput->postMsg(NeutrinoMessages::REBOOT, 0);
|
||||
|
Reference in New Issue
Block a user