[Xfce4-commits] <xfce4-screenshooter:master> Set true as the default value for horodating.

Jérôme Guelfucci jeromeg at xfce.org
Fri Aug 14 00:26:25 CEST 2009


Updating branch refs/heads/master
         to 4f58c934bf567ab78756217a1451b207808346bb (commit)
       from a5aaeb9c5585b003c53554bd7db1d59e6c76be4e (commit)

commit 4f58c934bf567ab78756217a1451b207808346bb
Author: Jérôme Guelfucci <jeromeg at xfce.org>
Date:   Sun Aug 9 23:19:59 2009 +0200

    Set true as the default value for horodating.
    
    Mark the default screenshot title as translatable.
    
    Factorize the code to open the help page.

 ChangeLog                           |    8 ++++++++
 lib/screenshooter-actions.c         |   10 +---------
 lib/screenshooter-utils.c           |   24 ++++++++++++++++++++----
 lib/screenshooter-utils.h           |   31 ++++++++++++++++---------------
 panel-plugin/screenshooter-plugin.c |   12 +-----------
 src/main.c                          |   10 +---------
 6 files changed, 47 insertions(+), 48 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 847cd4f..583cb38 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2009-08-09 jeromeg
 
+Set true as the default value for horodating.
+
+Mark the default screenshot title as translatable.
+
+Factorize the code to open the help page.
+
+2009-08-09 jeromeg
+
 Make enter validate the ZimageZ dialog.
 
 2009-08-09 jeromeg
diff --git a/lib/screenshooter-actions.c b/lib/screenshooter-actions.c
index b6c08b0..10f3172 100644
--- a/lib/screenshooter-actions.c
+++ b/lib/screenshooter-actions.c
@@ -26,16 +26,8 @@ cb_help_response (GtkWidget *dialog, gint response, gpointer unused)
 {
   if (response == GTK_RESPONSE_HELP)
     {
-      GError *error_help = NULL;
-
       g_signal_stop_emission_by_name (dialog, "response");
-
-      /* Launch the help page and show an error dialog if there was an error. */
-      if (!g_spawn_command_line_async ("xfhelp4 xfce4-screenshooter.html", &error_help))
-        {
-          screenshooter_error ("%s", error_help->message);
-          g_error_free (error_help);
-        }
+      screenshooter_open_help ();
     }
 }
 
diff --git a/lib/screenshooter-utils.c b/lib/screenshooter-utils.c
index 3289a3d..b5d1bec 100644
--- a/lib/screenshooter-utils.c
+++ b/lib/screenshooter-utils.c
@@ -61,9 +61,9 @@ screenshooter_read_rc_file (const gchar *file, ScreenshotData *sd)
   gint region = FULLSCREEN;
   gint action = SAVE;
   gint show_mouse = 1;
-  gboolean horodate = FALSE;
+  gboolean horodate = TRUE;
   gchar *screenshot_dir = g_strdup (default_uri);
-  gchar *title = g_strdup ("Screenshot");
+  gchar *title = g_strdup (_("Screenshot"));
   gchar *app = g_strdup ("none");
   gchar *last_user = g_strdup ("");
 
@@ -81,7 +81,7 @@ screenshooter_read_rc_file (const gchar *file, ScreenshotData *sd)
           region = xfce_rc_read_int_entry (rc, "region", FULLSCREEN);
           action = xfce_rc_read_int_entry (rc, "action", SAVE);
           show_mouse = xfce_rc_read_int_entry (rc, "show_mouse", 1);
-          horodate = xfce_rc_read_bool_entry (rc, "horodate", FALSE);
+          horodate = xfce_rc_read_bool_entry (rc, "horodate", TRUE);
 
           g_free (app);
           app = g_strdup (xfce_rc_read_entry (rc, "app", "none"));
@@ -94,7 +94,8 @@ screenshooter_read_rc_file (const gchar *file, ScreenshotData *sd)
             g_strdup (xfce_rc_read_entry (rc, "screenshot_dir", default_uri));
 
           g_free (title);
-          title = g_strdup (xfce_rc_read_entry (rc, "title", "Screenshot"));
+          title =
+            g_strdup (xfce_rc_read_entry (rc, "title", _("Screenshot")));
         }
 
       TRACE ("Close the rc file");
