summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorWilliam Jon McCann <jmccann@redhat.com>2010-06-16 20:40:20 -0400
committerWilliam Jon McCann <jmccann@redhat.com>2010-06-16 20:40:20 -0400
commit302c4c6c080da5f8872e1a80fa6b2526fb307816 (patch)
tree1207d43f8f10c81c75a950f5bd33b63a11503e4a /utils
parentb55b7e37a7e376e9a1d44ee580c3557e5f9c2881 (diff)
downloadgdm-302c4c6c080da5f8872e1a80fa6b2526fb307816.tar.gz
Fix minor issues with screenshot tool
As suggested by Christian Persch https://bugzilla.gnome.org/show_bug.cgi?id=569409
Diffstat (limited to 'utils')
-rw-r--r--utils/gdm-screenshot.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/utils/gdm-screenshot.c b/utils/gdm-screenshot.c
index a29626d5..1b9e31b5 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 ();