aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-sound.c
diff options
context:
space:
mode:
authorSebastien Bacher <seb128@ubuntu.com>2010-07-08 19:31:44 +0200
committerSebastien Bacher <seb128@ubuntu.com>2010-07-08 19:31:44 +0200
commitcf5205162e421080c511428f54cb18d60cd05568 (patch)
treef096e69514b8849f40d73beb3f8cf6646a63f5b8 /src/indicator-sound.c
parentf881060f5a83bea46484083c53ee9b78f01d5d77 (diff)
parent964106d9c8c140d9c27a22aca8078dfdab57c5e9 (diff)
downloadayatana-indicator-sound-cf5205162e421080c511428f54cb18d60cd05568.tar.gz
ayatana-indicator-sound-cf5205162e421080c511428f54cb18d60cd05568.tar.bz2
ayatana-indicator-sound-cf5205162e421080c511428f54cb18d60cd05568.zip
* New upstream release:
-New transport widget integrated -New title widget integrated which allows the user to launch familiar app directly from the menu - UI tidied - Each player that registers with the menu will be stored in the cache file allowing the menu to show the application even if it has not been launched.
Diffstat (limited to 'src/indicator-sound.c')
-rw-r--r--src/indicator-sound.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/indicator-sound.c b/src/indicator-sound.c
index 3f0d2d3..8be97b4 100644
--- a/src/indicator-sound.c
+++ b/src/indicator-sound.c
@@ -40,6 +40,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include "indicator-sound.h"
#include "transport-widget.h"
#include "metadata-widget.h"
+#include "title-widget.h"
#include "dbus-shared-names.h"
#include "sound-service-client.h"
#include "common-defs.h"
@@ -96,6 +97,7 @@ static void style_changed_cb(GtkWidget *widget, gpointer user_data);
//player widgets related
static gboolean new_transport_widget(DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client);
static gboolean new_metadata_widget(DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client);
+static gboolean new_title_widget(DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client);
// DBUS communication
static DBusGProxy *sound_dbus_proxy = NULL;
@@ -243,7 +245,7 @@ get_menu (IndicatorObject * io)
dbusmenu_client_add_type_handler(DBUSMENU_CLIENT(client), DBUSMENU_SLIDER_MENUITEM_TYPE, new_slider_item);
dbusmenu_client_add_type_handler(DBUSMENU_CLIENT(client), DBUSMENU_TRANSPORT_MENUITEM_TYPE, new_transport_widget);
dbusmenu_client_add_type_handler(DBUSMENU_CLIENT(client), DBUSMENU_METADATA_MENUITEM_TYPE, new_metadata_widget);
-
+ dbusmenu_client_add_type_handler(DBUSMENU_CLIENT(client), DBUSMENU_TITLE_MENUITEM_TYPE, new_title_widget);
// register Key-press listening on the menu widget as the slider does not allow this.
g_signal_connect(menu, "key-press-event", G_CALLBACK(key_press_cb), NULL);
return GTK_MENU(menu);
@@ -326,10 +328,9 @@ new_transport_widget(DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, Dbus
bar = transport_widget_new(newitem);
GtkMenuItem *menu_transport_bar = GTK_MENU_ITEM(bar);
+ gtk_widget_show_all(bar);
dbusmenu_gtkclient_newitem_base(DBUSMENU_GTKCLIENT(client), newitem, menu_transport_bar, parent);
- gtk_widget_show_all(bar);
-
return TRUE;
}
@@ -346,16 +347,31 @@ new_metadata_widget(DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, Dbusm
metadata = metadata_widget_new (newitem);
GtkMenuItem *menu_metadata_widget = GTK_MENU_ITEM(metadata);
+ gtk_widget_show_all(metadata);
dbusmenu_gtkclient_newitem_base(DBUSMENU_GTKCLIENT(client), newitem, menu_metadata_widget, parent);
- gtk_widget_show_all(metadata);
-
return TRUE;
}
-//const gchar* path = dbusmenu_menuitem_property_get(new_item, DBUSMENU_METADATA_MENUITEM_IMAGE_PATH);
+static gboolean
+new_title_widget(DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client)
+{
+ g_debug("indicator-sound: new_title_widget");
+
+ GtkWidget* title = NULL;
+
+ g_return_val_if_fail(DBUSMENU_IS_MENUITEM(newitem), FALSE);
+ g_return_val_if_fail(DBUSMENU_IS_GTKCLIENT(client), FALSE);
+
+ title = title_widget_new (newitem);
+ GtkMenuItem *menu_title_widget = GTK_MENU_ITEM(title);
+
+ dbusmenu_gtkclient_newitem_base(DBUSMENU_GTKCLIENT(client), newitem, menu_title_widget, parent);
-//g_debug("New transport bar path = %s", path);
+ gtk_widget_show_all(title);
+
+ return TRUE;
+}
static void