aboutsummaryrefslogtreecommitdiff
path: root/src/sound-menu.vala
diff options
context:
space:
mode:
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;