aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.in2
-rw-r--r--src/dbus-accounts.c2
-rw-r--r--src/dbus-accounts.h2
-rw-r--r--src/dbus-consolekit-manager.c2
-rw-r--r--src/dbus-consolekit-manager.h2
-rw-r--r--src/dbus-consolekit-seat.c2
-rw-r--r--src/dbus-consolekit-seat.h2
-rw-r--r--src/dbus-consolekit-session.c2
-rw-r--r--src/dbus-consolekit-session.h2
-rw-r--r--src/dbus-display-manager.c2
-rw-r--r--src/dbus-display-manager.h2
-rw-r--r--src/dbus-upower.c2
-rw-r--r--src/dbus-upower.h2
-rw-r--r--src/dbus-user.c2
-rw-r--r--src/dbus-user.h2
-rw-r--r--src/indicator-session.c66
-rw-r--r--src/session-menu-mgr.c13
-rw-r--r--src/shared-names.h4
18 files changed, 22 insertions, 91 deletions
diff --git a/src/Makefile.in b/src/Makefile.in
index e920d93..7d61f64 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.5 from Makefile.am.
+# Makefile.in generated by automake 1.11.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
diff --git a/src/dbus-accounts.c b/src/dbus-accounts.c
index 17b28cd..37fd93c 100644
--- a/src/dbus-accounts.c
+++ b/src/dbus-accounts.c
@@ -1,5 +1,5 @@
/*
- * Generated by gdbus-codegen 2.33.12. DO NOT EDIT.
+ * Generated by gdbus-codegen 2.34.0. DO NOT EDIT.
*
* The license of this code is the same as for the source it was derived from.
*/
diff --git a/src/dbus-accounts.h b/src/dbus-accounts.h
index 0c9dd2f..23404c0 100644
--- a/src/dbus-accounts.h
+++ b/src/dbus-accounts.h
@@ -1,5 +1,5 @@
/*
- * Generated by gdbus-codegen 2.33.12. DO NOT EDIT.
+ * Generated by gdbus-codegen 2.34.0. DO NOT EDIT.
*
* The license of this code is the same as for the source it was derived from.
*/
diff --git a/src/dbus-consolekit-manager.c b/src/dbus-consolekit-manager.c
index d934d2e..0f57648 100644
--- a/src/dbus-consolekit-manager.c
+++ b/src/dbus-consolekit-manager.c
@@ -1,5 +1,5 @@
/*
- * Generated by gdbus-codegen 2.33.12. DO NOT EDIT.
+ * Generated by gdbus-codegen 2.34.0. DO NOT EDIT.
*
* The license of this code is the same as for the source it was derived from.
*/
diff --git a/src/dbus-consolekit-manager.h b/src/dbus-consolekit-manager.h
index 9cac7b3..59d3e61 100644
--- a/src/dbus-consolekit-manager.h
+++ b/src/dbus-consolekit-manager.h
@@ -1,5 +1,5 @@
/*
- * Generated by gdbus-codegen 2.33.12. DO NOT EDIT.
+ * Generated by gdbus-codegen 2.34.0. DO NOT EDIT.
*
* The license of this code is the same as for the source it was derived from.
*/
diff --git a/src/dbus-consolekit-seat.c b/src/dbus-consolekit-seat.c
index 8bb8d0e..651eb06 100644
--- a/src/dbus-consolekit-seat.c
+++ b/src/dbus-consolekit-seat.c
@@ -1,5 +1,5 @@
/*
- * Generated by gdbus-codegen 2.33.12. DO NOT EDIT.
+ * Generated by gdbus-codegen 2.34.0. DO NOT EDIT.
*
* The license of this code is the same as for the source it was derived from.
*/
diff --git a/src/dbus-consolekit-seat.h b/src/dbus-consolekit-seat.h
index 787d0ce..2f153ed 100644
--- a/src/dbus-consolekit-seat.h
+++ b/src/dbus-consolekit-seat.h
@@ -1,5 +1,5 @@
/*
- * Generated by gdbus-codegen 2.33.12. DO NOT EDIT.
+ * Generated by gdbus-codegen 2.34.0. DO NOT EDIT.
*
* The license of this code is the same as for the source it was derived from.
*/
diff --git a/src/dbus-consolekit-session.c b/src/dbus-consolekit-session.c
index 85ed255..c3c6642 100644
--- a/src/dbus-consolekit-session.c
+++ b/src/dbus-consolekit-session.c
@@ -1,5 +1,5 @@
/*
- * Generated by gdbus-codegen 2.33.12. DO NOT EDIT.
+ * Generated by gdbus-codegen 2.34.0. DO NOT EDIT.
*
* The license of this code is the same as for the source it was derived from.
*/
diff --git a/src/dbus-consolekit-session.h b/src/dbus-consolekit-session.h
index 68cb565..0c1cb93 100644
--- a/src/dbus-consolekit-session.h
+++ b/src/dbus-consolekit-session.h
@@ -1,5 +1,5 @@
/*
- * Generated by gdbus-codegen 2.33.12. DO NOT EDIT.
+ * Generated by gdbus-codegen 2.34.0. DO NOT EDIT.
*
* The license of this code is the same as for the source it was derived from.
*/
diff --git a/src/dbus-display-manager.c b/src/dbus-display-manager.c
index ed08688..b810349 100644
--- a/src/dbus-display-manager.c
+++ b/src/dbus-display-manager.c
@@ -1,5 +1,5 @@
/*
- * Generated by gdbus-codegen 2.33.12. DO NOT EDIT.
+ * Generated by gdbus-codegen 2.34.0. DO NOT EDIT.
*
* The license of this code is the same as for the source it was derived from.
*/
diff --git a/src/dbus-display-manager.h b/src/dbus-display-manager.h
index 8a8177b..2528e7b 100644
--- a/src/dbus-display-manager.h
+++ b/src/dbus-display-manager.h
@@ -1,5 +1,5 @@
/*
- * Generated by gdbus-codegen 2.33.12. DO NOT EDIT.
+ * Generated by gdbus-codegen 2.34.0. DO NOT EDIT.
*
* The license of this code is the same as for the source it was derived from.
*/
diff --git a/src/dbus-upower.c b/src/dbus-upower.c
index af91304..32f8fa0 100644
--- a/src/dbus-upower.c
+++ b/src/dbus-upower.c
@@ -1,5 +1,5 @@
/*
- * Generated by gdbus-codegen 2.33.12. DO NOT EDIT.
+ * Generated by gdbus-codegen 2.34.0. DO NOT EDIT.
*
* The license of this code is the same as for the source it was derived from.
*/
diff --git a/src/dbus-upower.h b/src/dbus-upower.h
index 7360447..8da838b 100644
--- a/src/dbus-upower.h
+++ b/src/dbus-upower.h
@@ -1,5 +1,5 @@
/*
- * Generated by gdbus-codegen 2.33.12. DO NOT EDIT.
+ * Generated by gdbus-codegen 2.34.0. DO NOT EDIT.
*
* The license of this code is the same as for the source it was derived from.
*/
diff --git a/src/dbus-user.c b/src/dbus-user.c
index 785abcc..38de6e7 100644
--- a/src/dbus-user.c
+++ b/src/dbus-user.c
@@ -1,5 +1,5 @@
/*
- * Generated by gdbus-codegen 2.33.12. DO NOT EDIT.
+ * Generated by gdbus-codegen 2.34.0. DO NOT EDIT.
*
* The license of this code is the same as for the source it was derived from.
*/
diff --git a/src/dbus-user.h b/src/dbus-user.h
index 48fa3a5..e7cc313 100644
--- a/src/dbus-user.h
+++ b/src/dbus-user.h
@@ -1,5 +1,5 @@
/*
- * Generated by gdbus-codegen 2.33.12. DO NOT EDIT.
+ * Generated by gdbus-codegen 2.34.0. DO NOT EDIT.
*
* The license of this code is the same as for the source it was derived from.
*/
diff --git a/src/indicator-session.c b/src/indicator-session.c
index 06a5a7b..c100d78 100644
--- a/src/indicator-session.c
+++ b/src/indicator-session.c
@@ -80,10 +80,6 @@ static gboolean new_user_item (DbusmenuMenuitem * newitem,
DbusmenuMenuitem * parent,
DbusmenuClient * client,
gpointer user_data);
-static gboolean build_restart_item (DbusmenuMenuitem * newitem,
- DbusmenuMenuitem * parent,
- DbusmenuClient * client,
- gpointer user_data);
static void on_menu_layout_updated (DbusmenuClient * client, IndicatorSession * session);
static void indicator_session_update_icon_callback (GtkWidget * widget, gpointer callback_data);
static void indicator_session_update_icon_and_a11y (IndicatorSession * self);
@@ -168,9 +164,6 @@ indicator_session_init (IndicatorSession *self)
dbusmenu_client_add_type_handler (self->menu_client,
USER_ITEM_TYPE,
new_user_item);
- dbusmenu_client_add_type_handler (self->menu_client,
- RESTART_ITEM_TYPE,
- build_restart_item);
dbusmenu_gtkclient_set_accel_group (DBUSMENU_GTKCLIENT(self->menu_client),
gtk_accel_group_new());
}
@@ -316,7 +309,6 @@ new_user_item (DbusmenuMenuitem * newitem,
return TRUE;
}
-
static void
user_real_name_get_cb (GObject * obj, GAsyncResult * res, gpointer user_data)
{
@@ -357,64 +349,6 @@ receive_signal (GDBusProxy * proxy,
}
}
-
-
-
-static void
-restart_property_change (DbusmenuMenuitem * item,
- const gchar * property,
- GVariant * variant,
- gpointer user_data)
-{
- DbusmenuGtkClient * client = DBUSMENU_GTKCLIENT(user_data);
- GtkMenuItem * gmi = dbusmenu_gtkclient_menuitem_get(client, item);
-
- if (g_strcmp0(property, RESTART_ITEM_LABEL) == 0) {
- gtk_menu_item_set_label(gmi, g_variant_get_string(variant, NULL));
- } else if (g_strcmp0(property, RESTART_ITEM_ICON) == 0) {
- GtkWidget * image = gtk_image_menu_item_get_image(GTK_IMAGE_MENU_ITEM(gmi));
-
- GIcon * gicon = g_themed_icon_new_with_default_fallbacks(g_variant_get_string(variant, NULL));
- if (image == NULL) {
- image = gtk_image_new_from_gicon(gicon, GTK_ICON_SIZE_MENU);
- gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(gmi), image);
- } else {
- gtk_image_set_from_gicon(GTK_IMAGE(image), gicon, GTK_ICON_SIZE_MENU);
- }
- g_object_unref(G_OBJECT(gicon));
- }
- return;
-}
-
-static gboolean
-build_restart_item (DbusmenuMenuitem * newitem,
- DbusmenuMenuitem * parent,
- DbusmenuClient * client,
- gpointer user_data)
-{
- GtkMenuItem * gmi = GTK_MENU_ITEM(gtk_image_menu_item_new());
- if (gmi == NULL) {
- return FALSE;
- }
-
- dbusmenu_gtkclient_newitem_base(DBUSMENU_GTKCLIENT(client), newitem, gmi, parent);
-
- g_signal_connect(G_OBJECT(newitem), DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED, G_CALLBACK(restart_property_change), client);
-
- GVariant * variant;
- variant = dbusmenu_menuitem_property_get_variant(newitem, RESTART_ITEM_LABEL);
- if (variant != NULL) {
- restart_property_change(newitem, RESTART_ITEM_LABEL, variant, client);
- }
-
- variant = dbusmenu_menuitem_property_get_variant(newitem, RESTART_ITEM_ICON);
- if (variant != NULL) {
- restart_property_change(newitem, RESTART_ITEM_ICON, variant, client);
- }
-
- return TRUE;
-}
-
static void
indicator_session_update_users_label (IndicatorSession * self,
const gchar * name)
diff --git a/src/session-menu-mgr.c b/src/session-menu-mgr.c
index f6cd038..f5b5bcf 100644
--- a/src/session-menu-mgr.c
+++ b/src/session-menu-mgr.c
@@ -318,7 +318,6 @@ init_upower_proxy (SessionMenuMgr * mgr)
g_clear_error (&error);
}
- on_upower_properties_changed (mgr);
g_signal_connect_swapped (mgr->upower_proxy, "changed",
G_CALLBACK(on_upower_properties_changed), mgr);
}
@@ -491,8 +490,7 @@ update_confirmation_labels (SessionMenuMgr * mgr)
mi_set_label (mgr->shutdown_mi, confirm_needed ? _("Shut Down\342\200\246")
: _("Shut Down"));
- dbusmenu_menuitem_property_set (mgr->restart_mi, RESTART_ITEM_LABEL,
- confirm_needed ? _("Restart\342\200\246")
+ mi_set_label (mgr->restart_mi, confirm_needed ? _("Restart\342\200\246")
: _("Restart"));
}
@@ -516,9 +514,7 @@ build_session_menuitems (SessionMenuMgr* mgr)
g_signal_connect_swapped (mi, DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
G_CALLBACK(action_func_hibernate), mgr);
- mi = mgr->restart_mi = dbusmenu_menuitem_new ();
- mi_set_type (mi, RESTART_ITEM_TYPE);
- dbusmenu_menuitem_property_set (mi, RESTART_ITEM_LABEL, _("Restart\342\200\246"));
+ mi = mgr->restart_mi = mi_new (_("Restart\342\200\246"));
dbusmenu_menuitem_child_append (mgr->top_mi, mi);
g_signal_connect_swapped (mi, DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
G_CALLBACK(action_func_spawn_async), CMD_RESTART);
@@ -1193,6 +1189,11 @@ session_menu_mgr_new (SessionDbus * session_dbus,
mgr->user_menuitem_index = n;
update_user_menuitems (mgr);
build_session_menuitems (mgr);
+
+ /* After we have the session menu items built we can look to
+ align them with UPower */
+ on_upower_properties_changed (mgr);
+
return mgr;
}
diff --git a/src/shared-names.h b/src/shared-names.h
index e82aef8..900fbbe 100644
--- a/src/shared-names.h
+++ b/src/shared-names.h
@@ -36,10 +36,6 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#define USER_ITEM_PROP_ICON "user-item-icon-path"
#define USER_ITEM_ICON_DEFAULT "avatar-default"
-#define RESTART_ITEM_TYPE "x-canonical-restart-item"
-#define RESTART_ITEM_LABEL "restart-label"
-#define RESTART_ITEM_ICON "restart-icon"
-
#define ICON_DEFAULT "system-devices-panel"
#define ICON_INFO "system-devices-panel-information"
#define ICON_ALERT "system-devices-panel-alert"