All pastes #482840 Raw Edit

Stuff

public cpp v1 · immutable
·published 2007-05-11 12:56 UTC
rendered paste body
--- main.cpp.orig       2007-05-11 12:03:06.000000000 +0100+++ main.cpp    2007-05-11 12:02:17.000000000 +0100@@ -451,15 +451,22 @@     // first of all find out, if this is a frontend only host...     bool frontendOnly = gContext->IsFrontendOnly(); +    // how do you want to quit today?+    int  exitMenuStyle = gContext->GetNumSetting("OverrideExitMenu", 0);+     QString title = QObject::tr("Do you really want to exit MythTV?");      DialogBox diag(gContext->GetMainWindow(), title);     diag.AddButton(QObject::tr("No"));-    diag.AddButton(QObject::tr("Yes, Exit now"));-    if (frontendOnly)+    if (exitMenuStyle < 3)+        diag.AddButton(QObject::tr("Yes, Exit now"));+    if ((exitMenuStyle == 0 && frontendOnly) || +        (exitMenuStyle > 1 && exitMenuStyle < 4))         diag.AddButton(QObject::tr("Yes, Exit and Shutdown"));      int result = diag.exec();+    if ((exitMenuStyle == 3) && (result == 2))+        result = 3;     switch (result)     {         case 1: return NO_EXIT;--- globalsettings.cpp.orig     2007-05-11 12:14:31.000000000 +0100+++ globalsettings.cpp  2007-05-11 12:22:43.000000000 +0100@@ -1337,6 +1337,21 @@     return gc; } +static HostComboBox *OverrideExitMenu()+{+    HostComboBox *gc = new HostComboBox("OverrideExitMenu");+    gc->setLabel(QObject::tr("Exit menu style"));+    gc->addSelection(QObject::tr("Autodetect"), "0");+    gc->addSelection(QObject::tr("Show quit"), "1");+    gc->addSelection(QObject::tr("Show quit and shutdown"), "2");+    gc->addSelection(QObject::tr("Show shutdown"), "3");+    gc->setHelpText(QObject::tr("MythTV automatically determines which "+                    "options to show in the exit menu. If you wish, you may "+                    "force specific options to display, to suit your "+                    "configuration."));+    return gc;+}+ static HostCheckBox *NoPromptOnExit() {     HostCheckBox *gc = new HostCheckBox("NoPromptOnExit");@@ -3374,6 +3389,7 @@     general->addChild(AllowQuitShutdown());     general->addChild(NoPromptOnExit());     general->addChild(HaltCommand());+    general->addChild(OverrideExitMenu());     general->addChild(LircKeyPressedApp());     general->addChild(UseArrowAccels());     general->addChild(NetworkControlEnabled());