diff options
author | Guido Günther <agx@sigxcpu.org> | 2009-04-24 11:28:49 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2009-04-24 11:28:49 +0200 |
commit | 9d5cdf24ef40097737cdb3ecd2ac1331653b471f (patch) | |
tree | 2df5ea1d5ce717daac6c6b3bf4f071ba3e43b5f2 /src | |
parent | Imported Upstream version 0.9~rc1 (diff) | |
download | krb5-auth-dialog-9d5cdf24ef40097737cdb3ecd2ac1331653b471f.tar.gz krb5-auth-dialog-9d5cdf24ef40097737cdb3ecd2ac1331653b471f.tar.bz2 krb5-auth-dialog-9d5cdf24ef40097737cdb3ecd2ac1331653b471f.zip |
Imported Upstream version 0.9+0gitec60300
Diffstat (limited to 'src')
-rw-r--r-- | src/krb5-auth-applet.c | 35 | ||||
-rw-r--r-- | src/krb5-auth-dialog.c | 16 | ||||
-rw-r--r-- | src/krb5-auth-dialog.glade | 385 | ||||
-rw-r--r-- | src/krb5-auth-pwdialog.c | 10 |
4 files changed, 180 insertions, 266 deletions
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 @@ -<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> -<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> - +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd"> +<!--*- mode: xml -*--> <glade-interface> -<requires lib="gnome"/> - -<widget class="GtkDialog" id="krb5_dialog"> - <property name="border_width">6</property> - <property name="visible">False</property> - <property name="title" translatable="yes">Network Authentication</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_CENTER</property> - <property name="modal">False</property> - <property name="resizable">False</property> - <property name="destroy_with_parent">False</property> - <property name="decorated">True</property> - <property name="skip_taskbar_hint">False</property> - <property name="skip_pager_hint">False</property> - <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> - <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> - <property name="has_separator">False</property> - - <child internal-child="vbox"> - <widget class="GtkVBox" id="dialog-vbox2"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child internal-child="action_area"> - <widget class="GtkHButtonBox" id="dialog-action_area2"> - <property name="visible">True</property> - <property name="layout_style">GTK_BUTTONBOX_END</property> - - <child> - <widget class="GtkButton" id="cancelbutton1"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-cancel</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="response_id">-6</property> - </widget> - </child> - - <child> - <widget class="GtkButton" id="krb5_renew_button"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="has_default">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Renew Ticket</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="response_id">-5</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">GTK_PACK_END</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox1"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">12</property> - - <child> - <widget class="GtkImage" id="image1"> - <property name="visible">True</property> - <property name="stock">gtk-dialog-authentication</property> - <property name="icon_size">6</property> - <property name="xalign">0.5</property> - <property name="yalign">0</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment4"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">10</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkVBox" id="vbox2"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">12</property> - - <child> - <widget class="GtkVBox" id="vbox1"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkLabel" id="krb5_message_label"> - <property name="visible">True</property> - <property name="label" translatable="no"></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox3"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkHBox" id="hbox5"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkLabel" id="label5"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Password:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">krb5_entry</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="Custom" id="krb5_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">False</property> - <property name="max_length">0</property> - <property name="text" translatable="no"></property> - <property name="has_frame">True</property> - <property name="activates_default">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="krb5_status_label"> - <property name="visible">True</property> - <property name="label" translatable="no"><span size="smaller"> </span></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">1</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> -</widget> - + <widget class="GtkDialog" id="krb5_dialog"> + <property name="border_width">6</property> + <property name="title" translatable="yes">Network Authentication</property> + <property name="resizable">False</property> + <property name="window_position">GTK_WIN_POS_CENTER</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> + <property name="has_separator">False</property> + <child internal-child="vbox"> + <widget class="GtkVBox" id="dialog-vbox2"> + <property name="visible">True</property> + <child> + <widget class="GtkHBox" id="hbox1"> + <property name="visible">True</property> + <property name="border_width">6</property> + <property name="spacing">12</property> + <child> + <widget class="GtkImage" id="image1"> + <property name="visible">True</property> + <property name="yalign">0</property> + <property name="stock">gtk-dialog-authentication</property> + <property name="icon_size">6</property> + </widget> + <packing> + <property name="expand">False</property> + </packing> + </child> + <child> + <widget class="GtkAlignment" id="alignment4"> + <property name="visible">True</property> + <property name="bottom_padding">10</property> + <child> + <widget class="GtkVBox" id="vbox2"> + <property name="visible">True</property> + <property name="spacing">12</property> + <child> + <widget class="GtkVBox" id="vbox1"> + <property name="visible">True</property> + <child> + <widget class="GtkLabel" id="krb5_message_label"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + <child> + <widget class="GtkVBox" id="vbox3"> + <property name="visible">True</property> + <property name="spacing">3</property> + <child> + <widget class="GtkHBox" id="hbox5"> + <property name="visible">True</property> + <property name="spacing">3</property> + <child> + <widget class="Custom" id="krb5_entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + </widget> + </child> + </widget> + </child> + <child> + <widget class="GtkLabel" id="krb5_status_label"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="label"><span size="smaller"> </span></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> + </widget> + </child> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> + <child internal-child="action_area"> + <widget class="GtkHButtonBox" id="dialog-action_area2"> + <property name="visible">True</property> + <property name="layout_style">GTK_BUTTONBOX_END</property> + <child> + <widget class="GtkButton" id="cancelbutton1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="label">gtk-cancel</property> + <property name="use_stock">True</property> + <property name="response_id">-6</property> + </widget> + </child> + <child> + <widget class="GtkButton" id="krb5_renew_button"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="label" translatable="yes">_Renew Ticket</property> + <property name="use_underline">True</property> + <property name="response_id">-5</property> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="pack_type">GTK_PACK_END</property> + </packing> + </child> + </widget> + </child> + </widget> </glade-interface> 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), ""); |