From e96c17a3d509e7c2c443553e094a624eda0721cb Mon Sep 17 00:00:00 2001 From: pizzaboxer Date: Mon, 26 Aug 2024 19:26:05 +0100 Subject: [PATCH] Move About page to its own separate window --- Bloxstrap/App.xaml.cs | 2 + Bloxstrap/Resources/Strings.Designer.cs | 27 + Bloxstrap/Resources/Strings.resx | 9 + Bloxstrap/UI/Elements/About/MainWindow.xaml | 48 ++ .../UI/Elements/About/MainWindow.xaml.cs | 35 + .../UI/Elements/About/Pages/AboutPage.xaml | 134 ++++ .../Pages/AboutPage.xaml.cs | 2 +- .../UI/Elements/About/Pages/LicensesPage.xaml | 72 ++ .../Elements/About/Pages/LicensesPage.xaml.cs | 13 + .../Elements/About/Pages/TranslatorsPage.xaml | 484 +++++++++++++ .../About/Pages/TranslatorsPage.xaml.cs | 13 + .../UI/Elements/Dialogs/LaunchMenuDialog.xaml | 8 + .../UI/Elements/Settings/MainWindow.xaml | 2 +- .../UI/Elements/Settings/Pages/AboutPage.xaml | 665 ------------------ .../ViewModels/Dialogs/LaunchMenuViewModel.cs | 6 +- .../Settings/MainWindowViewModel.cs | 6 +- 16 files changed, 857 insertions(+), 669 deletions(-) create mode 100644 Bloxstrap/UI/Elements/About/MainWindow.xaml create mode 100644 Bloxstrap/UI/Elements/About/MainWindow.xaml.cs create mode 100644 Bloxstrap/UI/Elements/About/Pages/AboutPage.xaml rename Bloxstrap/UI/Elements/{Settings => About}/Pages/AboutPage.xaml.cs (86%) create mode 100644 Bloxstrap/UI/Elements/About/Pages/LicensesPage.xaml create mode 100644 Bloxstrap/UI/Elements/About/Pages/LicensesPage.xaml.cs create mode 100644 Bloxstrap/UI/Elements/About/Pages/TranslatorsPage.xaml create mode 100644 Bloxstrap/UI/Elements/About/Pages/TranslatorsPage.xaml.cs delete mode 100644 Bloxstrap/UI/Elements/Settings/Pages/AboutPage.xaml diff --git a/Bloxstrap/App.xaml.cs b/Bloxstrap/App.xaml.cs index db72422..a644408 100644 --- a/Bloxstrap/App.xaml.cs +++ b/Bloxstrap/App.xaml.cs @@ -6,6 +6,8 @@ using System.Windows.Threading; using Microsoft.Win32; using Bloxstrap.Models.SettingTasks.Base; +using Bloxstrap.UI.Elements.About.Pages; +using Bloxstrap.UI.Elements.About; namespace Bloxstrap { diff --git a/Bloxstrap/Resources/Strings.Designer.cs b/Bloxstrap/Resources/Strings.Designer.cs index 10e9947..cbfba62 100644 --- a/Bloxstrap/Resources/Strings.Designer.cs +++ b/Bloxstrap/Resources/Strings.Designer.cs @@ -60,6 +60,33 @@ namespace Bloxstrap.Resources { } } + /// + /// Looks up a localized string similar to Licenses. + /// + public static string About_Licenses_Title { + get { + return ResourceManager.GetString("About.Licenses.Title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to About Bloxstrap. + /// + public static string About_Title { + get { + return ResourceManager.GetString("About.Title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Translators. + /// + public static string About_Translators_Title { + get { + return ResourceManager.GetString("About.Translators.Title", resourceCulture); + } + } + /// /// Looks up a localized string similar to left game. /// diff --git a/Bloxstrap/Resources/Strings.resx b/Bloxstrap/Resources/Strings.resx index 0fb0885..09587cb 100644 --- a/Bloxstrap/Resources/Strings.resx +++ b/Bloxstrap/Resources/Strings.resx @@ -1130,4 +1130,13 @@ If not, then please report this exception to the maintainers of this fork. Do NO Please wait for uninstallation to finish. + + About Bloxstrap + + + Licenses + + + Translators + \ No newline at end of file diff --git a/Bloxstrap/UI/Elements/About/MainWindow.xaml b/Bloxstrap/UI/Elements/About/MainWindow.xaml new file mode 100644 index 0000000..a334f3a --- /dev/null +++ b/Bloxstrap/UI/Elements/About/MainWindow.xaml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Bloxstrap/UI/Elements/About/MainWindow.xaml.cs b/Bloxstrap/UI/Elements/About/MainWindow.xaml.cs new file mode 100644 index 0000000..425b995 --- /dev/null +++ b/Bloxstrap/UI/Elements/About/MainWindow.xaml.cs @@ -0,0 +1,35 @@ +using System.Windows.Controls; +using Wpf.Ui.Controls.Interfaces; +using Wpf.Ui.Mvvm.Contracts; + +namespace Bloxstrap.UI.Elements.About +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : INavigationWindow + { + public MainWindow() + { + InitializeComponent(); + + App.Logger.WriteLine("MainWindow::MainWindow", "Initializing menu"); + } + + #region INavigationWindow methods + + public Frame GetFrame() => RootFrame; + + public INavigation GetNavigation() => RootNavigation; + + public bool Navigate(Type pageType) => RootNavigation.Navigate(pageType); + + public void SetPageService(IPageService pageService) => RootNavigation.PageService = pageService; + + public void ShowWindow() => Show(); + + public void CloseWindow() => Close(); + + #endregion INavigationWindow methods + } +} diff --git a/Bloxstrap/UI/Elements/About/Pages/AboutPage.xaml b/Bloxstrap/UI/Elements/About/Pages/AboutPage.xaml new file mode 100644 index 0000000..8e16999 --- /dev/null +++ b/Bloxstrap/UI/Elements/About/Pages/AboutPage.xaml @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Bloxstrap/UI/Elements/Settings/Pages/AboutPage.xaml.cs b/Bloxstrap/UI/Elements/About/Pages/AboutPage.xaml.cs similarity index 86% rename from Bloxstrap/UI/Elements/Settings/Pages/AboutPage.xaml.cs rename to Bloxstrap/UI/Elements/About/Pages/AboutPage.xaml.cs index 75cbd32..3294258 100644 --- a/Bloxstrap/UI/Elements/Settings/Pages/AboutPage.xaml.cs +++ b/Bloxstrap/UI/Elements/About/Pages/AboutPage.xaml.cs @@ -1,6 +1,6 @@ using Bloxstrap.UI.ViewModels.Settings; -namespace Bloxstrap.UI.Elements.Settings.Pages +namespace Bloxstrap.UI.Elements.About.Pages { /// /// Interaction logic for AboutPage.xaml diff --git a/Bloxstrap/UI/Elements/About/Pages/LicensesPage.xaml b/Bloxstrap/UI/Elements/About/Pages/LicensesPage.xaml new file mode 100644 index 0000000..8a4f984 --- /dev/null +++ b/Bloxstrap/UI/Elements/About/Pages/LicensesPage.xaml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Bloxstrap/UI/Elements/About/Pages/LicensesPage.xaml.cs b/Bloxstrap/UI/Elements/About/Pages/LicensesPage.xaml.cs new file mode 100644 index 0000000..7ce2e61 --- /dev/null +++ b/Bloxstrap/UI/Elements/About/Pages/LicensesPage.xaml.cs @@ -0,0 +1,13 @@ +namespace Bloxstrap.UI.Elements.About.Pages +{ + /// + /// Interaction logic for LicensesPage.xaml + /// + public partial class LicensesPage + { + public LicensesPage() + { + InitializeComponent(); + } + } +} diff --git a/Bloxstrap/UI/Elements/About/Pages/TranslatorsPage.xaml b/Bloxstrap/UI/Elements/About/Pages/TranslatorsPage.xaml new file mode 100644 index 0000000..2ad3738 --- /dev/null +++ b/Bloxstrap/UI/Elements/About/Pages/TranslatorsPage.xaml @@ -0,0 +1,484 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Bloxstrap/UI/Elements/About/Pages/TranslatorsPage.xaml.cs b/Bloxstrap/UI/Elements/About/Pages/TranslatorsPage.xaml.cs new file mode 100644 index 0000000..fb41f0a --- /dev/null +++ b/Bloxstrap/UI/Elements/About/Pages/TranslatorsPage.xaml.cs @@ -0,0 +1,13 @@ +namespace Bloxstrap.UI.Elements.About.Pages +{ + /// + /// Interaction logic for TranslatorsPage.xaml + /// + public partial class TranslatorsPage + { + public TranslatorsPage() + { + InitializeComponent(); + } + } +} diff --git a/Bloxstrap/UI/Elements/Dialogs/LaunchMenuDialog.xaml b/Bloxstrap/UI/Elements/Dialogs/LaunchMenuDialog.xaml index 446b34c..b7bce3b 100644 --- a/Bloxstrap/UI/Elements/Dialogs/LaunchMenuDialog.xaml +++ b/Bloxstrap/UI/Elements/Dialogs/LaunchMenuDialog.xaml @@ -41,6 +41,8 @@ + + @@ -48,6 +50,12 @@ + + + + + + diff --git a/Bloxstrap/UI/Elements/Settings/MainWindow.xaml b/Bloxstrap/UI/Elements/Settings/MainWindow.xaml index 49f508a..4d6fc63 100644 --- a/Bloxstrap/UI/Elements/Settings/MainWindow.xaml +++ b/Bloxstrap/UI/Elements/Settings/MainWindow.xaml @@ -60,7 +60,7 @@ - + diff --git a/Bloxstrap/UI/Elements/Settings/Pages/AboutPage.xaml b/Bloxstrap/UI/Elements/Settings/Pages/AboutPage.xaml deleted file mode 100644 index 830e14b..0000000 --- a/Bloxstrap/UI/Elements/Settings/Pages/AboutPage.xaml +++ /dev/null @@ -1,665 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Bloxstrap/UI/ViewModels/Dialogs/LaunchMenuViewModel.cs b/Bloxstrap/UI/ViewModels/Dialogs/LaunchMenuViewModel.cs index 821bd02..991ae8d 100644 --- a/Bloxstrap/UI/ViewModels/Dialogs/LaunchMenuViewModel.cs +++ b/Bloxstrap/UI/ViewModels/Dialogs/LaunchMenuViewModel.cs @@ -1,7 +1,7 @@ using System.Windows.Input; using CommunityToolkit.Mvvm.Input; -using Bloxstrap.Resources; +using Bloxstrap.UI.Elements.About; namespace Bloxstrap.UI.ViewModels.Installer { @@ -14,10 +14,14 @@ namespace Bloxstrap.UI.ViewModels.Installer public ICommand LaunchRobloxCommand => new RelayCommand(LaunchRoblox); + public ICommand LaunchAboutCommand => new RelayCommand(LaunchAbout); + public event EventHandler? CloseWindowRequest; private void LaunchSettings() => CloseWindowRequest?.Invoke(this, NextAction.LaunchSettings); private void LaunchRoblox() => CloseWindowRequest?.Invoke(this, NextAction.LaunchRoblox); + + private void LaunchAbout() => new MainWindow().Show(); } } diff --git a/Bloxstrap/UI/ViewModels/Settings/MainWindowViewModel.cs b/Bloxstrap/UI/ViewModels/Settings/MainWindowViewModel.cs index df279e5..767bb0b 100644 --- a/Bloxstrap/UI/ViewModels/Settings/MainWindowViewModel.cs +++ b/Bloxstrap/UI/ViewModels/Settings/MainWindowViewModel.cs @@ -1,15 +1,19 @@ using System.Windows.Input; - +using Bloxstrap.UI.Elements.About; using CommunityToolkit.Mvvm.Input; namespace Bloxstrap.UI.ViewModels.Settings { public class MainWindowViewModel : NotifyPropertyChangedViewModel { + public ICommand OpenAboutCommand => new RelayCommand(OpenAbout); + public ICommand SaveSettingsCommand => new RelayCommand(SaveSettings); public EventHandler? RequestSaveNoticeEvent; + private void OpenAbout() => new MainWindow().ShowDialog(); + private void SaveSettings() { const string LOG_IDENT = "MainWindowViewModel::SaveSettings";