Skip to content

Commit 0467b78

Browse files
committed
Corrected windows size on save XML upgrade
Additionally enabled progress bar when initial settings were loaded
1 parent 75c3370 commit 0467b78

3 files changed

Lines changed: 22 additions & 19 deletions

File tree

Sources/AppConfig.cs

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ private void LoadSettings()
164164
_settings.ShowSessionProgress = true;
165165
_settings.StyleDesiredWidth = 0;
166166
}
167-
if (_settings.Version == 2) // Coming from version 1.11 to 1.14
167+
if (_settings.Version == 2) // Coming from version 1.11 - 1.14
168168
{
169169
_settings.Version = 3;
170170
_settings.ShortcutHitUndoEnable = false;
@@ -199,31 +199,34 @@ private void LoadSettings()
199199
_settings.SuccessionHits = 0;
200200
_settings.SuccessionHitsWay = 0;
201201
_settings.SuccessionHitsPB = 0;
202+
203+
if (baseVersion < 0)
204+
{
205+
// Use different hot keys when loaded without any previous settings
206+
// (we don't have to take care of previous user/default settings)
207+
_settings.ShortcutHitKeyCode = 0x10000 | 0x70; // Shift F1
208+
_settings.ShortcutWayHitKeyCode = 0x10000 | 0x71; // Shift F2
209+
_settings.ShortcutSplitKeyCode = 0x10000 | 0x72; // Shift F3
210+
_settings.ShortcutPBKeyCode = 0x10000 | 0x73; // Shift F4
211+
_settings.ShortcutHitUndoKeyCode = 0x10000 | 0x74; // Shift F5
212+
_settings.ShortcutWayHitUndoKeyCode = 0x10000 | 0x75; // Shift F6
213+
_settings.ShortcutSplitPrevKeyCode = 0x10000 | 0x76; // Shift F7
214+
_settings.ShortcutResetKeyCode = 0x10000 | 0x77; // Shift F8
215+
}
202216
}
203217
if (_settings.Version == 5) // Coming from version 1.17
204218
{
205219
_settings.Version = 6;
220+
_settings.MainHeight -= 59; // "Succession" group box starts collapsed
206221
_settings.AlwaysOnTop = false;
207-
_settings.ShowSessionProgress = false;
222+
223+
// Only enable progress bar when new settings were created
224+
_settings.ShowSessionProgress = (baseVersion < 0 ? true : false);
208225
// Should be set false but in version 5 it was introduced with true,
209226
// so only for users that were running version 5, we keep it true.
210227
_settings.StyleSuperscriptPB = (baseVersion == 5 ? true : false);
211228
}
212229

213-
if (baseVersion < 0) // no settings were loaded, we created complete new one
214-
{
215-
// Use different hot keys when loaded the first time
216-
// (we don't have to take care of previous user/default settings)
217-
_settings.ShortcutHitKeyCode = 0x10000 | 0x70; // Shift F1
218-
_settings.ShortcutWayHitKeyCode = 0x10000 | 0x71; // Shift F2
219-
_settings.ShortcutSplitKeyCode = 0x10000 | 0x72; // Shift F3
220-
_settings.ShortcutPBKeyCode = 0x10000 | 0x73; // Shift F4
221-
_settings.ShortcutHitUndoKeyCode = 0x10000 | 0x74; // Shift F5
222-
_settings.ShortcutWayHitUndoKeyCode = 0x10000 | 0x75; // Shift F6
223-
_settings.ShortcutSplitPrevKeyCode = 0x10000 | 0x76; // Shift F7
224-
_settings.ShortcutResetKeyCode = 0x10000 | 0x77; // Shift F8
225-
}
226-
227230
// Apply settings..
228231
pi.ProfileUpdateBegin();
229232

@@ -297,7 +300,7 @@ private void SaveSettings()
297300
ShortcutsKey key = new ShortcutsKey();
298301

299302
_settings.MainWidth = this.Width;
300-
_settings.MainHeight = this.Height;
303+
_settings.MainHeight = this.Height - gpSuccession.Height + gpSuccession_Height; // always save expandend values
301304
_settings.AlwaysOnTop = this.TopMost;
302305
_settings.HotKeyMethod = (int)sc.NextStart_Method;
303306
key = sc.Key_Get(Shortcuts.SC_Type.SC_Type_Reset);

Sources/Form1.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ public Form1()
5757
gpSuccession_ValueChangedSema = false;
5858
DataGridView1_ValueChangedSema = false;
5959

60-
gpSuccession_Height = gpSuccession.Height;
61-
ShowSuccessionMenu(false); // start collapsed
60+
gpSuccession_Height = gpSuccession.Height; // remember expanded size from designer settings
6261

6362
pi = DataGridView1; // for better capsulation
6463
om = new OutModule(pi);
@@ -74,6 +73,7 @@ private void Form1_Load(object sender, EventArgs e)
7473
Text = Text + " - v" + Application.ProductVersion + " " + OsLayer.Name;
7574
btnHit.Select();
7675
LoadSettings();
76+
ShowSuccessionMenu(false); // start collapsed
7777
UpdateProgressAndTotals(true); // Write very first output once after application start
7878
}
7979

Sources/HitCounterManagerInit.xml

-2 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)