krb5-auth-dialog r92 - in branches/pkinit: . icons src
- From: guidog svn gnome org
- To: svn-commits-list gnome org
- Subject: krb5-auth-dialog r92 - in branches/pkinit: . icons src
- Date: Sun, 4 Jan 2009 16:04:09 +0000 (UTC)
Author: guidog
Date: Sun Jan 4 16:04:09 2009
New Revision: 92
URL: http://svn.gnome.org/viewvc/krb5-auth-dialog?rev=92&view=rev
Log:
add "expiring" tray icon
shown when credentials are about to expire
Added:
branches/pkinit/icons/krb-expiring-ticket.png
Modified:
branches/pkinit/ChangeLog
branches/pkinit/icons/Makefile.am
branches/pkinit/src/krb5-auth-applet.c
branches/pkinit/src/krb5-auth-applet.h
branches/pkinit/src/krb5-auth-dialog.c
Modified: branches/pkinit/icons/Makefile.am
==============================================================================
--- branches/pkinit/icons/Makefile.am (original)
+++ branches/pkinit/icons/Makefile.am Sun Jan 4 16:04:09 2009
@@ -4,6 +4,7 @@
smallicon_DATA= \
krb-valid-ticket.png \
krb-no-valid-ticket.png \
+ krb-expiring-ticket.png \
$(NULL)
EXTRA_DIST=\
Added: branches/pkinit/icons/krb-expiring-ticket.png
==============================================================================
Binary files (empty file) and branches/pkinit/icons/krb-expiring-ticket.png Sun Jan 4 16:04:09 2009 differ
Modified: branches/pkinit/src/krb5-auth-applet.c
==============================================================================
--- branches/pkinit/src/krb5-auth-applet.c (original)
+++ branches/pkinit/src/krb5-auth-applet.c Sun Jan 4 16:04:09 2009
@@ -30,6 +30,12 @@
#define NOTIFY_SECONDS 300
+enum ka_icons {
+ inv_icon = 0,
+ exp_icon,
+ val_icon,
+};
+
/* update the tray icon's tooltip and icon */
int
ka_update_status(Krb5AuthApplet* applet, krb5_timestamp expiry)
@@ -46,14 +52,15 @@
hours = remaining / 3600;
minutes = (remaining % 3600) / 60;
expiry_text = g_strdup_printf (_("Your credentials expire in %.2d:%.2dh"), hours, minutes);
+ gtk_status_icon_set_from_icon_name (applet->tray_icon, applet->icons[val_icon]);
} else {
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[exp_icon]);
}
- 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,
@@ -70,7 +77,7 @@
#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[inv_icon]);
#ifdef HAVE_LIBNOTIFY
if (!expiry_notified) {
ka_send_event_notification (applet, NOTIFY_URGENCY_NORMAL,
@@ -214,7 +221,7 @@
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_from_icon_name (tray_icon, applet->icons[exp_icon]);
gtk_status_icon_set_tooltip (tray_icon, PACKAGE);
return tray_icon;
}
@@ -223,8 +230,9 @@
int
ka_setup_icons (Krb5AuthApplet* applet)
{
- applet->icons[0] = "krb-no-valid-ticket";
- applet->icons[1] = "krb-valid-ticket";
+ applet->icons[val_icon] = "krb-valid-ticket";
+ applet->icons[exp_icon] = "krb-expiring-ticket";
+ applet->icons[inv_icon] = "krb-no-valid-ticket";
return TRUE;
}
@@ -241,6 +249,7 @@
g_error ("Failure to create tray icon");
if (!(applet->context_menu = ka_create_context_menu (applet)))
g_error ("Failure to create context menu");
+ gtk_window_set_default_icon_name (applet->icons[val_icon]);
ka_show_tray_icon (applet);
return applet;
Modified: branches/pkinit/src/krb5-auth-applet.h
==============================================================================
--- branches/pkinit/src/krb5-auth-applet.h (original)
+++ branches/pkinit/src/krb5-auth-applet.h Sun Jan 4 16:04:09 2009
@@ -35,7 +35,7 @@
typedef struct {
GtkStatusIcon* tray_icon; /* the tray icon */
GtkWidget* context_menu; /* the tray icon's context menu */
- const char* icons[2]; /* for expired and valid tickts */
+ const char* icons[3]; /* for invalid, expiring and valid tickts */
gboolean show_trayicon; /* show the trayicon */
/* The password dialog */
Modified: branches/pkinit/src/krb5-auth-dialog.c
==============================================================================
--- branches/pkinit/src/krb5-auth-dialog.c (original)
+++ branches/pkinit/src/krb5-auth-dialog.c Sun Jan 4 16:04:09 2009
@@ -891,7 +891,6 @@
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]);
#ifdef ENABLE_NETWORK_MANAGER
nm_context = libnm_glib_init ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]