aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-03-11 15:24:11 +0000
committerConor Curran <conor.curran@canonical.com>2011-03-11 15:24:11 +0000
commit4eb79a1becd4abf459d86754685577b762bb895a (patch)
treed168c1f4c2641cc85ccce6a715afb85524d59666
parenta3b638eb52e751626c7e14beac3a8f29342ce703 (diff)
parent6b0f3ffcaf55d151d87f8dc60d16388b8f4557a2 (diff)
downloadayatana-indicator-sound-4eb79a1becd4abf459d86754685577b762bb895a.tar.gz
ayatana-indicator-sound-4eb79a1becd4abf459d86754685577b762bb895a.tar.bz2
ayatana-indicator-sound-4eb79a1becd4abf459d86754685577b762bb895a.zip
missing icon for playlists fixed
-rw-r--r--configure.ac4
-rw-r--r--src/playlists-menu-item.vala17
-rw-r--r--src/sound-service-dbus.c5
-rw-r--r--src/sound-service.c2
4 files changed, 21 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index e4ccb67..bf438e0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,11 +29,11 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
GTK_REQUIRED_VERSION=2.12
INDICATOR_REQUIRED_VERSION=0.3.19
-DBUSMENUGTK_REQUIRED_VERSION=0.3.9
+DBUSMENUGTK_REQUIRED_VERSION=0.3.101
POLKIT_REQUIRED_VERSION=0.92
PULSE_AUDIO_REQUIRED_VERSION=0.9.19
INDICATOR_DISPLAY_OBJECTS=0.1.11
-DBUSMENUGLIB_REQUIRED_VERSION=0.3.9
+DBUSMENUGLIB_REQUIRED_VERSION=0.3.101
GIO_2_0_REQUIRED_VERSION=2.25.13
LIBNOTIFY_REQUIRED_VERSION=0.7.0
diff --git a/src/playlists-menu-item.vala b/src/playlists-menu-item.vala
index f4d7233..b3fd7c6 100644
--- a/src/playlists-menu-item.vala
+++ b/src/playlists-menu-item.vala
@@ -47,7 +47,12 @@ public class PlaylistsMenuitem : PlayerItem
Dbusmenu.Menuitem menuitem = new Menuitem();
menuitem.property_set (MENUITEM_PROP_LABEL, detail.name);
- menuitem.property_set (MENUITEM_PROP_ICON_NAME, detail.icon_path);
+ var result = this.parse_icon_path (detail.icon_path);
+
+ if (result != null) {
+ menuitem.property_set (MENUITEM_PROP_ICON_NAME, result);
+ }
+
menuitem.property_set (MENUITEM_PATH, (string)detail.path);
menuitem.property_set_bool (MENUITEM_PROP_VISIBLE, true);
menuitem.property_set_bool (MENUITEM_PROP_ENABLED, true);
@@ -77,12 +82,20 @@ public class PlaylistsMenuitem : PlayerItem
}
}
+ private string? parse_icon_path (string path)
+ {
+ return ( path == "" ? null : Path.get_basename(path).split(".")[0] );
+ }
+
public void update_individual_playlist (PlaylistDetails new_detail)
{
foreach ( Dbusmenu.Menuitem item in this.current_playlists.values ){
if (new_detail.path == item.property_get (MENUITEM_PATH)){
item.property_set (MENUITEM_PROP_LABEL, new_detail.name);
- item.property_set (MENUITEM_PROP_ICON_NAME, new_detail.icon_path);
+ var result = this.parse_icon_path (new_detail.icon_path);
+ if (result != null) {
+ item.property_set (MENUITEM_PROP_ICON_NAME, result);
+ }
}
}
// If its active make sure the name is updated on the root item.
diff --git a/src/sound-service-dbus.c b/src/sound-service-dbus.c
index 43d7360..8d0cc0b 100644
--- a/src/sound-service-dbus.c
+++ b/src/sound-service-dbus.c
@@ -149,7 +149,10 @@ sound_service_dbus_create_root_item (SoundServiceDbus* self)
SoundServiceDbusPrivate * priv = SOUND_SERVICE_DBUS_GET_PRIVATE(self);
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);
+ DbusmenuServer *server = dbusmenu_server_new (INDICATOR_SOUND_MENU_DBUS_OBJECT_PATH);
+ const gchar* paths[] = {"/usr/share/banshee-1/icons", NULL};
+ dbusmenu_server_set_icon_paths (server,
+ paths);
dbusmenu_server_set_root (server, priv->root_menuitem);
g_object_unref (priv->root_menuitem);
priv->active_sink = active_sink_new (self);
diff --git a/src/sound-service.c b/src/sound-service.c
index c79b9f6..cfc0b7e 100644
--- a/src/sound-service.c
+++ b/src/sound-service.c
@@ -39,10 +39,8 @@ service_shutdown (IndicatorService *service, gpointer user_data)
{
if (mainloop != NULL) {
g_debug("Service shutdown !");
-
close_pulse_activites();
g_main_loop_quit(mainloop);
-
}
return;
}