Added SIGQUIT handler, which mkaes menu exit (and request mmwrapper also exit.)
authorskeezix <skeezix@flotsam-vm.(none)>
Tue, 6 Apr 2010 20:30:31 +0000 (16:30 -0400)
committerskeezix <skeezix@flotsam-vm.(none)>
Tue, 6 Apr 2010 20:30:31 +0000 (16:30 -0400)
minimenu/TODO.txt
minimenu/mmenu.c

index e19cfdf..efc0082 100644 (file)
@@ -3,8 +3,17 @@
   - full-replacement PXML is one option, another is
   - apply override to all sections that match -- by unique-id, so apply override to all sub-apps that apply?
 
+- switch default skin to davec
+- kill -3 .. request quit
+
 - add font and fontcolour control to conf
 - About screen and shoutouts // konami code?
+- Perhaps a seriesof conf sections for per-file-extension or per-mimetype or both
+  [Section-FILEEXT] and [Section-MIMETYPE]
+  icon             /some/path
+  invoke           /path/to/proggy/to/run/it
+  -- this would thus let us do things like invoke a video player
+  -- alternative: parse the MIME handlers for xfce (say), to poach the info. Could be really slow.
 
 - add check.. if bad skin reported by mmenu, have mmwrapper set it back to default? or mm itself do it?
 
 - deploy..
   - .desktop for deployment, for running from xfce
 
-- maybe:
-  - directory browser; easy hack
-
 - future
-  - honor render_mask to know what to update
   - handle SD eject/insert? or leave on manual
   - add callback to pnd_disco_Search (maybe new func to not break cpas code), so can show number apps found so far
-  - note taking field
index 95a8b4b..3c1800f 100644 (file)
@@ -36,6 +36,7 @@
 #include <ctype.h>
 #include <sys/wait.h>
 #include <dirent.h>
+#include <signal.h> // for sigaction
 
 #include "pnd_logger.h"
 #include "pnd_pxml.h"
@@ -70,6 +71,8 @@ char g_skin_selected [ 100 ] = "default";
 char *g_skinpath = NULL; // where 'skin_selected' is located .. the fullpath including skin-dir-name
 pnd_conf_handle g_skinconf = NULL;
 
+void sigquit_handler ( int n );
+
 int main ( int argc, char *argv[] ) {
   int logall = -1; // -1 means normal logging rules; >=0 means log all!
   int i;
@@ -173,6 +176,17 @@ int main ( int argc, char *argv[] ) {
     emit_and_quit ( MM_QUIT );
   }
 
+  /* set up quit signal handler
+   */
+  sigset_t ss;
+  sigemptyset ( &ss );
+
+  struct sigaction siggy;
+  siggy.sa_handler = sigquit_handler;
+  siggy.sa_mask = ss; /* implicitly blocks the origin signal */
+  siggy.sa_flags = SA_RESTART; /* don't need anything */
+  sigaction ( SIGQUIT, &siggy, NULL );
+
   /* category conf file
    */
   {
@@ -601,3 +615,8 @@ void applications_scan ( void ) {
 
   return;
 }
+
+void sigquit_handler ( int n ) {
+  pnd_log ( pndn_rem, "SIGQUIT received; graceful exit.\n" );
+  emit_and_quit ( MM_QUIT );
+}