[cheese/wip/hans-fixes-master: 14/16] Fix updating sensitivity of device selection combo
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cheese/wip/hans-fixes-master: 14/16] Fix updating sensitivity of device selection combo
- Date: Sun, 16 Jun 2013 20:59:20 +0000 (UTC)
commit 6c5c7ebaf58387fb93bfe136cfc654cf986ff157
Author: Hans de Goede <hdegoede redhat com>
Date: Thu Jun 13 10:30:02 2013 +0200
Fix updating sensitivity of device selection combo
If Cheese was started with 1 device, and then a second was added, the
device selection stayed insensitive, making it impossible to select the
second device.
This fixes the problem, and also makes the combo insensitive again when
going from >= 2 devices to <= 1 device.
Signed-off-by: Hans de Goede <hdegoede redhat com>
src/cheese-preferences.vala | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/cheese-preferences.vala b/src/cheese-preferences.vala
index d4d5501..e078cbb 100644
--- a/src/cheese-preferences.vala
+++ b/src/cheese-preferences.vala
@@ -136,8 +136,7 @@ public class Cheese.PreferencesDialog : GLib.Object
camera_model = new ListStore (2, typeof (string), typeof (Cheese.CameraDevice));
source_combo.model = camera_model;
- if (devices.len <= 1)
- source_combo.sensitive = false;
+ source_combo.sensitive = false;
devices.foreach(add_camera_device);
@@ -499,6 +498,9 @@ public class Cheese.PreferencesDialog : GLib.Object
if (camera.get_selected_device ().get_device_node () == dev.get_device_node ())
source_combo.set_active_iter (iter);
+
+ if (camera_model.iter_n_children (null) > 1)
+ source_combo.sensitive = true;
}
/**
@@ -522,6 +524,9 @@ public class Cheese.PreferencesDialog : GLib.Object
this.dialog.hide();
}
camera_model.remove (iter);
+
+ if (camera_model.iter_n_children (null) <= 1)
+ source_combo.sensitive = false;
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]