[mythtv] [PATCH] Add new configuration setting to disable exit prompt

Wayne A. Hogue II mythtv at chiphead.net
Wed Jan 14 11:08:45 EST 2004


As suggested, now its a setting instead of a command line pram.

-Wayne
-------------- next part --------------
Index: globalsettings.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythfrontend/globalsettings.cpp,v
retrieving revision 1.124
diff -b -B -d -u -w -r1.124 globalsettings.cpp
--- globalsettings.cpp	11 Jan 2004 04:20:33 -0000	1.124
+++ globalsettings.cpp	14 Jan 2004 16:05:31 -0000
@@ -819,6 +819,17 @@
     };
 };
 
+class NoPromptOnExit: public CheckBoxSetting, public GlobalSetting {
+public:
+    NoPromptOnExit():
+        GlobalSetting("NoPromptOnExit") {
+        setLabel(QObject::tr("No Prompt on Exit"));
+        setValue(false);
+        setHelpText(QObject::tr("If set, you will not be prompted when pressing "
+                    "the exit key.  Instead, MythTV will immediately exit."));
+    };
+};
+
 class HaltCommand: public LineEditSetting, public GlobalSetting {
 public:
     HaltCommand():
@@ -1459,6 +1470,7 @@
 
     VerticalConfigurationGroup* general = new VerticalConfigurationGroup(false);
     general->addChild(new AllowQuitShutdown());
+    general->addChild(new NoPromptOnExit());
     general->addChild(new HaltCommand());
     general->addChild(new SetupPinCodeRequired());
     general->addChild(new SetupPinCode());
Index: main.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythfrontend/main.cpp,v
retrieving revision 1.127
diff -b -B -d -u -w -r1.127 main.cpp
--- main.cpp	13 Jan 2004 07:37:34 -0000	1.127
+++ main.cpp	14 Jan 2004 16:05:31 -0000
@@ -379,6 +379,10 @@
 
 int handleExit(void)
 {
+    if (gContext->GetNumSetting("NoPromptOnExit") == 1)
+    {
+        return QUIT;
+    }
     // first of all find out, if a backend runs on this host...
     bool backendOnLocalhost = false;
 


More information about the mythtv-dev mailing list