optimizations
This commit is contained in:
@@ -15,4 +15,9 @@ public partial class GitLabRepoWorkspaceConfigEditorView : AvaloniaFlyoutBase
|
|||||||
DataContext = settings;
|
DataContext = settings;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override object? GetResult()
|
||||||
|
{
|
||||||
|
return Settings;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -24,7 +24,8 @@ internal class LocalFolderWorkspace(LocalFolderWorkspaceConfig config) : IWorksp
|
|||||||
rawUpdateInfos = await GetContent(ConfigX.FileLocationUpdateJson);
|
rawUpdateInfos = await GetContent(ConfigX.FileLocationUpdateJson);
|
||||||
UpdateInfos = UpdateInfos.Parse(rawUpdateInfos);
|
UpdateInfos = UpdateInfos.Parse(rawUpdateInfos);
|
||||||
|
|
||||||
ConfigX.FolderName = Path.GetFileName(ConfigX.RootFolderPath);
|
if (string.IsNullOrWhiteSpace(ConfigX.FolderName))
|
||||||
|
ConfigX.FolderName = Path.GetFileName(ConfigX.RootFolderPath);
|
||||||
|
|
||||||
return InstallInfos != null && UpdateInfos != null;
|
return InstallInfos != null && UpdateInfos != null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,9 @@
|
|||||||
|
|
||||||
<dialogs:AvaloniaFlyoutBase.MainContent>
|
<dialogs:AvaloniaFlyoutBase.MainContent>
|
||||||
<StackPanel Spacing="6">
|
<StackPanel Spacing="6">
|
||||||
|
<Label Target="TextBoxName" Content="{x:Static langRes:GeneralLangRes.Name}"/>
|
||||||
|
<TextBox Name="TextBoxName" Text="{Binding FolderName}"/>
|
||||||
|
|
||||||
<Label Target="TextBoxRootFolderPath" Content="{x:Static langRes:GeneralLangRes.RootFolderPath}"/>
|
<Label Target="TextBoxRootFolderPath" Content="{x:Static langRes:GeneralLangRes.RootFolderPath}"/>
|
||||||
<Grid
|
<Grid
|
||||||
ColumnDefinitions="*,Auto"
|
ColumnDefinitions="*,Auto"
|
||||||
|
|||||||
@@ -22,6 +22,11 @@ public partial class LocalFolderWorkspaceConfigEditorView : AvaloniaFlyoutBase
|
|||||||
ButtonSearch.ImageSource = AppGlobals.Symbols.GetImageSource(AppSymbols.opened_folder);
|
ButtonSearch.ImageSource = AppGlobals.Symbols.GetImageSource(AppSymbols.opened_folder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override object? GetResult()
|
||||||
|
{
|
||||||
|
return Settings;
|
||||||
|
}
|
||||||
|
|
||||||
private async void ButtonSearch_OnClick(object? sender, RoutedEventArgs e)
|
private async void ButtonSearch_OnClick(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (TopLevel.GetTopLevel(this) is not { } topLevel)
|
if (TopLevel.GetTopLevel(this) is not { } topLevel)
|
||||||
@@ -33,7 +38,12 @@ public partial class LocalFolderWorkspaceConfigEditorView : AvaloniaFlyoutBase
|
|||||||
AllowMultiple = false,
|
AllowMultiple = false,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (filePaths.Count >= 1)
|
if (filePaths.Count < 1)
|
||||||
TextBoxRootFolderPath.Text = filePaths[0].Path.AbsolutePath;
|
return;
|
||||||
|
|
||||||
|
TextBoxRootFolderPath.Text = filePaths[0].Path.AbsolutePath;
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(TextBoxName.Text))
|
||||||
|
TextBoxName.Text = filePaths[0].Name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using System.Reflection;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Interactivity;
|
using Avalonia.Interactivity;
|
||||||
using Avalonia.Media;
|
using Avalonia.Media;
|
||||||
@@ -7,6 +8,7 @@ using ModpackUpdater.Apps.Manager.Api.Plugins.Features;
|
|||||||
using ModpackUpdater.Apps.Manager.Api.Plugins.Params;
|
using ModpackUpdater.Apps.Manager.Api.Plugins.Params;
|
||||||
using ModpackUpdater.Apps.Manager.Settings;
|
using ModpackUpdater.Apps.Manager.Settings;
|
||||||
using ModpackUpdater.Apps.Manager.Ui.Models.MainWindow;
|
using ModpackUpdater.Apps.Manager.Ui.Models.MainWindow;
|
||||||
|
using Pilz.Extensions;
|
||||||
using Pilz.Features;
|
using Pilz.Features;
|
||||||
using Pilz.UI.AvaloniaUI.Features;
|
using Pilz.UI.AvaloniaUI.Features;
|
||||||
using Pilz.UI.Symbols;
|
using Pilz.UI.Symbols;
|
||||||
@@ -28,6 +30,8 @@ public partial class MainWindow : Window, IMainApi
|
|||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
Title = $"{Title} (v{Assembly.GetExecutingAssembly().GetAppVersion().ToShortString()})";
|
||||||
|
|
||||||
GridMain.DataContext = Model;
|
GridMain.DataContext = Model;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user