Skip to content

Commit

Permalink
Merge pull request #106 from nemethviktor/development
Browse files Browse the repository at this point in the history
Development [8897]
  • Loading branch information
nemethviktor authored May 14, 2024
2 parents a907c18 + af2c3c5 commit 6dc8db8
Show file tree
Hide file tree
Showing 20 changed files with 442 additions and 393 deletions.
14 changes: 11 additions & 3 deletions App.config
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.3" newVersion="7.0.0.3" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.3" newVersion="8.0.0.3" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="SQLitePCLRaw.core" publicKeyToken="1488e028ca7ab535" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.1.6.2060" newVersion="2.1.6.2060" />
<bindingRedirect oldVersion="0.0.0.0-2.1.8.2226" newVersion="2.1.8.2226" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="IronSoftware.Drawing.Common" publicKeyToken="8d7e55c97b3e9835" culture="neutral" />
Expand All @@ -49,6 +49,14 @@
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Web.WebView2.WinForms" publicKeyToken="2a8ab48044d2601e" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.0.2478.35" newVersion="1.0.2478.35" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Web.WebView2.Core" publicKeyToken="2a8ab48044d2601e" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.0.2478.35" newVersion="1.0.2478.35" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<entityFramework>
Expand Down
35 changes: 27 additions & 8 deletions FrmMainApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using System.Text.Json;
using System.Threading.Tasks;
using System.Windows.Forms;
using AutoUpdaterDotNET;
using geoTagNinja;
using GeoTagNinja.Helpers;
using GeoTagNinja.Model;
Expand Down Expand Up @@ -342,10 +343,31 @@ private async void FrmMainApp_Load(object sender,
Request_Map_NavigateGo();

await HelperAPIVersionCheckers.CheckForNewVersions();
LaunchAutoUpdater();

Logger.Info(message: "OnLoad: Done.");
}

/// <summary>
/// This fires up the autoupdater
/// </summary>
private static void LaunchAutoUpdater()
{
HelperNonStatic updateHelper = new();
// AutoUpdater.InstalledVersion = new Version(version: "1.2"); // here for testing only.

AutoUpdater.Synchronous =
true; // needs to be true otherwise the single pipe instance crashes. (well, I think _that_ crashes, something does.)
AutoUpdater.ParseUpdateInfoEvent +=
updateHelper.AutoUpdaterOnParseUpdateInfoEvent;
AutoUpdater.CheckForUpdateEvent += updateHelper.AutoUpdaterOnCheckForUpdateEvent;

string updateJsonPath =
Path.Combine(path1: HelperVariables.UserDataFolderPath,
path2: "updateJsonData.json");
AutoUpdater.Start(appCast: Path.Combine(updateJsonPath));
}


/// <summary>
/// When the app closes we want to make sure there's nothing in the write-queue.
Expand Down Expand Up @@ -751,16 +773,15 @@ void ShowLocToMapDialog()

// via https://stackoverflow.com/a/17385937/3968494
List<string> getLocToMapDialogChoice =
DialogWithCheckBox.DisplayAndReturnList(
DialogWithOrWithoutCheckBox.DisplayAndReturnList(
labelText: HelperDataLanguageTZ.DataReadDTObjectText(
objectType: ControlType.Label,
objectName: "lbl_QuestionAddToponomy"
),
caption: GenericGetMessageBoxCaption(
captionType: MessageBoxCaption.Question.ToString()),
checkboxesDictionary: checkboxDictionary,
buttonsDictionary: buttonsDictionary,
orientation: "Horizontal");
orientation: "Horizontal", checkboxesDictionary: checkboxDictionary);

_showLocToMapDialogChoice = getLocToMapDialogChoice.Contains(item: "yes");
_rememberLocToMapDialogChoice =
Expand Down Expand Up @@ -1462,7 +1483,6 @@ private async Task InitialiseWebView()

#endregion


#region File

