aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2014-10-02 11:24:54 -0500
committerTed Gould <ted@gould.cx>2014-10-02 11:24:54 -0500
commit4b6d204d6cc5d193d6400b14acb520296dfb7d96 (patch)
treed5a2cc54b4374bb3ab0db719972ee64c9c989aab /src
parent4f500f48301cbc7140b87034d3e1326a0a3b917a (diff)
downloadayatana-indicator-sound-4b6d204d6cc5d193d6400b14acb520296dfb7d96.tar.gz
ayatana-indicator-sound-4b6d204d6cc5d193d6400b14acb520296dfb7d96.tar.bz2
ayatana-indicator-sound-4b6d204d6cc5d193d6400b14acb520296dfb7d96.zip
Add a silent mode menu item
Diffstat (limited to 'src')
-rw-r--r--src/service.vala4
-rw-r--r--src/sound-menu.vala7
2 files changed, 8 insertions, 3 deletions
diff --git a/src/service.vala b/src/service.vala
index a78519d..8711b6a 100644
--- a/src/service.vala
+++ b/src/service.vala
@@ -52,9 +52,9 @@ public class IndicatorSound.Service: Object {
this.menus = new HashTable<string, SoundMenu> (str_hash, str_equal);
this.menus.insert ("desktop_greeter", new SoundMenu (null, SoundMenu.DisplayFlags.SHOW_MUTE | SoundMenu.DisplayFlags.HIDE_PLAYERS | SoundMenu.DisplayFlags.GREETER_PLAYERS));
- this.menus.insert ("phone_greeter", new SoundMenu (null, SoundMenu.DisplayFlags.HIDE_INACTIVE_PLAYERS | SoundMenu.DisplayFlags.GREETER_PLAYERS));
+ this.menus.insert ("phone_greeter", new SoundMenu (null, SoundMenu.DisplayFlags.SHOW_SILENT_MODE | SoundMenu.DisplayFlags.HIDE_INACTIVE_PLAYERS | SoundMenu.DisplayFlags.GREETER_PLAYERS));
this.menus.insert ("desktop", new SoundMenu ("indicator.desktop-settings", SoundMenu.DisplayFlags.SHOW_MUTE));
- this.menus.insert ("phone", new SoundMenu ("indicator.phone-settings", SoundMenu.DisplayFlags.HIDE_INACTIVE_PLAYERS));
+ this.menus.insert ("phone", new SoundMenu ("indicator.phone-settings", SoundMenu.DisplayFlags.SHOW_SILENT_MODE | SoundMenu.DisplayFlags.HIDE_INACTIVE_PLAYERS));
this.menus.@foreach ( (profile, menu) => {
this.volume_control.bind_property ("active-mic", menu, "show-mic-volume", BindingFlags.SYNC_CREATE);
diff --git a/src/sound-menu.vala b/src/sound-menu.vala
index f5e2627..1247e0a 100644
--- a/src/sound-menu.vala
+++ b/src/sound-menu.vala
@@ -24,7 +24,8 @@ public class SoundMenu: Object
SHOW_MUTE = 1,
HIDE_INACTIVE_PLAYERS = 2,
HIDE_PLAYERS = 4,
- GREETER_PLAYERS = 8
+ GREETER_PLAYERS = 8,
+ SHOW_SILENT_MODE = 16
}
public SoundMenu (string? settings_action, DisplayFlags flags) {
@@ -34,8 +35,12 @@ public class SoundMenu: Object
*/
this.volume_section = new Menu ();
+
if ((flags & DisplayFlags.SHOW_MUTE) != 0)
volume_section.append (_("Mute"), "indicator.mute");
+ if ((flags & DisplayFlags.SHOW_SILENT_MODE) != 0)
+ volume_section.append (_("Silent Mode"), "indicator.silent-mode");
+
volume_section.append_item (this.create_slider_menu_item ("indicator.volume(0)", 0.0, 1.0, 0.01,
"audio-volume-low-zero-panel",
"audio-volume-high-panel"));