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
1=== modified file 'src/service.vala'
2--- src/service.vala 2014-10-03 14:27:38 +0000
3+++ src/service.vala 2014-10-14 14:06:02 +0000
4@@ -51,10 +51,24 @@
5 this.actions.add_action (this.create_mic_volume_action ());
6
7 this.menus = new HashTable<string, SoundMenu> (str_hash, str_equal);
8- this.menus.insert ("desktop_greeter", new SoundMenu (null, SoundMenu.DisplayFlags.SHOW_MUTE | SoundMenu.DisplayFlags.HIDE_PLAYERS | SoundMenu.DisplayFlags.GREETER_PLAYERS));
9- this.menus.insert ("phone_greeter", new SoundMenu (null, SoundMenu.DisplayFlags.SHOW_SILENT_MODE | SoundMenu.DisplayFlags.HIDE_INACTIVE_PLAYERS | SoundMenu.DisplayFlags.GREETER_PLAYERS));
10- this.menus.insert ("desktop", new SoundMenu ("indicator.desktop-settings", SoundMenu.DisplayFlags.SHOW_MUTE));
11- this.menus.insert ("phone", new SoundMenu ("indicator.phone-settings", SoundMenu.DisplayFlags.SHOW_SILENT_MODE | SoundMenu.DisplayFlags.HIDE_INACTIVE_PLAYERS));
12+ this.menus.insert ("desktop_greeter", new SoundMenu (null,
13+ SoundMenu.DisplayFlags.SHOW_MUTE |
14+ SoundMenu.DisplayFlags.HIDE_PLAYERS |
15+ SoundMenu.DisplayFlags.GREETER_PLAYERS));
16+
17+ this.menus.insert ("phone_greeter", new SoundMenu (null,
18+ SoundMenu.DisplayFlags.SHOW_SILENT_MODE |
19+ SoundMenu.DisplayFlags.HIDE_INACTIVE_PLAYERS |
20+ SoundMenu.DisplayFlags.HIDE_CONTROLS |
21+ SoundMenu.DisplayFlags.GREETER_PLAYERS));
22+
23+ this.menus.insert ("desktop", new SoundMenu ("indicator.desktop-settings",
24+ SoundMenu.DisplayFlags.SHOW_MUTE));
25+
26+ this.menus.insert ("phone", new SoundMenu ("indicator.phone-settings",
27+ SoundMenu.DisplayFlags.SHOW_SILENT_MODE |
28+ SoundMenu.DisplayFlags.HIDE_CONTROLS |
29+ SoundMenu.DisplayFlags.HIDE_INACTIVE_PLAYERS));
30
31 this.menus.@foreach ( (profile, menu) => {
32 this.volume_control.bind_property ("active-mic", menu, "show-mic-volume", BindingFlags.SYNC_CREATE);
33
34=== modified file 'src/sound-menu.vala'
35--- src/sound-menu.vala 2014-10-08 01:57:56 +0000
36+++ src/sound-menu.vala 2014-10-14 14:06:02 +0000
37@@ -25,7 +25,8 @@
38 HIDE_INACTIVE_PLAYERS = 2,
39 HIDE_PLAYERS = 4,
40 GREETER_PLAYERS = 8,
41- SHOW_SILENT_MODE = 16
42+ SHOW_SILENT_MODE = 16,
43+ HIDE_CONTROLS = 32
44 }
45
46 public SoundMenu (string? settings_action, DisplayFlags flags) {
47@@ -67,6 +68,7 @@
48
49 this.hide_players = (flags & DisplayFlags.HIDE_PLAYERS) != 0;
50 this.hide_inactive = (flags & DisplayFlags.HIDE_INACTIVE_PLAYERS) != 0;
51+ this.hide_controls = (flags & DisplayFlags.HIDE_CONTROLS) != 0;
52 this.notify_handlers = new HashTable<MediaPlayer, ulong> (direct_hash, direct_equal);
53
54 this.greeter_players = (flags & DisplayFlags.GREETER_PLAYERS) != 0;
55@@ -143,6 +145,7 @@
56 bool settings_shown = false;
57 bool hide_inactive;
58 bool hide_players = false;
59+ bool hide_controls = false;
60 HashTable<MediaPlayer, ulong> notify_handlers;
61 bool greeter_players = false;
62
63@@ -188,12 +191,14 @@
64 player_item.set_attribute_value ("icon", icon.serialize ());
65 section.append_item (player_item);
66
67- var playback_item = new MenuItem (null, null);
68- playback_item.set_attribute ("x-canonical-type", "s", "com.canonical.unity.playback-item");
69- playback_item.set_attribute ("x-canonical-play-action", "s", "indicator.play." + player.id);
70- playback_item.set_attribute ("x-canonical-next-action", "s", "indicator.next." + player.id);
71- playback_item.set_attribute ("x-canonical-previous-action", "s", "indicator.previous." + player.id);
72- section.append_item (playback_item);
73+ if (!this.hide_controls) {
74+ var playback_item = new MenuItem (null, null);
75+ playback_item.set_attribute ("x-canonical-type", "s", "com.canonical.unity.playback-item");
76+ playback_item.set_attribute ("x-canonical-play-action", "s", "indicator.play." + player.id);
77+ playback_item.set_attribute ("x-canonical-next-action", "s", "indicator.next." + player.id);
78+ playback_item.set_attribute ("x-canonical-previous-action", "s", "indicator.previous." + player.id);
79+ section.append_item (playback_item);
80+ }
81
82 /* Add new players to the end of the player sections, just before the settings */
83 if (settings_shown) {

Subscribers

People subscribed via source and target branches