/// <summary>
Expand Down Expand Up @@ -1568,7 +1588,6 @@ private void tmi_File_Quit_Click(object sender,

#endregion


#region FrmMainApp's TaskBar Stuff

/// <summary>
Expand Down Expand Up @@ -2238,14 +2257,14 @@ private void lvw_FileList_UpdateTagsFromWeb(string strGpsLatitude,

// ReSharper disable once InconsistentNaming
List<string> APIHandlingChoice =
DialogWithCheckBox.DisplayAndReturnList(
DialogWithOrWithoutCheckBox.DisplayAndReturnList(
labelText: GenericGetMessageBoxText(
messageBoxName: "mbx_FrmMainApp_QuestionNoRowsFromAPI"),
caption: GenericGetMessageBoxCaption(
captionType: MessageBoxCaption.Question.ToString()),
checkboxesDictionary: checkboxDictionary,
buttonsDictionary: buttonsDictionary,
orientation: "Horizontal");
orientation: "Horizontal",
checkboxesDictionary: checkboxDictionary);

if (APIHandlingChoice.Contains(value: "yes"))
{
Expand Down
39 changes: 20 additions & 19 deletions FrmSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1126,8 +1126,7 @@ private void dgv_CustomRules_RowValidating(object sender,
"mbx_FrmSettings_dgv_CustomRules_CustomOutcomeCannotBeEmpty"),
caption: HelperControlAndMessageBoxHandling
.GenericGetMessageBoxCaption(
captionType: HelperControlAndMessageBoxHandling
.MessageBoxCaption.Information.ToString()),
captionType: HelperControlAndMessageBoxHandling.MessageBoxCaption.Information.ToString()),
buttons: MessageBoxButtons.OK,
icon: MessageBoxIcon.Warning);
customMessageBox.ShowDialog();
Expand Down Expand Up @@ -1187,15 +1186,15 @@ private void btn_ExportSettings_Click(object sender,
Dictionary<string, string> buttonsDictionary = GetButtonsDictionary();

// ReSharper disable once InconsistentNaming
List<string> ItemsToExport = DialogWithCheckBox.DisplayAndReturnList(
List<string> ItemsToExport = DialogWithOrWithoutCheckBox.DisplayAndReturnList(
labelText: HelperControlAndMessageBoxHandling.GenericGetMessageBoxText(
messageBoxName: "mbx_FrmSettings_QuestionWhatToExport"),
caption: HelperControlAndMessageBoxHandling.GenericGetMessageBoxCaption(
captionType: HelperControlAndMessageBoxHandling.MessageBoxCaption.Question
.ToString()),
checkboxesDictionary: checkboxDictionary,
.ToString()),
buttonsDictionary: buttonsDictionary,
orientation: "Vertical");
orientation: "Vertical",
checkboxesDictionary: checkboxDictionary);

// ignore the whole thing if "no" is part of the output
// probably impossible that _neither_ of them are in the list but in case i missed something...
Expand Down Expand Up @@ -1234,8 +1233,7 @@ private void btn_ExportSettings_Click(object sender,
ex.Message,
caption: HelperControlAndMessageBoxHandling
.GenericGetMessageBoxCaption(
captionType: HelperControlAndMessageBoxHandling
.MessageBoxCaption.Error.ToString()),
captionType: HelperControlAndMessageBoxHandling.MessageBoxCaption.Error.ToString()),
buttons: MessageBoxButtons.OK,
icon: MessageBoxIcon.Error);
customMessageBox.ShowDialog();
Expand Down Expand Up @@ -1267,15 +1265,15 @@ private void btn_ImportSettings_Click(object sender,
Dictionary<string, string> buttonsDictionary = GetButtonsDictionary();

// ReSharper disable once InconsistentNaming
List<string> ItemsToImport = DialogWithCheckBox.DisplayAndReturnList(
List<string> ItemsToImport = DialogWithOrWithoutCheckBox.DisplayAndReturnList(
labelText: HelperControlAndMessageBoxHandling.GenericGetMessageBoxText(
messageBoxName: "mbx_FrmSettings_QuestionWhatToImport"),
caption: HelperControlAndMessageBoxHandling.GenericGetMessageBoxCaption(
captionType: HelperControlAndMessageBoxHandling.MessageBoxCaption
.Question.ToString()),
checkboxesDictionary: checkboxDictionary,
buttonsDictionary: buttonsDictionary,
orientation: "Vertical");
orientation: "Vertical",
checkboxesDictionary: checkboxDictionary);

// ignore the whole thing if "no" is part of the output
// probably impossible that _neither_ of them are in the list but in case i missed something...
Expand Down Expand Up @@ -1339,14 +1337,17 @@ private void PromptUserToRestartApp()
};

// ReSharper disable once InconsistentNaming
List<string> displayAndReturnList = DialogWithoutCheckBox.DisplayAndReturnList(
labelText: HelperControlAndMessageBoxHandling.GenericGetMessageBoxText(
messageBoxName: "mbx_FrmSettings_PleaseRestartApp"),
caption: HelperControlAndMessageBoxHandling.GenericGetMessageBoxCaption(
captionType: HelperControlAndMessageBoxHandling.MessageBoxCaption.Question
.ToString()),
buttonsDictionary: buttonsDictionary,
orientation: "Horizontal");
List<string> displayAndReturnList =
DialogWithOrWithoutCheckBox.DisplayAndReturnList(
labelText: HelperControlAndMessageBoxHandling.GenericGetMessageBoxText(
messageBoxName: "mbx_FrmSettings_PleaseRestartApp"),
caption: HelperControlAndMessageBoxHandling.GenericGetMessageBoxCaption(
captionType: HelperControlAndMessageBoxHandling.MessageBoxCaption
.Question
.ToString()),
buttonsDictionary: buttonsDictionary,
orientation: "Horizontal",
checkboxesDictionary: new Dictionary<string, string>());

// basically this triggers an error in debug mode but works ok in prod.
#if !DEBUG
Expand Down
Loading

0 comments on commit 6dc8db8

Please sign in to comment.