diff options
Diffstat (limited to 'src/sound-service-dbus.c')
-rw-r--r-- | src/sound-service-dbus.c | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/src/sound-service-dbus.c b/src/sound-service-dbus.c index 9950302..b69f081 100644 --- a/src/sound-service-dbus.c +++ b/src/sound-service-dbus.c @@ -57,6 +57,7 @@ struct _SoundServiceDbusPrivate { GDBusConnection* connection; DbusmenuMenuitem* root_menuitem; Device* device; + gboolean greeter_mode; }; enum { @@ -169,9 +170,10 @@ sound_service_dbus_init (SoundServiceDbus *self) } DbusmenuMenuitem* -sound_service_dbus_create_root_item (SoundServiceDbus* self) +sound_service_dbus_create_root_item (SoundServiceDbus* self, gboolean greeter_mode) { SoundServiceDbusPrivate * priv = SOUND_SERVICE_DBUS_GET_PRIVATE(self); + priv->greeter_mode = greeter_mode; priv->root_menuitem = dbusmenu_menuitem_new(); DbusmenuServer *server = dbusmenu_server_new (INDICATOR_SOUND_MENU_DBUS_OBJECT_PATH); dbusmenu_server_set_root (server, priv->root_menuitem); @@ -193,25 +195,27 @@ sound_service_dbus_build_sound_menu ( SoundServiceDbus* self, dbusmenu_menuitem_child_add_position (priv->root_menuitem, slider_item, 1); dbusmenu_menuitem_child_add_position (priv->root_menuitem, voip_input_menu_item, 2); - // Separator - DbusmenuMenuitem* separator = dbusmenu_menuitem_new(); - - dbusmenu_menuitem_property_set (separator, - DBUSMENU_MENUITEM_PROP_TYPE, - DBUSMENU_CLIENT_TYPES_SEPARATOR); - dbusmenu_menuitem_child_add_position (priv->root_menuitem, separator, 3); - g_object_unref (separator); - - // Sound preferences dialog - DbusmenuMenuitem* settings_mi = dbusmenu_menuitem_new(); - - dbusmenu_menuitem_property_set( settings_mi, - DBUSMENU_MENUITEM_PROP_LABEL, - _("Sound Preferences...")); - dbusmenu_menuitem_child_append(priv->root_menuitem, settings_mi); - g_object_unref (settings_mi); - g_signal_connect(G_OBJECT(settings_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, - G_CALLBACK(show_sound_settings_dialog), NULL); + if (!priv->greeter_mode) { + // Separator + DbusmenuMenuitem* separator = dbusmenu_menuitem_new(); + + dbusmenu_menuitem_property_set (separator, + DBUSMENU_MENUITEM_PROP_TYPE, + DBUSMENU_CLIENT_TYPES_SEPARATOR); + dbusmenu_menuitem_child_add_position (priv->root_menuitem, separator, 3); + g_object_unref (separator); + + // Sound preferences dialog + DbusmenuMenuitem* settings_mi = dbusmenu_menuitem_new(); + + dbusmenu_menuitem_property_set( settings_mi, + DBUSMENU_MENUITEM_PROP_LABEL, + _("Sound Settings...")); + dbusmenu_menuitem_child_append(priv->root_menuitem, settings_mi); + g_object_unref (settings_mi); + g_signal_connect(G_OBJECT(settings_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, + G_CALLBACK(show_sound_settings_dialog), NULL); + } } /** |