aboutsummaryrefslogtreecommitdiff
path: root/src/device-menu-mgr.c
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-08-31 15:51:16 +0100
committerConor Curran <conor.curran@canonical.com>2011-08-31 15:51:16 +0100
commitc7a50eedd6e9878547b73e8cf952f75f544cb5d2 (patch)
treefefd1cb1e1ef113113703c37afeb38d1f29fe926 /src/device-menu-mgr.c
parent55a161683098d17364d9f521d2f4b97f89298297 (diff)
downloadayatana-indicator-session-c7a50eedd6e9878547b73e8cf952f75f544cb5d2.tar.gz
ayatana-indicator-session-c7a50eedd6e9878547b73e8cf952f75f544cb5d2.tar.bz2
ayatana-indicator-session-c7a50eedd6e9878547b73e8cf952f75f544cb5d2.zip
make sure to bring up logout dialog from apt menuitem when restart is required
Diffstat (limited to 'src/device-menu-mgr.c')
-rw-r--r--src/device-menu-mgr.c59
1 files changed, 0 insertions, 59 deletions
diff --git a/src/device-menu-mgr.c b/src/device-menu-mgr.c
index 523ea8d..5a63be3 100644
--- a/src/device-menu-mgr.c
+++ b/src/device-menu-mgr.c
@@ -61,7 +61,6 @@ static DBusGProxyCall * hibernate_call = NULL;
static DbusmenuMenuitem * hibernate_mi = NULL;
static DbusmenuMenuitem * suspend_mi = NULL;
static DbusmenuMenuitem * logout_mi = NULL;
-static DbusmenuMenuitem * restart_mi = NULL;
static DbusmenuMenuitem * shutdown_mi = NULL;
static gboolean can_hibernate = TRUE;
@@ -73,7 +72,6 @@ static DBusGProxy * up_main_proxy = NULL;
static DBusGProxy * up_prop_proxy = NULL;
static void device_menu_mgr_ensure_settings_client (DeviceMenuMgr* self);
-static void setup_restart_watch (DeviceMenuMgr* self);
static void setup_up (DeviceMenuMgr* self);
static void device_menu_mgr_rebuild_items (DeviceMenuMgr *self);
static void lock_if_possible (DeviceMenuMgr* self);
@@ -106,7 +104,6 @@ device_menu_mgr_init (DeviceMenuMgr *self)
{
self->apt_watcher = NULL;
self->root_item = dbusmenu_menuitem_new ();
- setup_restart_watch(self);
setup_up(self);
g_idle_add(lock_screen_setup, NULL);
}
@@ -751,62 +748,6 @@ device_menu_mgr_rebuild_items (DeviceMenuMgr* self)
can_suspend && allow_suspend);
}
-/* When the directory changes we need to figure out how our menu
- item should look. */
-static void
-restart_dir_changed (gpointer userdata)
-{
- DeviceMenuMgr* self = DEVICE_MENU_MGR (userdata);
- gboolean restart_required = g_file_test("/var/run/reboot-required", G_FILE_TEST_EXISTS);
-
- if (restart_required) {
- if (supress_confirmations()) {
- dbusmenu_menuitem_property_set (restart_mi,
- RESTART_ITEM_LABEL,
- _("Restart to Complete Update"));
- } else {
- dbusmenu_menuitem_property_set (restart_mi,
- RESTART_ITEM_LABEL,
- _("Restart to Complete Update\342\200\246"));
- }
- dbusmenu_menuitem_property_set (restart_mi,
- RESTART_ITEM_ICON,
- "system-restart-panel");
- if (self->session_dbus_interface != NULL) {
- session_dbus_set_name (self->session_dbus_interface, ICON_RESTART);
- }
- } else {
- if (supress_confirmations()) {
- dbusmenu_menuitem_property_set(restart_mi, RESTART_ITEM_LABEL, _("Restart"));
- } else {
- dbusmenu_menuitem_property_set(restart_mi, RESTART_ITEM_LABEL, _("Restart\342\200\246"));
- }
- dbusmenu_menuitem_property_remove(restart_mi, RESTART_ITEM_ICON);
- if (self->session_dbus_interface != NULL) {
- session_dbus_set_name(self->session_dbus_interface, ICON_DEFAULT);
- }
- }
- return;
-}
-
-/* Buids a file watcher for the directory so that when it
- changes we can check to see if our reboot-required is
- there. */
-static void
-setup_restart_watch (DeviceMenuMgr* self)
-{
- GFile * filedir = g_file_new_for_path("/var/run");
- GFileMonitor * filemon = g_file_monitor_directory(filedir, G_FILE_MONITOR_NONE, NULL, NULL);
- if (filemon != NULL) {
- g_signal_connect (G_OBJECT(filemon),
- "changed",
- G_CALLBACK(restart_dir_changed),
- self);
- }
- restart_dir_changed(self);
- return;
-}
-
/* Ensures that we have a GConf client and if we build one
set up the signal handler. */
static void