Blob Blame Raw
From 82d8c27242efcf40612edaccc47c37a79aeaf6c8 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 3 Sep 2013 15:39:49 +0200
Subject: [PATCH 11/11] cheese-window: Disable effect switching buttons on
 webcam error

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 src/cheese-window.vala | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/cheese-window.vala b/src/cheese-window.vala
index e117ec2..8e31611 100644
--- a/src/cheese-window.vala
+++ b/src/cheese-window.vala
@@ -1027,9 +1027,11 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
         var effects_next = this.lookup_action ("effects-next") as SimpleAction;
         var effects_previous = this.lookup_action ("effects-previous") as SimpleAction;
 
-        effects_next.set_enabled (is_effects_selector_active
+        effects_next.set_enabled (!error_layer.visible
+                                  && is_effects_selector_active
                                   && current_effects_page != effects_manager.effects.length () / EFFECTS_PER_PAGE);
-        effects_previous.set_enabled (is_effects_selector_active
+        effects_previous.set_enabled (!error_layer.visible
+                                      && is_effects_selector_active
                                       && current_effects_page != 0);
     }
 
@@ -1148,6 +1150,7 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
     public void camera_state_change_playing ()
     {
         show_error (null);
+        setup_effects_page_switch_sensitivity ();
 
         Effect effect = effects_manager.get_effect (settings.get_string ("selected-effect"));
         if (effect != null)
@@ -1166,6 +1169,7 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
         {
             show_error (_("There was an error playing video from the webcam"));
         }
+        setup_effects_page_switch_sensitivity ();
     }
 
   /**
-- 
1.8.3.1