From 21fc25741b288cbc8d20485c0ecc40c3777ef95c Mon Sep 17 00:00:00 2001 From: shept Date: Fri, 2 Jan 2026 17:19:36 +0500 Subject: [PATCH] small ui updates --- .../MetaforceInstaller.UI.csproj | 2 +- .../Windows/MainWindow.axaml | 29 +++++++++--- .../Windows/MainWindow.axaml.cs | 44 +++++++++++++++++++ 3 files changed, 67 insertions(+), 8 deletions(-) diff --git a/MetaforceInstaller.UI/MetaforceInstaller.UI.csproj b/MetaforceInstaller.UI/MetaforceInstaller.UI.csproj index 26ffaf3..ad61469 100644 --- a/MetaforceInstaller.UI/MetaforceInstaller.UI.csproj +++ b/MetaforceInstaller.UI/MetaforceInstaller.UI.csproj @@ -8,7 +8,7 @@ true app.manifest true - 1.2.1 + 2.0.0-b1 diff --git a/MetaforceInstaller.UI/Windows/MainWindow.axaml b/MetaforceInstaller.UI/Windows/MainWindow.axaml index fa144a4..eaaf434 100644 --- a/MetaforceInstaller.UI/Windows/MainWindow.axaml +++ b/MetaforceInstaller.UI/Windows/MainWindow.axaml @@ -31,6 +31,7 @@ + - - - - - - - + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MetaforceInstaller.UI/Windows/MainWindow.axaml.cs b/MetaforceInstaller.UI/Windows/MainWindow.axaml.cs index d628bdd..ee23eb4 100644 --- a/MetaforceInstaller.UI/Windows/MainWindow.axaml.cs +++ b/MetaforceInstaller.UI/Windows/MainWindow.axaml.cs @@ -1,6 +1,10 @@ +using System; +using System.Diagnostics; +using System.Reflection; using Avalonia.Controls; using Avalonia.Interactivity; using MetaforceInstaller.Core.Intefaces; +using MetaforceInstaller.Core.Models; using MetaforceInstaller.Core.Services; using MetaforceInstaller.UI.ViewModels; @@ -18,6 +22,9 @@ public partial class MainWindow : Window _viewModel = new MainWindowViewModel(); _storageService = new StorageService(); DataContext = _viewModel; + + VersionLabel.Content = Assembly.GetExecutingAssembly() + .GetCustomAttribute()?.Version; NewInstallationButton.Click += OnNewInstalltionClick; @@ -36,4 +43,41 @@ public partial class MainWindow : Window await newInstallationDialog.ShowDialog(this); LoadInstallations(); } + + public async void OnDeleteInstallationClick(object? sender, RoutedEventArgs e) + { + if (sender is Button button && button.DataContext is InstallationData installationData) + { + var name = installationData.Title; + Console.WriteLine($"Delete {name}"); + } + } + + public async void OnLaunchServerClick(object? sender, RoutedEventArgs e) + { + if (sender is Button button && button.DataContext is InstallationData installationData) + { + var exePath = installationData.Parts.WindowsServerPath; + var processInfo = new ProcessStartInfo + { + FileName = exePath, + UseShellExecute = false, + }; + Process.Start(processInfo); + } + } + + public async void OnLaunchAdminClick(object? sender, RoutedEventArgs e) + { + if (sender is Button button && button.DataContext is InstallationData installationData) + { + var exePath = installationData.Parts.WindowsAdminPath; + var processInfo = new ProcessStartInfo + { + FileName = exePath, + UseShellExecute = false, + }; + Process.Start(processInfo); + } + } } \ No newline at end of file