aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-04-06 16:24:57 +0200
committerGuido Günther <agx@sigxcpu.org>2011-04-06 16:24:57 +0200
commitcc2cada6cac9113edc7c1f4901567364632ba6e0 (patch)
tree86329ac7f459601f517fe0367751a789253a1fa3 /src
parentNew upstream version 2.91.93 (diff)
downloadkrb5-auth-dialog-cc2cada6cac9113edc7c1f4901567364632ba6e0.tar.gz
krb5-auth-dialog-cc2cada6cac9113edc7c1f4901567364632ba6e0.tar.bz2
krb5-auth-dialog-cc2cada6cac9113edc7c1f4901567364632ba6e0.zip
New upstream version 3.0.0
Diffstat (limited to 'src')
-rw-r--r--src/ka-applet.c19
-rw-r--r--src/ka-dbus.c8
-rw-r--r--src/ka-tickets.c72
-rw-r--r--src/org.gnome.KrbAuthDialog.service.in2
4 files changed, 53 insertions, 48 deletions
diff --git a/src/ka-applet.c b/src/ka-applet.c
index 2d4981e..441ed94 100644
--- a/src/ka-applet.c
+++ b/src/ka-applet.c
@@ -81,7 +81,7 @@ struct _KaAppletPrivate {
gboolean ns_persistence; /* does the notification server support persistence */
KaPwDialog *pwdialog; /* the password dialog */
- int pw_prompt_secs; /* when to start prompting for a password */
+ int pw_prompt_secs; /* when to start sending notifications */
KaPluginLoader *loader; /* Plugin loader */
NotifyNotification *notification; /* notification messages */
@@ -530,7 +530,7 @@ ka_send_event_notification (KaApplet *self,
}
notify_notification_clear_actions(notification);
- /* Add List Tickets button until we moved this into cc-panl */
+
if (self->priv->ns_persistence) {
notify_notification_add_action (notification,
"ka-list-tickets",
@@ -591,14 +591,14 @@ ka_applet_update_status (KaApplet *applet, krb5_timestamp expiry)
int remaining = expiry - now;
static int last_warn = 0;
static gboolean expiry_notified = FALSE;
+ static gboolean initial_notification = TRUE;
static krb5_timestamp old_expiry = 0;
gboolean notify = TRUE;
const char *status_icon = ka_applet_select_icon (applet, remaining);
char *tooltip_text = ka_applet_tooltip_text (remaining);
-
if (remaining > 0) {
- if (expiry_notified) {
+ if (expiry_notified || initial_notification) {
const char* msg;
ka_gconf_get_bool (applet->priv->gconf,
KA_GCONF_KEY_NOTIFY_VALID, &notify);
@@ -607,8 +607,12 @@ ka_applet_update_status (KaApplet *applet, krb5_timestamp expiry)
if (applet->priv->krb_msg)
msg = applet->priv->krb_msg;
- else
- msg = _("You've refreshed your Kerberos credentials.");
+ else {
+ if (initial_notification)
+ msg = _("You have valid Kerberos credentials.");
+ else
+ msg = _("You've refreshed your Kerberos credentials.");
+ }
ka_send_event_notification (applet,
_("Network credentials valid"),
msg,
@@ -661,6 +665,7 @@ ka_applet_update_status (KaApplet *applet, krb5_timestamp expiry)
old_expiry = expiry;
ka_update_tray_icon(applet, status_icon, tooltip_text);
g_free (tooltip_text);
+ initial_notification = FALSE;
return 0;
}
@@ -731,7 +736,7 @@ ka_applet_cb_about_dialog (GtkMenuItem *menuitem G_GNUC_UNUSED,
"logo-icon-name", "krb-valid-ticket",
"copyright",
"Copyright (C) 2004,2005,2006 Red Hat, Inc.,\n"
- "2008,2009 Guido Günther",
+ "2008-2011 Guido Günther",
"website-label", PACKAGE " website",
"website",
"https://honk.sigxcpu.org/piki/projects/krb5-auth-dialog/",
diff --git a/src/ka-dbus.c b/src/ka-dbus.c
index 4a7be2c..a79f85f 100644
--- a/src/ka-dbus.c
+++ b/src/ka-dbus.c
@@ -171,9 +171,9 @@ static const GDBusInterfaceVTable interface_vtable =
static void
-ka_dbus_on_name_acquired (GDBusConnection *connection,
- const gchar *name G_GNUC_UNUSED,
- gpointer user_data)
+ka_dbus_on_bus_acquired (GDBusConnection *connection,
+ const gchar *name G_GNUC_UNUSED,
+ gpointer user_data)
{
KaApplet *applet = user_data;
guint id;
@@ -233,8 +233,8 @@ ka_dbus_connect (KaApplet *applet)
dbus_owner_id = g_bus_own_name (G_BUS_TYPE_SESSION,
"org.gnome.KrbAuthDialog",
G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT,
+ ka_dbus_on_bus_acquired,
NULL,
- ka_dbus_on_name_acquired,
ka_dbus_on_name_lost,
applet,
NULL);
diff --git a/src/ka-tickets.c b/src/ka-tickets.c
index c7d9ea7..ce01fce 100644
--- a/src/ka-tickets.c
+++ b/src/ka-tickets.c
@@ -33,7 +33,6 @@ GtkWidget *
ka_tickets_dialog_create (GtkBuilder *xml)
{
GtkCellRenderer *text_renderer, *toggle_renderer;
- GtkTreeViewColumn *column;
GtkTreeView *tickets_view;
tickets = gtk_list_store_new (N_COLUMNS,
@@ -53,41 +52,42 @@ ka_tickets_dialog_create (GtkBuilder *xml)
text_renderer = gtk_cell_renderer_text_new ();
toggle_renderer = gtk_cell_renderer_toggle_new ();
- column = gtk_tree_view_column_new_with_attributes (_("Principal"),
- text_renderer,
- "text",
- PRINCIPAL_COLUMN,
- NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (tickets_view), column);
- column = gtk_tree_view_column_new_with_attributes (_("Start Time"),
- text_renderer,
- "text",
- START_TIME_COLUMN,
- NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (tickets_view), column);
- column = gtk_tree_view_column_new_with_attributes (_("End Time"),
- text_renderer,
- "markup",
- END_TIME_COLUMN, NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (tickets_view), column);
- column = gtk_tree_view_column_new_with_attributes (_("Fwd"),
- toggle_renderer,
- "active",
- FORWARDABLE_COLUMN,
- NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (tickets_view), column);
- column = gtk_tree_view_column_new_with_attributes (_("Proxy"),
- toggle_renderer,
- "active",
- PROXIABLE_COLUMN,
- NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (tickets_view), column);
- column = gtk_tree_view_column_new_with_attributes (_("Renew"),
- toggle_renderer,
- "active",
- RENEWABLE_COLUMN,
- NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (tickets_view), column);
+ gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(tickets_view), -1,
+ _("Principal"),
+ text_renderer,
+ "text",
+ PRINCIPAL_COLUMN,
+ NULL);
+ gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(tickets_view), -1,
+ _("Start Time"),
+ text_renderer,
+ "text",
+ START_TIME_COLUMN,
+ NULL);
+ gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(tickets_view), -1,
+ _("End Time"),
+ text_renderer,
+ "markup",
+ END_TIME_COLUMN,
+ NULL);
+ gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(tickets_view), -1,
+ _("Fwd"),
+ toggle_renderer,
+ "active",
+ FORWARDABLE_COLUMN,
+ NULL);
+ gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(tickets_view), -1,
+ _("Proxy"),
+ toggle_renderer,
+ "active",
+ PROXIABLE_COLUMN,
+ NULL);
+ gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(tickets_view), -1,
+ _("Renew"),
+ toggle_renderer,
+ "active",
+ RENEWABLE_COLUMN,
+ NULL);
return tickets_dialog;
}
diff --git a/src/org.gnome.KrbAuthDialog.service.in b/src/org.gnome.KrbAuthDialog.service.in
index f49546a..c8c3632 100644
--- a/src/org.gnome.KrbAuthDialog.service.in
+++ b/src/org.gnome.KrbAuthDialog.service.in
@@ -1,3 +1,3 @@
[D-BUS Service]
Name=org.gnome.KrbAuthDialog
-Exec=@BINDIR@/krb5-auth-dialog -A
+Exec=@BINDIR@/krb5-auth-dialog
bgstack15