part of manager main window
This commit is contained in:
@@ -3,10 +3,207 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:modpackUpdater="clr-namespace:ModpackUpdater;assembly=ModpackUpdater"
|
||||
xmlns:local="clr-namespace:ModpackUpdater.Apps.Manager.Ui"
|
||||
xmlns:manager="clr-namespace:ModpackUpdater.Apps.Manager"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="ModpackUpdater.Apps.Manager.Ui.MainWindow"
|
||||
Title="Minecraft Modpack Manager"
|
||||
Padding="3">
|
||||
|
||||
|
||||
<Grid
|
||||
RowDefinitions="Auto,*">
|
||||
<Menu>
|
||||
<Menu.Items>
|
||||
<MenuItem x:Name="MenuItemWorkspace" Header="Workspace">
|
||||
|
||||
<MenuItem.Items>
|
||||
<MenuItem x:Name="MenuItemWorkspacePreferences" Header="Workspace preferences"/>
|
||||
<MenuItem x:Name="MenuItemSaveWorkspace" Header="Save workspace"/>
|
||||
<Separator/>
|
||||
<MenuItem x:Name="MenuItemNewWorkspace" Header="New workspace"/>
|
||||
<Separator/>
|
||||
<MenuItem x:Name="MenuItemRecentWorkspaces" Header="Recent workspaces"/>
|
||||
</MenuItem.Items>
|
||||
</MenuItem>
|
||||
|
||||
<MenuItem x:Name="MenuItemUpdates" Header="Updates">
|
||||
<MenuItem.Items>
|
||||
<MenuItem x:Name="MenuItemCreateUpdate" Header="Create update"/>
|
||||
<MenuItem x:Name="MenuItemRemoveUpdate" Header="Remove update"/>
|
||||
</MenuItem.Items>
|
||||
</MenuItem>
|
||||
|
||||
<MenuItem x:Name="MenuItemTools" Header="Tools"/>
|
||||
</Menu.Items>
|
||||
</Menu>
|
||||
|
||||
<Grid
|
||||
Grid.Row="1"
|
||||
ColumnDefinitions="Auto,*,*"
|
||||
Margin="3">
|
||||
|
||||
<TreeView
|
||||
Grid.Column="0"
|
||||
Margin="3"/>
|
||||
|
||||
<!-- ... -->
|
||||
|
||||
<ScrollViewer
|
||||
Grid.Column="2"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
|
||||
<StackPanel>
|
||||
|
||||
<!-- Update -->
|
||||
<StackPanel
|
||||
x:Name="StackPanelUpdate"
|
||||
Margin="3"
|
||||
Spacing="6">
|
||||
|
||||
<!-- Header -->
|
||||
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||
<Image x:Name="ImageUpdate"/>
|
||||
<TextBlock Text="Update" FontSize="20"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Inherit from -->
|
||||
<Label Content="Inherit from" Target="TextBoxUpdateActionInheritFrom"/>
|
||||
<TextBox x:Name="TextBoxUpdateActionInheritFrom" Text="{Binding InheritFrom, DataType=modpackUpdater:UpdateAction}"/>
|
||||
|
||||
<!-- Source type -->
|
||||
<Label Content="Source type" Target="ComboBoxUpdateActionSourceType"/>
|
||||
<ComboBox
|
||||
x:Name="ComboBoxUpdateActionSourceType"
|
||||
ItemsSource="{x:Static local:MainWindow.UpdateActionTypes}"
|
||||
DisplayMemberBinding="{Binding Value}"
|
||||
SelectedValueBinding="{Binding Key}"
|
||||
SelectedValue="{Binding Type, DataType=modpackUpdater:UpdateAction}"/>
|
||||
|
||||
<!-- Is Directory -->
|
||||
<CheckBox
|
||||
x:Name="CheckBoxUpdateActionIsDir"
|
||||
Content="Is Directory"
|
||||
IsChecked="{Binding IsDirectory, DataType=modpackUpdater:UpdateAction}"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- General -->
|
||||
<StackPanel
|
||||
Margin="3"
|
||||
Spacing="6">
|
||||
|
||||
<!-- Header -->
|
||||
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||
<Image x:Name="ImageGeneral"/>
|
||||
<TextBlock Text="General" FontSize="20"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Id -->
|
||||
<Label Content="Id" Target="TextBoxInstallActionId"/>
|
||||
<TextBox x:Name="TextBoxInstallActionId" Text="{Binding Id, DataType=modpackUpdater:InstallAction}"/>
|
||||
|
||||
<!-- Name -->
|
||||
<Label Content="Name" Target="TextBoxInstallActionName"/>
|
||||
<TextBox x:Name="TextBoxInstallActionName" Text="{Binding Name, DataType=modpackUpdater:InstallAction}"/>
|
||||
|
||||
<!-- Side -->
|
||||
<Label Content="Side" Target="ComboBoxInstallActionSide"/>
|
||||
<ComboBox
|
||||
x:Name="ComboBoxInstallActionSide"
|
||||
ItemsSource="{x:Static local:MainWindow.Sides}"
|
||||
DisplayMemberBinding="{Binding Value}"
|
||||
SelectedValueBinding="{Binding Key}"
|
||||
SelectedValue="{Binding Side, DataType=modpackUpdater:InstallAction}"/>
|
||||
|
||||
<!-- Is Extra -->
|
||||
<CheckBox
|
||||
x:Name="CheckBoxInstallActionIsExtra"
|
||||
Content="Is Extra"
|
||||
IsChecked="{Binding IsExtra, DataType=modpackUpdater:InstallAction}"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Destination -->
|
||||
<StackPanel
|
||||
Margin="3"
|
||||
Spacing="6">
|
||||
|
||||
<!-- Header -->
|
||||
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||
<Image x:Name="ImageDestination"/>
|
||||
<TextBlock Text="Destination" FontSize="20"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Destination path -->
|
||||
<TextBox x:Name="TextBoxInstallDestPath" Text="{Binding DestPath, DataType=modpackUpdater:InstallAction}"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Source -->
|
||||
<StackPanel
|
||||
Margin="3"
|
||||
Spacing="6">
|
||||
|
||||
<!-- Header -->
|
||||
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||
<Image x:Name="ImageSource"/>
|
||||
<TextBlock Text="Source" FontSize="20"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Source types -->
|
||||
<Label Content="Source type" Target="CheckBoxInstallActionSourceType"/>
|
||||
<ComboBox
|
||||
x:Name="CheckBoxInstallActionSourceType"
|
||||
ItemsSource="{x:Static local:MainWindow.SourceTypes}"
|
||||
DisplayMemberBinding="{Binding Value}"
|
||||
SelectedValueBinding="{Binding Key}"
|
||||
SelectedValue="{Binding SourceType, DataType=modpackUpdater:InstallAction}"/>
|
||||
|
||||
<!-- Is Zip -->
|
||||
<CheckBox
|
||||
x:Name="CheckBoxInstallActionIsZip"
|
||||
Content="Is Zip archive"
|
||||
IsChecked="{Binding IsZip, DataType=modpackUpdater:InstallAction}"/>
|
||||
|
||||
<!-- Source owner -->
|
||||
<Label Content="Source owner" Target="TextBoxInstallActionSourceOwner"/>
|
||||
<TextBox x:Name="TextBoxInstallActionSourceOwner" Text="{Binding SourceOwner, DataType=modpackUpdater:InstallAction}"/>
|
||||
|
||||
<!-- Source name -->
|
||||
<Label Content="Source name" Target="TextBoxInstallActionSourceName"/>
|
||||
<TextBox x:Name="TextBoxInstallActionSourceName" Text="{Binding SourceName, DataType=modpackUpdater:InstallAction}"/>
|
||||
|
||||
<!-- Source RegEx -->
|
||||
<Label Content="Source RegEx" Target="TextBoxInstallActionSourceRegEx"/>
|
||||
<TextBox x:Name="TextBoxInstallActionSourceRegEx" Text="{Binding SourceRegex, DataType=modpackUpdater:InstallAction}"/>
|
||||
|
||||
<!-- Source url -->
|
||||
<Label Content="Source URL" Target="TextBoxInstallActionSourceUrl"/>
|
||||
<TextBox x:Name="TextBoxInstallActionSourceUrl" Text="{Binding SourceUrl, DataType=modpackUpdater:InstallAction}"/>
|
||||
|
||||
<!-- Zip archive path -->
|
||||
<Label Content="ZIP archive path" Target="TextBoxInstallActionZipArchivePath"/>
|
||||
<TextBox x:Name="TextBoxInstallActionZipArchivePath" Text="{Binding SourceUrl, DataType=modpackUpdater:InstallAction}"/>
|
||||
|
||||
<!-- Source path -->
|
||||
<Label Content="Source path" Target="TextBoxInstallActionSourcePath"/>
|
||||
<TextBox x:Name="TextBoxInstallActionSourcePath" Text="{Binding SrcPath, DataType=modpackUpdater:UpdateAction}"/>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel
|
||||
Margin="3"
|
||||
Spacing="6">
|
||||
|
||||
<!-- Header -->
|
||||
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||
<Image x:Name="ImageMetadata"/>
|
||||
<TextBlock Text="Metadata" FontSize="20"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Website -->
|
||||
<Label Content="Website" Target="TextBoxInstallActionWebsite"/>
|
||||
<TextBox x:Name="TextBoxInstallActionWebsite" Text="{Binding Website, DataType=modpackUpdater:InstallAction}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
@@ -6,6 +7,12 @@ namespace ModpackUpdater.Apps.Manager.Ui;
|
||||
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public static Dictionary<SourceType, string> SourceTypes { get; } = Enum.GetValues<SourceType>().ToDictionary(n => n, n => Enum.GetName(n)!);
|
||||
public static Dictionary<Side, string> Sides { get; } = Enum.GetValues<Side>().ToDictionary(n => n, n => Enum.GetName(n)!);
|
||||
public static Dictionary<UpdateActionType, string> UpdateActionTypes { get; } = Enum.GetValues<UpdateActionType>().ToDictionary(n => n, n => Enum.GetName(n)!);
|
||||
|
||||
private readonly ObservableCollection<InstallAction> actions = [];
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Reference in New Issue
Block a user