optimizations
This commit is contained in:
@@ -15,4 +15,9 @@ public partial class GitLabRepoWorkspaceConfigEditorView : AvaloniaFlyoutBase
|
||||
DataContext = settings;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override object? GetResult()
|
||||
{
|
||||
return Settings;
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,7 @@ internal class LocalFolderWorkspace(LocalFolderWorkspaceConfig config) : IWorksp
|
||||
rawUpdateInfos = await GetContent(ConfigX.FileLocationUpdateJson);
|
||||
UpdateInfos = UpdateInfos.Parse(rawUpdateInfos);
|
||||
|
||||
if (string.IsNullOrWhiteSpace(ConfigX.FolderName))
|
||||
ConfigX.FolderName = Path.GetFileName(ConfigX.RootFolderPath);
|
||||
|
||||
return InstallInfos != null && UpdateInfos != null;
|
||||
|
||||
@@ -15,6 +15,9 @@
|
||||
|
||||
<dialogs:AvaloniaFlyoutBase.MainContent>
|
||||
<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}"/>
|
||||
<Grid
|
||||
ColumnDefinitions="*,Auto"
|
||||
|
||||
@@ -22,6 +22,11 @@ public partial class LocalFolderWorkspaceConfigEditorView : AvaloniaFlyoutBase
|
||||
ButtonSearch.ImageSource = AppGlobals.Symbols.GetImageSource(AppSymbols.opened_folder);
|
||||
}
|
||||
|
||||
protected override object? GetResult()
|
||||
{
|
||||
return Settings;
|
||||
}
|
||||
|
||||
private async void ButtonSearch_OnClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (TopLevel.GetTopLevel(this) is not { } topLevel)
|
||||
@@ -33,7 +38,12 @@ public partial class LocalFolderWorkspaceConfigEditorView : AvaloniaFlyoutBase
|
||||
AllowMultiple = false,
|
||||
});
|
||||
|
||||
if (filePaths.Count >= 1)
|
||||
if (filePaths.Count < 1)
|
||||
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.Interactivity;
|
||||
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.Settings;
|
||||
using ModpackUpdater.Apps.Manager.Ui.Models.MainWindow;
|
||||
using Pilz.Extensions;
|
||||
using Pilz.Features;
|
||||
using Pilz.UI.AvaloniaUI.Features;
|
||||
using Pilz.UI.Symbols;
|
||||
@@ -29,6 +31,8 @@ public partial class MainWindow : Window, IMainApi
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Title = $"{Title} (v{Assembly.GetExecutingAssembly().GetAppVersion().ToShortString()})";
|
||||
|
||||
GridMain.DataContext = Model;
|
||||
|
||||
ButtonWorkspace.ImageSource = AppGlobals.Symbols.GetImageSource(AppSymbols.workspace);
|
||||
|
||||
Reference in New Issue
Block a user