ui(client): improvements

This commit is contained in:
Pascal
2025-11-07 10:45:55 +01:00
parent 05b94a3189
commit b899d2ee7d
11 changed files with 95 additions and 54 deletions

View File

@@ -11,6 +11,7 @@ using Pilz.SymbolPacks.Sets;
using Pilz.UI.AvaloniaUI.Symbols;
using System.Diagnostics;
using System.Reflection;
using Pilz.UI.Symbols;
namespace ModpackUpdater.Apps.Client.Gui;
@@ -34,10 +35,10 @@ public partial class MainForm : Window
Closing += MainForm_Closing;
Loaded += MainForm_Loaded;
ButtonImageSearchProfileFolder.Source = Symbols.Fluent.GetImageSource(SymbolsFluent.opened_folder);
ButtonImageCheckForUpdates.Source = Symbols.Fluent.GetImageSource(SymbolsFluent.update);
ButtonImageInstall.Source = Symbols.Fluent.GetImageSource(SymbolsFluent.software_installer);
MenuItemImageRepair.Source = Symbols.Fluent.GetImageSource(SymbolsFluent.wrench);
ButtonSearchProfileFolder.ImageSource = Symbols.Fluent.GetImageSource(SymbolsFluent.opened_folder);
ButtonCheckForUpdates.ImageSource = Symbols.Fluent.GetImageSource(SymbolsFluent.update);
ButtonInstall.ImageSource = Symbols.Fluent.GetImageSource(SymbolsFluent.software_installer);
MenuItemRepair.Icon = Symbols.Fluent.GetImage(SymbolsFluent.wrench, SymbolSize.Small);
ClearStatus();
LoadProfileToUi();
@@ -115,7 +116,7 @@ public partial class MainForm : Window
ButtonInstall.IsEnabled = false;
return false;
}
else if (updateConfig == null || string.IsNullOrWhiteSpace(TextBoxModpackConfig.Text))
else if (string.IsNullOrWhiteSpace(TextBoxModpackConfig.Text))
{
SetStatus(GeneralLangRes.ConfigIncompleteOrNotLoaded, Symbols.Fluent.GetImageSource(SymbolsFluent.warning_shield));
ButtonCheckForUpdates.IsEnabled = false;
@@ -271,7 +272,6 @@ public partial class MainForm : Window
//Application.Restart(); // FIXME
return;
}
CheckStatusAndUpdate(true);
}
@@ -314,20 +314,20 @@ public partial class MainForm : Window
private async void ButtonInstall_Click(object? sender, RoutedEventArgs e)
{
if (!currentUpdating)
{
ClearStatus();
await ExecuteUpdate(true, false);
}
if (currentUpdating)
return;
ClearStatus();
await ExecuteUpdate(true, false);
}
private async void MenuItemRepair_Click(object? sender, RoutedEventArgs e)
{
if (!currentUpdating)
{
ClearStatus();
await ExecuteUpdate(true, true);
}
if (currentUpdating)
return;
ClearStatus();
await ExecuteUpdate(true, true);
}
#endregion