[chronojump] race analyzer pps show equivalence to cm in preferences
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] race analyzer pps show equivalence to cm in preferences
- Date: Thu, 28 Jan 2021 16:31:02 +0000 (UTC)
commit 03549e9eac9b382e7403e8c9c182bacc48ec5583
Author: Xavier de Blas <xaviblas gmail com>
Date: Thu Jan 28 17:30:07 2021 +0100
race analyzer pps show equivalence to cm in preferences
glade/preferences_win.glade | 99 ++++++++++++++++++++++++++++++---------------
src/gui/preferences.cs | 17 ++++++++
2 files changed, 83 insertions(+), 33 deletions(-)
---
diff --git a/glade/preferences_win.glade b/glade/preferences_win.glade
index 2004c5d8..598ef3f0 100644
--- a/glade/preferences_win.glade
+++ b/glade/preferences_win.glade
@@ -5050,6 +5050,7 @@ It starts before and arrives there with some speed.</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">8</property>
+ <property name="spacing">12</property>
<child>
<widget class="GtkTable" id="table8">
<property name="visible">True</property>
@@ -5128,39 +5129,6 @@ It starts before and arrives there with some speed.</property>
<property name="x_options"/>
</packing>
</child>
- <child>
- <widget class="GtkHBox" id="hbox86">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <widget class="GtkSpinButton" id="spin_run_encoder_pps">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">●</property>
- <property name="invisible_char_set">True</property>
- <property name="primary_icon_activatable">False</property>
- <property name="secondary_icon_activatable">False</property>
- <property name="primary_icon_sensitive">True</property>
- <property name="secondary_icon_sensitive">True</property>
- <property name="adjustment">10 1 1000 1 1 0</property>
- <property name="climb_rate">1</property>
- <property name="numeric">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- </packing>
- </child>
<child>
<widget class="GtkAlignment" id="alignment29">
<property name="visible">True</property>
@@ -5206,6 +5174,40 @@ It starts before and arrives there with some speed.</property>
<property name="x_options"/>
</packing>
</child>
+ <child>
+ <widget class="GtkHBox" id="hbox86">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <widget class="GtkSpinButton" id="spin_run_encoder_pps">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="invisible_char_set">True</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ <property name="adjustment">10 1 1000 1 1 0</property>
+ <property name="climb_rate">1</property>
+ <property name="numeric">True</property>
+ <signal name="value_changed"
handler="on_spin_run_encoder_pps_value_changed" swapped="no"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
<child>
<widget class="GtkAlignment" id="alignment30">
<property name="visible">True</property>
@@ -5242,6 +5244,18 @@ It starts before and arrives there with some speed.</property>
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <widget class="GtkLabel" id="label148">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label">pps</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</widget>
</child>
</widget>
@@ -5260,6 +5274,25 @@ It starts before and arrives there with some speed.</property>
<property name="position">0</property>
</packing>
</child>
+ <child>
+ <widget class="GtkAlignment" id="alignment31">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="left_padding">30</property>
+ <child>
+ <widget class="GtkLabel" id="label_pps_equivalent">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</widget>
</child>
</widget>
diff --git a/src/gui/preferences.cs b/src/gui/preferences.cs
index 724bb2c5..aa1b146c 100644
--- a/src/gui/preferences.cs
+++ b/src/gui/preferences.cs
@@ -189,6 +189,7 @@ public class PreferencesWindow
//runEncoder tab
[Widget] Gtk.SpinButton spin_run_encoder_acceleration;
[Widget] Gtk.SpinButton spin_run_encoder_pps;
+ [Widget] Gtk.Label label_pps_equivalent;
//multimedia tab
[Widget] Gtk.CheckButton checkbutton_volume;
@@ -738,6 +739,7 @@ public class PreferencesWindow
//runEncoder -->
PreferencesWindowBox.spin_run_encoder_acceleration.Value = preferences.runEncoderMinAccel;
PreferencesWindowBox.spin_run_encoder_pps.Value = preferences.runEncoderPPS;
+ PreferencesWindowBox.update_run_encoder_pps_equivalence ();
//language -->
if(preferences.language == "")
@@ -971,6 +973,21 @@ public class PreferencesWindow
* end of triggers stuff
*/
+
+ // ---- race analyzer ---->
+
+ private void on_spin_run_encoder_pps_value_changed (object o, EventArgs args)
+ {
+ update_run_encoder_pps_equivalence ();
+ }
+ private void update_run_encoder_pps_equivalence ()
+ {
+ label_pps_equivalent.Text = string.Format(Catalog.GetString("{0} pps is equivalent to a
resolution of {1} cm."),
+ spin_run_encoder_pps.Value, 0.3003 * spin_run_encoder_pps.Value);
+ }
+
+ // <---- end of race analyzer ----
+
private void createComboCamera(string current, string pixelFormat, string resolution, string
framerate)
{
// 1) videoDevice
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]