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

Jerome Guelfucci jeromeg at xfce.org
Wed Nov 5 12:12:42 CET 2008


Author: jeromeg
Date: 2008-11-05 11:12:42 +0000 (Wed, 05 Nov 2008)
New Revision: 5981

Modified:
   xfce4-screenshooter-plugin/trunk/ChangeLog
   xfce4-screenshooter-plugin/trunk/NEWS
   xfce4-screenshooter-plugin/trunk/panel-plugin/screenshooter-plugin.c
   xfce4-screenshooter-plugin/trunk/src/main.c
Log:
  * src/main.c, lib/screenshooter-plugin.c:
    - If no application is selected to open the screenshots, show the save 
      dialog as usual. If an application is selected, save the screenshot in
      /tmp without showing the save dialog, and open it with the application.
      The user will then be able to do what he wants to do with the picture, and
      to save it where he wants using the application.
    - don't leak screenshot_path when GIO is not present on the system.
  * NEWS: updated


Modified: xfce4-screenshooter-plugin/trunk/ChangeLog
===================================================================
--- xfce4-screenshooter-plugin/trunk/ChangeLog	2008-11-05 10:24:43 UTC (rev 5980)
+++ xfce4-screenshooter-plugin/trunk/ChangeLog	2008-11-05 11:12:42 UTC (rev 5981)
@@ -1,5 +1,16 @@
 2008-11-05 jeromeg
 
+  * src/main.c, lib/screenshooter-plugin.c:
+    - If no application is selected to open the screenshots, show the save 
+      dialog as usual. If an application is selected, save the screenshot in
+      /tmp without showing the save dialog, and open it with the application.
+      The user will then be able to do what he wants to do with the picture, and
+      to save it where he wants using the application.
+    - don't leak screenshot_path when GIO is not present on the system.
+  * NEWS: updated
+
+2008-11-05 jeromeg
+
   * Add svn tag.
   * Fix the version mess.
   * lib/screenshooter-utils.c: 

Modified: xfce4-screenshooter-plugin/trunk/NEWS
===================================================================
--- xfce4-screenshooter-plugin/trunk/NEWS	2008-11-05 10:24:43 UTC (rev 5980)
+++ xfce4-screenshooter-plugin/trunk/NEWS	2008-11-05 11:12:42 UTC (rev 5981)
@@ -2,6 +2,11 @@
 
   * Apply a patch by Enrico Tröger to fix a crash.
   * Plug some additionnal leaks.
+  * If no application is selected to open the screenshots, show the save dialog 
+    as usual. If an application is selected, save the screenshot in /tmp without 
+    showing the save dialog, and open it with the application. The user will 
+    then be able to do what he wants to do with the picture, and to save it 
+    where he wants using the application.
 
 === Version 1.3.9.0 ===
 

Modified: xfce4-screenshooter-plugin/trunk/panel-plugin/screenshooter-plugin.c
===================================================================
--- xfce4-screenshooter-plugin/trunk/panel-plugin/screenshooter-plugin.c	2008-11-05 10:24:43 UTC (rev 5980)
+++ xfce4-screenshooter-plugin/trunk/panel-plugin/screenshooter-plugin.c	2008-11-05 11:12:42 UTC (rev 5981)
@@ -163,22 +163,34 @@
 
   /* Get the screenshot */
 	screenshot = screenshooter_take_screenshot (pd->sd->mode, pd->sd->delay);
-
-  screenshot_path = 
-    screenshooter_save_screenshot (screenshot, pd->sd->show_save_dialog, 
-                                   pd->sd->screenshot_dir);
   
-  g_object_unref (screenshot);                                   
-  
-  /* Open the screenshot */
   #ifdef HAVE_GIO
-  if (screenshot_path != NULL)
+  if (!g_str_equal(pd->sd->app, "none"))
     {
-      screenshooter_open_screenshot (screenshot_path, pd->sd->app);
-      g_free (screenshot_path);
+      screenshot_path = 
+        screenshooter_save_screenshot (screenshot, FALSE, "/tmp");
     }
-  #endif                             
+  else
+    {
+  #endif
+      screenshot_path = 
+        screenshooter_save_screenshot (screenshot, pd->sd->show_save_dialog, 
+                                       pd->sd->screenshot_dir);
+  #ifdef HAVE_GIO
+    }
+  #endif
+    
+  g_object_unref (screenshot);                                   
   
+  /* Open the screenshot */
+ if (screenshot_path != NULL)
+	 {
+	   #ifdef HAVE_GIO
+	   screenshooter_open_screenshot (screenshot_path, pd->sd->app);
+	   #endif
+	   g_free (screenshot_path);
+	 }                           
+  
   /* Make the panel button clickable */
 	gtk_widget_set_sensitive (GTK_WIDGET (pd->button), TRUE);
 }

Modified: xfce4-screenshooter-plugin/trunk/src/main.c
===================================================================
--- xfce4-screenshooter-plugin/trunk/src/main.c	2008-11-05 10:24:43 UTC (rev 5980)
+++ xfce4-screenshooter-plugin/trunk/src/main.c	2008-11-05 11:12:42 UTC (rev 5981)
@@ -204,20 +204,39 @@
           
           /* Take the screenshot */
           screenshot = screenshooter_take_screenshot (sd->mode, sd->delay);
-          screenshot_path =
-            screenshooter_save_screenshot (screenshot, sd->show_save_dialog, 
-                                           sd->screenshot_dir);
+          
+          #ifdef HAVE_GIO
+          if (!g_str_equal(sd->app, "none"))
+            {
+              screenshot_path = 
+                screenshooter_save_screenshot (screenshot, 
+                                               FALSE, 
+                                               "/tmp");
+            }
+          else
+            {
+          #endif
+              screenshot_path = 
+                screenshooter_save_screenshot (screenshot, 
+                                               sd->show_save_dialog, 
+                                               sd->screenshot_dir);
+          #ifdef HAVE_GIO
+            }
+          #endif
+          
           g_object_unref (screenshot);
           
           /* Open the screenshot */
-          #ifdef HAVE_GIO
+          
           if (screenshot_path != NULL)
             {
+              #ifdef HAVE_GIO
               screenshooter_open_screenshot (screenshot_path, sd->app);
+              #endif
               g_free (screenshot_path);
             }
-          #endif
           
+          
           /* Save preferences */     
           screenshooter_write_rc_file (rc_file, sd);
         }




More information about the Goodies-commits mailing list