aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-10-14 17:58:42 +0100
committerConor Curran <conor.curran@canonical.com>2010-10-14 17:58:42 +0100
commite2792ab0a1dfd8ca0c96b59b675fa09e8cd0e5d7 (patch)
treeaf40bb6796cdb9b60c182bfe7d572b95dc649b3f /src
parent000862e2eae0d894e1f81df6b13c14d19f407d48 (diff)
downloadayatana-indicator-sound-e2792ab0a1dfd8ca0c96b59b675fa09e8cd0e5d7.tar.gz
ayatana-indicator-sound-e2792ab0a1dfd8ca0c96b59b675fa09e8cd0e5d7.tar.bz2
ayatana-indicator-sound-e2792ab0a1dfd8ca0c96b59b675fa09e8cd0e5d7.zip
moving towards getting the icon across the divide
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/music-player-bridge.vala14
-rw-r--r--src/player-controller.vala16
-rw-r--r--src/sound-service.c4
-rw-r--r--src/title-widget.c3
-rw-r--r--src/title-widget.h2
6 files changed, 37 insertions, 4 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index b23e9c1..563b755 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -76,6 +76,8 @@ music_bridge_VALAFLAGS = \
--pkg gee-1.0 \
--pkg Indicate-0.2 \
--pkg Dbusmenu-Glib-0.2 \
+ --pkg DbusmenuGtk-0.2 \
+ --pkg gtk+-2.0 \
--pkg common-defs \
--pkg dbus-glib-1 \
--pkg gio-unix-2.0 \
diff --git a/src/music-player-bridge.vala b/src/music-player-bridge.vala
index 9ba4ef6..e109dec 100644
--- a/src/music-player-bridge.vala
+++ b/src/music-player-bridge.vala
@@ -24,7 +24,6 @@ using GLib;
public class MusicPlayerBridge : GLib.Object
{
-
private Listener listener;
private Dbusmenu.Menuitem root_menu;
private HashMap<string, PlayerController> registered_clients;
@@ -61,8 +60,12 @@ public class MusicPlayerBridge : GLib.Object
calculate_menu_position(),
PlayerController.state.OFFLINE);
ctrl.app_info = app_info;
- if(ctrl.app_info == null)
+ if(ctrl.app_info == null){
warning("for some reason the app info is null");
+ }
+ else{
+ ctrl.set_icon_path();
+ }
this.registered_clients.set(determine_key(app), ctrl);
}
}
@@ -102,6 +105,13 @@ public class MusicPlayerBridge : GLib.Object
bridge.calculate_menu_position(),
PlayerController.state.READY);
ctrl.set("app_info", app_info);
+ if(ctrl.app_info == null){
+ warning("for some reason the app info is null");
+ }
+ else{
+ ctrl.set_icon_path();
+ }
+
bridge.registered_clients.set(determine_key(path), ctrl);
debug("successfully created appinfo and instance from path and set it on the respective instance");
}
diff --git a/src/player-controller.vala b/src/player-controller.vala
index d5b79e7..4b5144a 100644
--- a/src/player-controller.vala
+++ b/src/player-controller.vala
@@ -19,6 +19,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
*/
using Dbusmenu;
+using DbusmenuGtk;
using Gee;
public class PlayerController : GLib.Object
@@ -62,6 +63,7 @@ public class PlayerController : GLib.Object
construct_widgets();
establish_mpris_connection();
this.update_layout();
+
}
public void update_state(state new_state)
@@ -167,6 +169,20 @@ public class PlayerController : GLib.Object
return formatted;
}
+ public void set_icon_path()
+ {
+ if(this.app_info != null){
+ /*Gtk.IconTheme icon_t = Gtk.IconTheme.get_default();
+ Gtk.IconInfo iconInfo = icon_t.lookup_icon(app_info.get_icon(),
+ getIconSize(),
+ Gtk.ICON_LOOKUP_USE_BUILTIN);*/
+ //return iconInfo.load_icon();
+ dbusmenu_menuitem_property_set_image(this.custom_items[widget_order.TITLE],
+ MENUITEM_PROP_ICON_DATA,
+ app_info.get_icon());
+ }
+ }
+
// Temporarily we will need to handle to different mpris implemenations
// Do it for now - a couple of weeks should see this messy carry on out of
// the codebase.
diff --git a/src/sound-service.c b/src/sound-service.c
index f19379d..51f5f37 100644
--- a/src/sound-service.c
+++ b/src/sound-service.c
@@ -41,8 +41,8 @@ service_shutdown (IndicatorService *service, gpointer user_data)
if (mainloop != NULL) {
g_debug("Service shutdown !");
//TODO: uncomment for release !!
- close_pulse_activites();
- g_main_loop_quit(mainloop);
+ //close_pulse_activites();
+ //g_main_loop_quit(mainloop);
}
return;
}
diff --git a/src/title-widget.c b/src/title-widget.c
index 5e86b4d..d9faa57 100644
--- a/src/title-widget.c
+++ b/src/title-widget.c
@@ -135,6 +135,9 @@ title_widget_property_update(DbusmenuMenuitem* item, gchar* property,
gtk_menu_item_set_label (GTK_MENU_ITEM(mitem),
g_value_get_string(value));
}
+ /*else(g_ascii_strcasecmp(DBUSMENU_MENUITEM_PROP_ICON_DATA, property) == 0){
+ g_debug("changing the icon data on the title");
+ }*/
}
static void
diff --git a/src/title-widget.h b/src/title-widget.h
index 574a2b1..1e25775 100644
--- a/src/title-widget.h
+++ b/src/title-widget.h
@@ -21,6 +21,8 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <gtk/gtkimagemenuitem.h>
#include <libdbusmenu-gtk/menuitem.h>
+#include <libdbusmenu-glib/menuitem.h>
+
G_BEGIN_DECLS