diff options
author | Conor Curran <conor.curran@canonical.com> | 2011-08-10 18:08:46 +0100 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2011-08-10 18:08:46 +0100 |
commit | 830677b9602f9d066c5635ededccb3ae7303f982 (patch) | |
tree | 83a84d44d49fc349125854c2a95164eada276864 /src/session-service.c | |
parent | 4e3a03e474e364747cbe484a9614112ccd46b600 (diff) | |
parent | c09a09f1ad35f5a6ac1333f99cdcbf5369b97691 (diff) | |
download | ayatana-indicator-session-830677b9602f9d066c5635ededccb3ae7303f982.tar.gz ayatana-indicator-session-830677b9602f9d066c5635ededccb3ae7303f982.tar.bz2 ayatana-indicator-session-830677b9602f9d066c5635ededccb3ae7303f982.zip |
add the new greeter mode
Diffstat (limited to 'src/session-service.c')
-rw-r--r-- | src/session-service.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/session-service.c b/src/session-service.c index bb473e9..fa212fd 100644 --- a/src/session-service.c +++ b/src/session-service.c @@ -78,11 +78,21 @@ service_shutdown (IndicatorService * service, gpointer user_data) return; } +static gboolean +get_greeter_mode (void) +{ + const gchar *var; + var = g_getenv("INDICATOR_GREETER_MODE"); + return (g_strcmp0(var, "1") == 0); +} + /* Main, is well, main. It brings everything up and throws us into the mainloop of no return. */ int main (int argc, char ** argv) { + gboolean greeter_mode; + g_type_init(); /* Setting up i18n and gettext. Apparently, we need @@ -99,15 +109,19 @@ main (int argc, char ** argv) session_dbus = session_dbus_new(); + greeter_mode = get_greeter_mode(); + // Devices - DeviceMenuMgr* device_mgr = device_menu_mgr_new (session_dbus); + DeviceMenuMgr* device_mgr = device_menu_mgr_new (session_dbus, greeter_mode); DbusmenuServer * server = dbusmenu_server_new(INDICATOR_SESSION_DBUS_OBJECT); dbusmenu_server_set_root(server, device_mgr_get_root_item (device_mgr)); - // Users - UserMenuMgr* user_mgr = user_menu_mgr_new (session_dbus); - DbusmenuServer* users_server = dbusmenu_server_new (INDICATOR_USERS_DBUS_OBJECT); - dbusmenu_server_set_root (users_server, user_mgr_get_root_item (user_mgr)); + if (!greeter_mode) { + // Users + UserMenuMgr* user_mgr = user_menu_mgr_new (session_dbus); + DbusmenuServer* users_server = dbusmenu_server_new (INDICATOR_USERS_DBUS_OBJECT); + dbusmenu_server_set_root (users_server, user_mgr_get_root_item (user_mgr)); + } mainloop = g_main_loop_new(NULL, FALSE); g_main_loop_run(mainloop); |