From 65027bed3ef54b18534e7f3a552bb7275df48b33 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 6 Aug 2013 14:50:00 +0200 Subject: [PATCH 01/11] cheese-window: Allow changing effects while shooting / recording a video There is no technical reason to disable the effect selector while shooting a video. Likewise there is no technical reason to disallow start / stop recording / shooting, or changing mode when the effect selector is change. Removing these unnecessary limitations simplifies the code, and allows users to change effects while recording a video. Signed-off-by: Hans de Goede --- src/cheese-application.vala | 25 +++---------------------- src/cheese-window.vala | 4 ---- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/src/cheese-application.vala b/src/cheese-application.vala index 253e57c..0b6689f 100644 --- a/src/cheese-application.vala +++ b/src/cheese-application.vala @@ -369,17 +369,8 @@ public class Cheese.Application : Gtk.Application switch (new_state) { case Gst.State.PLAYING: - if (effects.state.get_boolean ()) - { - mode.set_enabled (false); - shoot.set_enabled (false); - } - else - { - mode.set_enabled (true); - shoot.set_enabled (true); - } - + mode.set_enabled (true); + shoot.set_enabled (true); effects.set_enabled (true); main_window.camera_state_change_playing (); @@ -492,17 +483,7 @@ public class Cheese.Application : Gtk.Application { return_if_fail (value != null); - var state = value.get_boolean (); - - var shoot = this.lookup_action ("shoot") as SimpleAction; - var mode = this.lookup_action ("mode") as SimpleAction; - - // Effects selection and shooting/mode changes are mutually exclusive. - shoot.set_enabled (!state); - mode.set_enabled (!state); - - main_window.set_effects (state); - + main_window.set_effects (value.get_boolean ()); action.set_state (value); } diff --git a/src/cheese-window.vala b/src/cheese-window.vala index 4585a66..dd8fbfc 100644 --- a/src/cheese-window.vala +++ b/src/cheese-window.vala @@ -379,8 +379,6 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow { var mode = this.application.lookup_action ("mode") as SimpleAction; mode.set_enabled (true); - var effects = this.application.lookup_action ("effects") as SimpleAction; - effects.set_enabled (true); var preferences = this.application.lookup_action ("preferences") as SimpleAction; preferences.set_enabled (true); } @@ -392,8 +390,6 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow { var mode = this.application.lookup_action ("mode") as SimpleAction; mode.set_enabled (false); - var effects = this.application.lookup_action ("effects") as SimpleAction; - effects.set_enabled (false); var preferences = this.application.lookup_action ("preferences") as SimpleAction; preferences.set_enabled (false); } -- 1.8.3.1