diff options
author | Conor Curran <conor.curran@canonical.com> | 2011-06-29 10:24:23 +0200 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2011-06-29 10:24:23 +0200 |
commit | e63dc6451177bc9d4c398849eda13ff880fc69c3 (patch) | |
tree | b05fabfb4e370ddb0f73278d44f554cd59e8d970 /src | |
parent | 01fc374f65b6c552891d3f0d2dad5c7eb8031596 (diff) | |
download | ayatana-indicator-sound-e63dc6451177bc9d4c398849eda13ff880fc69c3.tar.gz ayatana-indicator-sound-e63dc6451177bc9d4c398849eda13ff880fc69c3.tar.bz2 ayatana-indicator-sound-e63dc6451177bc9d4c398849eda13ff880fc69c3.zip |
new menu items manager - and removed the earlier attempt at a custom item for the same purpose
Diffstat (limited to 'src')
-rw-r--r-- | src/mpris2-watcher.vala | 2 | ||||
-rw-r--r-- | src/player-controller.vala | 10 | ||||
-rw-r--r-- | src/player-item.vala | 2 | ||||
-rw-r--r-- | src/sound-service-dbus.c | 1 | ||||
-rw-r--r-- | src/track-specific-items-manager.vala (renamed from src/track-specific-menu-item.vala) | 24 |
5 files changed, 16 insertions, 23 deletions
diff --git a/src/mpris2-watcher.vala b/src/mpris2-watcher.vala index d508959..06ccb6e 100644 --- a/src/mpris2-watcher.vala +++ b/src/mpris2-watcher.vala @@ -38,7 +38,7 @@ public class Mpris2Watcher : GLib.Object this.fdesktop_obj = Bus.get_proxy_sync ( BusType.SESSION, FREEDESKTOP_SERVICE, FREEDESKTOP_OBJECT, - DBusProxyFlags.DO_NOT_LOAD_PROPERTIES ); + DBusProxyFlags.DO_NOT_LOAD_PROPERTIES ); this.fdesktop_obj.name_owner_changed.connect (this.name_changes_detected); this.check_for_active_clients.begin(); } diff --git a/src/player-controller.vala b/src/player-controller.vala index e988682..b1c0396 100644 --- a/src/player-controller.vala +++ b/src/player-controller.vala @@ -109,18 +109,18 @@ public class PlayerController : GLib.Object } public void enable_track_specific_items (string object_path) - { - debug ("enable_track_specific_items"); + { track_specific_client = new Client (this.dbus_name, object_path); - track_specific_client.new_menuitem.connect (on_new_track_specific_menuitem); + track_specific_client.root_changed.connect (on_new_track_specific_root_changed); /*TrackSpecificMenuitem menuitem = this.custom_items[widget_order.TRACK_SPECIFIC] as TrackSpecificMenuitem; menuitem.root_item.property_set_bool (MENUITEM_PROP_VISIBLE, true); menuitem.root_item.property_set_bool (MENUITEM_PROP_ENABLED, true);*/ } - private void on_new_track_specific_menuitem (GLib.Object item) + private void on_new_track_specific_root_changed (GLib.Object item) { - debug ("New track specific item for %s", this.app_info.get_name()); + debug ("!!!!!!!!!!!!!!!!!! - Root changed for track specific item %s", + this.app_info.get_name()); } private void establish_mpris_connection() diff --git a/src/player-item.vala b/src/player-item.vala index 162dbea..7867653 100644 --- a/src/player-item.vala +++ b/src/player-item.vala @@ -61,6 +61,8 @@ public class PlayerItem : Dbusmenu.Menuitem //debug("search key = %s", search_key); Variant? v = data.lookup(search_key); + if (v == null) continue; + if (v.is_of_type ( VariantType.STRING )){ string update = v.get_string().strip(); //debug("with value : %s", update); diff --git a/src/sound-service-dbus.c b/src/sound-service-dbus.c index 980fa05..bad90ca 100644 --- a/src/sound-service-dbus.c +++ b/src/sound-service-dbus.c @@ -322,6 +322,7 @@ bus_method_call (GDBusConnection * connection, retval = g_variant_new ("(b)", result); } else if (g_strcmp0(method, "EnableTrackSpecificItems") == 0) { + g_debug ("EnableTrackSpecificItems"); gchar* player_object_path; gchar* player_id; g_variant_get (params, "(os)", &player_object_path, &player_id); diff --git a/src/track-specific-menu-item.vala b/src/track-specific-items-manager.vala index 718a564..3949727 100644 --- a/src/track-specific-menu-item.vala +++ b/src/track-specific-items-manager.vala @@ -1,5 +1,6 @@ /* -Copyright 2011 Canonical Ltd. +This service primarily controls PulseAudio and is driven by the sound indicator menu on the panel. +Copyright 2010 Canonical Ltd. Authors: Conor Curran <conor.curran@canonical.com> @@ -19,22 +20,11 @@ with this program. If not, see <http://www.gnu.org/licenses/>. using Dbusmenu; using Gee; -using DbusmenuTrackSpecific; -using Dbusmenu; -public class TrackSpecificMenuitem : PlayerItem +public class TrackSpecificMenuitemsManager : GLib.Object { - public Menuitem root_item{get; construct;} - - public TrackSpecificMenuitem (PlayerController parent) - { - Object(item_type: MENUITEM_TYPE, owner: parent); - } - construct - { - this.root_item = new Menuitem(); - this.root_item.property_set ( MENUITEM_PROP_LABEL, _("Like This") ); - this.root_item.property_set_bool (MENUITEM_PROP_VISIBLE, false); - this.root_item.property_set_bool (MENUITEM_PROP_ENABLED, false); - } + public TrackSpecificMenuitemsManager() + { + } } + |