Blame SOURCES/0050-cheese-Don-t-allow-changing-the-camera-and-or-its-re.patch

ecdf9b
From b6eb2f95f6dfac8d0f332c3fb7fca8c711f68ad6 Mon Sep 17 00:00:00 2001
ecdf9b
From: Hans de Goede <hdegoede@redhat.com>
ecdf9b
Date: Thu, 20 Jun 2013 16:53:22 +0200
ecdf9b
Subject: [PATCH 50/50] cheese: Don't allow changing the camera and/or its
ecdf9b
 resolution while recording
ecdf9b
ecdf9b
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ecdf9b
ecdf9b
Conflicts:
ecdf9b
	src/cheese-window.vala
ecdf9b
---
ecdf9b
 src/cheese-main.vala        |  1 +
ecdf9b
 src/cheese-preferences.vala | 16 +++++++++++++++-
ecdf9b
 src/cheese-window.vala      | 16 ++++++++++++++++
ecdf9b
 3 files changed, 32 insertions(+), 1 deletion(-)
ecdf9b
ecdf9b
diff --git a/src/cheese-main.vala b/src/cheese-main.vala
ecdf9b
index 761f1b5..a62f8d0 100644
ecdf9b
--- a/src/cheese-main.vala
ecdf9b
+++ b/src/cheese-main.vala
ecdf9b
@@ -155,6 +155,7 @@ public class Cheese.Main : Gtk.Application
ecdf9b
       main_window.show ();
ecdf9b
       create_camera (device);
ecdf9b
       preferences_dialog = new PreferencesDialog (camera);
ecdf9b
+      main_window.set_preferences_dialog (preferences_dialog);
ecdf9b
       preferences_dialog.camera_error.connect (on_camera_error);
ecdf9b
       preferences_dialog.setup_camera ();
ecdf9b
     }
ecdf9b
diff --git a/src/cheese-preferences.vala b/src/cheese-preferences.vala
ecdf9b
index df2ded2..d16930a 100644
ecdf9b
--- a/src/cheese-preferences.vala
ecdf9b
+++ b/src/cheese-preferences.vala
ecdf9b
@@ -25,6 +25,7 @@ public class Cheese.PreferencesDialog : GLib.Object
ecdf9b
 {
ecdf9b
   private Cheese.Camera camera;
ecdf9b
   private bool camera_needs_setup;
ecdf9b
+  private bool camera_controls_sensitive;
ecdf9b
   private string camera_device_node;
ecdf9b
 
ecdf9b
   private GLib.Settings settings;
ecdf9b
@@ -58,6 +59,7 @@ public class Cheese.PreferencesDialog : GLib.Object
ecdf9b
   public PreferencesDialog (Cheese.Camera camera)
ecdf9b
   {
ecdf9b
     this.camera = camera;
ecdf9b
+    this.camera_controls_sensitive = true;
ecdf9b
 
ecdf9b
     settings = new GLib.Settings ("org.gnome.Cheese");
ecdf9b
 
ecdf9b
@@ -539,7 +541,7 @@ public class Cheese.PreferencesDialog : GLib.Object
ecdf9b
                       0, dev.get_name () + " (" + dev.get_device_node () + ")",
ecdf9b
                       1, dev);
ecdf9b
 
ecdf9b
-    if (camera_model.iter_n_children (null) > 1)
ecdf9b
+    if (camera_model.iter_n_children (null) > 1 && camera_controls_sensitive)
ecdf9b
       source_combo.sensitive = true;
ecdf9b
 
ecdf9b
     if (camera_needs_setup)
ecdf9b
@@ -595,6 +597,18 @@ public class Cheese.PreferencesDialog : GLib.Object
ecdf9b
   }
ecdf9b
 
ecdf9b
   /**
ecdf9b
+   * Set camera controls sensitivity
ecdf9b
+   */
ecdf9b
+  public void set_camera_controls_sensitivities (bool sensitive)
ecdf9b
+  {
ecdf9b
+    camera_controls_sensitive = sensitive;
ecdf9b
+    photo_resolution_combo.sensitive = sensitive;
ecdf9b
+    video_resolution_combo.sensitive = sensitive;
ecdf9b
+    if (camera_model.iter_n_children (null) > 1)
ecdf9b
+      source_combo.sensitive = sensitive;
ecdf9b
+  }
ecdf9b
+
ecdf9b
+  /**
ecdf9b
    * Show the dialog.
ecdf9b
    */
ecdf9b
   public void show ()
ecdf9b
diff --git a/src/cheese-window.vala b/src/cheese-window.vala
ecdf9b
index 77efd32..fc38850 100644
ecdf9b
--- a/src/cheese-window.vala
ecdf9b
+++ b/src/cheese-window.vala
ecdf9b
@@ -104,6 +104,8 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
ecdf9b
 
ecdf9b
   private Cheese.ShareableMedia shareable_media;
ecdf9b
 
ecdf9b
+  private PreferencesDialog preferences_dialog;
ecdf9b
+
ecdf9b
   /**
ecdf9b
    * Responses from the delete files confirmation dialog.
ecdf9b
    *
ecdf9b
@@ -501,6 +503,8 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
ecdf9b
 
ecdf9b
     var effects = this.application.lookup_action ("effects") as SimpleAction;
ecdf9b
     effects.set_enabled (true);    
ecdf9b
+
ecdf9b
+    preferences_dialog.set_camera_controls_sensitivities (true);
ecdf9b
   }
ecdf9b
 
ecdf9b
   /**
ecdf9b
@@ -521,6 +525,8 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
ecdf9b
         effects_toggle_button.set_active (false);
ecdf9b
       }
ecdf9b
     }
ecdf9b
+
ecdf9b
+    preferences_dialog.set_camera_controls_sensitivities (false);
ecdf9b
   }
ecdf9b
 
ecdf9b
   /**
ecdf9b
@@ -1504,4 +1510,14 @@ public class Cheese.MainWindow : Gtk.ApplicationWindow
ecdf9b
     {
ecdf9b
         this.camera = camera;
ecdf9b
     }
ecdf9b
+
ecdf9b
+    /**
ecdf9b
+     * Set the preferences-dialog.
ecdf9b
+     *
ecdf9b
+     * @param preferences_dialog the preferences-dialog to set
ecdf9b
+     */
ecdf9b
+    public void set_preferences_dialog (PreferencesDialog  preferences_dialog)
ecdf9b
+    {
ecdf9b
+        this.preferences_dialog = preferences_dialog;
ecdf9b
+    }
ecdf9b
 }
ecdf9b
-- 
ecdf9b
1.8.2.1
ecdf9b