From 9d5cdf24ef40097737cdb3ecd2ac1331653b471f Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Fri, 24 Apr 2009 11:28:49 +0200 Subject: Imported Upstream version 0.9+0gitec60300 --- src/krb5-auth-applet.c | 35 ++++- src/krb5-auth-dialog.c | 16 +- src/krb5-auth-dialog.glade | 385 ++++++++++++++++----------------------------- src/krb5-auth-pwdialog.c | 10 +- 4 files changed, 180 insertions(+), 266 deletions(-) (limited to 'src') diff --git a/src/krb5-auth-applet.c b/src/krb5-auth-applet.c index 6e02ed8..b528ae9 100644 --- a/src/krb5-auth-applet.c +++ b/src/krb5-auth-applet.c @@ -371,13 +371,26 @@ ka_applet_select_icon(KaApplet* applet, int remaining) } +#ifdef HAVE_LIBNOTIFY +static gboolean +show_notification (KaApplet *applet) +{ + /* wait for the panel to be settled before showing a bubble */ + if (gtk_status_icon_is_embedded (applet->priv->tray_icon)) { + notify_notification_show (applet->priv->notification, NULL); + } else { + g_timeout_add_seconds (5, (GSourceFunc)show_notification, applet); + } + return FALSE; +} + + static void -ka_send_event_notification (KaApplet *applet G_GNUC_UNUSED, - const char *summary G_GNUC_UNUSED, - const char *message G_GNUC_UNUSED, - const char *icon G_GNUC_UNUSED) +ka_send_event_notification (KaApplet *applet, + const char *summary, + const char *message, + const char *icon) { -#ifdef HAVE_LIBNOTIFY const char *notify_icon; g_return_if_fail (applet != NULL); @@ -398,9 +411,17 @@ ka_send_event_notification (KaApplet *applet G_GNUC_UNUSED, notify_notification_new_with_status_icon(summary, message, notify_icon, applet->priv->tray_icon); notify_notification_set_urgency (applet->priv->notification, NOTIFY_URGENCY_NORMAL); - notify_notification_show (applet->priv->notification, NULL); -#endif /* HAVE_LIBNOTIFY */ + show_notification (applet); +} +#else +static void +ka_send_event_notification (KaApplet *applet G_GNUC_UNUSED, + const char *summary G_GNUC_UNUSED, + const char *message G_GNUC_UNUSED, + const char *icon G_GNUC_UNUSED) +{ } +#endif /* ! HAVE_LIBNOTIFY */ /* update the tray icon's tooltip and icon */ diff --git a/src/krb5-auth-dialog.c b/src/krb5-auth-dialog.c index 32cc016..08f1c12 100644 --- a/src/krb5-auth-dialog.c +++ b/src/krb5-auth-dialog.c @@ -178,6 +178,7 @@ credentials_expiring_real (KaApplet* applet) goto out; } + /* copy principal from cache if any */ if (krb5_principal_compare (kcontext, my_creds.client, kprincipal)) { krb5_free_principal(kcontext, kprincipal); krb5_copy_principal(kcontext, my_creds.client, &kprincipal); @@ -529,9 +530,11 @@ ka_parse_name(KaApplet* applet, krb5_context krbcontext, krb5_principal* kprinc) krb5_error_code ret; gchar *principal = NULL; + if (*kprinc != NULL) + krb5_free_principal(krbcontext, *kprinc); + g_object_get(applet, "principal", &principal, NULL); - ret = krb5_parse_name(krbcontext, principal, - kprinc); + ret = krb5_parse_name(krbcontext, principal, kprinc); g_free(principal); return ret; @@ -611,11 +614,9 @@ grab_credentials (KaApplet* applet) memset(&my_creds, 0, sizeof(my_creds)); - if (kprincipal == NULL) { - retval = ka_parse_name(applet, kcontext, &kprincipal); - if (retval) - goto out2; - } + retval = ka_parse_name(applet, kcontext, &kprincipal); + if (retval) + goto out2; retval = krb5_cc_default (kcontext, &ccache); if (retval) @@ -780,7 +781,6 @@ using_krb5(void) krb5_copy_principal(kcontext, creds.client, &kprincipal); krb5_free_cred_contents (kcontext, &creds); } - return have_tgt; } diff --git a/src/krb5-auth-dialog.glade b/src/krb5-auth-dialog.glade index 45ab987..e252817 100644 --- a/src/krb5-auth-dialog.glade +++ b/src/krb5-auth-dialog.glade @@ -1,251 +1,138 @@ - - - + + + - - - - 6 - False - Network Authentication - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER - False - False - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - False - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - True - True - True - True - _Renew Ticket - True - GTK_RELIEF_NORMAL - True - -5 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 6 - True - False - 12 - - - - True - gtk-dialog-authentication - 6 - 0.5 - 0 - 0 - 0 - - - 0 - False - True - - - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 10 - 0 - 0 - - - - True - False - 12 - - - - True - False - 0 - - - - True - - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - 0 - True - True - - - - - - True - False - 3 - - - - True - False - 3 - - - - True - _Password: - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - krb5_entry - - - 0 - False - False - - - - - - True - True - True - False - 0 - - True - True - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - <span size="smaller"> </span> - False - True - GTK_JUSTIFY_LEFT - False - False - 1 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - 0 - True - True - - - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - + + 6 + Network Authentication + False + GTK_WIN_POS_CENTER + GDK_WINDOW_TYPE_HINT_NORMAL + False + + + True + + + True + 6 + 12 + + + True + 0 + gtk-dialog-authentication + 6 + + + False + + + + + True + 10 + + + True + 12 + + + True + + + True + 0 + True + + + False + False + + + + + + + True + 3 + + + True + 3 + + + True + True + + + + + + + True + 1 + <span size="smaller"> </span> + True + + + False + False + 1 + + + + + 1 + + + + + + + 1 + + + + + 1 + + + + + True + GTK_BUTTONBOX_END + + + True + True + True + gtk-cancel + True + -6 + + + + + True + True + True + True + _Renew Ticket + True + -5 + + + 1 + + + + + False + GTK_PACK_END + + + + + diff --git a/src/krb5-auth-pwdialog.c b/src/krb5-auth-pwdialog.c index 7873a8a..b3ed068 100644 --- a/src/krb5-auth-pwdialog.c +++ b/src/krb5-auth-pwdialog.c @@ -191,11 +191,12 @@ ka_pwdialog_setup (KaPwDialog* pwdialog, const gchar *krb5prompt, { KaPwDialogPrivate *priv = pwdialog->priv; gchar *wrong_markup = NULL; + GtkWidget *e; gchar *prompt; int pw4len; if (krb5prompt == NULL) { - prompt = g_strdup (_("Please enter your Kerberos password.")); + prompt = g_strdup (_("Please enter your Kerberos password:")); } else { /* Kerberos's prompts are a mess, and basically impossible to * translate. There's basically no way short of doing a lot of @@ -206,12 +207,17 @@ ka_pwdialog_setup (KaPwDialog* pwdialog, const gchar *krb5prompt, pw4len = strlen ("Password for "); if (strncmp (krb5prompt, "Password for ", pw4len) == 0) { gchar *uid = (gchar *) (krb5prompt + pw4len); - prompt = g_strdup_printf (_("Please enter the password for '%s'"), uid); + prompt = g_strdup_printf (_("Please enter the password for '%s':"), uid); } else { prompt = g_strdup (krb5prompt); } } + e = gtk_entry_new (); + gtk_secure_entry_set_invisible_char (GTK_SECURE_ENTRY (priv->pw_entry), + gtk_entry_get_invisible_char (GTK_ENTRY (e))); + gtk_widget_destroy (e); + /* Clear the password entry field */ gtk_secure_entry_set_text (GTK_SECURE_ENTRY (priv->pw_entry), ""); -- cgit