aboutsummaryrefslogtreecommitdiff
path: root/src/sound-menu.vala
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2014-10-14 12:08:00 -0500
committerTed Gould <ted@gould.cx>2014-10-14 12:08:00 -0500
commit2b4342f72a57c6b3d112fd6e923c544be789f6ea (patch)
treee89cd0ad054e3a94475661a67d6d89a4260caf9c /src/sound-menu.vala
parenta7ad5e0c977fbd4d1f0a3efa071bcffd0e5d6b13 (diff)
parent8e7cbaadfed452063b2d659bc679746cad5cbb14 (diff)
downloadayatana-indicator-sound-2b4342f72a57c6b3d112fd6e923c544be789f6ea.tar.gz
ayatana-indicator-sound-2b4342f72a57c6b3d112fd6e923c544be789f6ea.tar.bz2
ayatana-indicator-sound-2b4342f72a57c6b3d112fd6e923c544be789f6ea.zip
Grabbing the extreme volume warnings
Diffstat (limited to 'src/sound-menu.vala')
-rw-r--r--src/sound-menu.vala20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/sound-menu.vala b/src/sound-menu.vala
index 03faa89..38c5214 100644
--- a/src/sound-menu.vala
+++ b/src/sound-menu.vala
@@ -82,12 +82,31 @@ public class SoundMenu: Object
this.mic_volume_shown = true;
}
else if (!value && this.mic_volume_shown) {
+ /* TODO: Make smarter */
this.volume_section.remove (this.volume_section.get_n_items () -1);
this.mic_volume_shown = false;
}
}
}
+ public bool show_high_volume_warning {
+ get {
+ return this.high_volume_warning_shown;
+ }
+ set {
+ if (value && !this.high_volume_warning_shown) {
+ var item = new MenuItem(_("High volume can damage your hearing."), null);
+ volume_section.append_item (item);
+ this.high_volume_warning_shown = true;
+ }
+ else if (!value && this.high_volume_warning_shown) {
+ /* TODO: Make smarter */
+ this.volume_section.remove (this.volume_section.get_n_items () -1);
+ this.high_volume_warning_shown = false;
+ }
+ }
+ }
+
public void add_player (MediaPlayer player) {
if (this.notify_handlers.contains (player))
return;
@@ -130,6 +149,7 @@ public class SoundMenu: Object
Menu volume_section;
bool mic_volume_shown;
bool settings_shown = false;
+ bool high_volume_warning_shown = false;
bool hide_inactive;
bool hide_players = false;
HashTable<MediaPlayer, ulong> notify_handlers;