[chronojump] encoder display graph/table/signal updated on sql on exit only if changed
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] encoder display graph/table/signal updated on sql on exit only if changed
- Date: Mon, 9 Aug 2021 16:30:41 +0000 (UTC)
commit 70aaa74d21de7795af71db30814295028a29ff34
Author: Xavier de Blas <xaviblas gmail com>
Date: Mon Aug 9 17:45:31 2021 +0200
encoder display graph/table/signal updated on sql on exit only if changed
src/gui/app1/chronojump.cs | 18 ++++--------------
src/preferences.cs | 3 +++
src/sqlite/preferences.cs | 3 +++
3 files changed, 10 insertions(+), 14 deletions(-)
---
diff --git a/src/gui/app1/chronojump.cs b/src/gui/app1/chronojump.cs
index 1cd0a2cab..0115900d6 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -2814,8 +2814,10 @@ public partial class ChronoJumpWindow
LogB.Information("Updates on SQL");
//as ShowOnlyBars stuff can be changed during capture, store at sql here
- SqlitePreferences.Update("encoderCaptureShowOnlyBars",
- preferences.encoderCaptureShowOnlyBars.GetInt.ToString(), false);
+
+ if(preferences.encoderCaptureShowOnlyBars.GetInt !=
preferences.encoderCaptureShowOnlyBarsStored.GetInt)
+ SqlitePreferences.Update("encoderCaptureShowOnlyBars",
+ preferences.encoderCaptureShowOnlyBars.GetInt.ToString(), false);
LogB.Information("Bye3!");
@@ -3924,18 +3926,6 @@ public partial class ChronoJumpWindow
hbox_contacts_capture_show_need_one.Visible = false;
else
hbox_contacts_capture_show_need_one.Visible = true;
-
- /*
- update the preferences variable
- note as can be changed while capturing, it will be saved to SQL on exit
- to not have problems with SQL while capturing
- */
- /* TODO:
- preferences.encoderCaptureShowOnlyBars = new EncoderCaptureDisplay(
- check_encoder_capture_signal.Active,
- check_encoder_capture_table.Active,
- check_encoder_capture_bars.Active);
- */
}
private void radio_mode_contacts_analyze_buttons_visible (Constants.Modes m)
diff --git a/src/preferences.cs b/src/preferences.cs
index 7151fa782..9f522fe4c 100644
--- a/src/preferences.cs
+++ b/src/preferences.cs
@@ -61,7 +61,10 @@ public class Preferences
public UnitsEnum units;
public bool encoderCaptureInfinite;
+
public EncoderCaptureDisplay encoderCaptureShowOnlyBars;
+ public EncoderCaptureDisplay encoderCaptureShowOnlyBarsStored; //to update sql on exit if changed
+
public int encoderCaptureShowNRepetitions;
public bool showPower;
diff --git a/src/sqlite/preferences.cs b/src/sqlite/preferences.cs
index f14499c42..0e794c23f 100644
--- a/src/sqlite/preferences.cs
+++ b/src/sqlite/preferences.cs
@@ -532,7 +532,10 @@ class SqlitePreferences : Sqlite
else if(reader[0].ToString() == EncoderCaptureInfinite)
preferences.encoderCaptureInfinite = reader[1].ToString() == "True";
else if(reader[0].ToString() == "encoderCaptureShowOnlyBars")
+ {
preferences.encoderCaptureShowOnlyBars = new
EncoderCaptureDisplay(Convert.ToInt32(reader[1].ToString()));
+ preferences.encoderCaptureShowOnlyBarsStored =
preferences.encoderCaptureShowOnlyBars;
+ }
else if(reader[0].ToString() == "encoderCaptureShowNRepetitions")
preferences.encoderCaptureShowNRepetitions =
Convert.ToInt32(reader[1].ToString());
else if(reader[0].ToString() == "showPower")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]