aboutsummaryrefslogtreecommitdiff
path: root/src/sound-service.c
diff options
context:
space:
mode:
authorMichael Terry <michael.terry@canonical.com>2011-08-03 13:05:34 -0400
committerMichael Terry <michael.terry@canonical.com>2011-08-03 13:05:34 -0400
commita71045671c8681c900847af89afdf0f8b17c7189 (patch)
tree756a5df404771cbc0dbae3eca8ae7a18a0c7b7d0 /src/sound-service.c
parentc60b7f972eb8faa1b06366dfebdb4a220d565f1e (diff)
downloadayatana-indicator-sound-a71045671c8681c900847af89afdf0f8b17c7189.tar.gz
ayatana-indicator-sound-a71045671c8681c900847af89afdf0f8b17c7189.tar.bz2
ayatana-indicator-sound-a71045671c8681c900847af89afdf0f8b17c7189.zip
don't show player bridge and settings links when used in a greeter
Diffstat (limited to 'src/sound-service.c')
-rw-r--r--src/sound-service.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/sound-service.c b/src/sound-service.c
index 1324537..a368081 100644
--- a/src/sound-service.c
+++ b/src/sound-service.c
@@ -47,12 +47,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:
**/
int
main (int argc, char ** argv)
{
+ gboolean greeter_mode;
g_type_init();
textdomain (GETTEXT_PACKAGE);
@@ -67,9 +76,13 @@ main (int argc, char ** argv)
SoundServiceDbus* sound_service = g_object_new(SOUND_SERVICE_DBUS_TYPE, NULL);
- DbusmenuMenuitem* root_menuitem = sound_service_dbus_create_root_item(sound_service);
- MusicPlayerBridge* server = music_player_bridge_new();
- music_player_bridge_set_root_menu_item(server, root_menuitem);
+ greeter_mode = get_greeter_mode();
+
+ DbusmenuMenuitem* root_menuitem = sound_service_dbus_create_root_item(sound_service, greeter_mode);
+ if (!greeter_mode) {
+ MusicPlayerBridge* server = music_player_bridge_new();
+ music_player_bridge_set_root_menu_item(server, root_menuitem);
+ }
// Run the loop
mainloop = g_main_loop_new(NULL, FALSE);