Merge lp:~larsu/indicator-sound/dont-show-players-on-greeter into lp:indicator-sound/14.04

Proposed by Lars Karlitski
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 422
Merged at revision: 422
Proposed branch: lp:~larsu/indicator-sound/dont-show-players-on-greeter
Merge into: lp:indicator-sound/14.04
Diff against target: 62 lines (+11/-2)
2 files modified
src/service.vala (+1/-1)
src/sound-menu.vala (+10/-1)
To merge this branch: bzr merge lp:~larsu/indicator-sound/dont-show-players-on-greeter
Reviewer Review Type Date Requested Status
Sebastien Bacher Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+210604@code.launchpad.net

Commit message

Don't show player sections on the greeter and lock screen

Description of the change

Don't show player sections on the greeter and lock screen

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
Sebastien Bacher (seb128) wrote :

Thanks, seems to work fine for me!

review: Approve

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-03-03 09:32:53 +0000
3+++ src/service.vala 2014-03-12 13:29:36 +0000
4@@ -38,7 +38,7 @@
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));
9+ this.menus.insert ("desktop_greeter", new SoundMenu (null, SoundMenu.DisplayFlags.SHOW_MUTE | SoundMenu.DisplayFlags.HIDE_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.HIDE_INACTIVE_PLAYERS));
12
13
14=== modified file 'src/sound-menu.vala'
15--- src/sound-menu.vala 2013-11-15 20:55:45 +0000
16+++ src/sound-menu.vala 2014-03-12 13:29:36 +0000
17@@ -22,7 +22,8 @@
18 public enum DisplayFlags {
19 NONE = 0,
20 SHOW_MUTE = 1,
21- HIDE_INACTIVE_PLAYERS = 2
22+ HIDE_INACTIVE_PLAYERS = 2,
23+ HIDE_PLAYERS = 4
24 }
25
26 public SoundMenu (string? settings_action, DisplayFlags flags) {
27@@ -55,6 +56,7 @@
28 this.root = new Menu ();
29 root.append_item (root_item);
30
31+ this.hide_players = (flags & DisplayFlags.HIDE_PLAYERS) != 0;
32 this.hide_inactive = (flags & DisplayFlags.HIDE_INACTIVE_PLAYERS) != 0;
33 this.notify_handlers = new HashTable<MediaPlayer, ulong> (direct_hash, direct_equal);
34 }
35@@ -119,6 +121,7 @@
36 bool mic_volume_shown;
37 bool settings_shown = false;
38 bool hide_inactive;
39+ bool hide_players = false;
40 HashTable<MediaPlayer, ulong> notify_handlers;
41
42 /* returns the position in this.menu of the section that's associated with @player */
43@@ -137,6 +140,9 @@
44 }
45
46 void insert_player_section (MediaPlayer player) {
47+ if (this.hide_players)
48+ return;
49+
50 var section = new Menu ();
51 Icon icon;
52
53@@ -166,6 +172,9 @@
54 }
55
56 void remove_player_section (MediaPlayer player) {
57+ if (this.hide_players)
58+ return;
59+
60 int index = this.find_player_section (player);
61 if (index >= 0)
62 this.menu.remove (index);

Subscribers

People subscribed via source and target branches