From a335b8e973287fa5cf60286bb6fd8f46fb66ad83 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Fri, 2 Sep 2011 12:11:13 +0100 Subject: make sure to flag restart state in greeter mode also with the right icon --- src/dbus-shared-names.h | 2 ++ src/indicator-session.c | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/dbus-shared-names.h b/src/dbus-shared-names.h index 350fa6d..11aebca 100644 --- a/src/dbus-shared-names.h +++ b/src/dbus-shared-names.h @@ -64,5 +64,7 @@ typedef enum { #define ICON_DEFAULT "system-devices-panel" #define ICON_RESTART "system-devices-panel-alert" #define GREETER_ICON_DEFAULT "system-shutdown-panel" +#define GREETER_ICON_RESTART "system-shutdown-panel-restart" + #endif /* __DBUS_SHARED_NAMES_H__ */ diff --git a/src/indicator-session.c b/src/indicator-session.c index 2b36fdd..7a8a238 100644 --- a/src/indicator-session.c +++ b/src/indicator-session.c @@ -70,6 +70,8 @@ struct _IndicatorSession { GDBusProxy * service_proxy; }; +static gboolean greeter_mode; + GType indicator_session_get_type (void); /* Indicator stuff */ @@ -166,11 +168,11 @@ indicator_session_init (IndicatorSession *self) const gchar *greeter_var; greeter_var = g_getenv("INDICATOR_GREETER_MODE"); - + greeter_mode = g_strcmp0(greeter_var, "1") == 0; // devices self->devices.menu = GTK_MENU (dbusmenu_gtkmenu_new(INDICATOR_SESSION_DBUS_NAME, INDICATOR_SESSION_DBUS_OBJECT)); - if (g_strcmp0(greeter_var, "1") == 0){ + if (greeter_mode){ self->devices.image = indicator_image_helper (GREETER_ICON_DEFAULT); } else{ @@ -507,7 +509,12 @@ receive_signal (GDBusProxy * proxy, } } else if (g_strcmp0(signal_name, "RestartRequired") == 0) { - self->devices.image = indicator_image_helper (ICON_RESTART); + if (greeter_mode == TRUE){ + self->devices.image = indicator_image_helper (GREETER_ICON_RESTART); + } + else{ + self->devices.image = indicator_image_helper (ICON_RESTART); + } } } -- cgit v1.2.3 From 12f76de565f5af5d9d946d4ebc43b195c34bbea2 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 6 Sep 2011 16:01:58 +0100 Subject: added new field to gsettings to allow to hide the user menu --- src/user-menu-mgr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/user-menu-mgr.c b/src/user-menu-mgr.c index a4308dd..98f6c8a 100644 --- a/src/user-menu-mgr.c +++ b/src/user-menu-mgr.c @@ -64,7 +64,7 @@ static void user_change (UsersServiceDbus *service, gpointer user_data); static void ensure_settings_client (); -static gboolean check_guest_session (void); +static gboolean is_this_guest_session (void); static void activate_guest_session (DbusmenuMenuitem * mi, guint timestamp, gpointer user_data); @@ -148,7 +148,7 @@ user_menu_mgr_rebuild_items (UserMenuMgr *self, gboolean greeter_mode) self->users_dbus_interface); } - if (check_guest_session ()) + if (is_this_guest_session ()) { guest_mi = dbusmenu_menuitem_new (); dbusmenu_menuitem_property_set (guest_mi, @@ -415,7 +415,7 @@ user_mgr_get_root_item (UserMenuMgr* self) /* Checks to see if we should show the guest suession item */ static gboolean -check_guest_session (void) +is_this_guest_session (void) { if (geteuid() < 500) { /* System users shouldn't have guest account shown. Mostly -- cgit v1.2.3 From cf5f3639b23ba4e2bd12fd4b987e67f7a3b3b1d4 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 6 Sep 2011 16:52:08 +0100 Subject: live cd user should now be turned off via new gsettings entry by casper --- src/settings-helper.c | 6 ++++++ src/settings-helper.h | 3 +++ src/user-menu-mgr.c | 20 ++++++++++---------- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/settings-helper.c b/src/settings-helper.c index 5a69d17..d70df95 100644 --- a/src/settings-helper.c +++ b/src/settings-helper.c @@ -52,6 +52,12 @@ supress_confirmations (void) { return g_settings_get_boolean (settings, SUPPRESS_KEY) ; } +gboolean +should_show_user_menu (void) { + build_settings(); + return g_settings_get_boolean (settings, SHOW_USER_MENU) ; +} + gboolean show_logout (void) { build_settings(); diff --git a/src/settings-helper.h b/src/settings-helper.h index 7b377ca..f17f8ea 100644 --- a/src/settings-helper.h +++ b/src/settings-helper.h @@ -36,6 +36,7 @@ with this program. If not, see . #define LOGOUT_KEY "suppress-logout-menuitem" #define RESTART_KEY "suppress-restart-menuitem" #define SHUTDOWN_KEY "suppress-shutdown-menuitem" +#define SHOW_USER_MENU "show-user-menu" #define LOCKDOWN_SCHEMA "org.gnome.desktop.lockdown" #define LOCKDOWN_KEY_USER "disable-user-switching" @@ -56,5 +57,7 @@ gboolean supress_confirmations (void); gboolean show_logout (void); gboolean show_restart (void); gboolean show_shutdown (void); +gboolean should_show_user_menu (void); + #endif /* __GCONF_HELPER__ */ diff --git a/src/user-menu-mgr.c b/src/user-menu-mgr.c index 98f6c8a..16c6e3b 100644 --- a/src/user-menu-mgr.c +++ b/src/user-menu-mgr.c @@ -18,7 +18,6 @@ with this program. If not, see . */ #include - #include "user-menu-mgr.h" #include "settings-helper.h" #include "dbus-shared-names.h" @@ -54,22 +53,19 @@ static void activate_online_accounts (DbusmenuMenuitem *mi, gpointer user_data); static void activate_user_accounts (DbusmenuMenuitem *mi, guint timestamp, - gpointer user_data); - + gpointer user_data); static void user_menu_mgr_rebuild_items (UserMenuMgr *self, gboolean greeter_mode); static gboolean check_new_session (); static void user_change (UsersServiceDbus *service, const gchar *user_id, gpointer user_data); - static void ensure_settings_client (); static gboolean is_this_guest_session (void); static void activate_guest_session (DbusmenuMenuitem * mi, guint timestamp, gpointer user_data); - G_DEFINE_TYPE (UserMenuMgr, user_menu_mgr, G_TYPE_OBJECT); @@ -177,14 +173,18 @@ user_menu_mgr_rebuild_items (UserMenuMgr *self, gboolean greeter_mode) users = users_service_dbus_get_user_list (self->users_dbus_interface); self->user_count = g_list_length(users); - gboolean user_menu_is_visible = FALSE; + gboolean user_menu_is_visible = should_show_user_menu(); - if (!greeter_mode){ - user_menu_is_visible = TRUE; + if (user_menu_is_visible == FALSE || greeter_mode == TRUE){ + session_dbus_set_user_menu_visibility (self->session_dbus_interface, + FALSE); + } + else{ + // This needs to be updated once the ability to query guest session support is available + session_dbus_set_user_menu_visibility (self->session_dbus_interface, + user_menu_is_visible); } - session_dbus_set_user_menu_visibility (self->session_dbus_interface, - user_menu_is_visible); if (self->user_count > MINIMUM_USERS && self->user_count < MAXIMUM_USERS) { users = g_list_sort (users, (GCompareFunc)compare_users_by_username); -- cgit v1.2.3 From b23c52315a5a5ccb875926a6c567baa9074e8338 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 6 Sep 2011 17:36:25 +0100 Subject: change the actual key on the entry --- src/settings-helper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/settings-helper.h b/src/settings-helper.h index f17f8ea..ae57575 100644 --- a/src/settings-helper.h +++ b/src/settings-helper.h @@ -36,7 +36,7 @@ with this program. If not, see . #define LOGOUT_KEY "suppress-logout-menuitem" #define RESTART_KEY "suppress-restart-menuitem" #define SHUTDOWN_KEY "suppress-shutdown-menuitem" -#define SHOW_USER_MENU "show-user-menu" +#define SHOW_USER_MENU "user-show-menu" #define LOCKDOWN_SCHEMA "org.gnome.desktop.lockdown" #define LOCKDOWN_KEY_USER "disable-user-switching" -- cgit v1.2.3 From f05ddfcd0b93b64e01efcae411b9313e22ab37f0 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 6 Sep 2011 18:07:05 +0100 Subject: updated the schema entry with the correct key --- data/com.canonical.indicator.session.gschema.xml.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/data/com.canonical.indicator.session.gschema.xml.in b/data/com.canonical.indicator.session.gschema.xml.in index d1d7d4c..5383221 100644 --- a/data/com.canonical.indicator.session.gschema.xml.in +++ b/data/com.canonical.indicator.session.gschema.xml.in @@ -20,5 +20,11 @@ <_summary>Remove the shutdown item from the session menu <_description>Makes it so that the shutdown button doesn’t show in the session menu. + + true + Determine the visibility of the User Menu + Allow for the user menu to be hidden by the user. + + -- cgit v1.2.3 From c6857c3028b36d35f69079e3c0e5510597997f75 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 6 Sep 2011 18:07:55 +0100 Subject: updated the schema entry with the correct key --- data/com.canonical.indicator.session.gschema.xml.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/com.canonical.indicator.session.gschema.xml.in b/data/com.canonical.indicator.session.gschema.xml.in index 5383221..e0d14c3 100644 --- a/data/com.canonical.indicator.session.gschema.xml.in +++ b/data/com.canonical.indicator.session.gschema.xml.in @@ -20,7 +20,7 @@ <_summary>Remove the shutdown item from the session menu <_description>Makes it so that the shutdown button doesn’t show in the session menu. - + true Determine the visibility of the User Menu Allow for the user menu to be hidden by the user. -- cgit v1.2.3 From 433512c195ed7faac8d834bd648f32aaff380827 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 6 Sep 2011 18:24:09 +0100 Subject: bump version for release --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 951e8a3..a89c30d 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.3.4.2) +AM_INIT_AUTOMAKE(indicator-session, 0.3.4.3) AM_MAINTAINER_MODE -- cgit v1.2.3