Tweak MessageBox

This commit is contained in:
Michael Bucari-Tovo 2022-07-22 19:20:47 -06:00
parent 07d2c656fc
commit ab731a63af
10 changed files with 14 additions and 14 deletions

View File

@ -183,7 +183,7 @@ namespace LibationWinForms.AvaloniaUI
=> ShowCoreAsync(owner, text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1); => ShowCoreAsync(owner, text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.None, MessageBoxDefaultButton.Button1);
public static async Task VerboseLoggingWarning_ShowIfTrue() public static void VerboseLoggingWarning_ShowIfTrue()
{ {
// when turning on debug (and especially Verbose) to share logs, some privacy settings may not be obscured // when turning on debug (and especially Verbose) to share logs, some privacy settings may not be obscured
if (Serilog.Log.Logger.IsVerboseEnabled()) if (Serilog.Log.Logger.IsVerboseEnabled())
@ -230,7 +230,7 @@ Libation.
/// <param name="text">The text to display in the message box.</param> /// <param name="text">The text to display in the message box.</param>
/// <param name="caption">The text to display in the title bar of the message box.</param> /// <param name="caption">The text to display in the title bar of the message box.</param>
/// <param name="exception">Exception to log.</param> /// <param name="exception">Exception to log.</param>
public static async Task ShowAdminAlert(Window owner, string text, string caption, Exception exception) public static void ShowAdminAlert(Window owner, string text, string caption, Exception exception)
{ {
// for development and debugging, show me what broke! // for development and debugging, show me what broke!
if (System.Diagnostics.Debugger.IsAttached) if (System.Diagnostics.Debugger.IsAttached)

View File

@ -152,7 +152,7 @@ namespace LibationWinForms.AvaloniaUI.ViewModels
finally finally
{ {
if (Result == ProcessBookResult.None) if (Result == ProcessBookResult.None)
Result = await showRetry(LibraryBook); Result = showRetry(LibraryBook);
Status = Result switch Status = Result switch
{ {
@ -313,7 +313,7 @@ namespace LibationWinForms.AvaloniaUI.ViewModels
#region Failure Handler #region Failure Handler
private async Task<ProcessBookResult> showRetry(LibraryBook libraryBook) private ProcessBookResult showRetry(LibraryBook libraryBook)
{ {
Logger.Error("ERROR. All books have not been processed. Most recent book: processing failed"); Logger.Error("ERROR. All books have not been processed. Most recent book: processing failed");

View File

@ -191,7 +191,7 @@ namespace LibationWinForms.AvaloniaUI.ViewModels
} }
} }
private void CounterTimer_Tick(object? state) private void CounterTimer_Tick(object state)
{ {
string timeToStr(TimeSpan time) string timeToStr(TimeSpan time)
{ {

View File

@ -316,7 +316,7 @@ namespace LibationWinForms.AvaloniaUI.ViewModels
} }
catch (Exception ex) catch (Exception ex)
{ {
await MessageBox.ShowAdminAlert( MessageBox.ShowAdminAlert(
null, null,
"Error scanning library. You may still manually select books to remove from Libation's library.", "Error scanning library. You may still manually select books to remove from Libation's library.",
"Error scanning library", "Error scanning library",

View File

@ -160,9 +160,8 @@ namespace LibationWinForms.AvaloniaUI.Views.Dialogs
Export(acc); Export(acc);
} }
protected override async Task SaveAndCloseAsync() protected override void SaveAndClose()
{ {
try try
{ {
if (!inputIsValid()) if (!inputIsValid())
@ -179,7 +178,7 @@ namespace LibationWinForms.AvaloniaUI.Views.Dialogs
} }
catch (Exception ex) catch (Exception ex)
{ {
await MessageBox.ShowAdminAlert(this, "Error attempting to save accounts", "Error saving accounts", ex); MessageBox.ShowAdminAlert(this, "Error attempting to save accounts", "Error saving accounts", ex);
} }
} }

View File

@ -29,6 +29,7 @@
Grid.Row="1" Grid.Row="1"
Margin="10,10,10,0" Margin="10,10,10,0"
IsReadOnly="True" IsReadOnly="True"
TextWrapping="Wrap"
Text="{Binding ExceptionMessage}" /> Text="{Binding ExceptionMessage}" />
<Grid <Grid

View File

@ -41,7 +41,7 @@ namespace LibationWinForms.AvaloniaUI.Views.Dialogs
} }
} }
private async void GoToLogs_Tapped(object sender, Avalonia.Interactivity.RoutedEventArgs e) private void GoToLogs_Tapped(object sender, Avalonia.Interactivity.RoutedEventArgs e)
{ {
LongPath dir = ""; LongPath dir = "";
try try

View File

@ -36,7 +36,7 @@ namespace LibationWinForms.AvaloniaUI.Views.Dialogs
if (!settingsDisp.SaveSettings(config)) if (!settingsDisp.SaveSettings(config))
return; return;
await MessageBox.VerboseLoggingWarning_ShowIfTrue(); MessageBox.VerboseLoggingWarning_ShowIfTrue();
await base.SaveAndCloseAsync(); await base.SaveAndCloseAsync();
} }
@ -69,7 +69,7 @@ namespace LibationWinForms.AvaloniaUI.Views.Dialogs
settingsDisp.DownloadDecryptSettings.ChapterFileTemplate = newTemplate; settingsDisp.DownloadDecryptSettings.ChapterFileTemplate = newTemplate;
} }
public async void EditCharReplacementButton_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e) public void EditCharReplacementButton_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e)
{ {
var form = new LibationWinForms.Dialogs.EditReplacementChars(config); var form = new LibationWinForms.Dialogs.EditReplacementChars(config);
form.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; form.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;

View File

@ -13,7 +13,7 @@ namespace LibationWinForms.AvaloniaUI.Views
public async void basicSettingsToolStripMenuItem_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e) => await new Dialogs.SettingsDialog().ShowDialog(this); public async void basicSettingsToolStripMenuItem_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e) => await new Dialogs.SettingsDialog().ShowDialog(this);
public async void aboutToolStripMenuItem_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e) public void aboutToolStripMenuItem_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e)
=> MessageBox.Show($"Running Libation version {AppScaffolding.LibationScaffolding.BuildVersion}", $"Libation v{AppScaffolding.LibationScaffolding.BuildVersion}"); => MessageBox.Show($"Running Libation version {AppScaffolding.LibationScaffolding.BuildVersion}", $"Libation v{AppScaffolding.LibationScaffolding.BuildVersion}");
} }
} }

View File

@ -65,7 +65,7 @@ namespace LibationWinForms.AvaloniaUI.Views
productsDisplay?.CloseImageDisplay(); productsDisplay?.CloseImageDisplay();
} }
private async void MainWindow_Opened(object sender, EventArgs e) private void MainWindow_Opened(object sender, EventArgs e)
{ {
} }