diff options
-rwxr-xr-x | src/indicator-sound.c | 32 | ||||
-rw-r--r-- | src/metadata-menu-item.vala | 3 | ||||
-rw-r--r-- | src/metadata-widget.c | 5 | ||||
-rw-r--r-- | src/metadata-widget.c~ | 9 |
4 files changed, 35 insertions, 14 deletions
diff --git a/src/indicator-sound.c b/src/indicator-sound.c index a3856c4..af2a6f9 100755 --- a/src/indicator-sound.c +++ b/src/indicator-sound.c @@ -39,6 +39,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include "indicator-sound.h" #include "transport-bar.h" +#include "metadata-widget.h" #include "dbus-shared-names.h" #include "sound-service-client.h" #include "common-defs.h" @@ -92,8 +93,9 @@ static void slider_grabbed(GtkWidget *widget, gpointer user_data); static void slider_released(GtkWidget *widget, gpointer user_data); static void style_changed_cb(GtkWidget *widget, gpointer user_data); -//transport bar related +//player widgets related static gboolean new_transport_bar(DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client); +static gboolean new_metadata_widget(DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client); // DBUS communication static DBusGProxy *sound_dbus_proxy = NULL; @@ -240,6 +242,7 @@ get_menu (IndicatorObject * io) g_object_set_data (G_OBJECT (client), "indicator", 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_bar); + dbusmenu_client_add_type_handler(DBUSMENU_CLIENT(client), DBUSMENU_METADATA_MENUITEM_TYPE, new_metadata_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); @@ -310,7 +313,8 @@ new_slider_item(DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuC return TRUE; } -static gboolean new_transport_bar(DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client) +static gboolean +new_transport_bar(DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client) { g_debug("indicator-sound: new_transport_bar() called "); @@ -329,6 +333,30 @@ static gboolean new_transport_bar(DbusmenuMenuitem * newitem, DbusmenuMenuitem * return TRUE; } +static gboolean +new_metadata_widget(DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client) +{ + g_debug("indicator-sound: new_metadata_widget"); + + GtkWidget* metadata = NULL; + + g_return_val_if_fail(DBUSMENU_IS_MENUITEM(newitem), FALSE); + g_return_val_if_fail(DBUSMENU_IS_GTKCLIENT(client), FALSE); + + metadata = metadata_widget_new (newitem); + GtkMenuItem *menu_metadata_widget = GTK_MENU_ITEM(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); + +//g_debug("New transport bar path = %s", path); + static void connection_changed (IndicatorServiceManager * sm, gboolean connected, gpointer userdata) diff --git a/src/metadata-menu-item.vala b/src/metadata-menu-item.vala index c9daee6..ef72143 100644 --- a/src/metadata-menu-item.vala +++ b/src/metadata-menu-item.vala @@ -17,6 +17,9 @@ public class MetadataMenuitem : Dbusmenu.Menuitem this.property_set(DBUSMENU_METADATA_MENUITEM_TEXT_PIECE, "Nocturne"); this.property_set(DBUSMENU_METADATA_MENUITEM_TEXT_CONTAINER, "Seven Months in E minor"); this.property_set(DBUSMENU_METADATA_MENUITEM_IMAGE_PATH, "/home/ronoc/Desktop/Sonnamble/Sonnamble_CD.jpg"); + + debug("image_path property set %s:", this.property_get(DBUSMENU_METADATA_MENUITEM_IMAGE_PATH)); + } public override void handle_event(string name, GLib.Value input_value, uint timestamp) diff --git a/src/metadata-widget.c b/src/metadata-widget.c index b414969..70542e9 100644 --- a/src/metadata-widget.c +++ b/src/metadata-widget.c @@ -138,11 +138,6 @@ metadata_widget_button_release_event (GtkWidget *menuitem, static void metadata_widget_update_state(gchar *property, GValue *value, gpointer userdata) { g_debug("metadata_widget_update_state - with property %s", property); - - if (value == NULL){ - g_debug("value is null"); - return; - } } /** diff --git a/src/metadata-widget.c~ b/src/metadata-widget.c~ index 81c6f75..df58de5 100644 --- a/src/metadata-widget.c~ +++ b/src/metadata-widget.c~ @@ -88,9 +88,9 @@ metadata_widget_init (MetadataWidget *self) hbox = gtk_hbox_new(TRUE, 2); - const gchar* path = dbusmenu_menuitem_property_get(twin_item, DBUSMENU_METADATA_MENUITEM_IMAGE); + //const gchar* path = dbusmenu_menuitem_property_get(twin_item, DBUSMENU_METADATA_MENUITEM_IMAGE_PATH); - g_debug("MetadataWidget:init - path = %s", path); + //g_debug("MetadataWidget:init - path = %s", path); priv->our_path = g_strdup(path); @@ -138,11 +138,6 @@ metadata_widget_button_release_event (GtkWidget *menuitem, static void metadata_widget_update_state(gchar *property, GValue *value, gpointer userdata) { g_debug("metadata_widget_update_state - with property %s", property); - - if (value == NULL){ - g_debug("value is null"); - return; - } } /** |