[gdm] Fix minor issues with screenshot tool



commit 302c4c6c080da5f8872e1a80fa6b2526fb307816
Author: William Jon McCann <jmccann redhat com>
Date:   Wed Jun 16 20:40:20 2010 -0400

    Fix minor issues with screenshot tool
    
    As suggested by Christian Persch
    https://bugzilla.gnome.org/show_bug.cgi?id=569409

 utils/gdm-screenshot.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/utils/gdm-screenshot.c b/utils/gdm-screenshot.c
index a29626d..1b9e31b 100644
--- a/utils/gdm-screenshot.c
+++ b/utils/gdm-screenshot.c
@@ -271,6 +271,8 @@ int
 main (int argc, char *argv[])
 {
         GOptionContext *ctx;
+        gboolean        res;
+        GError         *error;
 
         bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
         bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
@@ -278,13 +280,19 @@ main (int argc, char *argv[])
         setlocale (LC_ALL, "");
 
         /* Option parsing */
-        ctx = g_option_context_new (_("Take a picture of the screen"));
+        ctx = g_option_context_new (N_("Take a picture of the screen"));
         g_option_context_set_translation_domain (ctx, GETTEXT_PACKAGE);
         g_option_context_add_main_entries (ctx, options, NULL);
-        g_option_context_parse (ctx, &argc, &argv, NULL);
+        g_option_context_add_group (ctx, gtk_get_option_group (TRUE));
+        error = NULL;
+        res = g_option_context_parse (ctx, &argc, &argv, &error);
         g_option_context_free (ctx);
 
-        gtk_init (&argc, &argv);
+        if (! res) {
+                g_warning ("%s", error->message);
+                g_error_free (error);
+                exit (1);
+        }
 
         prepare_screenshot ();
 



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