Skip to content
This repository has been archived by the owner on May 3, 2023. It is now read-only.

Commit

Permalink
Patch for UI issues
Browse files Browse the repository at this point in the history
  • Loading branch information
vonhoff committed Jul 7, 2022
1 parent 365c0a3 commit 7b7c330
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/WinFormsUI/Forms/CreateForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/WinFormsUI/Forms/CreateForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ private void BtnResourcesExplore_Click(object sender, EventArgs e)
}
catch (OperationCanceledException ex)
{
Log.Information("The operation has been canceled.");
Log.Information(ex.Message);
MessageBox.Show(ex.Message, "Operation canceled",
MessageBoxButtons.OK, MessageBoxIcon.Information);
}
Expand Down Expand Up @@ -239,6 +239,7 @@ private void BtnCreate_Click(object sender, EventArgs e)
};

await _mediator.Send(exportDefinitionQuery, _cancellationTokenSource.Token);
Log.Information("Created new definitions file: {path}", _definitionsLocation);
}

Invoke(() => lblStatus.Text = "Packing resources...");
Expand All @@ -253,10 +254,11 @@ private void BtnCreate_Click(object sender, EventArgs e)
};

await _mediator.Send(buildQuery, _cancellationTokenSource.Token);
Log.Information("Created new resource package: {path}", _packageLocation);
}
catch (OperationCanceledException ex)
{
Log.Information("The package construction operation has been cancelled.");
Log.Information(ex.Message);
MessageBox.Show(ex.Message, "Operation canceled",
MessageBoxButtons.OK, MessageBoxIcon.Information);

Expand Down Expand Up @@ -302,8 +304,6 @@ private void BtnCreate_Click(object sender, EventArgs e)
btnCancel.Focus();
});

Log.Information("Created new resource package: {path}", _packageLocation);
Log.Information("Created new definitions file: {path}", _definitionsLocation);
SystemSounds.Asterisk.Play();
this.FlashNotification();
_cancellationTokenSource.Cancel();
Expand Down
10 changes: 8 additions & 2 deletions src/WinFormsUI/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ private void BtnOpen_Click(object sender, EventArgs e)

Task.Run(async () =>
{
var hideCancellationDialog = false;

try
{
var query = new GetPackageInformationQuery(binaryReader)
Expand All @@ -304,6 +306,7 @@ private void BtnOpen_Click(object sender, EventArgs e)
{
if (passwordDialog.ShowDialog() != DialogResult.OK)
{
hideCancellationDialog = true;
_cancellationTokenSource.Cancel();
throw new OperationCanceledException();
}
Expand Down Expand Up @@ -360,8 +363,11 @@ private void BtnOpen_Click(object sender, EventArgs e)
catch (OperationCanceledException ex)
{
Log.Information(ex.Message);
MessageBox.Show(ex.Message, "Operation canceled",
MessageBoxButtons.OK, MessageBoxIcon.Information);
if (!hideCancellationDialog)
{
MessageBox.Show(ex.Message, "Operation canceled",
MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
catch (InvalidPasswordException)
{
Expand Down
4 changes: 2 additions & 2 deletions src/WinFormsUI/WinFormsUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<NeutralLanguage>en-US</NeutralLanguage>
<Platforms>x64;x86</Platforms>
<AssemblyName>ResourcePackerGUI</AssemblyName>
<FileVersion>1.0.1.1</FileVersion>
<AssemblyVersion>1.0.2</AssemblyVersion>
<FileVersion>1.0.2.1</FileVersion>
<AssemblyVersion>1.0.2.1</AssemblyVersion>
<Authors>$(AssemblyName)</Authors>
<Version>$(VersionPrefix)</Version>
</PropertyGroup>
Expand Down

0 comments on commit 7b7c330

Please sign in to comment.