Skip to content

Commit b1eca6a

Browse files
authored
Merge pull request #1216 from Ordisoftware/dev
Dev
2 parents 45f6690 + 4f79ad4 commit b1eca6a

17 files changed

+69
-150
lines changed

Project/App.config

+2-2
Original file line numberDiff line numberDiff line change
@@ -742,11 +742,11 @@
742742
</dependentAssembly>
743743
<dependentAssembly>
744744
<assemblyIdentity name="SQLitePCLRaw.core" publicKeyToken="1488e028ca7ab535" culture="neutral" />
745-
<bindingRedirect oldVersion="0.0.0.0-2.1.1.1705" newVersion="2.1.1.1705" />
745+
<bindingRedirect oldVersion="0.0.0.0-2.1.2.1721" newVersion="2.1.2.1721" />
746746
</dependentAssembly>
747747
<dependentAssembly>
748748
<assemblyIdentity name="SQLitePCLRaw.batteries_v2" publicKeyToken="8226ea5df37bcae9" culture="neutral" />
749-
<bindingRedirect oldVersion="0.0.0.0-2.1.1.1705" newVersion="2.1.1.1705" />
749+
<bindingRedirect oldVersion="0.0.0.0-2.1.2.1721" newVersion="2.1.2.1721" />
750750
</dependentAssembly>
751751
</assemblyBinding>
752752
</runtime>

Project/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// en utilisant '*', comme indiqué ci-dessous :
3333
// [assembly: AssemblyVersion("1.0.*")]
3434
[assembly: NeutralResourcesLanguage("en")]
35-
[assembly: AssemblyVersion("9.34.0.0")]
36-
[assembly: AssemblyFileVersion("9.34.0.0")]
35+
[assembly: AssemblyVersion("9.33.0.0")]
36+
[assembly: AssemblyFileVersion("9.33.0.0")]

Project/Source/Common/Core/Globalization/SysTranslations.Application.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/// You may add additional accurate notices of copyright ownership.
1212
/// </license>
1313
/// <created> 2016-04 </created>
14-
/// <edited> 2022-06 </edited>
14+
/// <edited> 2022-09 </edited>
1515
namespace Ordisoftware.Core;
1616

1717
/// <summary>
@@ -129,10 +129,10 @@ static public TranslationsDictionary ApplicationMustExit
129129
[Language.FR] = "Quitter l'application ?"
130130
};
131131

132-
static public readonly TranslationsDictionary CantExitWhileGenerating = new()
132+
static public readonly TranslationsDictionary CantExitWhileProcessing = new()
133133
{
134-
[Language.EN] = "Can't exit application while generating data.",
135-
[Language.FR] = "Impossible de quitter l'application durant la génération des données."
134+
[Language.EN] = "Can't exit application while processing data.",
135+
[Language.FR] = "Impossible de quitter l'application durant le traitement des données."
136136
};
137137

138138
static public readonly TranslationsDictionary AskToShutdownComputer = new()

Project/Source/Common/Core/Globals/Globals.State.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/// You may add additional accurate notices of copyright ownership.
1212
/// </license>
1313
/// <created> 2016-04 </created>
14-
/// <edited> 2021-09 </edited>
14+
/// <edited> 2022-09 </edited>
1515
namespace Ordisoftware.Core;
1616

1717
/// <summary>
@@ -45,6 +45,11 @@ static partial class Globals
4545
/// </summary>
4646
static public bool IsLoadingData { get; set; }
4747

48+
/// <summary>
49+
/// Indicates if the application is in loading or rendering or generating data stage.
50+
/// </summary>
51+
static public bool IsProcessingData => IsLoadingData || IsRendering || IsGenerating;
52+
4853
/// <summary>
4954
/// Indicates if the application is ready to interact with the user or do its purpose.
5055
/// </summary>

Project/Source/Common/Hebrew/WinControls/LettersControl.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/// You may add additional accurate notices of copyright ownership.
1212
/// </license>
1313
/// <created> 2012-10 </created>
14-
/// <edited> 2022-07 </edited>
14+
/// <edited> 2022-09 </edited>
1515
namespace Ordisoftware.Hebrew;
1616

1717
public enum LettersControlFocusSelect
@@ -563,7 +563,6 @@ private void ActionPaste_Click(object sender, EventArgs e)
563563
{
564564
Focus(LettersControlFocusSelect.All);
565565
TextBox.Text = Clipboard.GetText();
566-
//TextBoxEx.ActionPaste.PerformClick();
567566
}
568567

