From 302c4c6c080da5f8872e1a80fa6b2526fb307816 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Wed, 16 Jun 2010 20:40:20 -0400 Subject: 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 file changed, 11 insertions(+), 3 deletions(-) (limited to 'utils') 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 (); -- cgit v1.2.1