aboutsummaryrefslogtreecommitdiff
path: root/src/sound-service-dbus.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-dbus.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-dbus.c')
-rw-r--r--src/sound-service-dbus.c44
1 files changed, 24 insertions, 20 deletions
diff --git a/src/sound-service-dbus.c b/src/sound-service-dbus.c
index 6fb0a64..0db03d4 100644
--- a/src/sound-service-dbus.c
+++ b/src/sound-service-dbus.c
@@ -56,6 +56,7 @@ struct _SoundServiceDbusPrivate {
GDBusConnection* connection;
DbusmenuMenuitem* root_menuitem;
Device* device;
+ gboolean greeter_mode;
};
static GDBusNodeInfo * node_info = NULL;
@@ -144,9 +145,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();
//g_debug("Root ID: %d", dbusmenu_menuitem_get_id(priv->root_menuitem));
DbusmenuServer *server = dbusmenu_server_new (INDICATOR_SOUND_MENU_DBUS_OBJECT_PATH);
@@ -169,25 +171,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 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);
+ 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);
+ }
}
/**