[mythtv] [patch] add command line switch to mythfrontend to disable exit prompt

Wayne A. Hogue II mythtv at chiphead.net
Tue Jan 13 20:35:48 EST 2004


I have integrated mythtv into freevo as a plugin.  It is nicer to exit 
streight back to freevo whne you hit exit.  So I added a switch.  With 
out the switch, the app acts as it always has.

-Wayne.


-------------- next part --------------
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 01:28:09 -0000
@@ -37,6 +37,7 @@
 #define QUIT     1
 #define HALT     2
 
+bool promptExit = true;
 ThemedMenu *menu;
 MythContext *gContext;
 XBox *xbox = NULL;
@@ -379,6 +380,8 @@
 
 int handleExit(void)
 {
+    if (promptExit)
+    {
     // first of all find out, if a backend runs on this host...
     bool backendOnLocalhost = false;
 
@@ -411,6 +414,8 @@
 
     return 0;
 }
+    return QUIT;
+}
 
 void haltnow()
 {
@@ -678,6 +683,10 @@
             cout << MYTH_BINARY_VERSION << endl;
             exit(0);
         }
+        else if (!strcmp(a.argv()[argpos],"--no-prompt-exit"))
+        {
+            promptExit = false;
+        }
         else if ((argpos + 1 == a.argc()) &&
                     !QString(a.argv()[argpos]).startsWith("-"))
         {
@@ -690,6 +699,7 @@
                 cerr << "Invalid argument: " << a.argv()[argpos] << endl;
             cerr << "Valid options are: " << endl <<
                     "-l or --logfile filename       Writes STDERR and STDOUT messages to filename" << endl <<
+                    "--no-prompt-exit               Exit with out confirmation" << endl <<
                     "-v or --verbose debug-level    Prints more information" << endl <<
                     "                               Accepts any combination (separated by comma)" << endl << 
                     "                               of all,none,quiet,record,playback," << endl <<


More information about the mythtv-dev mailing list