[chronojump] Fixed 3 unneded updated sql preferences (when they had no change)
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Fixed 3 unneded updated sql preferences (when they had no change)
- Date: Fri, 7 Feb 2020 12:17:59 +0000 (UTC)
commit f36524448e94269c1f72e6149438101fee34ced4
Author: Xavier de Blas <xaviblas gmail com>
Date: Fri Feb 7 11:37:19 2020 +0100
Fixed 3 unneded updated sql preferences (when they had no change)
src/gui/preferences.cs | 35 +++++++++++++++++++----------------
1 file changed, 19 insertions(+), 16 deletions(-)
---
diff --git a/src/gui/preferences.cs b/src/gui/preferences.cs
index 6306d242..49232891 100644
--- a/src/gui/preferences.cs
+++ b/src/gui/preferences.cs
@@ -1740,17 +1740,19 @@ public class PreferencesWindow
SqlitePreferences.Update("showAngle",
PreferencesWindowBox.checkbutton_angle.Active.ToString(), true);
preferences.showAngle = PreferencesWindowBox.checkbutton_angle.Active;
}
-
+
if(PreferencesWindowBox.checkbutton_show_tv_tc_index.Active) {
- SqlitePreferences.Update("showQIndex",
PreferencesWindowBox.radiobutton_show_q_index.Active.ToString(), true);
- SqlitePreferences.Update("showDjIndex",
PreferencesWindowBox.radiobutton_show_dj_index.Active.ToString(), true);
- preferences.showQIndex = PreferencesWindowBox.radiobutton_show_q_index.Active;
- preferences.showDjIndex = PreferencesWindowBox.radiobutton_show_dj_index.Active;
+ preferences.showQIndex = Preferences.PreferencesChange(
+ "showQIndex", preferences.showQIndex,
+ PreferencesWindowBox.radiobutton_show_q_index.Active);
+ preferences.showDjIndex = Preferences.PreferencesChange(
+ "showDjIndex", preferences.showDjIndex,
+ PreferencesWindowBox.radiobutton_show_dj_index.Active);
} else {
- SqlitePreferences.Update("showQIndex", "False", true);
- SqlitePreferences.Update("showDjIndex", "False", true);
- preferences.showQIndex = false;
- preferences.showDjIndex = false;
+ preferences.showQIndex = Preferences.PreferencesChange(
+ "showQIndex", preferences.showQIndex, false);
+ preferences.showDjIndex = Preferences.PreferencesChange(
+ "showDjIndex", preferences.showDjIndex, false);
}
preferences.jumpsDjGraphHeights = Preferences.PreferencesChange(
@@ -1956,9 +1958,10 @@ public class PreferencesWindow
else // (PreferencesWindowBox.radio_encoder_1RM_weighted3.Active)
encoder1RMMethod = Constants.Encoder1RMMethod.WEIGHTED3;
- SqlitePreferences.Update("encoder1RMMethod", encoder1RMMethod.ToString(), true);
- preferences.encoder1RMMethod = encoder1RMMethod;
-
+ if(preferences.encoder1RMMethod != encoder1RMMethod) {
+ SqlitePreferences.Update("encoder1RMMethod", encoder1RMMethod.ToString(), true);
+ preferences.encoder1RMMethod = encoder1RMMethod;
+ }
//---- end of encoder other
@@ -2058,13 +2061,13 @@ public class PreferencesWindow
preferences.videoStopAfter = selected_camera_stop_after;
}
- //end of camera stuff
-
- if(PreferencesWindowBox.radio_export_latin.Active) {
+ if(preferences.CSVExportDecimalSeparator == "POINT" &&
PreferencesWindowBox.radio_export_latin.Active)
+ {
SqlitePreferences.Update("CSVExportDecimalSeparator","COMMA", true);
preferences.CSVExportDecimalSeparator = "COMMA";
}
- else {
+ else if(preferences.CSVExportDecimalSeparator == "COMMA" && !
PreferencesWindowBox.radio_export_latin.Active)
+ {
SqlitePreferences.Update("CSVExportDecimalSeparator","POINT", true);
preferences.CSVExportDecimalSeparator = "POINT";
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]