[cheese] Make actions insensitive when no webcam is present



commit 1083c461ff784cc1f84e3af1e78a4709446e0110
Author: David King <amigadave amigadave com>
Date:   Sun Jul 7 20:42:05 2013 +0100

    Make actions insensitive when no webcam is present
    
    Set the "effects", "mode" and "shoot" actions insensitive when no camera
    devices are found on startup. Fixes bug 693070.

 src/cheese-application.vala |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/src/cheese-application.vala b/src/cheese-application.vala
index beb3498..99f2dd7 100644
--- a/src/cheese-application.vala
+++ b/src/cheese-application.vala
@@ -272,7 +272,12 @@ public class Cheese.Application : Gtk.Application
      */
     public void setup_camera ()
     {
-        double value;
+        var effects = this.lookup_action ("effects") as SimpleAction;
+        var mode = this.lookup_action ("mode") as SimpleAction;
+        var shoot = this.lookup_action ("shoot") as SimpleAction;
+        effects.set_enabled (false);
+        mode.set_enabled (false);
+        shoot.set_enabled (false);
 
         var video_preview = main_window.get_video_preview ();
         camera = new Camera (video_preview, device,
@@ -286,12 +291,14 @@ public class Cheese.Application : Gtk.Application
         catch (Error err)
         {
             video_preview.hide ();
-            warning ("Error: %s\n", err.message);
+            message ("Error during camera setup: %s\n", err.message);
             main_window.show_error (err.message);
 
             return;
         }
 
+        double value;
+
         value = settings.get_double ("brightness");
         if (value != 0.0)
         {
@@ -316,13 +323,6 @@ public class Cheese.Application : Gtk.Application
             camera.set_balance_property ("saturation", value);
         }
 
-        var effects = this.lookup_action ("effects") as SimpleAction;
-        var mode = this.lookup_action ("mode") as SimpleAction;
-        var shoot = this.lookup_action ("shoot") as SimpleAction;
-        effects.set_enabled (false);
-        mode.set_enabled (false);
-        shoot.set_enabled (false);
-
         camera.state_flags_changed.connect (on_camera_state_flags_changed);
         main_window.set_camera (camera);
         camera.play ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]