Merge lp:~ted/indicator-sound/greeter-no-settings into lp:indicator-sound/13.10

Proposed by Ted Gould
Status: Merged
Approved by: Ted Gould
Approved revision: 389
Merged at revision: 387
Proposed branch: lp:~ted/indicator-sound/greeter-no-settings
Merge into: lp:indicator-sound/13.10
Diff against target: 68 lines (+14/-4)
3 files modified
data/com.canonical.indicator.sound (+1/-1)
src/service.vala (+1/-0)
src/sound-menu.vala (+12/-3)
To merge this branch: bzr merge lp:~ted/indicator-sound/greeter-no-settings
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Lars Karlitski (community) Approve
Review via email: mp+188911@code.launchpad.net

Commit message

Add a desktop_greeter menu without settings

Description of the change

Adds a greeter menu and makes it so we can configure whether menus have settings or not.

To post a comment you must log in.
389. By Ted Gould

Make sure to set the initial value of settings shown

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

That should do it. Thanks!

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

Mterry verified it worked for his use-case in the greeter.

Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'data/com.canonical.indicator.sound'
--- data/com.canonical.indicator.sound 2013-07-25 14:38:15 +0000
+++ data/com.canonical.indicator.sound 2013-10-02 19:44:29 +0000
@@ -10,4 +10,4 @@
10ObjectPath=/com/canonical/indicator/sound/phone10ObjectPath=/com/canonical/indicator/sound/phone
1111
12[desktop_greeter]12[desktop_greeter]
13ObjectPath=/com/canonical/indicator/sound/desktop13ObjectPath=/com/canonical/indicator/sound/desktop_greeter
1414
=== modified file 'src/service.vala'
--- src/service.vala 2013-10-01 12:11:04 +0000
+++ src/service.vala 2013-10-02 19:44:29 +0000
@@ -34,6 +34,7 @@
34 this.actions.add_action (this.create_mic_volume_action ());34 this.actions.add_action (this.create_mic_volume_action ());
3535
36 this.menus = new HashTable<string, SoundMenu> (str_hash, str_equal);36 this.menus = new HashTable<string, SoundMenu> (str_hash, str_equal);
37 this.menus.insert ("desktop_greeter", new SoundMenu (true, null));
37 this.menus.insert ("desktop", new SoundMenu (true, "indicator.desktop-settings"));38 this.menus.insert ("desktop", new SoundMenu (true, "indicator.desktop-settings"));
38 this.menus.insert ("phone", new SoundMenu (false, "indicator.phone-settings"));39 this.menus.insert ("phone", new SoundMenu (false, "indicator.phone-settings"));
3940
4041
=== modified file 'src/sound-menu.vala'
--- src/sound-menu.vala 2013-09-15 18:39:49 +0000
+++ src/sound-menu.vala 2013-10-02 19:44:29 +0000
@@ -22,7 +22,7 @@
2222
23class SoundMenu: Object23class SoundMenu: Object
24{24{
25 public SoundMenu (bool show_mute, string settings_action) {25 public SoundMenu (bool show_mute, string? settings_action) {
26 /* A sound menu always has at least two sections: the volume section (this.volume_section)26 /* A sound menu always has at least two sections: the volume section (this.volume_section)
27 * at the start of the menu, and the settings section at the end. Between those two,27 * at the start of the menu, and the settings section at the end. Between those two,
28 * it has a dynamic amount of player sections, one for each registered player.28 * it has a dynamic amount of player sections, one for each registered player.
@@ -37,7 +37,11 @@
3737
38 this.menu = new Menu ();38 this.menu = new Menu ();
39 this.menu.append_section (null, volume_section);39 this.menu.append_section (null, volume_section);
40 this.menu.append (_("Sound Settingsā€¦"), settings_action);40
41 if (settings_action != null) {
42 settings_shown = true;
43 this.menu.append (_("Sound Settingsā€¦"), settings_action);
44 }
4145
42 var root_item = new MenuItem (null, "indicator.root");46 var root_item = new MenuItem (null, "indicator.root");
43 root_item.set_attribute ("x-canonical-type", "s", "com.canonical.indicator.root");47 root_item.set_attribute ("x-canonical-type", "s", "com.canonical.indicator.root");
@@ -96,7 +100,11 @@
96 player.notify["is-running"].connect ( () => this.update_playlists (player) );100 player.notify["is-running"].connect ( () => this.update_playlists (player) );
97 update_playlists (player);101 update_playlists (player);
98102
99 this.menu.insert_section (this.menu.get_n_items () -1, null, section);103 if (settings_shown) {
104 this.menu.insert_section (this.menu.get_n_items () -1, null, section);
105 } else {
106 this.menu.append_section (null, section);
107 }
100 }108 }
101109
102 public void remove_player (MediaPlayer player) {110 public void remove_player (MediaPlayer player) {
@@ -109,6 +117,7 @@
109 Menu menu;117 Menu menu;
110 Menu volume_section;118 Menu volume_section;
111 bool mic_volume_shown;119 bool mic_volume_shown;
120 bool settings_shown = false;
112121
113 /* returns the position in this.menu of the section that's associated with @player */122 /* returns the position in this.menu of the section that's associated with @player */
114 int find_player_section (MediaPlayer player) {123 int find_player_section (MediaPlayer player) {

Subscribers

People subscribed via source and target branches