diff options
Diffstat (limited to 'src/service.vala')
-rw-r--r-- | src/service.vala | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/service.vala b/src/service.vala index e69bca8..aa992ff 100644 --- a/src/service.vala +++ b/src/service.vala @@ -34,9 +34,9 @@ public class IndicatorSound.Service { this.actions.add_action (this.create_mic_volume_action ()); this.menus = new HashTable<string, SoundMenu> (str_hash, str_equal); - this.menus.insert ("desktop_greeter", new SoundMenu (true, null)); - this.menus.insert ("desktop", new SoundMenu (true, "indicator.desktop-settings")); - this.menus.insert ("phone", new SoundMenu (false, "indicator.phone-settings")); + this.menus.insert ("desktop_greeter", new SoundMenu (null, SoundMenu.DisplayFlags.SHOW_MUTE)); + 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.@foreach ( (profile, menu) => { this.volume_control.bind_property ("active-mic", menu, "show-mic-volume", BindingFlags.SYNC_CREATE); @@ -120,9 +120,7 @@ public class IndicatorSound.Service { void activate_desktop_settings (SimpleAction action, Variant? param) { var env = Environment.get_variable ("DESKTOP_SESSION"); string cmd; - if (env == "unity") - cmd = "gnome-control-center sound-nua"; - else if (env == "xubuntu" || env == "ubuntustudio") + if (env == "xubuntu" || env == "ubuntustudio") cmd = "pavucontrol"; else cmd = "gnome-control-center sound"; @@ -177,10 +175,10 @@ public class IndicatorSound.Service { } Action create_mute_action () { - var mute_action = new SimpleAction.stateful ("mute", null, this.volume_control.mute); + var mute_action = new SimpleAction.stateful ("mute", null, new Variant.boolean (this.volume_control.mute)); mute_action.activate.connect ( (action, param) => { - action.change_state (!action.get_state ().get_boolean ()); + action.change_state (new Variant.boolean (!action.get_state ().get_boolean ())); }); mute_action.change_state.connect ( (action, val) => { @@ -188,7 +186,7 @@ public class IndicatorSound.Service { }); this.volume_control.notify["mute"].connect ( () => { - mute_action.set_state (this.volume_control.mute); + mute_action.set_state (new Variant.boolean (this.volume_control.mute)); this.update_root_icon (); }); @@ -197,13 +195,13 @@ public class IndicatorSound.Service { void volume_changed (double volume) { var volume_action = this.actions.lookup_action ("volume") as SimpleAction; - volume_action.set_state (volume); + volume_action.set_state (new Variant.double (volume)); this.update_root_icon (); } Action create_volume_action () { - var volume_action = new SimpleAction.stateful ("volume", VariantType.INT32, this.volume_control.get_volume ()); + var volume_action = new SimpleAction.stateful ("volume", VariantType.INT32, new Variant.double (this.volume_control.get_volume ())); volume_action.change_state.connect ( (action, val) => { volume_control.set_volume (val.get_double ()); @@ -223,14 +221,14 @@ public class IndicatorSound.Service { } Action create_mic_volume_action () { - var volume_action = new SimpleAction.stateful ("mic-volume", null, this.volume_control.get_mic_volume ()); + var volume_action = new SimpleAction.stateful ("mic-volume", null, new Variant.double (this.volume_control.get_mic_volume ())); volume_action.change_state.connect ( (action, val) => { volume_control.set_mic_volume (val.get_double ()); }); this.volume_control.mic_volume_changed.connect ( (volume) => { - volume_action.set_state (volume); + volume_action.set_state (new Variant.double (volume)); }); this.volume_control.bind_property ("ready", volume_action, "enabled", BindingFlags.SYNC_CREATE); |