aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwalters <walters@517b70f8-ed25-0410-8bf6-f5db08f7b76e>2008-06-09 19:06:52 +0000
committerwalters <walters@517b70f8-ed25-0410-8bf6-f5db08f7b76e>2008-06-09 19:06:52 +0000
commitae1db9adf041e6c2e8905ec53210ab13ccf16c07 (patch)
treeffa95d0ba9850ef3f426cc0a04c8131e6e0b8579
parentdfa9097cdf3dd084639c41febec9c78080adbd08 (diff)
2008-06-09 Colin Walters <walters@verbum.org>
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
-rw-r--r--ChangeLog7
-rw-r--r--src/krb5-auth-dialog.c38
2 files changed, 30 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index d042835..34ba69b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2008-06-09 Colin Walters <walters@verbum.org>
+ Bug 534515: cleanups
+
+ * src/krb5-auth-dialog.c: Use GOption instead of
+ libgnome. Patch from Guido Günther.
+
+2008-06-09 Colin Walters <walters@verbum.org>
+
Bug 529220: set dialog icon
* src/krb5-auth-dialog.c: Set an icon so we
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 <gtk/gtk.h>
-#include <glade/glade.h>
-#include <gnome.h>
#include <stdlib.h>
#include <time.h>
#include <krb5.h>
#include <stdio.h>
#include <sys/wait.h>
#include <string.h>
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+#include <glade/glade.h>
#include <dbus/dbus-glib.h>
@@ -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);