[chronojump] Load last session/mode before app1.Show



commit 8fbf6c363419207ba3d8a81a0bccf57beedb1a32
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Aug 4 18:38:14 2020 +0200

    Load last session/mode before app1.Show

 src/gui/app1/chronojump.cs | 16 ++++++++--------
 src/preferences.cs         | 14 +++++++-------
 2 files changed, 15 insertions(+), 15 deletions(-)
---
diff --git a/src/gui/app1/chronojump.cs b/src/gui/app1/chronojump.cs
index 5c4b3ba1..286ddd40 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -712,6 +712,14 @@ public partial class ChronoJumpWindow
                } else
                        LogB.Information("Ping discarded (Compujump)");
 
+               if(preferences.loadLastSessionAtStart && preferences.lastSessionID > 0 && ! 
configChronojump.Compujump)
+               {
+                       currentSession = SqliteSession.Select (preferences.lastSessionID.ToString());
+                       on_load_session_accepted();
+               }
+               if(preferences.loadLastModeAtStart && preferences.lastMode != 
Constants.Menuitem_modes.UNDEFINED && ! configChronojump.Compujump)
+                       changeMode(preferences.lastMode);
+
                initialize_menu_or_menu_tiny();
 
                testNewStuff();
@@ -744,14 +752,6 @@ public partial class ChronoJumpWindow
                if(! showSendLog && notebook_sup.CurrentPage == Convert.ToInt32(notebook_sup_pages.START))
                        new ChronojumpLogo (drawingarea_chronojump_logo, viewport_chronojump_logo, 
preferences.logoAnimatedShow);
 
-               if(preferences.loadLastSessionAtStart && preferences.lastSessionID > 0 && ! 
configChronojump.Compujump)
-               {
-                       currentSession = SqliteSession.Select (preferences.lastSessionID.ToString());
-                       on_load_session_accepted();
-               }
-               if(preferences.loadLastModeAtStart && preferences.lastMode != 
Constants.Menuitem_modes.UNDEFINED && ! configChronojump.Compujump)
-                       changeMode(preferences.lastMode);
-
                LogB.Information("Chronojump window started");
        }
 
diff --git a/src/preferences.cs b/src/preferences.cs
index 7e36c0ba..1ecf6512 100644
--- a/src/preferences.cs
+++ b/src/preferences.cs
@@ -28,7 +28,7 @@ public class Preferences
         * these are sent to preferences window
         */
 
-       //appearance tab
+       //main tab
        public enum MaximizedTypes { NO, YES, YESUNDECORATED};
        public MaximizedTypes maximized;
        public bool personWinHide;
@@ -40,6 +40,12 @@ public class Preferences
        public bool colorBackgroundIsDark; //this is assigned when colorBackgroundString changes. And this is 
used by the rest of the program. Not stored on SQL.
        public bool logoAnimatedShow;
 
+       public bool loadLastSessionAtStart;
+       public int lastSessionID;
+       public bool loadLastModeAtStart;
+       public Constants.Menuitem_modes lastMode;
+
+
        public enum UnitsEnum { METRIC, IMPERIAL };
        public UnitsEnum units;
 
@@ -230,12 +236,6 @@ public class Preferences
 
        public bool debugMode;
 
-       //session
-       public bool loadLastSessionAtStart;
-       public int lastSessionID;
-       public bool loadLastModeAtStart;
-       public Constants.Menuitem_modes lastMode;
-
        /*
         * these are unused on SqlitePreferences.SelectAll
         */


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