diff options
author | Guido Guenther <agx@sigxcpu.org> | 2008-07-17 07:40:31 -0230 |
---|---|---|
committer | Guido Guenther <agx@sigxcpu.org> | 2008-07-17 07:40:31 -0230 |
commit | 9d4e8d8c409b078fed576f87b1d14309eeb1fa8a (patch) | |
tree | 7577e15b2c964d9de1fdbd0a1e72d5c51168b73e | |
parent | Imported Upstream version 0.7.git30891fc (diff) | |
download | krb5-auth-dialog-9d4e8d8c409b078fed576f87b1d14309eeb1fa8a.tar.gz krb5-auth-dialog-9d4e8d8c409b078fed576f87b1d14309eeb1fa8a.tar.bz2 krb5-auth-dialog-9d4e8d8c409b078fed576f87b1d14309eeb1fa8a.zip |
Imported Upstream version 0.7.git7cc1d84
-rw-r--r-- | ChangeLog | 53 | ||||
-rw-r--r-- | icons/Makefile.am | 2 | ||||
-rw-r--r-- | src/Makefile.am | 10 | ||||
-rw-r--r-- | src/krb5-auth-applet.c | 126 | ||||
-rw-r--r-- | src/krb5-auth-applet.h | 4 | ||||
-rw-r--r-- | src/krb5-auth-dialog.1.in | 2 | ||||
-rw-r--r-- | src/krb5-auth-dialog.c | 37 | ||||
-rw-r--r-- | src/krb5-auth-dialog.desktop.in | 3 | ||||
-rw-r--r-- | src/krb5-auth-dialog.glade | 1 | ||||
-rw-r--r-- | src/krb5-auth-dialog.h | 4 | ||||
-rw-r--r-- | src/krb5-auth-dialog.schemas.in | 39 | ||||
-rw-r--r-- | src/krb5-auth-gconf.c | 62 | ||||
-rw-r--r-- | src/krb5-auth-gconf.h | 4 | ||||
-rw-r--r-- | src/krb5-auth-notify.c | 4 | ||||
-rw-r--r-- | src/krb5-auth-notify.h | 4 |
15 files changed, 170 insertions, 185 deletions
@@ -1,3 +1,56 @@ +2008-06-09 Colin Walters <walters@verbum.org> + + Bug 534867: should use g_timeout_add_seconds + + * src/krb5-auth-dialog.c: Save power with + g_timeout_add_seconds. + Patch from from Guido Günther. + +2008-06-09 Colin Walters <walters@verbum.org> + + Bug 534736: make i18n work + + * src/krb5-auth-dialog.c: Set up i18n correctly. + * src/Makefile.am: Pass in LOCALEDIR. + Patch from from Guido Günther. + +2008-06-09 Colin Walters <walters@verbum.org> + + Bug 534620: password field focus + + * src/krb5-auth-dialog.c: Be sure we focus the + password field every time. + Patch from from Guido Günther. + +2008-06-09 Colin Walters <walters@verbum.org> + + Bug 534515: cleanups + + * configure.in: Look for dbus-glib and not libgnome. + Patch from from Guido Günther. + +2008-06-09 Colin Walters <walters@verbum.org> + + Bug 534515: cleanups + + * src/krb5-auth-dialog.c: Cleaner use of + gboolean. Patch from from Guido Günther. + +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 + look nicer in the window list. Patch from + Guido Günther. + 2008-03-22 Colin Walters <walters@verbum.org> * src/krb5-auth-dialog.c: Grab a name on the diff --git a/icons/Makefile.am b/icons/Makefile.am index e3f6763..b771676 100644 --- a/icons/Makefile.am +++ b/icons/Makefile.am @@ -1,4 +1,4 @@ -NULL = +NULL = smallicondir=${datadir}/icons/hicolor/22x22/apps smallicon_DATA= \ diff --git a/src/Makefile.am b/src/Makefile.am index d165710..066e582 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -43,16 +43,6 @@ glade_DATA = \ EXTRA_DIST = \ $(glade_DATA) \ $(autostart_in_files) \ - $(schema_SOURCES) \ krb5-auth-dialog.1.in -schemadir = $(sysconfdir)/gconf/schemas -schema_SOURCES = $(PACKAGE).schemas.in -schema_DATA = $(PACKAGE).schemas - DISTCLEANFILES = krb5-auth-dialog.desktop -CLEANFILES = $(schema_DATA) - -%.schemas: $(srcdir)/%.schemas.in - sed -e "s,::PACKAGE::,$(PACKAGE)," -e "s,::MINIMUM_LIFETIME::,$(minimum_lifetime)," < $< > $@ - diff --git a/src/krb5-auth-applet.c b/src/krb5-auth-applet.c index 8799ae1..4a11d09 100644 --- a/src/krb5-auth-applet.c +++ b/src/krb5-auth-applet.c @@ -1,7 +1,7 @@ /* Krb5 Auth Applet -- Acquire and release kerberos tickets - * + * * (C) 2008 Guido Guenther <agx@sigxcpu.org> - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -28,57 +28,66 @@ #include "krb5-auth-notify.h" #endif +#define NOTIFY_SECONDS 300 /* update the tray icon's tooltip and icon */ -int +int ka_update_status(Krb5AuthApplet* applet, krb5_timestamp expiry) { gchar* expiry_text; - int interval = expiry - time(0); + int now = time(0); + int remaining = expiry - now; + static int last_warn = 0; static gboolean expiry_notified = FALSE; - if (interval > 0) { + if (remaining > 0) { int hours, minutes; - if (interval >= 3600) { - hours = interval / 3600; - minutes = (interval % 3600) / 60; + if (remaining >= 3600) { + hours = remaining / 3600; + minutes = (remaining % 3600) / 60; expiry_text = g_strdup_printf (_("Your credentials expire in %.2d:%.2dh"), hours, minutes); } else { - minutes = interval / 60; + minutes = remaining / 60; expiry_text = g_strdup_printf (ngettext( "Your credentials expire in %d minute", "Your credentials expire in %d minutes", minutes), minutes); } - gtk_status_icon_set_from_icon_name (applet->tray_icon, applet->icons[1]); + gtk_status_icon_set_from_icon_name (applet->tray_icon, applet->icons[1]); #ifdef HAVE_LIBNOTIFY if (expiry_notified) { ka_send_event_notification (applet, NOTIFY_URGENCY_NORMAL, _("Network credentials valid"), _("Your Kerberos credentials have been refreshed."), NULL); expiry_notified = FALSE; + } else if (remaining < applet->pw_prompt_secs && (now - last_warn) > NOTIFY_SECONDS) { + ka_send_event_notification (applet, NOTIFY_URGENCY_NORMAL, + _("Network credentials expiring"), + expiry_text, NULL); + last_warn = now; } #endif } else { expiry_text = g_strdup (_("Your credentials have expired")); - gtk_status_icon_set_from_icon_name (applet->tray_icon, applet->icons[0]); + gtk_status_icon_set_from_icon_name (applet->tray_icon, applet->icons[0]); #ifdef HAVE_LIBNOTIFY if (!expiry_notified) { ka_send_event_notification (applet, NOTIFY_URGENCY_NORMAL, _("Network credentials expired"), _("Your Kerberos credentails have expired."), NULL); expiry_notified = TRUE; + last_warn = 0; } #endif } - gtk_status_icon_set_tooltip(applet->tray_icon, expiry_text); - g_free(expiry_text); + gtk_status_icon_set_tooltip (applet->tray_icon, expiry_text); + g_free (expiry_text); return 0; } -static void +static void ka_menu_add_separator_item (GtkWidget* menu) { GtkWidget* menu_item; @@ -90,23 +99,23 @@ ka_menu_add_separator_item (GtkWidget* menu) /* Free all resources and quit */ -static void +static void ka_quit_applet (GtkMenuItem* menuitem, gpointer user_data) { Krb5AuthApplet* applet = (Krb5AuthApplet*) user_data; - - g_free(applet->principal); - g_free(applet); - gtk_main_quit(); + + g_free (applet->principal); + g_free (applet); + gtk_main_quit (); } -static void +static void ka_about_dialog (GtkMenuItem* menuitem, gpointer user_data) { gchar* authors[] = { "Christopher Aillon <caillon@redhat.com>", "Colin Walters <walters@verbum.org>", - "Guido Günther <agx@sigxpcu.org>", + "Guido Günther <agx@sigxpcu.org>", NULL }; gtk_show_about_dialog (NULL, "authors", authors, @@ -133,7 +142,7 @@ ka_create_context_menu (Krb5AuthApplet* applet) gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item), image); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); - ka_menu_add_separator_item(menu); + ka_menu_add_separator_item (menu); /* About item */ menu_item = gtk_image_menu_item_new_with_mnemonic (_("_About")); @@ -142,7 +151,7 @@ ka_create_context_menu (Krb5AuthApplet* applet) gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menu_item), image); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); - ka_menu_add_separator_item(menu); + ka_menu_add_separator_item (menu); /* Quit */ menu_item = gtk_image_menu_item_new_with_mnemonic (_("_Quit")); @@ -158,14 +167,14 @@ ka_create_context_menu (Krb5AuthApplet* applet) static void -ka_tray_icon_on_menu (GtkStatusIcon* status_icon, guint button, +ka_tray_icon_on_menu (GtkStatusIcon* status_icon, guint button, guint activate_time, gpointer user_data) { Krb5AuthApplet* applet = (Krb5AuthApplet*) user_data; - + KA_DEBUG("Trayicon right clicked: %d", applet->pw_prompt_secs); - gtk_menu_popup (GTK_MENU (applet->context_menu), NULL, NULL, - gtk_status_icon_position_menu, applet->tray_icon, + gtk_menu_popup (GTK_MENU (applet->context_menu), NULL, NULL, + gtk_status_icon_position_menu, applet->tray_icon, button, activate_time); } @@ -193,36 +202,23 @@ ka_show_tray_icon (Krb5AuthApplet* applet) } -static GtkStatusIcon* +static GtkStatusIcon* ka_create_tray_icon (Krb5AuthApplet* applet) { - GtkStatusIcon* tray_icon; - - tray_icon = gtk_status_icon_new(); - g_signal_connect(G_OBJECT(tray_icon), "activate", - G_CALLBACK(ka_tray_icon_on_click), applet); - g_signal_connect(G_OBJECT(tray_icon), - "popup-menu", - G_CALLBACK(ka_tray_icon_on_menu), applet); + GtkStatusIcon* tray_icon; + + tray_icon = gtk_status_icon_new (); + g_signal_connect (G_OBJECT(tray_icon), "activate", + G_CALLBACK(ka_tray_icon_on_click), applet); + g_signal_connect (G_OBJECT(tray_icon), + "popup-menu", + G_CALLBACK(ka_tray_icon_on_menu), applet); gtk_status_icon_set_from_icon_name (tray_icon, applet->icons[0]); gtk_status_icon_set_tooltip (tray_icon, PACKAGE); return tray_icon; } -static void -ka_err_dialog (const char* err) -{ - GtkWidget* dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - err); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); -} - - int ka_setup_icons (Krb5AuthApplet* applet) { @@ -233,33 +229,19 @@ ka_setup_icons (Krb5AuthApplet* applet) /* create the tray icon applet */ -Krb5AuthApplet* +Krb5AuthApplet* ka_create_applet() { - const char* err; - Krb5AuthApplet* applet = g_malloc0(sizeof(Krb5AuthApplet)); - - if(!(ka_setup_icons(applet))) { - err = _("Failure to setup icons"); - goto out; - } - - if(!(applet->tray_icon = ka_create_tray_icon(applet))) { - err = _("Failure to create tray icon"); - goto out; - } - // FIXME: handle with signal + Krb5AuthApplet* applet = g_malloc0 (sizeof(Krb5AuthApplet)); + + if (!(ka_setup_icons (applet))) + g_error ("Failure to setup icons"); + if (!(applet->tray_icon = ka_create_tray_icon (applet))) + g_error ("Failure to create tray icon"); + if (!(applet->context_menu = ka_create_context_menu (applet))) + g_error ("Failure to create context menu"); ka_show_tray_icon (applet); - if(!(applet->context_menu = ka_create_context_menu(applet))) { - err = _("Failure to create context menu"); - goto out; - } - return applet; -out: - ka_err_dialog(err); - g_free(applet); - return NULL; } diff --git a/src/krb5-auth-applet.h b/src/krb5-auth-applet.h index 0cf29d9..062e148 100644 --- a/src/krb5-auth-applet.h +++ b/src/krb5-auth-applet.h @@ -1,7 +1,7 @@ /* Krb5 Auth Applet -- Acquire and release kerberos tickets - * + * * (C) 2008 Guido Guenther <agx@sigxcpu.org> - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or diff --git a/src/krb5-auth-dialog.1.in b/src/krb5-auth-dialog.1.in index 7f83138..b0e7b38 100644 --- a/src/krb5-auth-dialog.1.in +++ b/src/krb5-auth-dialog.1.in @@ -1,4 +1,4 @@ -.TH krb5-auth-dialog 2005/11/02 "GNOME" "System Administrator's Manual" +.TH krb5-auth-dialog 1 2005/11/02 "GNOME" "System Administrator's Manual" .SH NAME krb5-auth-dialog \- Kerberos 5 credential checking diff --git a/src/krb5-auth-dialog.c b/src/krb5-auth-dialog.c index de5d9c9..f376ffd 100644 --- a/src/krb5-auth-dialog.c +++ b/src/krb5-auth-dialog.c @@ -212,7 +212,7 @@ krb5_auth_dialog_wrong_label_update_expiry (GtkWidget* label) /* Check for things we have to do while the password dialog is open */ static gboolean -krb5_auth_dialog_do_updates(gpointer data) +krb5_auth_dialog_do_updates (gpointer data) { Krb5AuthApplet* applet = (Krb5AuthApplet*)data; gboolean refreshable; @@ -328,8 +328,8 @@ auth_dialog_prompter (krb5_context ctx, errcode = KRB5_LIBOS_CANTREADPWD; krb5_auth_dialog_setup (applet, (gchar *) prompts[i].prompt, prompts[i].hidden); - entry = glade_xml_get_widget(applet->pw_xml, "krb5_entry"); - gtk_widget_grab_focus(entry); + entry = glade_xml_get_widget (applet->pw_xml, "krb5_entry"); + gtk_widget_grab_focus (entry); source_id = g_timeout_add_seconds (5, (GSourceFunc)krb5_auth_dialog_do_updates, applet); response = gtk_dialog_run (GTK_DIALOG (applet->pw_dialog)); @@ -404,7 +404,7 @@ credentials_expiring (gpointer *data) Krb5AuthApplet* applet = (Krb5AuthApplet*) data; KA_DEBUG("Checking expiry: %d", applet->pw_prompt_secs); - if (credentials_expiring_real (applet, &renewable) && is_online) { + if (credentials_expiring_real (applet, &renewable) && is_online && !applet->show_trayicon) { give_up = canceled && (creds_expiry == canceled_creds_expiry); if (!give_up) { do { @@ -614,16 +614,16 @@ ka_destroy_cache (GtkMenuItem *menuitem, gpointer data) } -static void +static void ka_error_dialog(int err) { const char* msg = error_message(err); GtkWidget *dialog = gtk_message_dialog_new (NULL, - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - _("Couldn't acquire kerberos ticket: '%s'"), msg); - gtk_dialog_run (GTK_DIALOG (dialog)); + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, + _("Couldn't acquire kerberos ticket: '%s'"), msg); + gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); } @@ -645,7 +645,7 @@ ka_grab_credentials (Krb5AuthApplet* applet) break; case 0: /* success */ case KRB5_LIBOS_CANTREADPWD: /* canceled */ - retry = FALSE; + retry = FALSE; break; case KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN: default: @@ -670,6 +670,7 @@ ka_create_gtk_secure_entry (GladeXML *xml, gchar *func_name, gchar *name, if (!strcmp(name, "krb5_entry")) { entry = gtk_secure_entry_new (); gtk_secure_entry_set_activates_default(GTK_SECURE_ENTRY(entry), TRUE); + gtk_widget_set(entry, "invisible-char", 0x25cf, NULL); gtk_widget_show (entry); } else { g_warning("Don't know anything about widget %s", name); @@ -726,22 +727,22 @@ main (int argc, char *argv[]) g_error_free (error); return 1; } - textdomain(PACKAGE); - bind_textdomain_codeset(PACKAGE, "UTF-8"); - bindtextdomain(PACKAGE, LOCALE_DIR); + textdomain (PACKAGE); + bind_textdomain_codeset (PACKAGE, "UTF-8"); + bindtextdomain (PACKAGE, LOCALE_DIR); ka_secmem_init(); - if(!ka_dbus_connect (&status)) + if (!ka_dbus_connect (&status)) exit(status); if (run_always && !run_auto) { always_run = TRUE; } if (using_krb5 () || always_run) { - applet = ka_create_applet(); + applet = ka_create_applet (); if (!applet) return 1; - if (!ka_gconf_init(applet, argc, argv)) + if (!ka_gconf_init (applet, argc, argv)) return 1; /* setup the pw dialog */ @@ -751,7 +752,7 @@ main (int argc, char *argv[]) applet->pw_dialog = glade_xml_get_widget (applet->pw_xml, "krb5_dialog"); g_set_application_name (_("Network Authentication")); - gtk_window_set_default_icon_name(applet->icons[1]); + gtk_window_set_default_icon_name (applet->icons[1]); #ifdef ENABLE_NETWORK_MANAGER nm_context = libnm_glib_init (); diff --git a/src/krb5-auth-dialog.desktop.in b/src/krb5-auth-dialog.desktop.in index 223aaf9..911f12e 100644 --- a/src/krb5-auth-dialog.desktop.in +++ b/src/krb5-auth-dialog.desktop.in @@ -1,7 +1,6 @@ [Desktop Entry] _Name=Network Authentication -_Comments=Kerberos Network Authentication Dialog -Exec=krb5-auth-dialog +_Comment=Kerberos Network Authentication Dialog Encoding=UTF-8 Exec=krb5-auth-dialog Terminal=false diff --git a/src/krb5-auth-dialog.glade b/src/krb5-auth-dialog.glade index e115849..7440dff 100644 --- a/src/krb5-auth-dialog.glade +++ b/src/krb5-auth-dialog.glade @@ -116,7 +116,6 @@ <child> <widget class="GtkLabel" id="krb5_message_label"> - <property name="width_request">333</property> <property name="visible">True</property> <property name="label" translatable="no"></property> <property name="use_underline">False</property> diff --git a/src/krb5-auth-dialog.h b/src/krb5-auth-dialog.h index 841b983..77a9891 100644 --- a/src/krb5-auth-dialog.h +++ b/src/krb5-auth-dialog.h @@ -1,7 +1,7 @@ /* Krb5 Auth Applet -- Acquire and release kerberos tickets - * + * * (C) 2008 Guido Guenther <agx@sigxcpu.org> - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or diff --git a/src/krb5-auth-dialog.schemas.in b/src/krb5-auth-dialog.schemas.in deleted file mode 100644 index e715d26..0000000 --- a/src/krb5-auth-dialog.schemas.in +++ /dev/null @@ -1,39 +0,0 @@ -<gconfschemafile> - <schemalist> - <schema> - <key>/schemas/apps/::PACKAGE::/show_trayicon</key> - <applyto>/apps/::PACKAGE::/show_trayicon</applyto> - <owner>::PACKAGE::</owner> - <type>bool</type> - <default>true</default> - <locale name="C"> - <short>Display trayicon</short> - <long>Display the trayicon in the panel</long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/::PACKAGE::/prompt_minutes</key> - <applyto>/apps/::PACKAGE::/prompt_minutes</applyto> - <owner>::PACKAGE::</owner> - <type>int</type> - <default>::MINIMUM_LIFETIME::</default> - <locale name="C"> - <short>Minutes before ticket expires</short> - <long>How many minutes before the ticket expires should - prompting for the new password start</long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/::PACKAGE::/principal</key> - <applyto>/apps/::PACKAGE::/principal</applyto> - <type>string</type> - <default></default> - <locale name="C"> - <short>default principal</short> - <long>principal to use when no ticket cache is present</long> - </locale> - </schema> - </schemalist> -</gconfschemafile> diff --git a/src/krb5-auth-gconf.c b/src/krb5-auth-gconf.c index 2d47cea..20d22ce 100644 --- a/src/krb5-auth-gconf.c +++ b/src/krb5-auth-gconf.c @@ -1,7 +1,7 @@ /* Krb5 Auth Applet -- Acquire and release kerberos tickets - * + * * (C) 2008 Guido Guenther <agx@sigxcpu.org> - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -29,10 +29,10 @@ #define KA_GCONF_KEY_PROMPT_MINS KA_GCONF_PATH "/prompt_minutes" #define KA_GCONF_KEY_SHOW_TRAYICON KA_GCONF_PATH "/show_trayicon" -static gboolean -ka_gconf_get_string(GConfClient* client, - const char* key, - char** value) +static gboolean +ka_gconf_get_string (GConfClient* client, + const char* key, + char** value) { GError* error = NULL; gboolean success = FALSE; @@ -56,7 +56,7 @@ ka_gconf_get_string(GConfClient* client, static gboolean -ka_gconf_get_int(GConfClient* client, +ka_gconf_get_int (GConfClient* client, const char* key, int* value) { @@ -83,7 +83,7 @@ ka_gconf_get_int(GConfClient* client, static gboolean -ka_gconf_get_bool(GConfClient* client, +ka_gconf_get_bool (GConfClient* client, const char* key, gboolean* value) { @@ -110,13 +110,13 @@ ka_gconf_get_bool(GConfClient* client, static gboolean -ka_gconf_set_principal(GConfClient* client, Krb5AuthApplet* applet) +ka_gconf_set_principal (GConfClient* client, Krb5AuthApplet* applet) { - g_free(applet->principal); + g_free (applet->principal); applet->principal = NULL; - if(!ka_gconf_get_string(client, KA_GCONF_KEY_PRINCIPAL, &applet->principal)) { - applet->principal = g_strdup(g_get_user_name()); - } + if(!ka_gconf_get_string (client, KA_GCONF_KEY_PRINCIPAL, &applet->principal)) { + applet->principal = g_strdup (g_get_user_name()); + } KA_DEBUG("Setting principal to %s", applet->principal); // FIXME: need to send set-principal signal return TRUE; @@ -124,11 +124,11 @@ ka_gconf_set_principal(GConfClient* client, Krb5AuthApplet* applet) static gboolean -ka_gconf_set_prompt_mins(GConfClient* client, Krb5AuthApplet* applet) +ka_gconf_set_prompt_mins (GConfClient* client, Krb5AuthApplet* applet) { - if(!ka_gconf_get_int(client, KA_GCONF_KEY_PROMPT_MINS, &applet->pw_prompt_secs)) { + if(!ka_gconf_get_int (client, KA_GCONF_KEY_PROMPT_MINS, &applet->pw_prompt_secs)) { applet->pw_prompt_secs = MINUTES_BEFORE_PROMPTING; - } + } applet->pw_prompt_secs *= 60; KA_DEBUG("Setting prompting timer to %d seconds", applet->pw_prompt_secs); return TRUE; @@ -136,11 +136,11 @@ ka_gconf_set_prompt_mins(GConfClient* client, Krb5AuthApplet* applet) static gboolean -ka_gconf_set_show_trayicon(GConfClient* client, Krb5AuthApplet* applet) +ka_gconf_set_show_trayicon (GConfClient* client, Krb5AuthApplet* applet) { if(!ka_gconf_get_bool(client, KA_GCONF_KEY_SHOW_TRAYICON, &applet->show_trayicon)) { applet->show_trayicon = TRUE; - } + } KA_DEBUG("Show trayicon: %s", (applet->show_trayicon ? "yes" : "no" )); // FIXME: send show trayicon signal ka_show_tray_icon(applet); @@ -162,12 +162,12 @@ ka_gconf_key_changed_callback (GConfClient* client, return; KA_DEBUG("Key %s changed", key); - if (g_strcmp0(key, KA_GCONF_KEY_PRINCIPAL) == 0) { - ka_gconf_set_principal(client, applet); - } else if (g_strcmp0(key, KA_GCONF_KEY_PROMPT_MINS) == 0) { - ka_gconf_set_prompt_mins(client, applet); - } else if (g_strcmp0(key, KA_GCONF_KEY_SHOW_TRAYICON) == 0) { - ka_gconf_set_show_trayicon(client, applet); + if (g_strcmp0 (key, KA_GCONF_KEY_PRINCIPAL) == 0) { + ka_gconf_set_principal (client, applet); + } else if (g_strcmp0 (key, KA_GCONF_KEY_PROMPT_MINS) == 0) { + ka_gconf_set_prompt_mins (client, applet); + } else if (g_strcmp0 (key, KA_GCONF_KEY_SHOW_TRAYICON) == 0) { + ka_gconf_set_show_trayicon (client, applet); } else g_warning("Received notification for unknown gconf key %s", key); return; @@ -181,20 +181,20 @@ ka_gconf_init (Krb5AuthApplet* applet, int argc, char* argv[]) GConfClient* client; gboolean success = FALSE; - client = gconf_client_get_default(); - gconf_client_add_dir(client, KA_GCONF_PATH, GCONF_CLIENT_PRELOAD_ONELEVEL, &error); + client = gconf_client_get_default (); + gconf_client_add_dir (client, KA_GCONF_PATH, GCONF_CLIENT_PRELOAD_ONELEVEL, &error); if (error) goto out; - gconf_client_notify_add(client, KA_GCONF_PATH, - ka_gconf_key_changed_callback, applet, NULL, &error); + gconf_client_notify_add (client, KA_GCONF_PATH, + ka_gconf_key_changed_callback, applet, NULL, &error); if (error) goto out; /* setup defaults */ - ka_gconf_set_principal(client, applet); - ka_gconf_set_prompt_mins(client, applet); - ka_gconf_set_show_trayicon(client, applet); + ka_gconf_set_principal (client, applet); + ka_gconf_set_prompt_mins (client, applet); + ka_gconf_set_show_trayicon (client, applet); success = TRUE; out: diff --git a/src/krb5-auth-gconf.h b/src/krb5-auth-gconf.h index 7c2f8ce..ec85704 100644 --- a/src/krb5-auth-gconf.h +++ b/src/krb5-auth-gconf.h @@ -1,7 +1,7 @@ /* Krb5 Auth Applet -- Acquire and release kerberos tickets - * + * * (C) 2008 Guido Guenther <agx@sigxcpu.org> - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or diff --git a/src/krb5-auth-notify.c b/src/krb5-auth-notify.c index 042ae00..3186a47 100644 --- a/src/krb5-auth-notify.c +++ b/src/krb5-auth-notify.c @@ -1,7 +1,7 @@ /* Krb5 Auth Applet -- Acquire and release kerberos tickets - * + * * (C) 2008 Guido Guenther <agx@sigxcpu.org> - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or diff --git a/src/krb5-auth-notify.h b/src/krb5-auth-notify.h index cc2c111..7d27b8a 100644 --- a/src/krb5-auth-notify.h +++ b/src/krb5-auth-notify.h @@ -1,7 +1,7 @@ /* Krb5 Auth Applet -- Acquire and release kerberos tickets - * + * * (C) 2008 Guido Guenther <agx@sigxcpu.org> - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or |