Merge lp:~larsu/indicator-sound/lp1381069 into lp:indicator-sound/14.10

Proposed by Lars Karlitski
Status: Work in progress
Proposed branch: lp:~larsu/indicator-sound/lp1381069
Merge into: lp:indicator-sound/14.10
Diff against target: 83 lines (+30/-11)
2 files modified
src/service.vala (+18/-4)
src/sound-menu.vala (+12/-7)
To merge this branch: bzr merge lp:~larsu/indicator-sound/lp1381069
Reviewer Review Type Date Requested Status
Ted Gould (community) Needs Fixing
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+238301@code.launchpad.net

Description of the change

phone menu: hide player controls

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ted Gould (ted) wrote :

So I think this should just hide the full player and not the controls:

<rickspencer3> larsu, I don't know specifically what is the correct thing to do, I guess having the currently playing song doesn't make much sense if there are no controls and album art

review: Needs Fixing
Revision history for this message
Lars Karlitski (larsu) wrote :

tvoss said he'll fix the media-hub instead. I don't think we'll need to do this at all.

Revision history for this message
Ted Gould (ted) wrote :

Marking as WIP for now.

Unmerged revisions

461. By Lars Karlitski

phone menu: hide player controls

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/service.vala'
--- src/service.vala 2014-10-03 14:27:38 +0000
+++ src/service.vala 2014-10-14 14:06:02 +0000
@@ -51,10 +51,24 @@
51 this.actions.add_action (this.create_mic_volume_action ());51 this.actions.add_action (this.create_mic_volume_action ());
5252
53 this.menus = new HashTable<string, SoundMenu> (str_hash, str_equal);53 this.menus = new HashTable<string, SoundMenu> (str_hash, str_equal);
54 this.menus.insert ("desktop_greeter", new SoundMenu (null, SoundMenu.DisplayFlags.SHOW_MUTE | SoundMenu.DisplayFlags.HIDE_PLAYERS | SoundMenu.DisplayFlags.GREETER_PLAYERS));54 this.menus.insert ("desktop_greeter", new SoundMenu (null,
55 this.menus.insert ("phone_greeter", new SoundMenu (null, SoundMenu.DisplayFlags.SHOW_SILENT_MODE | SoundMenu.DisplayFlags.HIDE_INACTIVE_PLAYERS | SoundMenu.DisplayFlags.GREETER_PLAYERS));55 SoundMenu.DisplayFlags.SHOW_MUTE |
56 this.menus.insert ("desktop", new SoundMenu ("indicator.desktop-settings", SoundMenu.DisplayFlags.SHOW_MUTE));56 SoundMenu.DisplayFlags.HIDE_PLAYERS |
57 this.menus.insert ("phone", new SoundMenu ("indicator.phone-settings", SoundMenu.DisplayFlags.SHOW_SILENT_MODE | SoundMenu.DisplayFlags.HIDE_INACTIVE_PLAYERS));57 SoundMenu.DisplayFlags.GREETER_PLAYERS));
58
59 this.menus.insert ("phone_greeter", new SoundMenu (null,
60 SoundMenu.DisplayFlags.SHOW_SILENT_MODE |
61 SoundMenu.DisplayFlags.HIDE_INACTIVE_PLAYERS |
62 SoundMenu.DisplayFlags.HIDE_CONTROLS |
63 SoundMenu.DisplayFlags.GREETER_PLAYERS));
64
65 this.menus.insert ("desktop", new SoundMenu ("indicator.desktop-settings",
66 SoundMenu.DisplayFlags.SHOW_MUTE));
67
68 this.menus.insert ("phone", new SoundMenu ("indicator.phone-settings",
69 SoundMenu.DisplayFlags.SHOW_SILENT_MODE |
70 SoundMenu.DisplayFlags.HIDE_CONTROLS |
71 SoundMenu.DisplayFlags.HIDE_INACTIVE_PLAYERS));
5872
59 this.menus.@foreach ( (profile, menu) => {73 this.menus.@foreach ( (profile, menu) => {
60 this.volume_control.bind_property ("active-mic", menu, "show-mic-volume", BindingFlags.SYNC_CREATE);74 this.volume_control.bind_property ("active-mic", menu, "show-mic-volume", BindingFlags.SYNC_CREATE);
6175
=== modified file 'src/sound-menu.vala'
--- src/sound-menu.vala 2014-10-08 01:57:56 +0000
+++ src/sound-menu.vala 2014-10-14 14:06:02 +0000
@@ -25,7 +25,8 @@
25 HIDE_INACTIVE_PLAYERS = 2,25 HIDE_INACTIVE_PLAYERS = 2,
26 HIDE_PLAYERS = 4,26 HIDE_PLAYERS = 4,
27 GREETER_PLAYERS = 8,27 GREETER_PLAYERS = 8,
28 SHOW_SILENT_MODE = 1628 SHOW_SILENT_MODE = 16,
29 HIDE_CONTROLS = 32
29 }30 }
3031
31 public SoundMenu (string? settings_action, DisplayFlags flags) {32 public SoundMenu (string? settings_action, DisplayFlags flags) {
@@ -67,6 +68,7 @@
6768
68 this.hide_players = (flags & DisplayFlags.HIDE_PLAYERS) != 0;69 this.hide_players = (flags & DisplayFlags.HIDE_PLAYERS) != 0;
69 this.hide_inactive = (flags & DisplayFlags.HIDE_INACTIVE_PLAYERS) != 0;70 this.hide_inactive = (flags & DisplayFlags.HIDE_INACTIVE_PLAYERS) != 0;
71 this.hide_controls = (flags & DisplayFlags.HIDE_CONTROLS) != 0;
70 this.notify_handlers = new HashTable<MediaPlayer, ulong> (direct_hash, direct_equal);72 this.notify_handlers = new HashTable<MediaPlayer, ulong> (direct_hash, direct_equal);
7173
72 this.greeter_players = (flags & DisplayFlags.GREETER_PLAYERS) != 0;74 this.greeter_players = (flags & DisplayFlags.GREETER_PLAYERS) != 0;
@@ -143,6 +145,7 @@
143 bool settings_shown = false;145 bool settings_shown = false;
144 bool hide_inactive;146 bool hide_inactive;
145 bool hide_players = false;147 bool hide_players = false;
148 bool hide_controls = false;
146 HashTable<MediaPlayer, ulong> notify_handlers;149 HashTable<MediaPlayer, ulong> notify_handlers;
147 bool greeter_players = false;150 bool greeter_players = false;
148151
@@ -188,12 +191,14 @@
188 player_item.set_attribute_value ("icon", icon.serialize ());191 player_item.set_attribute_value ("icon", icon.serialize ());
189 section.append_item (player_item);192 section.append_item (player_item);
190193
191 var playback_item = new MenuItem (null, null);194 if (!this.hide_controls) {
192 playback_item.set_attribute ("x-canonical-type", "s", "com.canonical.unity.playback-item");195 var playback_item = new MenuItem (null, null);
193 playback_item.set_attribute ("x-canonical-play-action", "s", "indicator.play." + player.id);196 playback_item.set_attribute ("x-canonical-type", "s", "com.canonical.unity.playback-item");
194 playback_item.set_attribute ("x-canonical-next-action", "s", "indicator.next." + player.id);197 playback_item.set_attribute ("x-canonical-play-action", "s", "indicator.play." + player.id);
195 playback_item.set_attribute ("x-canonical-previous-action", "s", "indicator.previous." + player.id);198 playback_item.set_attribute ("x-canonical-next-action", "s", "indicator.next." + player.id);
196 section.append_item (playback_item);199 playback_item.set_attribute ("x-canonical-previous-action", "s", "indicator.previous." + player.id);
200 section.append_item (playback_item);
201 }
197202
198 /* Add new players to the end of the player sections, just before the settings */203 /* Add new players to the end of the player sections, just before the settings */
199 if (settings_shown) {204 if (settings_shown) {

Subscribers

People subscribed via source and target branches