@@ -340,3 +341,18 @@ gchar *screenshooter_get_date (gboolean strip_slashes)
 
   return result;
 }
+
+
+
+void screenshooter_open_help (void)
+{
+  GError *error_help = NULL;
+
+  /* Launch the help page and show an error dialog if there was an error. */
+  if (!g_spawn_command_line_async ("xfhelp4 xfce4-screenshooter.html",
+                                   &error_help))
+    {
+      screenshooter_error ("%s", error_help->message);
+      g_error_free (error_help);
+    }
+}
diff --git a/lib/screenshooter-utils.h b/lib/screenshooter-utils.h
index 3fa1355..176c45b 100644
--- a/lib/screenshooter-utils.h
+++ b/lib/screenshooter-utils.h
@@ -35,21 +35,22 @@
 
 
 
-void screenshooter_copy_to_clipboard       (GdkPixbuf      *screenshot);
-void screenshooter_read_rc_file            (const gchar    *file,
-                                            ScreenshotData *sd);
-void screenshooter_write_rc_file           (const gchar    *file,
-                                            ScreenshotData *sd);
-void screenshooter_open_screenshot         (const gchar    *screenshot_path,
-                                            const gchar    *application);
-gchar *screenshooter_get_home_uri          (void);
-gchar *screenshooter_get_xdg_image_dir_uri (void);
-gboolean screenshooter_is_remote_uri       (const gchar    *uri);
-gchar *rot13                               (gchar          *string);
-void screenshooter_error                   (const gchar    *format,
-                                            ...);
-gchar *screenshooter_get_date              (gboolean strip_slashes);
-gchar *screenshooter_get_time              (void);
+void      screenshooter_copy_to_clipboard     (GdkPixbuf      *screenshot);
+void      screenshooter_read_rc_file          (const gchar    *file,
+                                               ScreenshotData *sd);
+void      screenshooter_write_rc_file         (const gchar    *file,
+                                               ScreenshotData *sd);
+void      screenshooter_open_screenshot       (const gchar    *screenshot_path,
+                                               const gchar    *application);
+gchar    *screenshooter_get_home_uri          (void);
+gchar    *screenshooter_get_xdg_image_dir_uri (void);
+gboolean  screenshooter_is_remote_uri         (const gchar    *uri);
+gchar    *rot13                               (gchar          *string);
+void      screenshooter_error                 (const gchar    *format,
+                                               ...);
+gchar    *screenshooter_get_date              (gboolean strip_slashes);
+gchar    *screenshooter_get_time              (void);
+void      screenshooter_open_help             (void);
 
 
 #endif
diff --git a/panel-plugin/screenshooter-plugin.c b/panel-plugin/screenshooter-plugin.c
index 96f21aa..514d21b 100644
--- a/panel-plugin/screenshooter-plugin.c
+++ b/panel-plugin/screenshooter-plugin.c
@@ -233,17 +233,7 @@ cb_dialog_response (GtkWidget *dlg, int response, PluginData *pd)
       screenshooter_plugin_write_rc_file (pd->plugin, pd);
     }
   else if (response == GTK_RESPONSE_HELP)
-    {
-      GError *error_help = NULL;
-
-      /* Execute the help and show an error dialog if there was
-       * an error. */
-      if (!g_spawn_command_line_async ("xfhelp4 xfce4-screenshooter.html", &error_help))
-        {
-          screenshooter_error ("%s", error_help->message);
-          g_error_free (error_help);
-        }
-    }
+    screenshooter_open_help ();
 }
 
 
diff --git a/src/main.c b/src/main.c
index 6f829d5..e07c8d6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -104,16 +104,8 @@ cb_dialog_response (GtkWidget *dialog, gint response, ScreenshotData *sd)
 {
   if (response == GTK_RESPONSE_HELP)
     {
-      GError *error_help = NULL;
-
       g_signal_stop_emission_by_name (dialog, "response");
-
-      /* Launch the help page and show an error dialog if there was an error. */
-      if (!g_spawn_command_line_async ("xfhelp4 xfce4-screenshooter.html", &error_help))
-        {
-          screenshooter_error ("%s", error_help->message);
-          g_error_free (error_help);
-        }
+      screenshooter_open_help ();
     }
   else if (response == GTK_RESPONSE_OK)
     {



More information about the Xfce4-commits mailing list