summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/mythtv/trunk/mythtv/myththemedmenu.cpp.patch
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core-testing/mythtv/trunk/mythtv/myththemedmenu.cpp.patch')
-rw-r--r--abs/core-testing/mythtv/trunk/mythtv/myththemedmenu.cpp.patch183
1 files changed, 0 insertions, 183 deletions
diff --git a/abs/core-testing/mythtv/trunk/mythtv/myththemedmenu.cpp.patch b/abs/core-testing/mythtv/trunk/mythtv/myththemedmenu.cpp.patch
deleted file mode 100644
index fbb85c3..0000000
--- a/abs/core-testing/mythtv/trunk/mythtv/myththemedmenu.cpp.patch
+++ /dev/null
@@ -1,183 +0,0 @@
-Index: libs/libmythui/myththemedmenu.cpp
-===================================================================
---- libs/libmythui/myththemedmenu.cpp (revision 20249)
-+++ libs/libmythui/myththemedmenu.cpp (working copy)
-@@ -88,6 +88,8 @@
- m_state(state), m_allocedstate(false), m_foundtheme(false),
- m_exitModifier(-1), m_ignorekeys(false), m_wantpop(false)
- {
-+ m_menuPopup = NULL;
-+
- if (!m_state)
- {
- m_state = new MythThemedMenuState(parent, "themedmenustate");
-@@ -269,6 +271,10 @@
- }
- }
- }
-+ else if (action == "MENU")
-+ {
-+ doMenu();
-+ }
- else
- handled = false;
- }
-@@ -290,6 +296,158 @@
- updateLCD();
- }
-
-+void MythThemedMenu::doMenu()
-+{
-+ if( m_menuPopup != NULL )
-+ return;
-+
-+ int allowsd = GetMythDB()->GetNumSetting("AllowQuitShutdown");
-+ int override_menu = GetMythDB()->GetNumSetting("OverRideExitMenu");
-+ QString label = "System Menu";
-+ MythScreenStack* mainStack = GetMythMainWindow()->GetMainStack();
-+ m_menuPopup = new MythDialogBox(label, mainStack, "menuPopup");
-+
-+ if (m_menuPopup->Create())
-+ mainStack->AddScreen(m_menuPopup);
-+
-+ if (override_menu == 0)
-+ {
-+ if ( (allowsd != 0) && (allowsd != 4) )
-+ {
-+ m_menuPopup->SetReturnEvent(this,"popmenu_exit");
-+ m_menuPopup->AddButton("Shutdown");
-+ m_menuPopup->AddButton("Reboot");
-+ }
-+ else
-+ {
-+ m_menuPopup->SetReturnEvent(this,"popmenu_noexit");
-+ }
-+ }
-+ if (override_menu == 5)
-+ { // reboot
-+ m_menuPopup->SetReturnEvent(this,"popmenu_reboot");
-+ m_menuPopup->AddButton("Reboot");
-+ }
-+ else if (override_menu == 2 || override_menu == 4)
-+ { // shutdown
-+ m_menuPopup->SetReturnEvent(this,"popmenu_shutdown");
-+ m_menuPopup->AddButton("Shutdown");
-+ }
-+ else if (override_menu == 3 || override_menu == 6)
-+ { // both
-+ m_menuPopup->SetReturnEvent(this,"popmenu_exit");
-+ m_menuPopup->AddButton("Shutdown");
-+ m_menuPopup->AddButton("Reboot");
-+ }
-+ else
-+ {
-+ m_menuPopup->SetReturnEvent(this,"popmenu_noexit");
-+ }
-+
-+ m_menuPopup->AddButton("About");
-+ m_menuPopup->AddButton("Cancel");
-+
-+}
-+
-+void MythThemedMenu::aboutScreen()
-+{
-+
-+ extern const char* myth_source_version;
-+ extern const char* myth_source_path;
-+ QString distro_line;
-+ distro_line = "";
-+
-+ QFile file("/etc/os_myth_release");
-+ if (file.open(QFile::ReadOnly))
-+ {
-+ QTextStream t( &file ); // use a text stream
-+ distro_line = t.readLine();
-+ file.close();
-+ }
-+
-+ QString label = "";
-+ label.append(QObject::tr("Revision: ") + myth_source_version + " \n Branch:" + myth_source_path + "\n" + distro_line );
-+
-+ MythScreenStack* mainStack = GetMythMainWindow()->GetMainStack();
-+ m_menuPopup = new MythDialogBox(label, mainStack, "About");
-+ if (m_menuPopup->Create())
-+ mainStack->AddScreen(m_menuPopup);
-+
-+ m_menuPopup->SetReturnEvent(this, "About");
-+ m_menuPopup->AddButton("OK!");
-+
-+}
-+
-+void MythThemedMenu::customEvent(QEvent *event)
-+{
-+ if (event->type() == kMythDialogBoxCompletionEventType)
-+ {
-+ DialogCompletionEvent *dce =
-+ dynamic_cast<DialogCompletionEvent*>(event);
-+
-+ QString resultid = dce->GetId();
-+ int buttonnum = dce->GetResult();
-+ QString halt_cmd = GetMythDB()->GetSetting("HaltCommand");
-+ QString reboot_cmd = GetMythDB()->GetSetting("RebootCommand");
-+
-+ if (resultid == "popmenu_exit")
-+ {
-+ if (buttonnum == 0)
-+ {
-+ if (!halt_cmd.isEmpty())
-+ system(halt_cmd.toAscii());
-+ }
-+
-+ if (buttonnum == 1)
-+ {
-+ if (!reboot_cmd.isEmpty())
-+ system(reboot_cmd.toAscii());
-+ }
-+
-+ if (buttonnum == 2)
-+ {
-+ aboutScreen();
-+ }
-+ }
-+
-+ if (resultid == "popmenu_noexit")
-+ {
-+ if (buttonnum == 0)
-+ aboutScreen();
-+ }
-+
-+ if (resultid == "popmenu_reboot")
-+ {
-+ if (buttonnum == 0)
-+ {
-+ if (!reboot_cmd.isEmpty())
-+ system(reboot_cmd.toAscii());
-+ }
-+
-+ if (buttonnum == 1)
-+ {
-+ aboutScreen();
-+ }
-+ }
-+
-+ if (resultid == "popmenu_shutdown")
-+ {
-+ if (buttonnum == 0)
-+ {
-+ if (!halt_cmd.isEmpty())
-+ system(halt_cmd.toAscii());
-+ }
-+
-+ if (buttonnum == 1)
-+ {
-+ aboutScreen();
-+ }
-+ }
-+
-+ m_menuPopup = NULL;
-+ }
-+}
-+
- /** \brief Parses the element's tags and set the ThemeButton's type,
- * text, depends, and action, then adds the button.
- *