summaryrefslogtreecommitdiffstats
path: root/abs/extra-testing/community/mythtv-vdpau/myththemedmenu.cpp.patch
diff options
context:
space:
mode:
authorCecil Hugh Watson <knoppmyth@gmail.com>2009-02-16 05:02:52 (GMT)
committerCecil Hugh Watson <knoppmyth@gmail.com>2009-02-16 05:02:52 (GMT)
commit39c2b31a9bfb656be1c7fba9bc73d297230f6d60 (patch)
tree90406a7c1356ebdd7e48e7ee0322be05a22a8610 /abs/extra-testing/community/mythtv-vdpau/myththemedmenu.cpp.patch
parentee08c3133373b7a4d14d655e052c3175eaf558fe (diff)
downloadlinhes_pkgbuild-39c2b31a9bfb656be1c7fba9bc73d297230f6d60.zip
linhes_pkgbuild-39c2b31a9bfb656be1c7fba9bc73d297230f6d60.tar.gz
linhes_pkgbuild-39c2b31a9bfb656be1c7fba9bc73d297230f6d60.tar.bz2
VDPAU!
Diffstat (limited to 'abs/extra-testing/community/mythtv-vdpau/myththemedmenu.cpp.patch')
-rw-r--r--abs/extra-testing/community/mythtv-vdpau/myththemedmenu.cpp.patch125
1 files changed, 125 insertions, 0 deletions
diff --git a/abs/extra-testing/community/mythtv-vdpau/myththemedmenu.cpp.patch b/abs/extra-testing/community/mythtv-vdpau/myththemedmenu.cpp.patch
new file mode 100644
index 0000000..e5c57ef
--- /dev/null
+++ b/abs/extra-testing/community/mythtv-vdpau/myththemedmenu.cpp.patch
@@ -0,0 +1,125 @@
+--- libs/libmythui/myththemedmenu.cpp.orig 2008-01-31 15:26:38.000000000 +0000
++++ libs/libmythui/myththemedmenu.cpp 2008-02-07 22:24:27.000000000 +0000
+@@ -2102,6 +2102,10 @@
+ }
+ lastbutton = NULL;
+ }
++ else if (action == "MENU")
++ {
++ parent->doMenu();
++ }
+ else if (action == "EJECT")
+ {
+ myth_eject();
+@@ -2482,6 +2486,8 @@
+
+ if (d->foundtheme)
+ d->parseMenu(menufile);
++
++ m_menuPopup = NULL;
+ }
+
+ MythThemedMenu::~MythThemedMenu(void)
+@@ -2592,3 +2598,102 @@
+ MythScreenType::aboutToShow();
+ d->updateLCD();
+ }
++void MythThemedMenu::doMenu()
++{
++ int allowsd = gContext->GetNumSetting("AllowQuitShutdown");
++ if (m_menuPopup)
++ return;
++ QString label = "System Menu";
++ MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
++ m_menuPopup = new MythDialogBox(label, mainStack, "menuPopup");
++ if (m_menuPopup->Create())
++ mainStack->AddScreen(m_menuPopup);
++
++ //changed line to always show shutdown/reboot
++ if ( allowsd != 10 && allowsd !=14 )
++ {
++ m_menuPopup->SetReturnEvent(this,"popmenu_exit");
++ m_menuPopup->AddButton("Power off");
++ m_menuPopup->AddButton("Reboot");
++ m_menuPopup->AddButton("About");
++ m_menuPopup->AddButton("Cancel");
++ }
++ 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(IO_ReadOnly | IO_Translate) )
++ {
++ 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(QCustomEvent *event)
++{
++ if (event->type() == kMythDialogBoxCompletionEventType)
++ {
++ DialogCompletionEvent *dce =
++ dynamic_cast<DialogCompletionEvent*>(event);
++
++ QString resultid= dce->GetId();
++ int buttonnum = dce->GetResult();
++ if (resultid == "popmenu_exit")
++ {
++ if (buttonnum == 0)
++ {
++ QString halt_cmd = gContext->GetSetting("HaltCommand",
++ "sudo /sbin/halt -p");
++ if (!halt_cmd.isEmpty())
++ system(halt_cmd.ascii());
++ }
++
++ if (buttonnum == 1)
++ {
++ QString reboot_cmd = gContext->GetSetting("RebootCommand",
++ "sudo /sbin/reboot");
++ if (!reboot_cmd.isEmpty())
++ system(reboot_cmd.ascii());
++ }
++
++ if (buttonnum == 2)
++ {
++ aboutScreen();
++ }
++ }
++
++ if (resultid == "popmenu_noexit")
++ {
++ if (buttonnum == 0)
++ aboutScreen();
++ }
++
++ m_menuPopup = NULL;
++ }
++}