From 50efa94bd1a30e53fb38a2d25478db5597032e79 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 23 Mar 2010 20:11:52 -0500 Subject: Missed the 'Switch Off' texts in the dialog. --- src/dialog.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dialog.c b/src/dialog.c index deefe0b..fba8013 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -34,7 +34,7 @@ with this program. If not, see . static const gchar * title_strings[LOGOUT_DIALOG_TYPE_CNT] = { /* LOGOUT_DIALOG_LOGOUT, */ NC_("title", "Log Out"), /* LOGOUT_DIALOG_RESTART, */ NC_("title", "Restart"), - /* LOGOUT_DIALOG_SHUTDOWN, */ NC_("title", "Switch Off") + /* LOGOUT_DIALOG_SHUTDOWN, */ NC_("title", "Shut Down") }; static const gchar * body_strings[LOGOUT_DIALOG_TYPE_CNT] = { @@ -46,7 +46,7 @@ static const gchar * body_strings[LOGOUT_DIALOG_TYPE_CNT] = { static const gchar * button_strings[LOGOUT_DIALOG_TYPE_CNT] = { /* LOGOUT_DIALOG_LOGOUT, */ NC_("button", "Log Out"), /* LOGOUT_DIALOG_RESTART, */ NC_("button", "Restart"), - /* LOGOUT_DIALOG_SHUTDOWN, */ NC_("button", "Switch Off") + /* LOGOUT_DIALOG_SHUTDOWN, */ NC_("button", "Shut Down") }; /* TRANSLATORS: These strings have an ellipsis so that the user knows @@ -54,7 +54,7 @@ static const gchar * button_strings[LOGOUT_DIALOG_TYPE_CNT] = { static const gchar * button_auth_strings[LOGOUT_DIALOG_TYPE_CNT] = { /* LOGOUT_DIALOG_LOGOUT, */ NC_("button auth", "Log Out"), /* LOGOUT_DIALOG_RESTART, */ NC_("button auth", "Restart..."), - /* LOGOUT_DIALOG_SHUTDOWN, */ NC_("button auth", "Switch Off...") + /* LOGOUT_DIALOG_SHUTDOWN, */ NC_("button auth", "Shut Down...") }; /* TRANSLATORS: This button appears on the logout dialog when -- cgit v1.2.3 -- cgit v1.2.3 From 1e6cf587eaeb5c7e46a12ff0070b25c9730bb848 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 24 Mar 2010 10:25:25 -0500 Subject: Remove debian/patches/restore_lock_screen.patch --- debian/changelog | 1 + debian/patches/restore_lock_screen.patch | 19 ------------------- 2 files changed, 1 insertion(+), 19 deletions(-) delete mode 100644 debian/patches/restore_lock_screen.patch diff --git a/debian/changelog b/debian/changelog index 230cdb5..700b62a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ indicator-session (0.2.6-0ubuntu3~ppa1) UNRELEASED; urgency=low * Upstream Merge * Fix strings to have all be "Shut Down" (LP: #545578) + * Remove debian/patches/restore_lock_screen.patch -- Ted Gould Wed, 24 Mar 2010 10:24:00 -0500 diff --git a/debian/patches/restore_lock_screen.patch b/debian/patches/restore_lock_screen.patch deleted file mode 100644 index 12a24d4..0000000 --- a/debian/patches/restore_lock_screen.patch +++ /dev/null @@ -1,19 +0,0 @@ -=== modified file 'src/lock-helper.c' ---- src/lock-helper.c 2010-03-18 19:19:39 +0000 -+++ src/lock-helper.c 2010-03-23 17:47:37 +0000 -@@ -131,11 +131,12 @@ - return FALSE; - } - -- if (gconf_client == NULL) { -+ /* if (gconf_client == NULL) { - gconf_client = gconf_client_get_default(); - } - -- return gconf_client_get_bool (gconf_client, GCONF_KEY, NULL); -+ return gconf_client_get_bool (gconf_client, GCONF_KEY, NULL); */ -+ return TRUE; - } - - /* When the screensave go active, if we've got a mainloop - -- cgit v1.2.3 From 983ebf80d277f9366dea62a92ca81e2c408605b8 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 24 Mar 2010 10:28:32 -0500 Subject: releasing version 0.2.6-0ubuntu3~ppa1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 700b62a..0b3f262 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -indicator-session (0.2.6-0ubuntu3~ppa1) UNRELEASED; urgency=low +indicator-session (0.2.6-0ubuntu3~ppa1) lucid; urgency=low * Upstream Merge * Fix strings to have all be "Shut Down" (LP: #545578) * Remove debian/patches/restore_lock_screen.patch - -- Ted Gould Wed, 24 Mar 2010 10:24:00 -0500 + -- Ted Gould Wed, 24 Mar 2010 10:28:28 -0500 indicator-session (0.2.6-0ubuntu2) lucid; urgency=low -- cgit v1.2.3 From bb6754e8d32362d7c3558ce4b839c7a2089cec4f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 24 Mar 2010 15:35:00 -0500 Subject: Scale the avatars to be ICON_SIZE_MENU --- src/indicator-session.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/indicator-session.c b/src/indicator-session.c index b54a5d9..10e8684 100644 --- a/src/indicator-session.c +++ b/src/indicator-session.c @@ -248,7 +248,17 @@ new_user_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuCl usericon = gtk_image_new_from_gicon(gicon, GTK_ICON_SIZE_MENU); g_object_unref(gicon); } else { - usericon = gtk_image_new_from_file(icon_name); + gint width, height; + gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height); + + GError * error = NULL; + GdkPixbuf * pixbuf = gdk_pixbuf_new_from_file_at_size(icon_name, width, height, &error); + + if (error == NULL) { + usericon = gtk_image_new_from_pixbuf(pixbuf); + } else { + g_error_free(error); + } } } if (usericon != NULL) { -- cgit v1.2.3 From b0d252aed4071e95a648fbcf9f102f816fbd1725 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 24 Mar 2010 16:24:26 -0500 Subject: Flipping things around a little bit so that if we get an error, we'll still build the default icon. --- src/indicator-session.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/indicator-session.c b/src/indicator-session.c index 10e8684..57ead25 100644 --- a/src/indicator-session.c +++ b/src/indicator-session.c @@ -243,11 +243,7 @@ new_user_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuCl const gchar * icon_name = dbusmenu_menuitem_property_get(newitem, USER_ITEM_PROP_ICON); g_debug("Using user icon for '%s' from file: %s", dbusmenu_menuitem_property_get(newitem, USER_ITEM_PROP_NAME), icon_name); if (icon_name != NULL && icon_name[0] != '\0') { - if (g_strcmp0(icon_name, USER_ITEM_ICON_DEFAULT) == 0 || !g_file_test(icon_name, G_FILE_TEST_EXISTS)) { - GIcon * gicon = g_themed_icon_new_with_default_fallbacks("stock_person-panel"); - usericon = gtk_image_new_from_gicon(gicon, GTK_ICON_SIZE_MENU); - g_object_unref(gicon); - } else { + if (g_strcmp0(icon_name, USER_ITEM_ICON_DEFAULT) != 0 && g_file_test(icon_name, G_FILE_TEST_EXISTS)) { gint width, height; gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height); @@ -256,10 +252,18 @@ new_user_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuCl if (error == NULL) { usericon = gtk_image_new_from_pixbuf(pixbuf); + g_object_unref(pixbuf); } else { + g_warning("Unable to load user icon '%s': %s", icon_name, error->message); g_error_free(error); } } + + if (usericon == NULL) { + GIcon * gicon = g_themed_icon_new_with_default_fallbacks("stock_person-panel"); + usericon = gtk_image_new_from_gicon(gicon, GTK_ICON_SIZE_MENU); + g_object_unref(gicon); + } } if (usericon != NULL) { gtk_misc_set_alignment(GTK_MISC(usericon), 0.0, 0.5); -- cgit v1.2.3 From 57f27aacb9ad4d60491a2bb65910a599fce23e0b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 24 Mar 2010 16:39:57 -0500 Subject: Adding in a check to see if the translator would like to fallback to not using the username. --- src/indicator-session.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/indicator-session.c b/src/indicator-session.c index b54a5d9..9167a03 100644 --- a/src/indicator-session.c +++ b/src/indicator-session.c @@ -300,11 +300,20 @@ switch_property_change (DbusmenuMenuitem * item, const gchar * property, const G GtkMenuItem * gmi = dbusmenu_gtkclient_menuitem_get(DBUSMENU_GTKCLIENT(user_data), item); gchar * finalstring = NULL; gboolean set_ellipsize = FALSE; + gboolean no_name_in_lang = FALSE; + + /* TRANSLATORS: Translate the '1' below into anything other than + '1' if "Switch From %s..." doesn't make sense in your language. + Instead, the string "Switch User..." will be used. */ + const gchar * translate = C_("session_menu:switchfrom", "1"); + if (g_strcmp0(translate, "1") != 0) { + no_name_in_lang = TRUE; + } /* If there's a NULL string of some type, then we want to go back to our old 'Switch User' which isn't great but eh, this error condition should never happen. */ - if (value == NULL || g_value_get_string(value) == NULL || g_value_get_string(value)[0] == '\0') { + if (value == NULL || g_value_get_string(value) == NULL || g_value_get_string(value)[0] == '\0' || no_name_in_lang) { finalstring = _("Switch User..."); set_ellipsize = FALSE; } -- cgit v1.2.3 From 9abd35df0f4194a06d5005009ed888f80938fc8c Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 24 Mar 2010 17:00:36 -0500 Subject: releasing version 0.2.6-0ubuntu3~ppa2 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index eaf8a0d..e64fa59 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -indicator-session (0.2.6-0ubuntu3~ppa2) UNRELEASED; urgency=low +indicator-session (0.2.6-0ubuntu3~ppa2) lucid; urgency=low * Upstream Merge * Scale avatar icons to menu size (LP: #542505) - -- Ted Gould Wed, 24 Mar 2010 16:57:33 -0500 + -- Ted Gould Wed, 24 Mar 2010 17:00:22 -0500 indicator-session (0.2.6-0ubuntu3~ppa1) lucid; urgency=low -- cgit v1.2.3 From e0253f40b7cdc7316f97823389ab1cd3b9058fe2 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 25 Mar 2010 09:28:26 -0500 Subject: releasing version 0.2.6-0ubuntu3~ppa3 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 43f6ffa..3c8042d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -indicator-session (0.2.6-0ubuntu3~ppa3) UNRELEASED; urgency=low +indicator-session (0.2.6-0ubuntu3~ppa3) lucid; urgency=low * Upstream Merge * Adding a switch for translators if the "Switch From" translation doesn't make sense (LP: #545893) - -- Ted Gould Thu, 25 Mar 2010 09:24:15 -0500 + -- Ted Gould Thu, 25 Mar 2010 09:28:23 -0500 indicator-session (0.2.6-0ubuntu3~ppa2) lucid; urgency=low -- cgit v1.2.3 From 791f0b47640052221f14439678c32efa3ba2f0dc Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 25 Mar 2010 09:34:34 -0500 Subject: 0.2.7 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index efe1c2b..a35679f 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ AC_INIT(src/indicator-session.c) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-session, 0.2.6) +AM_INIT_AUTOMAKE(indicator-session, 0.2.7) AM_MAINTAINER_MODE -- cgit v1.2.3 From 56a250cf8262579d749a71bde854da390fcc29e2 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 25 Mar 2010 09:40:38 -0500 Subject: releasing version 0.2.7-0ubuntu1~ppa1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index e9473ea..8a2fead 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -indicator-session (0.2.7-0ubuntu1~ppa1) UNRELEASED; urgency=low +indicator-session (0.2.7-0ubuntu1~ppa1) lucid; urgency=low * Upstream release 0.2.7 * Adding a switch for translators if the "Switch From" @@ -8,7 +8,7 @@ indicator-session (0.2.7-0ubuntu1~ppa1) UNRELEASED; urgency=low * Remove debian/patches/restore_lock_screen.patch added by downstream. - -- Ted Gould Thu, 25 Mar 2010 09:36:48 -0500 + -- Ted Gould Thu, 25 Mar 2010 09:40:31 -0500 indicator-session (0.2.6-0ubuntu2) lucid; urgency=low -- cgit v1.2.3 From e100d5583e340fa96f4e8c4aefae2d106c17a082 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 25 Mar 2010 13:09:23 -0500 Subject: Changing the menu item to 'Suspend' --- src/session-service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/session-service.c b/src/session-service.c index c1c2e57..3b3106a 100644 --- a/src/session-service.c +++ b/src/session-service.c @@ -637,7 +637,7 @@ rebuild_items (DbusmenuMenuitem *root, if (can_suspend && allow_suspend) { suspend_mi = dbusmenu_menuitem_new(); - dbusmenu_menuitem_property_set(suspend_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Sleep")); + dbusmenu_menuitem_property_set(suspend_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Suspend")); dbusmenu_menuitem_child_append(root, suspend_mi); g_signal_connect(G_OBJECT(suspend_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(machine_sleep), "Suspend"); } -- cgit v1.2.3 From cbbb96c5255b9842546c8480c0b2b60da3955560 Mon Sep 17 00:00:00 2001 From: Gabor Kelemen Date: Mon, 29 Mar 2010 14:08:16 -0500 Subject: Use contexts properly --- src/dialog.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dialog.c b/src/dialog.c index fba8013..51b1682 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -174,7 +174,7 @@ logout_dialog_new (LogoutDialogType type) "icon-name", icon_strings[type], "modal", TRUE, "resizable", FALSE, - "title", _(title_strings[type]), + "title", g_dpgettext2 (NULL, "title", title_strings[type]), "window-position", GTK_WIN_POS_CENTER_ALWAYS, /* Message Dialog */ "buttons", GTK_BUTTONS_NONE, @@ -197,9 +197,9 @@ logout_dialog_new (LogoutDialogType type) const gchar * button_text; if (allowed) { - button_text = _(button_strings[type]); + button_text = g_dpgettext2 (NULL, "button", button_strings[type]); } else { - button_text = _(button_auth_strings[type]); + button_text = g_dpgettext2 (NULL, "button auth", button_auth_strings[type]); } if (restart_required) { -- cgit v1.2.3 From 953b64bb904c94718ef822fc7ba3a2e71c64e147 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 1 Apr 2010 21:27:28 -0500 Subject: Seems that the message isn't always valid --- src/gtk-logout-helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gtk-logout-helper.c b/src/gtk-logout-helper.c index 64fba14..b8923c6 100644 --- a/src/gtk-logout-helper.c +++ b/src/gtk-logout-helper.c @@ -68,7 +68,7 @@ consolekit_fallback (LogoutDialogType action) g_object_unref(proxy); if (error != NULL) { - g_error("Unable to signal ConsoleKit: %s", error->message); + g_error("Unable to signal ConsoleKit"); g_error_free(error); } -- cgit v1.2.3 From a8a52218ac55b27ed2b27ae44993bf2f35165e4d Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 6 Apr 2010 11:49:10 -0500 Subject: Actually pass the service in the callback --- src/session-service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/session-service.c b/src/session-service.c index 3b3106a..c522748 100644 --- a/src/session-service.c +++ b/src/session-service.c @@ -545,7 +545,7 @@ rebuild_items (DbusmenuMenuitem *root, dbusmenu_menuitem_property_set (guest_mi, USER_ITEM_PROP_NAME, _("Guest Session")); dbusmenu_menuitem_property_set_bool (guest_mi, USER_ITEM_PROP_LOGGED_IN, FALSE); dbusmenu_menuitem_child_append (root, guest_mi); - g_signal_connect (G_OBJECT (guest_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK (activate_guest_session), NULL); + g_signal_connect (G_OBJECT (guest_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK (activate_guest_session), service); users_service_dbus_set_guest_item(service, guest_mi); } -- cgit v1.2.3 From 7a7161a2640f3b833ec4180c3c658de33042b011 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 6 Apr 2010 11:58:16 -0500 Subject: Adding some protection. We should always use protection. --- src/users-service-dbus.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/users-service-dbus.c b/src/users-service-dbus.c index 86007c3..58490de 100644 --- a/src/users-service-dbus.c +++ b/src/users-service-dbus.c @@ -550,6 +550,7 @@ static void add_sessions_for_user (UsersServiceDbus *self, UserData *user) { + g_return_if_fail(IS_USERS_SERVICE_DBUS(self)); UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self); GError *error; GPtrArray *sessions; @@ -582,6 +583,7 @@ seat_proxy_session_added (DBusGProxy *seat_proxy, const gchar *session_id, UsersServiceDbus *service) { + g_return_if_fail(IS_USERS_SERVICE_DBUS(service)); UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (service); uid_t uid; gboolean res; @@ -627,6 +629,7 @@ seat_proxy_session_removed (DBusGProxy *seat_proxy, const gchar *session_id, UsersServiceDbus *service) { + g_return_if_fail(IS_USERS_SERVICE_DBUS(service)); UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (service); UserData *user; gchar *username; @@ -671,6 +674,7 @@ seat_proxy_session_removed (DBusGProxy *seat_proxy, static void sync_users (UsersServiceDbus *self) { + g_return_if_fail(IS_USERS_SERVICE_DBUS(self)); UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self); if (g_hash_table_size (priv->users) > 0) @@ -770,6 +774,7 @@ static gboolean session_is_login_window (UsersServiceDbus *self, const char *ssid) { + g_return_val_if_fail(IS_USERS_SERVICE_DBUS(self), FALSE); UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self); DBusGProxy *proxy = NULL; GError *error = NULL; @@ -805,6 +810,7 @@ session_is_login_window (UsersServiceDbus *self, static char * get_login_session (UsersServiceDbus *self) { + g_return_val_if_fail(IS_USERS_SERVICE_DBUS(self), NULL); UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self); gboolean can_activate; GError *error = NULL; @@ -871,6 +877,7 @@ activate_user_session (UsersServiceDbus *self, const char *seat, const char *ssid) { + g_return_val_if_fail(IS_USERS_SERVICE_DBUS(self), FALSE); UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self); DBusMessage *message = NULL; DBusMessage *reply = NULL; @@ -1057,6 +1064,8 @@ user_updated (DBusGProxy *proxy, gint users_service_dbus_get_user_count (UsersServiceDbus *self) { + g_return_val_if_fail(IS_USERS_SERVICE_DBUS(self), 0); + UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self); return priv->count; @@ -1065,6 +1074,8 @@ users_service_dbus_get_user_count (UsersServiceDbus *self) GList * users_service_dbus_get_user_list (UsersServiceDbus *self) { + g_return_val_if_fail(IS_USERS_SERVICE_DBUS(self), NULL); + UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self); return g_hash_table_get_values (priv->users); @@ -1074,6 +1085,7 @@ users_service_dbus_get_user_list (UsersServiceDbus *self) gboolean users_service_dbus_activate_guest_session (UsersServiceDbus *self) { + g_return_val_if_fail(IS_USERS_SERVICE_DBUS(self), FALSE); UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self); return org_gnome_DisplayManager_LocalDisplayFactory_switch_to_user(priv->gdm_local_proxy, "guest", NULL, NULL); } @@ -1083,6 +1095,7 @@ gboolean users_service_dbus_activate_user_session (UsersServiceDbus *self, UserData *user) { + g_return_val_if_fail(IS_USERS_SERVICE_DBUS(self), FALSE); UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self); return org_gnome_DisplayManager_LocalDisplayFactory_switch_to_user(priv->gdm_local_proxy, user->user_name, NULL, NULL); } @@ -1090,6 +1103,7 @@ users_service_dbus_activate_user_session (UsersServiceDbus *self, gboolean users_service_dbus_can_activate_session (UsersServiceDbus *self) { + g_return_val_if_fail(IS_USERS_SERVICE_DBUS(self), FALSE); UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self); gboolean can_activate = FALSE; GError *error = NULL; @@ -1124,6 +1138,7 @@ users_service_dbus_can_activate_session (UsersServiceDbus *self) void users_service_dbus_set_guest_item (UsersServiceDbus * self, DbusmenuMenuitem * mi) { + g_return_if_fail(IS_USERS_SERVICE_DBUS(self)); UsersServiceDbusPrivate *priv = USERS_SERVICE_DBUS_GET_PRIVATE (self); priv->guest_item = mi; -- cgit v1.2.3 -- cgit v1.2.3 From 79c9706e99fb458644f12cce7b7b37a78d36f6dd Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 6 Apr 2010 16:54:46 -0500 Subject: Adding configuration options for the restart menuitem and the shutdown one. --- data/indicator-session.schemas.in | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/data/indicator-session.schemas.in b/data/indicator-session.schemas.in index bb8a147..3380c94 100644 --- a/data/indicator-session.schemas.in +++ b/data/indicator-session.schemas.in @@ -24,5 +24,27 @@ Makes it so that the logout button doesn't show in the session menu. + + /schemas/apps/indicator-session/suppress_restart_menuitem + /apps/indicator-session/suppress_restart_menuitem + indicator-session + bool + FALSE + + Remove the Restart item from the session menu + Makes it so that the restart button doesn't show in the session menu. + + + + /schemas/apps/indicator-session/suppress_shutdown_menuitem + /apps/indicator-session/suppress_shutdown_menuitem + indicator-session + bool + FALSE + + Remove the shutdown item from the session menu + Makes it so that the shutdown button doesn't show in the session menu. + + -- cgit v1.2.3 From fd1e69241e772a7f9f463ce98bf532c78fdf91f5 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 6 Apr 2010 16:56:04 -0500 Subject: Formatting --- data/indicator-session.schemas.in | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/data/indicator-session.schemas.in b/data/indicator-session.schemas.in index 3380c94..f4e70da 100644 --- a/data/indicator-session.schemas.in +++ b/data/indicator-session.schemas.in @@ -2,16 +2,16 @@ - /schemas/apps/indicator-session/suppress_logout_restart_shutdown - /apps/indicator-session/suppress_logout_restart_shutdown - indicator-session - bool - FALSE - - Suppress the dialog to confirm logout, restart and shutdown action - Whether or not to show confirmation dialogs for logout, - restart and shutdown actions. - + /schemas/apps/indicator-session/suppress_logout_restart_shutdown + /apps/indicator-session/suppress_logout_restart_shutdown + indicator-session + bool + FALSE + + Suppress the dialog to confirm logout, restart and shutdown action + Whether or not to show confirmation dialogs for logout, + restart and shutdown actions. + /schemas/apps/indicator-session/suppress_logout_menuitem -- cgit v1.2.3 From 07dcd3f24ee57e0ee895e457f1b07bd126c2facf Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 6 Apr 2010 17:24:42 -0500 Subject: Adding the restart and shutdown keys and functions to check them. --- src/gconf-helper.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gconf-helper.h b/src/gconf-helper.h index 6f9bcb7..505c24f 100644 --- a/src/gconf-helper.h +++ b/src/gconf-helper.h @@ -36,6 +36,8 @@ with this program. If not, see . #define GLOBAL_DIR "/apps/indicator-session" #define SUPPRESS_KEY GLOBAL_DIR "/suppress_logout_restart_shutdown" #define LOGOUT_KEY GLOBAL_DIR "/suppress_logout_menuitem" +#define RESTART_KEY GLOBAL_DIR "/suppress_restart_menuitem" +#define SHUTDOWN_KEY GLOBAL_DIR "/suppress_shutdown_menuitem" typedef struct _RestartShutdownLogoutMenuItems { @@ -45,8 +47,10 @@ typedef struct _RestartShutdownLogoutMenuItems } RestartShutdownLogoutMenuItems; -void update_menu_entries(RestartShutdownLogoutMenuItems*, DbusmenuMenuitem * logoutitem); +void update_menu_entries(RestartShutdownLogoutMenuItems*); gboolean supress_confirmations (void); gboolean show_logout (void); +gboolean show_restart (void); +gboolean show_shutdown (void); #endif /* __GCONF_HELPER__ */ -- cgit v1.2.3 From 234ca9cd5a231b6beee298539203b4de4d27e5bc Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 6 Apr 2010 17:25:05 -0500 Subject: Filling out everything to check and update the shutdown/restart items --- src/gconf-helper.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/src/gconf-helper.c b/src/gconf-helper.c index 29d8526..4911dcb 100644 --- a/src/gconf-helper.c +++ b/src/gconf-helper.c @@ -36,6 +36,8 @@ with this program. If not, see . static GConfClient * gconf_client = NULL; static guint confirmation_notify = 0; static guint logout_notify = 0; +static guint restart_notify = 0; +static guint shutdown_notify = 0; gboolean supress_confirmations (void) { @@ -53,6 +55,22 @@ show_logout (void) { return !gconf_client_get_bool (gconf_client, LOGOUT_KEY, NULL) ; } +gboolean +show_restart (void) { + if(!gconf_client) { + gconf_client = gconf_client_get_default (); + } + return !gconf_client_get_bool (gconf_client, RESTART_KEY, NULL) ; +} + +gboolean +show_shutdown (void) { + if(!gconf_client) { + gconf_client = gconf_client_get_default (); + } + return !gconf_client_get_bool (gconf_client, SHUTDOWN_KEY, NULL) ; +} + static void update_menu_entries_callback (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer data) { RestartShutdownLogoutMenuItems * restart_shutdown_logout_mi = (RestartShutdownLogoutMenuItems*) data; GConfValue * value = gconf_entry_get_value (entry); @@ -82,8 +100,30 @@ update_logout_callback (GConfClient *client, guint cnxn_id, GConfEntry *entry, } } +static void +update_restart_callback (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer data) { + DbusmenuMenuitem * mi = (DbusmenuMenuitem*) data; + GConfValue * value = gconf_entry_get_value (entry); + const gchar * key = gconf_entry_get_key (entry); + + if(g_strcmp0 (key, RESTART_KEY) == 0) { + dbusmenu_menuitem_property_set_bool(mi, DBUSMENU_MENUITEM_PROP_VISIBLE, !gconf_value_get_bool(value)); + } +} + +static void +update_shutdown_callback (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer data) { + DbusmenuMenuitem * mi = (DbusmenuMenuitem*) data; + GConfValue * value = gconf_entry_get_value (entry); + const gchar * key = gconf_entry_get_key (entry); + + if(g_strcmp0 (key, SHUTDOWN_KEY) == 0) { + dbusmenu_menuitem_property_set_bool(mi, DBUSMENU_MENUITEM_PROP_VISIBLE, !gconf_value_get_bool(value)); + } +} + void -update_menu_entries(RestartShutdownLogoutMenuItems * restart_shutdown_logout_mi, DbusmenuMenuitem * logoutitem) { +update_menu_entries(RestartShutdownLogoutMenuItems * restart_shutdown_logout_mi) { /* If we don't have a client, build one. */ if(!gconf_client) { gconf_client = gconf_client_get_default (); @@ -106,9 +146,25 @@ update_menu_entries(RestartShutdownLogoutMenuItems * restart_shutdown_logout_mi, logout_notify = 0; } + if (restart_notify != 0) { + gconf_client_notify_remove (gconf_client, restart_notify); + restart_notify = 0; + } + + if (shutdown_notify != 0) { + gconf_client_notify_remove (gconf_client, shutdown_notify); + shutdown_notify = 0; + } + confirmation_notify = gconf_client_notify_add (gconf_client, SUPPRESS_KEY, update_menu_entries_callback, restart_shutdown_logout_mi, NULL, NULL); logout_notify = gconf_client_notify_add (gconf_client, LOGOUT_KEY, - update_logout_callback, logoutitem, NULL, NULL); + update_logout_callback, restart_shutdown_logout_mi->logout_mi, NULL, NULL); + restart_notify = gconf_client_notify_add (gconf_client, RESTART_KEY, + update_restart_callback, restart_shutdown_logout_mi->restart_mi, NULL, NULL); + shutdown_notify = gconf_client_notify_add (gconf_client, SHUTDOWN_KEY, + update_shutdown_callback, restart_shutdown_logout_mi->shutdown_mi, NULL, NULL); + + return; } -- cgit v1.2.3 From 54f8f8b90005978ed2376d695bb22947f0878c0b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 6 Apr 2010 17:25:22 -0500 Subject: Changing prototype to not have the same info twice. --- src/session-service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/session-service.c b/src/session-service.c index c522748..054bb17 100644 --- a/src/session-service.c +++ b/src/session-service.c @@ -673,7 +673,7 @@ rebuild_items (DbusmenuMenuitem *root, restart_shutdown_logout_mi->restart_mi = restart_mi; restart_shutdown_logout_mi->shutdown_mi = shutdown_mi; - update_menu_entries(restart_shutdown_logout_mi, logout_mi); + update_menu_entries(restart_shutdown_logout_mi); if (g_file_test(DESKTOP_FILE, G_FILE_TEST_EXISTS)) { GAppInfo * appinfo = G_APP_INFO(g_desktop_app_info_new_from_filename(DESKTOP_FILE)); -- cgit v1.2.3 From 58cb1d4475110e662fa2d67717daa5b263c3331e Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 6 Apr 2010 17:26:41 -0500 Subject: Check to see if the shutdown and restart items should be shown on first run. --- src/session-service.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/session-service.c b/src/session-service.c index 054bb17..4fc12a1 100644 --- a/src/session-service.c +++ b/src/session-service.c @@ -656,6 +656,7 @@ rebuild_items (DbusmenuMenuitem *root, } else { dbusmenu_menuitem_property_set(restart_mi, RESTART_ITEM_LABEL, _("Restart...")); } + dbusmenu_menuitem_property_set_bool(restart_mi, DBUSMENU_MENUITEM_PROP_VISIBLE, show_restart()); dbusmenu_menuitem_child_append(root, restart_mi); g_signal_connect(G_OBJECT(restart_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "restart"); @@ -665,6 +666,7 @@ rebuild_items (DbusmenuMenuitem *root, } else { dbusmenu_menuitem_property_set(shutdown_mi, DBUSMENU_MENUITEM_PROP_LABEL, _("Shut Down...")); } + dbusmenu_menuitem_property_set_bool(shutdown_mi, DBUSMENU_MENUITEM_PROP_VISIBLE, show_shutdown()); dbusmenu_menuitem_child_append(root, shutdown_mi); g_signal_connect(G_OBJECT(shutdown_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_dialog), "shutdown"); -- cgit v1.2.3 From cf5ace2d77add0de49cbe888b1b9cb57a4463d00 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 6 Apr 2010 22:33:17 -0500 Subject: releasing version 0.2.7-0ubuntu1~ppa2 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 60da672..ad07b71 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -indicator-session (0.2.7-0ubuntu1~ppa2) UNRELEASED; urgency=low +indicator-session (0.2.7-0ubuntu1~ppa2) lucid; urgency=low * Upstream Merge * Changing 'Sleep' to 'Suspend' (LP: #547102) @@ -6,7 +6,7 @@ indicator-session (0.2.7-0ubuntu1~ppa2) UNRELEASED; urgency=low * Passing correct object to callback (LP: #543393) * Ignoring malformed message (LP: #548620) - -- Ted Gould Tue, 06 Apr 2010 22:24:06 -0500 + -- Ted Gould Tue, 06 Apr 2010 22:33:15 -0500 indicator-session (0.2.7-0ubuntu1~ppa1) lucid; urgency=low -- cgit v1.2.3 From e3391afe4da2839a4c0946a00d99019d35d2d024 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 6 Apr 2010 22:36:20 -0500 Subject: releasing version 0.2.7-0ubuntu1~ppa3~conf1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index a2f0bf1..b65d697 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -indicator-session (0.2.7-0ubuntu1~ppa3~conf1) UNRELEASED; urgency=low +indicator-session (0.2.7-0ubuntu1~ppa3~conf1) lucid; urgency=low * Upstream Merge * Making restart and shutdown items configurable (LP: #548810) - -- Ted Gould Tue, 06 Apr 2010 22:33:43 -0500 + -- Ted Gould Tue, 06 Apr 2010 22:36:15 -0500 indicator-session (0.2.7-0ubuntu1~ppa2) lucid; urgency=low -- cgit v1.2.3 From 8adaef5e5e9b2d8238c0e2f3a7ddcb3a2ba5ad52 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 7 Apr 2010 13:48:03 -0500 Subject: releasing version 0.2.7-0ubuntu1~ppa3 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index fb0a37f..31f6b44 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -indicator-session (0.2.7-0ubuntu1~ppa3) UNRELEASED; urgency=low +indicator-session (0.2.7-0ubuntu1~ppa3) lucid; urgency=low * Upstream Merge * Making restart and shutdown items configurable (LP: #548810) - -- Ted Gould Wed, 07 Apr 2010 13:45:11 -0500 + -- Ted Gould Wed, 07 Apr 2010 13:48:01 -0500 indicator-session (0.2.7-0ubuntu1~ppa2) lucid; urgency=low -- cgit v1.2.3 From 1ed276d9ef453783bcbc9361ec492b999321d8d8 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 9 Apr 2010 10:58:45 -0500 Subject: 0.2.8 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index a35679f..168f5bc 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ AC_INIT(src/indicator-session.c) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-session, 0.2.7) +AM_INIT_AUTOMAKE(indicator-session, 0.2.8) AM_MAINTAINER_MODE -- cgit v1.2.3 From dae6d7d6fda33bf31de4fd7f2a8d76c685f5cdf1 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 9 Apr 2010 11:02:38 -0500 Subject: Turning off merge support for bd --- .bzr-builddeb/default.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bzr-builddeb/default.conf b/.bzr-builddeb/default.conf index 3165e05..36c28f8 100644 --- a/.bzr-builddeb/default.conf +++ b/.bzr-builddeb/default.conf @@ -1,2 +1,2 @@ [BUILDDEB] -merge = True +merge = False -- cgit v1.2.3 From dda06df8cd9fd0186d81701c72ff2e6fa36f5658 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 9 Apr 2010 11:14:30 -0500 Subject: releasing version 0.2.8-0ubuntu1~ppa1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index cfbd904..021b738 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -indicator-session (0.2.8-0ubuntu1~ppa1) UNRELEASED; urgency=low +indicator-session (0.2.8-0ubuntu1~ppa1) lucid; urgency=low * New upstream release. * Making restart and shutdown items configurable (LP: #548810) @@ -7,7 +7,7 @@ indicator-session (0.2.8-0ubuntu1~ppa1) UNRELEASED; urgency=low * Passing correct object to callback (LP: #543393) * Ignoring malformed message (LP: #548620) - -- Ted Gould Fri, 09 Apr 2010 11:05:59 -0500 + -- Ted Gould Fri, 09 Apr 2010 11:08:47 -0500 indicator-session (0.2.7-0ubuntu1~ppa1) lucid; urgency=low -- cgit v1.2.3