[krb5-auth-dialog] use krb-valid-ticket icon and friends everywhere
- From: Guido Günther <guidog src gnome org>
- To: svn-commits-list gnome org
- Subject: [krb5-auth-dialog] use krb-valid-ticket icon and friends everywhere
- Date: Fri, 12 Jun 2009 06:05:19 -0400 (EDT)
commit 761fc7a10890afbadab351b6fe6568100403d5f3
Author: Guido Günther <agx sigxcpu org>
Date: Sun Jun 7 17:36:30 2009 +0200
use krb-valid-ticket icon and friends everywhere
instead of gtk-dialog-authentication. Makes using different icon themes
easier. Also use icons in notifications.
ChangeLog | 15 +++++++++++
.../krb5-auth-dialog-preferences.desktop.in | 2 +-
preferences/krb5-auth-dialog-preferences.xml | 4 +-
src/krb5-auth-applet.c | 27 ++++++++++++++-----
src/krb5-auth-applet.h | 2 +-
src/krb5-auth-dialog.c | 7 +----
src/krb5-auth-dialog.xml | 2 +-
7 files changed, 41 insertions(+), 18 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 247868b..a3a0b59 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+Fri Jun 12 11:51:20 CEST 2009 Guido Günther <agx sigxcpu org>
+
+ * preferences/krb5-auth-dialog-preferences.desktop.in: use
+ krb-valid-ticket icon instead of abusing gtk-dialog-authentication
+ * preferences/krb5-auth-dialog-preferences.xml: likewise
+ * src/krb5-auth-dialog.xml: likewise
+ * src/krb5-auth-applet.c (ka_send_event_notificatyion): likewise
+ (ka_applet_update_status): use icons in notifications
+ (ka_applet_create): load uixml after calling
+ gtk_icon_theme_append_search_path
+ (ka_applet_setup_icons): use DATA_DIR instead of PKG_DATA_DIR
+ (ka_applet_cb_about_dialog): add "logo-icon-name"
+ * src/krb5-auth-dialog.c: uixml parsing moved to ka_applet_create...
+ * src/krb5-auth-applet.h: ...so drop unused parameter
+
Fri Jun 12 11:45:30 CEST 2009 Guido Günther <agx sigxcpu org>
add scalable and 48x48 icons and move them from pkgdatadir to datadir.
diff --git a/preferences/krb5-auth-dialog-preferences.desktop.in b/preferences/krb5-auth-dialog-preferences.desktop.in
index d87e1e7..2aabd47 100644
--- a/preferences/krb5-auth-dialog-preferences.desktop.in
+++ b/preferences/krb5-auth-dialog-preferences.desktop.in
@@ -2,7 +2,7 @@
_Name=Network Authentication
_Comment=Set your Kerberos network authenticaion preferences
Exec=krb5-auth-dialog-preferences
-Icon=gtk-dialog-authentication
+Icon=krb-valid-ticket
Terminal=false
Type=Application
StartupNotify=true
diff --git a/preferences/krb5-auth-dialog-preferences.xml b/preferences/krb5-auth-dialog-preferences.xml
index 5c70ff3..5e27687 100644
--- a/preferences/krb5-auth-dialog-preferences.xml
+++ b/preferences/krb5-auth-dialog-preferences.xml
@@ -6,7 +6,7 @@
<property name="border_width">5</property>
<property name="title" translatable="yes">Kerberos Authentication Configuration</property>
<property name="window_position">center-on-parent</property>
- <property name="icon_name">gtk-dialog-authentication</property>
+ <property name="icon_name">krb-valid-ticket</property>
<property name="type_hint">dialog</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
@@ -47,7 +47,7 @@
<object class="GtkImage" id="access">
<property name="visible">True</property>
<property name="yalign">0</property>
- <property name="icon_name">gtk-dialog-authentication</property>
+ <property name="icon_name">krb-valid-ticket</property>
<property name="icon-size">6</property>
</object>
<packing>
diff --git a/src/krb5-auth-applet.c b/src/krb5-auth-applet.c
index 0a4a141..3c1cdca 100644
--- a/src/krb5-auth-applet.c
+++ b/src/krb5-auth-applet.c
@@ -66,6 +66,7 @@ G_DEFINE_TYPE(KaApplet, ka_applet, G_TYPE_OBJECT);
struct _KaAppletPrivate
{
+ GtkBuilder *uixml;
GtkStatusIcon* tray_icon; /* the tray icon */
GtkWidget* context_menu; /* the tray icon's context menu */
const char* icons[3]; /* for invalid, expiring and valid tickts */
@@ -211,6 +212,10 @@ ka_applet_dispose(GObject* object)
g_object_unref(applet->priv->pwdialog);
applet->priv->pwdialog = NULL;
}
+ if (applet->priv->uixml) {
+ g_object_unref(applet->priv->uixml);
+ applet->priv->uixml = NULL;
+ }
if (parent_class->dispose != NULL)
parent_class->dispose (object);
@@ -430,7 +435,7 @@ ka_send_event_notification (KaApplet *applet,
g_object_unref (applet->priv->notification);
}
- notify_icon = icon ? icon : "gtk-dialog-authentication";
+ notify_icon = icon ? icon : "krb-valid-ticket";
applet->priv->notification = \
notify_notification_new_with_status_icon(summary,
@@ -480,7 +485,8 @@ ka_applet_update_status(KaApplet* applet, krb5_timestamp expiry)
ka_send_event_notification (applet,
_("Network credentials valid"),
_("You've refreshed your Kerberos credentials."),
- NULL, "dont-show-again");
+ "krb-valid-ticket",
+ "dont-show-again");
}
expiry_notified = FALSE;
} else if (remaining < applet->priv->pw_prompt_secs && (now - last_warn) > NOTIFY_SECONDS &&
@@ -493,7 +499,8 @@ ka_applet_update_status(KaApplet* applet, krb5_timestamp expiry)
ka_send_event_notification (applet,
_("Network credentials expiring"),
tooltip_text,
- NULL, "dont-show-again");
+ "krb-expiring-ticket",
+ "dont-show-again");
}
last_warn = now;
}
@@ -507,7 +514,8 @@ ka_applet_update_status(KaApplet* applet, krb5_timestamp expiry)
ka_send_event_notification (applet,
_("Network credentials expired"),
_("Your Kerberos credentails have expired."),
- NULL, "dont-show-again");
+ "krb-no-valid-ticket",
+ "dont-show-again");
}
expiry_notified = TRUE;
last_warn = 0;
@@ -594,6 +602,7 @@ ka_applet_cb_about_dialog (GtkMenuItem* menuitem G_GNUC_UNUSED,
gtk_show_about_dialog (NULL,
"authors", authors,
"version", VERSION,
+ "logo-icon-name", "krb-valid-ticket",
"copyright",
"Copyright (C) 2004,2005,2006 Red Hat, Inc.,\n"
"2008,2009 Guido Günther",
@@ -737,7 +746,7 @@ ka_applet_setup_icons (KaApplet* applet)
{
/* Add application specific icons to search path */
gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (),
- KA_DATA_DIR G_DIR_SEPARATOR_S "icons");
+ DATA_DIR G_DIR_SEPARATOR_S "icons");
applet->priv->icons[val_icon] = "krb-valid-ticket";
applet->priv->icons[exp_icon] = "krb-expiring-ticket";
applet->priv->icons[inv_icon] = "krb-no-valid-ticket";
@@ -776,7 +785,7 @@ ka_applet_get_pwdialog(const KaApplet* applet)
/* create the tray icon applet */
KaApplet*
-ka_applet_create(GtkBuilder *xml)
+ka_applet_create()
{
KaApplet* applet = ka_applet_new();
@@ -790,7 +799,11 @@ ka_applet_create(GtkBuilder *xml)
g_signal_connect (applet, "notify::show-trayicon",
G_CALLBACK (ka_applet_cb_show_trayicon), NULL);
- applet->priv->pwdialog = ka_pwdialog_create(xml);
+ applet->priv->uixml = gtk_builder_new();
+ g_assert(gtk_builder_add_from_file(applet->priv->uixml,
+ KA_DATA_DIR G_DIR_SEPARATOR_S
+ PACKAGE ".xml", NULL));
+ applet->priv->pwdialog = ka_pwdialog_create(applet->priv->uixml);
g_return_val_if_fail (applet->priv->pwdialog != NULL, NULL);
applet->priv->gconf = ka_gconf_init (applet);
diff --git a/src/krb5-auth-applet.h b/src/krb5-auth-applet.h
index 9f2dcf1..35679bc 100644
--- a/src/krb5-auth-applet.h
+++ b/src/krb5-auth-applet.h
@@ -56,7 +56,7 @@ guint ka_applet_get_pw_prompt_secs(const KaApplet* applet);
KaPwDialog* ka_applet_get_pwdialog(const KaApplet* applet);
/* create the applet */
-KaApplet* ka_applet_create(GtkBuilder* xml);
+KaApplet* ka_applet_create(void);
/* update tooltip and icon */
int ka_applet_update_status(KaApplet* applet, krb5_timestamp expiry);
diff --git a/src/krb5-auth-dialog.c b/src/krb5-auth-dialog.c
index 32f7276..7415b47 100644
--- a/src/krb5-auth-dialog.c
+++ b/src/krb5-auth-dialog.c
@@ -945,7 +945,6 @@ main (int argc, char *argv[])
KaApplet *applet;
GOptionContext *context;
GError *error = NULL;
- GtkBuilder *xml;
guint status = 0;
gboolean run_auto = FALSE, run_always = FALSE;
@@ -984,10 +983,7 @@ main (int argc, char *argv[])
if (using_krb5 () || always_run) {
g_set_application_name (KA_NAME);
- xml = gtk_builder_new();
- g_assert(gtk_builder_add_from_file(xml, KA_DATA_DIR G_DIR_SEPARATOR_S
- PACKAGE ".xml", NULL));
- applet = ka_applet_create (xml);
+ applet = ka_applet_create ();
if (!applet)
return 1;
ka_nm_init();
@@ -998,7 +994,6 @@ main (int argc, char *argv[])
}
ka_dbus_service(applet);
gtk_main ();
- g_object_unref(xml);
}
return 0;
}
diff --git a/src/krb5-auth-dialog.xml b/src/krb5-auth-dialog.xml
index 3f58588..792b389 100644
--- a/src/krb5-auth-dialog.xml
+++ b/src/krb5-auth-dialog.xml
@@ -21,7 +21,7 @@
<object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="yalign">0</property>
- <property name="stock">gtk-dialog-authentication</property>
+ <property name="icon_name">krb-valid-ticket</property>
<property name="icon-size">6</property>
</object>
<packing>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]