From ae1db9adf041e6c2e8905ec53210ab13ccf16c07 Mon Sep 17 00:00:00 2001 From: walters Date: Mon, 9 Jun 2008 19:06:52 +0000 Subject: [PATCH] 2008-06-09 Colin Walters MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Bug 534515: cleanups * src/krb5-auth-dialog.c: Use GOption instead of libgnome. Patch from Guido Günther. git-svn-id: http://svn.gnome.org/svn/krb5-auth-dialog/trunk@73 517b70f8-ed25-0410-8bf6-f5db08f7b76e --- ChangeLog | 7 +++++++ src/krb5-auth-dialog.c | 38 +++++++++++++++++++++++--------------- 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index d042835..34ba69b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-06-09 Colin Walters + + Bug 534515: cleanups + + * src/krb5-auth-dialog.c: Use GOption instead of + libgnome. Patch from Guido Günther. + 2008-06-09 Colin Walters Bug 529220: set dialog icon diff --git a/src/krb5-auth-dialog.c b/src/krb5-auth-dialog.c index 00cb29e..803ce95 100644 --- a/src/krb5-auth-dialog.c +++ b/src/krb5-auth-dialog.c @@ -20,15 +20,15 @@ #include "config.h" -#include -#include -#include #include #include #include #include #include #include +#include +#include +#include #include @@ -570,29 +570,37 @@ int main (int argc, char *argv[]) { GtkWidget *dialog; - GnomeClient *client; + GOptionContext *context; + GError *error = NULL; DBusGConnection *session; DBusGProxy *bus_proxy; guint request_name_reply; unsigned int flags; - GError *error = NULL; int run_auto = 0, run_always = 0; - struct poptOption options[] = { - {"auto", 'a', 0, &run_auto, 0, - "Only run if an initialized ccache is found (default)", NULL}, - {"always", 'A', 0, &run_always, 0, - "Always run", NULL}, - {NULL}, + const char *help_msg = "Run '" PACKAGE " --help' to see a full list of available command line options"; + const GOptionEntry options [] = { + {"auto", 'a', 0, G_OPTION_ARG_NONE, &run_auto, + "Only run if an initialized ccache is found (default)", NULL}, + {"always", 'A', 0, G_OPTION_ARG_NONE, &run_always, + "Always run", NULL}, + { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL } }; #ifdef ENABLE_NETWORK_MANAGER libnm_glib_ctx *nm_context; guint32 nm_callback_id; #endif - - gnome_program_init (PACKAGE, VERSION, LIBGNOMEUI_MODULE, - argc, argv, GNOME_PARAM_POPT_TABLE, options, - GNOME_CLIENT_PARAM_SM_CONNECT, FALSE, GNOME_PARAM_NONE); + context = g_option_context_new ("- Kerberos 5 credential checking"); + g_option_context_add_main_entries (context, options, NULL); + g_option_context_add_group (context, gtk_get_option_group (TRUE)); + g_option_context_parse (context, &argc, &argv, &error); + if (error) { + g_print ("%s\n%s\n", + error->message, + help_msg); + g_error_free (error); + return 1; + } /* Connect to the session bus so we get exit-on-disconnect semantics. */ session = dbus_g_bus_get(DBUS_BUS_SESSION, &error); -- 2.34.1