[Goodies-commits] r6242 - in xfce4-screenshooter-plugin/trunk: . src

Jerome Guelfucci jeromeg at xfce.org
Mon Dec 1 11:05:19 CET 2008


Author: jeromeg
Date: 2008-12-01 10:05:19 +0000 (Mon, 01 Dec 2008)
New Revision: 6242

Modified:
   xfce4-screenshooter-plugin/trunk/ChangeLog
   xfce4-screenshooter-plugin/trunk/src/main.c
Log:
 * src/main.c: Show the dialog again after taking a screenshot, the
    application is exited when the user presses the Cancel Button.


Modified: xfce4-screenshooter-plugin/trunk/ChangeLog
===================================================================
--- xfce4-screenshooter-plugin/trunk/ChangeLog	2008-11-30 23:44:14 UTC (rev 6241)
+++ xfce4-screenshooter-plugin/trunk/ChangeLog	2008-12-01 10:05:19 UTC (rev 6242)
@@ -1,3 +1,8 @@
+2008-12-01 jeromeg
+
+  * src/main.c: Show the dialog again after taking a screenshot, the
+    application is exited when the user presses the Cancel Button.
+
 2008-11-30 jeromeg
 
   * Make a few strings consistent.

Modified: xfce4-screenshooter-plugin/trunk/src/main.c
===================================================================
--- xfce4-screenshooter-plugin/trunk/src/main.c	2008-11-30 23:44:14 UTC (rev 6241)
+++ xfce4-screenshooter-plugin/trunk/src/main.c	2008-12-01 10:05:19 UTC (rev 6242)
@@ -177,7 +177,7 @@
   else
     {
       GtkWidget *dialog;
-      gint response;
+      gint response = GTK_RESPONSE_OK;
       GdkDisplay *display = gdk_display_get_default ();
       
       rc_file = xfce_resource_lookup (XFCE_RESOURCE_CONFIG, 
@@ -189,41 +189,47 @@
       if (rc_file != NULL)
         g_free (rc_file);
       
-      /* Set the dialog up */
-      dialog = screenshooter_dialog_new (sd, FALSE);
+      /* Show the dialog and take the screenshot until the application
+       * is exited */
       
-      gtk_window_set_type_hint(GTK_WINDOW (dialog), 
-                               GDK_WINDOW_TYPE_HINT_NORMAL);
-      
-      /* Run the dialog and destroy it, so that it's not grabbed in 
-       * active window mode */
-      
-      response = gtk_dialog_run (GTK_DIALOG (dialog));
-      
-      gtk_widget_destroy (dialog);
-      
-      gdk_display_sync (display);
-      
-      sleep (1);
-                  
-      if (response == GTK_RESPONSE_OK)
+      while (response != GTK_RESPONSE_CANCEL)
         {
-          rc_file = 
-            xfce_resource_save_location (XFCE_RESOURCE_CONFIG, 
-                                         "xfce4/xfce4-screenshooter",
-                                         TRUE);
+          /* Set the dialog up */
+          dialog = screenshooter_dialog_new (sd, FALSE);
           
-          screenshooter_take_and_output_screenshot (sd);
+          gtk_window_set_type_hint(GTK_WINDOW (dialog), 
+                                   GDK_WINDOW_TYPE_HINT_NORMAL);
           
-          /* Save preferences */
+          /* Run the dialog and destroy it, so that it's not grabbed in 
+           * active window mode */
           
-          if (rc_file != NULL)
+          response = gtk_dialog_run (GTK_DIALOG (dialog));
+          
+          gtk_widget_destroy (dialog);
+          
+          gdk_display_sync (display);
+          
+          sleep (1);
+                      
+          if (response == GTK_RESPONSE_OK)
             {
-              screenshooter_write_rc_file (rc_file, sd);
+              rc_file = 
+                xfce_resource_save_location (XFCE_RESOURCE_CONFIG, 
+                                             "xfce4/xfce4-screenshooter",
+                                             TRUE);
               
-              g_free (rc_file);
+              screenshooter_take_and_output_screenshot (sd);
             }
         }
+      
+      /* Save preferences */
+          
+      if (rc_file != NULL)
+        {
+          screenshooter_write_rc_file (rc_file, sd);
+          
+          g_free (rc_file);
+        }
     }
   
   g_free (sd->screenshot_dir);




More information about the Goodies-commits mailing list