Skip to content

Commit

Permalink
Feature/change install folder (#41)
Browse files Browse the repository at this point in the history
* Add folder icon and directory selection feature

Introduced a folder icon for the installation directory setting UI and implemented functionality to change the installation directory. Updated resource files to include new string entries for "InstallationDirectory" and "Edit" in multiple languages.

* Add Click event to GmlButton component

Implemented a new Click event for the GmlButton component, enhancing its functionality. Updated the axaml template to bind the button's click action and ensured command execution on click events. Also added handler in SettingsPageView to utilize the new Click event.

* Remove OnPointerReleased override from GmlButton

The OnPointerReleased method was overriding base functionality, which is now removed to restore default behavior. This change ensures that the button handles pointer events as per the standard implementation, preventing unexpected behavior.

* Refactor settings initialization and folder change logic

Separated responsibilities for initialization steps into distinct methods in `ServiceLocator`. Enhanced `SettingsPageViewModel` to save the installation directory upon changes. Modified `OpenFileDialog` to use new folder picker API and propagate the folder change correctly.

* Add "Files" localization and update description format

Added a new "Files" string to the resource files for localization support. Updated the OverviewPageViewModel to include the "Files" string in its description format, enhancing clarity for file-related messages.

* Refactor (#40)

* Refactor converters and optimize ProfileChanges handling

Updated converters to ensure return values are non-nullable and handle exceptions gracefully. Optimized `ProfileChanges` handling by using a dedicated async method and made various minor improvements such as marking properties as private.

* Refactor ServiceNotFoundException constructor.

Simplify initialization of NotFoundedService property directly in the constructor. This reduces the code complexity and enhances readability.

* Refactor `ServiceLocator` for readability and simplicity

Simplified handler attachment with discards, removed redundant braces, and eliminated unnecessary return statement in `RegisterLocalizationService`. These changes improve code readability and maintainability without altering functionality.

* Add detailed documentation comments and code refinements

Enhance interface and class method documentation with detailed descriptions, parameters, and return type annotations. Refactor dependency initialization in LocalStorageService, improve encapsulation with "init" properties for immutable fields, and remove redundant constructor in SystemService.

* Refactor ViewModels and streamline code

Simplified several ViewModel, Model, and View implementations for better readability and maintainability. Removed unnecessary dependencies and streamlined property initializations. Also added event handling for window close functionality.

* Refactor and clean up multiple classes for better readability

Refactored various classes to improve code readability and maintainability. Changes include removing unnecessary usings, adjusting method placements, and cleaning up formatting inconsistencies. This enhances the overall structure and readability without altering core functionality.
  • Loading branch information
GamerVII-NET authored Jul 27, 2024
1 parent 5c25427 commit 9a4813a
Show file tree
Hide file tree
Showing 97 changed files with 1,156 additions and 927 deletions.
4 changes: 2 additions & 2 deletions src/Gml.Launcher/App.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="Assets/Styles/Colors.axaml"/>
<ResourceInclude Source="Assets/Styles/Colors.axaml" />
</ResourceDictionary.MergedDictionaries>
<FontFamily x:Key="ManropeFont">avares://Gml.Launcher/Assets/Fonts#Manrope</FontFamily>
</ResourceDictionary>
Expand All @@ -32,7 +32,7 @@
<StyleInclude Source="/Views/Components/ProgressBar.axaml" />
<StyleInclude Source="/Views/Components/OnlineComponent.axaml" />

<StyleInclude Source="Assets/Styles/Classes.axaml"/>
<StyleInclude Source="Assets/Styles/Classes.axaml" />

<StyleInclude Source="avares://GamerVII.Notification.Avalonia/Themes/Generic.xaml" />

Expand Down
8 changes: 2 additions & 6 deletions src/Gml.Launcher/App.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
using System.Globalization;
using System.Threading.Tasks;
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
using Gml.Launcher.ViewModels;
using Gml.Launcher.Views;
using Gml.Launcher.Views.SplashScreen;

namespace Gml.Launcher;

public partial class App : Application
public class App : Application
{
public override void Initialize()
{
Expand All @@ -20,11 +17,10 @@ public override async void OnFrameworkInitializationCompleted()
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{

#if DEBUG
desktop.MainWindow = new MainWindow
{
DataContext = new MainWindowViewModel(),
DataContext = new MainWindowViewModel()
};
#else
var splashViewModel = new SplashScreenViewModel();
Expand Down
8 changes: 6 additions & 2 deletions src/Gml.Launcher/Assets/Images/app.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions src/Gml.Launcher/Assets/Images/back.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions src/Gml.Launcher/Assets/Images/document.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 12 additions & 10 deletions src/Gml.Launcher/Assets/Images/download.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions src/Gml.Launcher/Assets/Images/folder.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion src/Gml.Launcher/Assets/Images/home.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 32 additions & 28 deletions src/Gml.Launcher/Assets/Images/lang-ru.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 9a4813a

Please sign in to comment.