[gnome-screenshot] screenshot: Add command option --include-pointer



commit 2eceef9e14d3b578e6d8fceb7b9f29c3aa433555
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Thu May 24 18:39:19 2012 +0200

    screenshot: Add command option --include-pointer
    
    https://bugzilla.gnome.org/show_bug.cgi?id=594141

 src/org.gnome.gnome-screenshot.gschema.xml.in |    2 +-
 src/screenshot-application.c                  |    3 +++
 src/screenshot-config.c                       |   11 ++++++++---
 src/screenshot-config.h                       |    1 +
 4 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/src/org.gnome.gnome-screenshot.gschema.xml.in b/src/org.gnome.gnome-screenshot.gschema.xml.in
index c251791..7252020 100644
--- a/src/org.gnome.gnome-screenshot.gschema.xml.in
+++ b/src/org.gnome.gnome-screenshot.gschema.xml.in
@@ -26,7 +26,7 @@
       <_description>Include the window manager border along with the screenshot</_description>
     </key>
     <key name="include-pointer" type="b">
-      <default>true</default>
+      <default>false</default>
       <_summary>Include Pointer</_summary>
       <_description>Include the pointer in the screenshot</_description>
     </key>
diff --git a/src/screenshot-application.c b/src/screenshot-application.c
index 7beeb35..bba46d9 100644
--- a/src/screenshot-application.c
+++ b/src/screenshot-application.c
@@ -500,6 +500,7 @@ screenshot_application_local_command_line (GApplication *app,
   gboolean area_arg = FALSE;
   gboolean include_border_arg = FALSE;
   gboolean disable_border_arg = FALSE;
+  gboolean include_pointer_arg = FALSE;
   gboolean interactive_arg = FALSE;
   gchar *border_effect_arg = NULL;
   guint delay_arg = 0;
@@ -510,6 +511,7 @@ screenshot_application_local_command_line (GApplication *app,
     { "area", 'a', 0, G_OPTION_ARG_NONE, &area_arg, N_("Grab an area of the screen instead of the entire screen"), NULL },
     { "include-border", 'b', 0, G_OPTION_ARG_NONE, &include_border_arg, N_("Include the window border with the screenshot"), NULL },
     { "remove-border", 'B', 0, G_OPTION_ARG_NONE, &disable_border_arg, N_("Remove the window border from the screenshot"), NULL },
+    { "include-pointer", 'p', 0, G_OPTION_ARG_NONE, &include_pointer_arg, N_("Include the pointer with the screenshot"), NULL },
     { "delay", 'd', 0, G_OPTION_ARG_INT, &delay_arg, N_("Take screenshot after specified delay [in seconds]"), N_("seconds") },
     { "border-effect", 'e', 0, G_OPTION_ARG_STRING, &border_effect_arg, N_("Effect to add to the border (shadow, border or none)"), N_("effect") },
     { "interactive", 'i', 0, G_OPTION_ARG_NONE, &interactive_arg, N_("Interactively set options"), NULL },
@@ -545,6 +547,7 @@ screenshot_application_local_command_line (GApplication *app,
                                 area_arg,
                                 include_border_arg,
                                 disable_border_arg,
+                                include_pointer_arg,
                                 border_effect_arg,
                                 delay_arg,
                                 interactive_arg,
diff --git a/src/screenshot-config.c b/src/screenshot-config.c
index e102ca8..82fe438 100644
--- a/src/screenshot-config.c
+++ b/src/screenshot-config.c
@@ -39,6 +39,7 @@ screenshot_load_config (gboolean clipboard_arg,
                         gboolean area_arg,
                         gboolean include_border_arg,
                         gboolean disable_border_arg,
+                        gboolean include_pointer_arg,
                         const gchar *border_effect_arg,
                         guint delay_arg,
                         gboolean interactive_arg,
@@ -74,6 +75,8 @@ screenshot_load_config (gboolean clipboard_arg,
     {
       if (clipboard_arg)
         g_warning ("Option --clipboard is ignored in interactive mode.");
+      if (include_pointer_arg)
+        g_warning ("Option --include-pointer is ignored in interactive mode.");
       if (file_arg)
         g_warning ("Option --file is ignored in interactive mode.");
 
@@ -93,6 +96,10 @@ screenshot_load_config (gboolean clipboard_arg,
       if (disable_border_arg)
         config->include_border = FALSE;
 
+      config->include_pointer =
+        g_settings_get_boolean (config->settings,
+                                INCLUDE_POINTER_KEY);
+
       if (border_effect_arg != NULL)
         config->border_effect = g_strdup (border_effect_arg);
       else
@@ -108,6 +115,7 @@ screenshot_load_config (gboolean clipboard_arg,
       config->delay = delay_arg;
       config->include_border = include_border_arg;
       config->include_border = !disable_border_arg;
+      config->include_pointer = include_pointer_arg;
       if (border_effect_arg != NULL)
         config->border_effect = g_strdup (border_effect_arg);
 
@@ -119,9 +127,6 @@ screenshot_load_config (gboolean clipboard_arg,
   config->include_icc_profile =
     g_settings_get_boolean (config->settings,
                             INCLUDE_ICC_PROFILE);
-  config->include_pointer =
-    g_settings_get_boolean (config->settings,
-                            INCLUDE_POINTER_KEY);
 
   if (config->border_effect == NULL)
     config->border_effect = g_strdup ("none");
diff --git a/src/screenshot-config.h b/src/screenshot-config.h
index 4cf55c7..8fa2d0c 100644
--- a/src/screenshot-config.h
+++ b/src/screenshot-config.h
@@ -54,6 +54,7 @@ gboolean screenshot_load_config (gboolean clipboard_arg,
                                  gboolean area_arg,
                                  gboolean include_border_arg,
                                  gboolean disable_border_arg,
+                                 gboolean include_pointer_arg,
                                  const gchar *border_effect_arg,
                                  guint delay_arg,
                                  gboolean interactive_arg,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]