[chronojump] Webcam preferences combos get filled



commit b2c6f14192f2fa5412047d20f6aa1773b3738a52
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Jul 5 12:10:36 2019 +0200

    Webcam preferences combos get filled

 glade/preferences_win.glade | 10 +++++-----
 src/gui/preferences.cs      | 13 ++++++-------
 2 files changed, 11 insertions(+), 12 deletions(-)
---
diff --git a/glade/preferences_win.glade b/glade/preferences_win.glade
index 6851cc6e..6a6285ed 100644
--- a/glade/preferences_win.glade
+++ b/glade/preferences_win.glade
@@ -3602,7 +3602,7 @@ Other</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
                                 <property name="xalign">0</property>
-                                <property name="label" translatable="yes">Search supported modes</property>
+                                <property name="label" translatable="yes">Check supported modes</property>
                               </widget>
                               <packing>
                                 <property name="expand">False</property>
@@ -3620,7 +3620,7 @@ Other</property>
                                   <widget class="GtkLabel" id="label86">
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
-                                    <property name="label" translatable="yes">Search</property>
+                                    <property name="label" translatable="yes">Check!</property>
                                   </widget>
                                 </child>
                               </widget>
@@ -3852,6 +3852,9 @@ Other</property>
                                     <property name="x_options">GTK_FILL</property>
                                   </packing>
                                 </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
                                 <child>
                                   <widget class="GtkLabel" id="label_camera_pixel_format">
                                     <property name="visible">True</property>
@@ -3879,9 +3882,6 @@ Other</property>
                                     <property name="x_options">GTK_FILL</property>
                                   </packing>
                                 </child>
-                                <child>
-                                  <placeholder/>
-                                </child>
                                 <child>
                                   <widget class="GtkLabel" id="label95">
                                     <property name="visible">True</property>
diff --git a/src/gui/preferences.cs b/src/gui/preferences.cs
index c7dbf1f6..3ab2dd1d 100644
--- a/src/gui/preferences.cs
+++ b/src/gui/preferences.cs
@@ -814,8 +814,9 @@ public class PreferencesWindow
 
                if(pixelFormat != "" && wfsm != null)
                {
+                       string currentResolution = getSelectedResolution();
                        UtilGtk.ComboUpdate(combo_camera_resolution, 
wfsm.PopulateListByPixelFormat(pixelFormat));
-                       combo_camera_resolution.Active = 0;
+                       combo_camera_resolution.Active = UtilGtk.ComboMakeActive(combo_camera_resolution, 
currentResolution);
                }
        }
        private void on_combo_camera_resolution_changed (object o, EventArgs args)
@@ -826,8 +827,9 @@ public class PreferencesWindow
 
                if(resolution != "" && resolution != Catalog.GetString("Custom") && wfsm != null)
                {
+                       string currentFramerate = getSelectedFramerate();
                        UtilGtk.ComboUpdate(combo_camera_framerate, wfsm.GetFramerates (pixelFormat, 
resolution));
-                       combo_camera_framerate.Active = 0;
+                       combo_camera_framerate.Active = UtilGtk.ComboMakeActive(combo_camera_framerate, 
currentFramerate);
                }
        }
        private void on_combo_camera_framerate_changed (object o, EventArgs args)
@@ -923,12 +925,9 @@ public class PreferencesWindow
                bool fillCombos = true;
                if(fillCombos)
                {
-                       UtilGtk.ComboUpdate(combo_camera_resolution, wfsm.PopulateFirstList());
-                       combo_camera_resolution.Active = 0;
-
+                       string currentPixelFormat = getSelectedPixelFormat();
                        UtilGtk.ComboUpdate(combo_camera_pixel_format, wfsm.GetPixelFormats());
-                       combo_camera_pixel_format.Active = 0;
-                       hbox_combo_camera_pixel_format.ShowAll();
+                       combo_camera_pixel_format.Active = UtilGtk.ComboMakeActive(combo_camera_pixel_format, 
currentPixelFormat);
 
                        hbox_combo_camera_pixel_format.Sensitive = true;
                        hbox_combo_camera_resolution.Sensitive = true;


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