569568
private void ActionSearchOnline_Click(object sender, EventArgs e)
@@ -599,7 +598,7 @@ public bool UpdateControls()
599598
internal void CheckClipboardContentType()
600599
{
601600
string strContent = Clipboard.GetText();
602-
ActionPaste.Enabled = !strContent.IsNullOrEmpty() /* TODO && strContent.Length <= Settings.HebrewTextBoxMaxLength*/;
601+
ActionPaste.Enabled = !strContent.IsNullOrEmpty();
603602
if ( ActionPaste.Enabled )
604603
{
605604
var strLabel = HebrewAlphabet.IsValidUnicode(strContent)

Project/Source/Database/ApplicationDatabase.Generate.cs

+21-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/// You may add additional accurate notices of copyright ownership.
1212
/// </license>
1313
/// <created> 2016-04 </created>
14-
/// <edited> 2022-03 </edited>
14+
/// <edited> 2022-09 </edited>
1515
namespace Ordisoftware.Hebrew.Calendar;
1616

1717
[Serializable]
@@ -47,6 +47,26 @@ public bool AddGenerateErrorAndCheckIfTooMany(string method, string date, Except
4747
return LastGenerationErrors.Count >= MaxGenerateErrors;
4848
}
4949

50+
public string ShowLastGenerationErrors(string title)
51+
{
52+
string errors = LastGenerationErrors.AsMultiLine();
53+
LastGenerationErrors.Clear();
54+
errors = Settings.GetGPSText() + Globals.NL2 + errors;
55+
DebugManager.Trace(LogTraceEvent.Error, errors);
56+
using ( var form = new ShowTextForm(title, errors,
57+
false, true,
58+
MessageBoxEx.DefaultWidthLarge, MessageBoxEx.DefaultHeightLarge,
59+
false, false) )
60+
{
61+
form.TextBox.Font = new Font("Courier new", 8);
62+
form.ShowDialog();
63+
}
64+
if ( DisplayManager.QueryYesNo(SysTranslations.ContactSupport.GetLang()) )
65+
ExceptionForm.Run(new ExceptionInfo(this, new TooManyErrorsException(errors)));
66+
return errors;
67+
}
68+
69+
5070
/// <summary>
5171
/// Creates the days.
5272
/// </summary>

Project/Source/Forms/Boxes/Boards/ParashotForm.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,6 @@ private void EditFontSize_ValueChanged(object sender, EventArgs e)
332332
{
333333
DataGridView.Font = new Font("Microsoft Sans Serif", (float)EditFontSize.Value);
334334
ColumnHebrew.DefaultCellStyle.Font = new Font("Hebrew", (float)EditFontSize.Value + 5);
335-
// TODO remove if ( DataGridView.Rows.Count > 0 ) DataGridView.ColumnHeadersHeight = DataGridView.Rows[0].Height + 5;
336335
}
337336

338337
private void BindingSource_DataSourceChanged(object sender, EventArgs e)
@@ -347,7 +346,7 @@ private void DataGridView_DataError(object sender, DataGridViewDataErrorEventArg
347346
e.ThrowException = false;
348347
}
349348

350-
private KeysConverter KeysConverter = new();
349+
private readonly KeysConverter KeysConverter = new();
351350

352351
private void DataGridView_KeyDown(object sender, KeyEventArgs e)
353352
{

Project/Source/Forms/Config/PreferencesForm.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/// You may add additional accurate notices of copyright ownership.
1212
/// </license>
1313
/// <created> 2016-04 </created>
14-
/// <edited> 2022-08 </edited>
14+
/// <edited> 2022-09 </edited>
1515
namespace Ordisoftware.Hebrew.Calendar;
1616

1717
using KVPDataExportTarget = KeyValuePair<DataExportTarget, string>;
@@ -29,7 +29,6 @@ partial class PreferencesForm : Form
2929
private bool IsReady;
3030
private bool InitialHotKeyEnabled;
3131

32-
// TODO refactor in a class or dictionary
3332
public int OldShabatDay { get; private set; }
3433
public string OldLatitude { get; private set; }
3534
public string OldLongitude { get; private set; }

Project/Source/Forms/MainForm/Data/MainForm.Data.Create.cs

+2-18
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/// You may add additional accurate notices of copyright ownership.
1212
/// </license>
1313
/// <created> 2016-04 </created>
14-
/// <edited> 2022-03 </edited>
14+
/// <edited> 2022-09 </edited>
1515
namespace Ordisoftware.Hebrew.Calendar;
1616

1717
partial class MainForm
@@ -92,23 +92,7 @@ private string CreateData(int yearFirst, int yearLast)
9292
UpdateButtons();
9393
}
9494
if ( ApplicationDatabase.Instance.LastGenerationErrors.Count != 0 )
95-
{
96-
string errors = ApplicationDatabase.Instance.LastGenerationErrors.AsMultiLine();
97-
ApplicationDatabase.Instance.LastGenerationErrors.Clear();
98-
errors = Settings.GetGPSText() + Globals.NL2 + errors;
99-
DebugManager.Trace(LogTraceEvent.Error, errors);
100-
using ( var form = new ShowTextForm(Text, errors,
101-
false, true,
102-
MessageBoxEx.DefaultWidthLarge, MessageBoxEx.DefaultHeightLarge,
103-
false, false) )
104-
{
105-
form.TextBox.Font = new Font("Courier new", 8);
106-
form.ShowDialog();
107-
}
108-
if ( DisplayManager.QueryYesNo(SysTranslations.ContactSupport.GetLang()) )
109-
ExceptionForm.Run(new ExceptionInfo(this, new TooManyErrorsException(errors)));
110-
return errors;
111-
}
95+
return ApplicationDatabase.Instance.ShowLastGenerationErrors(Text);
11296
return null;
11397
}
11498

Project/Source/Forms/MainForm/Data/MainForm.Data.Load.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/// You may add additional accurate notices of copyright ownership.
1212
/// </license>
1313
/// <created> 2019-01 </created>
14-
/// <edited> 2021-12 </edited>
14+
/// <edited> 2022-09 </edited>
1515
namespace Ordisoftware.Hebrew.Calendar;
1616

1717
partial class MainForm
@@ -21,7 +21,7 @@ private void LoadData()
2121
{
2222
bool formEnabled = Enabled;
2323
ToolStrip.Enabled = false;
24-
Globals.IsGenerating = true;
24+
Globals.IsLoadingData = true;
2525
try
2626
{
2727
PanelTitleInner.Visible = true;
@@ -50,7 +50,7 @@ private void LoadData()
5050
}
5151
finally
5252
{
53-
Globals.IsGenerating = false;
53+
Globals.IsLoadingData = false;
5454
LabelSubTitleGPS.Text = string.Empty;
5555
ToolStrip.Enabled = formEnabled;
5656
LoadDataEnd();

Project/Source/Forms/MainForm/Data/MainForm.FillMonths.cs

+6-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
/// You may add additional accurate notices of copyright ownership.
1212
/// </license>
1313
/// <created> 2019-01 </created>
14-
/// <edited> 2022-06 </edited>
14+
/// <edited> 2022-09 </edited>
1515
namespace Ordisoftware.Hebrew.Calendar;
1616

1717
using CodeProjectCalendar.NET;
18+
using CommandLine;
1819

1920
partial class MainForm
2021
{
@@ -236,12 +237,15 @@ void add(Color color, string text)
236237
catch ( Exception ex )
237238
{
238239
if ( ApplicationDatabase.Instance.AddGenerateErrorAndCheckIfTooMany(nameof(FillMonths), row.DateAsString, ex) )
240+
{
241+
if ( !Globals.IsGenerating && ApplicationDatabase.Instance.LastGenerationErrors.Count != 0 )
242+
ApplicationDatabase.Instance.ShowLastGenerationErrors(Text);
239243
return;
244+
}
240245
}
241246
}
242247
finally
243248
{
244-
// TODO show errors like with generate days
245249
Globals.ChronoShowData.Stop();
246250
Settings.BenchmarkFillCalendar = Globals.ChronoShowData.ElapsedMilliseconds;
247251
SystemManager.TryCatch(Settings.Store);

Project/Source/Forms/MainForm/UI/MainForm.GoToDate.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/// You may add additional accurate notices of copyright ownership.
1212
/// </license>
1313
/// <created> 2016-04 </created>
14-
/// <edited> 2022-06 </edited>
14+
/// <edited> 2022-09 </edited>
1515
namespace Ordisoftware.Hebrew.Calendar;
1616

1717
partial class MainForm
@@ -28,7 +28,8 @@ public void GoToDate(DateTime date,
2828
Form regetFocus = null,
2929
ViewScrollOverride scroll = ViewScrollOverride.None)
3030
{
31-
if ( !Globals.IsReady || Globals.IsGenerating ) return;
31+
if ( !Globals.IsReady ) return;
32+
if ( Globals.IsProcessingData ) return;
3233
if ( GoToDateMutex ) return;
3334
if ( date < DateFirst ) date = DateFirst;
3435
if ( date > DateLast ) date = DateLast;

Project/Source/Forms/MainForm/UI/MainForm.TrayIcon.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/// You may add additional accurate notices of copyright ownership.
1212
/// </license>
1313
/// <created> 2016-04 </created>
14-
/// <edited> 2022-06 </edited>
14+
/// <edited> 2022-09 </edited>
1515
namespace Ordisoftware.Hebrew.Calendar;
1616

1717
partial class MainForm
@@ -125,9 +125,9 @@ public void DoMenuShowHide_Click(object sender, EventArgs e)
125125

126126
private void DoMenuExit_Click(object sender, EventArgs e)
127127
{
128-
if ( Globals.IsGenerating )
128+
if ( Globals.IsProcessingData )
129129
{
130-
DisplayManager.ShowInformation(SysTranslations.CantExitWhileGenerating.GetLang());
130+
DisplayManager.ShowInformation(SysTranslations.CantExitWhileProcessing.GetLang());
131131
return;
132132
}
133133
if ( ( EditConfirmClosing.Checked && !Globals.IsSessionEnding )

Project/Source/Forms/MainForm/UI/MainForm.UpdateUI.cs

+7-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/// You may add additional accurate notices of copyright ownership.
1212
/// </license>
1313
/// <created> 2016-04 </created>
14-
/// <edited> 2022-04 </edited>
14+
/// <edited> 2022-09 </edited>
1515
namespace Ordisoftware.Hebrew.Calendar;
1616

1717
/// <summary>
@@ -89,7 +89,8 @@ private void DoScreenPosition(object sender, EventArgs e)
8989
/// </summary>
9090
private void UpdateTitles(bool force = false)
9191
{
92-
if ( !Globals.IsReady || Globals.IsGenerating ) return;
92+
if ( !Globals.IsReady ) return;
93+
if ( Globals.IsProcessingData ) return;
9394
if ( UpdateTitlesMutex ) return;
9495
UpdateTitlesMutex = true;
9596
try
@@ -179,8 +180,8 @@ public void UpdateButtons()
179180
SystemManager.TryCatchManage(() =>
180181
{
181182
if ( LoadingForm.Instance.Visible ) LoadingForm.Instance.Hide();
182-
MenuTray.Enabled = Globals.IsReady && !Globals.IsGenerating;
183-
ToolStrip.Enabled = !Globals.IsGenerating;
183+
MenuTray.Enabled = Globals.IsReady && !Globals.IsProcessingData;
184+
ToolStrip.Enabled = !Globals.IsProcessingData;
184185
ActionSaveToFile.Enabled = LunisolarDays.Count > 0;
185186
ActionCopyToClipboard.Enabled = ActionSaveToFile.Enabled;
186187
ActionPrint.Enabled = ActionSaveToFile.Enabled && Settings.CurrentView != ViewMode.Grid;
@@ -198,7 +199,7 @@ public void UpdateButtons()
198199
/// </summary>
199200
public void UpdateCalendarMonth(bool doFill)
200201
{
201-
Globals.IsGenerating = true;
202+
Globals.IsRendering = true;
202203
var cursor = Cursor;
203204
Cursor = Cursors.WaitCursor;
204205
bool formEnabled = Enabled;
@@ -213,7 +214,7 @@ public void UpdateCalendarMonth(bool doFill)
213214
{
214215
ToolStrip.Enabled = formEnabled;
215216
Cursor = cursor;
216-
Globals.IsGenerating = false;
217+
Globals.IsRendering = false;
217218
SetView(Settings.CurrentView, true);
218219
UpdateButtons();
219220
}

Project/Source/Program/Translations/AppTranslations.Celebrations.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/// You may add additional accurate notices of copyright ownership.
1212
/// </license>
1313
/// <created> 2016-04 </created>
14-
/// <edited> 2022-06 </edited>
14+
/// <edited> 2022-09 </edited>
1515
namespace Ordisoftware.Hebrew.Calendar;
1616

1717
using static Ordisoftware.Hebrew.HebrewTranslations;
@@ -126,7 +126,7 @@ static partial class AppTranslations
126126
[Language.EN] = TorahCelebrations[TorahCelebration.Soukot][Language.EN] + " " + End[Language.EN],
127127
[Language.FR] = TorahCelebrations[TorahCelebration.Soukot][Language.FR] + " " + End[Language.FR]
128128
}
129-
// TODO Manage as user custom remind list
129+
// TODO manage as user custom remind list
130130
/*[TorahCelebrationDay.HanoukaD1] = new TranslationsDictionary
131131
{
132132
[Language.EN] = "'Hanouka start",

0 commit comments

Comments
 (0)