~ubuntu-branches/ubuntu/oneiric/indicator-session/oneiric-proposed

« back to all changes in this revision

Viewing changes to src/device-menu-mgr.c

  • Committer: Package Import Robot
  • Author(s): Ken VanDine, Ken VanDine, Ted Gould
  • Date: 2011-09-01 13:53:50 UTC
  • mfrom: (1.1.37 upstream)
  • Revision ID: package-import@ubuntu.com-20110901135350-sl5g84ls1z0r7kwc
Tags: 0.3.4.1-0ubuntu1
[Ken VanDine]
* New upstream release.
  - in a Guest session user menu is not visible (LP: #834948)
  - User name shown as [Invalid UTF-8] in live session (LP: #837246)
  - "Reboot Required" menu opens Update Manager, doesn't reboot (LP: #837658)
  - indicator-session-service crashed with SIGSEGV in 
    g_str_hash() (LP: #824243)
  - indicator-session-service crashed with SIGSEGV in 
    g_variant_unref() (LP: #833965)
* +debian/patches/revert_icon_change.patch
  - revert the icon change in greeter mode until a UIF exception is 
    approved
* +debian/source/format

[Ted Gould]
* debian/control: Adding a depend on gnome-settings-daemon to ensure that
  the required schemas are available.  (LP: #833965)

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
static DbusmenuMenuitem * hibernate_mi = NULL;
62
62
static DbusmenuMenuitem * suspend_mi = NULL;
63
63
static DbusmenuMenuitem * logout_mi = NULL;
64
 
static DbusmenuMenuitem * restart_mi = NULL;
65
64
static DbusmenuMenuitem * shutdown_mi = NULL;
66
65
 
67
66
static gboolean can_hibernate = TRUE;
73
72
static DBusGProxy * up_prop_proxy = NULL;
74
73
 
75
74
static void device_menu_mgr_ensure_settings_client (DeviceMenuMgr* self);
76
 
static void setup_restart_watch (DeviceMenuMgr* self);
77
75
static void setup_up (DeviceMenuMgr* self);
78
76
static void device_menu_mgr_rebuild_items (DeviceMenuMgr *self);
79
77
static void lock_if_possible (DeviceMenuMgr* self);
106
104
{
107
105
  self->apt_watcher = NULL;
108
106
  self->root_item = dbusmenu_menuitem_new ();  
109
 
  setup_restart_watch(self);
110
107
        setup_up(self);  
111
108
        g_idle_add(lock_screen_setup, NULL);  
112
109
}
751
748
                                       can_suspend && allow_suspend);
752
749
}                                       
753
750
 
754
 
/* When the directory changes we need to figure out how our menu
755
 
   item should look. */
756
 
static void
757
 
restart_dir_changed (gpointer userdata)
758
 
{
759
 
  DeviceMenuMgr* self = DEVICE_MENU_MGR (userdata);
760
 
        gboolean restart_required = g_file_test("/var/run/reboot-required", G_FILE_TEST_EXISTS);
761
 
 
762
 
        if (restart_required) {
763
 
                if (supress_confirmations()) {
764
 
                        dbusmenu_menuitem_property_set (restart_mi,
765
 
                                      RESTART_ITEM_LABEL,
766
 
                                      _("Restart to Complete Update"));
767
 
                } else {
768
 
                        dbusmenu_menuitem_property_set (restart_mi,
769
 
                                      RESTART_ITEM_LABEL,
770
 
                                      _("Restart to Complete Update\342\200\246"));
771
 
                }
772
 
                dbusmenu_menuitem_property_set (restart_mi,
773
 
                                    RESTART_ITEM_ICON,
774
 
                                    "system-restart-panel");
775
 
                if (self->session_dbus_interface != NULL) {
776
 
                        session_dbus_set_name (self->session_dbus_interface, ICON_RESTART);
777
 
                }
778
 
        } else {        
779
 
                if (supress_confirmations()) {
780
 
                        dbusmenu_menuitem_property_set(restart_mi, RESTART_ITEM_LABEL, _("Restart"));
781
 
                } else {
782
 
                        dbusmenu_menuitem_property_set(restart_mi, RESTART_ITEM_LABEL, _("Restart\342\200\246"));
783
 
                }
784
 
                dbusmenu_menuitem_property_remove(restart_mi, RESTART_ITEM_ICON);
785
 
                if (self->session_dbus_interface != NULL) {
786
 
                        session_dbus_set_name(self->session_dbus_interface, ICON_DEFAULT);
787
 
                }
788
 
        }
789
 
        return;
790
 
}
791
 
 
792
 
/* Buids a file watcher for the directory so that when it
793
 
   changes we can check to see if our reboot-required is
794
 
   there. */
795
 
static void
796
 
setup_restart_watch (DeviceMenuMgr* self)
797
 
{
798
 
        GFile * filedir = g_file_new_for_path("/var/run");
799
 
        GFileMonitor * filemon = g_file_monitor_directory(filedir, G_FILE_MONITOR_NONE, NULL, NULL);
800
 
        if (filemon != NULL) {
801
 
                g_signal_connect (G_OBJECT(filemon),
802
 
                      "changed",
803
 
                      G_CALLBACK(restart_dir_changed),
804
 
                      self);
805
 
        }
806
 
        restart_dir_changed(self);
807
 
        return;
808
 
}
809
 
 
810
751
/* Ensures that we have a GConf client and if we build one
811
752
   set up the signal handler. */
812
753
static void