[krb5-auth-dialog] Add "Get Ticket" button to pop notifications
- From: Guido Günther <guidog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [krb5-auth-dialog] Add "Get Ticket" button to pop notifications
- Date: Tue, 5 Oct 2010 13:11:12 +0000 (UTC)
commit 78e3cbe853b988e6d3fb002a6d9102f39bb19d7f
Author: Guido Günther <agx sigxcpu org>
Date: Tue Oct 5 14:30:09 2010 +0200
Add "Get Ticket" button to pop notifications
this makes us less dependant on the tray icon.
src/ka-applet.c | 37 ++++++++++++++++++++++++++++++++-----
1 files changed, 32 insertions(+), 5 deletions(-)
---
diff --git a/src/ka-applet.c b/src/ka-applet.c
index 385382d..2eee864 100644
--- a/src/ka-applet.c
+++ b/src/ka-applet.c
@@ -442,11 +442,28 @@ ka_notify_action_cb (NotifyNotification *notification G_GNUC_UNUSED,
static void
+ka_notify_get_ticket_action_cb (NotifyNotification *notification G_GNUC_UNUSED,
+ gchar *action,
+ gpointer user_data)
+{
+ KaApplet *self = KA_APPLET (user_data);
+
+ if (strcmp (action, "ka-acquire-tgt") == 0) {
+ KA_DEBUG ("Getting new tgt");
+ ka_grab_credentials (self);
+ } else {
+ g_warning ("unkonwn action for callback");
+ }
+}
+
+
+static void
ka_send_event_notification (KaApplet *applet,
const char *summary,
const char *message,
const char *icon,
- const char *action)
+ const char *action,
+ gboolean get_ticket_action)
{
const char *notify_icon;
GError *error = NULL;
@@ -482,7 +499,17 @@ ka_send_event_notification (KaApplet *applet,
notify_notification_add_action (applet->priv->notification, action,
_("Don't show me this again"),
(NotifyActionCallback)
- ka_notify_action_cb, applet, NULL);
+ ka_notify_action_cb, applet,
+ NULL);
+ if (get_ticket_action) {
+ notify_notification_add_action (applet->priv->notification,
+ "ka-acquire-tgt",
+ _("Get Ticket"),
+ (NotifyActionCallback)
+ ka_notify_get_ticket_action_cb,
+ applet,
+ NULL);
+ }
ka_show_notification (applet);
}
#else
@@ -524,7 +551,7 @@ ka_applet_update_status (KaApplet *applet, krb5_timestamp expiry)
_("Network credentials valid"),
_("You've refreshed your Kerberos credentials."),
"krb-valid-ticket",
- "dont-show-again");
+ "dont-show-again", FALSE);
}
ka_applet_signal_emit (applet, KA_SIGNAL_ACQUIRED_TGT, expiry);
expiry_notified = FALSE;
@@ -541,7 +568,7 @@ ka_applet_update_status (KaApplet *applet, krb5_timestamp expiry)
_("Network credentials expiring"),
tooltip_text,
"krb-expiring-ticket",
- "dont-show-again");
+ "dont-show-again", TRUE);
}
last_warn = now;
}
@@ -559,7 +586,7 @@ ka_applet_update_status (KaApplet *applet, krb5_timestamp expiry)
_("Network credentials expired"),
_("Your Kerberos credentails have expired."),
"krb-no-valid-ticket",
- "dont-show-again");
+ "dont-show-again", TRUE);
}
ka_applet_signal_emit (applet, KA_SIGNAL_EXPIRED_TGT, expiry);
expiry_notified = TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]