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);
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
if (Serilog.Log.Logger.IsVerboseEnabled())
@ -230,7 +230,7 @@ Libation.
/// <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="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!
if (System.Diagnostics.Debugger.IsAttached)

View File

@ -152,7 +152,7 @@ namespace LibationWinForms.AvaloniaUI.ViewModels
finally
{
if (Result == ProcessBookResult.None)
Result = await showRetry(LibraryBook);
Result = showRetry(LibraryBook);
Status = Result switch
{
@ -313,7 +313,7 @@ namespace LibationWinForms.AvaloniaUI.ViewModels
#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");

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)
{

View File

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

View File

@ -160,9 +160,8 @@ namespace LibationWinForms.AvaloniaUI.Views.Dialogs
Export(acc);
}
protected override async Task SaveAndCloseAsync()
protected override void SaveAndClose()
{
try
{
if (!inputIsValid())
@ -179,7 +178,7 @@ namespace LibationWinForms.AvaloniaUI.Views.Dialogs
}
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"
Margin="10,10,10,0"
IsReadOnly="True"
TextWrapping="Wrap"
Text="{Binding ExceptionMessage}" />
<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 = "";
try

View File

@ -36,7 +36,7 @@ namespace LibationWinForms.AvaloniaUI.Views.Dialogs
if (!settingsDisp.SaveSettings(config))
return;
await MessageBox.VerboseLoggingWarning_ShowIfTrue();
MessageBox.VerboseLoggingWarning_ShowIfTrue();
await base.SaveAndCloseAsync();
}
@ -69,7 +69,7 @@ namespace LibationWinForms.AvaloniaUI.Views.Dialogs
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);
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 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}");
}
}

View File

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