420 lines
14 KiB
XML
420 lines
14 KiB
XML
<Window
|
|
xmlns="https://github.com/avaloniaui"
|
|
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:local="clr-namespace:ModpackUpdater.Apps.Manager.Ui"
|
|
xmlns:vm="clr-namespace:ModpackUpdater.Apps.Manager.Ui.Models"
|
|
xmlns:pilz="https://git.pilzinsel64.de/pilz-framework/pilz"
|
|
xmlns:symbols="clr-namespace:Pilz.UI.Symbols;assembly=Pilz.UI"
|
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
|
x:Class="ModpackUpdater.Apps.Manager.Ui.MainWindow"
|
|
x:DataType="vm:MainWindowViewModel"
|
|
Title="Minecraft Modpack Manager"
|
|
WindowState="Maximized"
|
|
Loaded="Window_OnLoaded">
|
|
|
|
<Grid
|
|
x:Name="GridMain"
|
|
RowDefinitions="Auto,*"
|
|
ColumnDefinitions="Auto,*,500"
|
|
RowSpacing="6"
|
|
ColumnSpacing="6"
|
|
Margin="3">
|
|
|
|
<!-- StackPanel: Workspace -->
|
|
<StackPanel
|
|
Grid.Column="0"
|
|
Grid.Row="0"
|
|
Orientation="Horizontal">
|
|
|
|
<!-- Button: Workspace -->
|
|
<pilz:ImageButton
|
|
x:Name="ButtonWorkspace"
|
|
Text="Workspace"
|
|
Background="Transparent">
|
|
|
|
<pilz:ImageButton.Flyout>
|
|
<MenuFlyout>
|
|
<MenuFlyout.Items>
|
|
<MenuItem x:Name="MenuItemWorkspacePreferences" Header="Workspace _preferences"/>
|
|
<MenuItem x:Name="MenuItemSaveWorkspace" Header="_Save workspace" HotKey="Ctrl+S"/>
|
|
<Separator/>
|
|
<MenuItem x:Name="MenuItemNewWorkspace" Header="_New workspace"/>
|
|
<Separator/>
|
|
<MenuItem x:Name="MenuItemRecentWorkspaces" Header="_Recent workspaces"/>
|
|
</MenuFlyout.Items>
|
|
</MenuFlyout>
|
|
</pilz:ImageButton.Flyout>
|
|
</pilz:ImageButton>
|
|
|
|
<!-- Button: Update -->
|
|
<pilz:ImageButton
|
|
x:Name="ButtonUpdate"
|
|
Text="Update"
|
|
Background="Transparent">
|
|
|
|
<pilz:ImageButton.Flyout>
|
|
<MenuFlyout>
|
|
<MenuFlyout.Items>
|
|
<MenuItem x:Name="MenuItemCreateUpdate" Header="_Create update" Click="MenuItemCreateUpdate_OnClick"/>
|
|
<MenuItem x:Name="MenuItemRemoveUpdate" Header="_Remove update" Click="MenuItemRemoveUpdate_OnClick"/>
|
|
</MenuFlyout.Items>
|
|
</MenuFlyout>
|
|
</pilz:ImageButton.Flyout>
|
|
</pilz:ImageButton>
|
|
|
|
<!-- Button: Tools -->
|
|
<pilz:ImageButton
|
|
x:Name="ButtonTools"
|
|
Text="Tools"
|
|
Background="Transparent"/>
|
|
</StackPanel>
|
|
|
|
<!-- TreeView: Workspace -->
|
|
<ScrollViewer
|
|
Grid.Column="0"
|
|
Grid.Row="1"
|
|
VerticalScrollBarVisibility="Auto">
|
|
|
|
<StackPanel>
|
|
<TreeView
|
|
ItemsSource="{Binding CurrentTreeNodes}"
|
|
SelectedItem="{Binding SelectedTreeNode}">
|
|
|
|
<TreeView.ItemTemplate>
|
|
<TreeDataTemplate
|
|
ItemsSource="{Binding Nodes}">
|
|
|
|
<StackPanel Orientation="Horizontal" Spacing="6">
|
|
<Image
|
|
Source="{Binding Image}"
|
|
Width="{x:Static symbols:SymbolGlobals.DefaultImageSmallSize}"/>
|
|
<TextBlock Text="{Binding DisplayText}"/>
|
|
</StackPanel>
|
|
</TreeDataTemplate>
|
|
</TreeView.ItemTemplate>
|
|
</TreeView>
|
|
</StackPanel>
|
|
</ScrollViewer>
|
|
|
|
<!-- Panel: List header -->
|
|
<ContentControl
|
|
Grid.Column="1"
|
|
Grid.Row="0"
|
|
Content="{Binding SelectedTreeNode}">
|
|
|
|
<ContentControl.DataTemplates>
|
|
<DataTemplate
|
|
DataType="vm:ActionSetTreeNode">
|
|
|
|
<StackPanel
|
|
Orientation="Horizontal">
|
|
|
|
<!-- Button: Add action -->
|
|
<pilz:ImageButton
|
|
x:Name="ButtonAddAction"
|
|
Text="Add"
|
|
ImageSource="{x:Static local:MainWindow.ButtonImageAddAction}"
|
|
Background="Transparent"
|
|
Click="ButtonAddAction_OnClick"/>
|
|
|
|
<!-- Button: Remove action -->
|
|
<pilz:ImageButton
|
|
x:Name="ButtonRemoveAction"
|
|
Text="Remove"
|
|
ImageSource="{x:Static local:MainWindow.ButtonImageRemoveAction}"
|
|
Background="Transparent"
|
|
Click="ButtonRemoveAction_OnClick"/>
|
|
|
|
<!-- TextBox: Version -->
|
|
<TextBox
|
|
Margin="3, 0, 3, 0"
|
|
Width="100"
|
|
Text="{Binding Version}"/>
|
|
|
|
<!-- CheckBox: Is public -->
|
|
<CheckBox
|
|
Margin="3, 0, 3, 0"
|
|
Content="Public"
|
|
IsChecked="{Binding IsPublic}"/>
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
|
|
<DataTemplate
|
|
DataType="vm:MainWindowTreeNode"/>
|
|
</ContentControl.DataTemplates>
|
|
</ContentControl>
|
|
|
|
<!-- DataGrid -->
|
|
<DataGrid
|
|
Grid.Column="1"
|
|
Grid.Row="1"
|
|
x:Name="DataGridActions"
|
|
VerticalAlignment="Stretch"
|
|
ItemsSource="{Binding CurrentGridRows}"
|
|
SelectedItem="{Binding SelectedGridRow}">
|
|
|
|
<DataGrid.Columns>
|
|
<DataGridTextColumn
|
|
Header="Id"
|
|
Binding="{Binding InheritedId}"/>
|
|
|
|
<DataGridTextColumn
|
|
Header="Side"
|
|
Binding="{Binding InheritedSide}"/>
|
|
|
|
<DataGridTextColumn
|
|
Header="Update type"
|
|
Binding="{Binding InheritedUpdateType}"
|
|
IsVisible="{Binding IsUpdate}"/>
|
|
|
|
<DataGridTextColumn
|
|
Header="Source type"
|
|
Binding="{Binding InheritedSourceType}"/>
|
|
|
|
<DataGridTextColumn
|
|
Header="Dest path"
|
|
Binding="{Binding InheritedDestPath}"/>
|
|
</DataGrid.Columns>
|
|
</DataGrid>
|
|
|
|
<!-- Action editor -->
|
|
<ScrollViewer
|
|
x:Name="ScrollViewerInstallAction"
|
|
Grid.Column="2"
|
|
Grid.Row="1"
|
|
DataContext="{Binding SelectedGridRow}"
|
|
VerticalScrollBarVisibility="Auto">
|
|
|
|
<StackPanel
|
|
Spacing="6">
|
|
|
|
<!-- Update -->
|
|
<Grid
|
|
ColumnDefinitions="150,*"
|
|
RowDefinitions="Auto,Auto,Auto,Auto,Auto"
|
|
RowSpacing="6"
|
|
ColumnSpacing="6"
|
|
IsVisible="{Binding IsUpdate}">
|
|
|
|
<!-- Header -->
|
|
<StackPanel
|
|
Grid.ColumnSpan="2"
|
|
Orientation="Horizontal"
|
|
Spacing="6">
|
|
|
|
<Image x:Name="ImageUpdate" Width="{x:Static symbols:SymbolGlobals.DefaultImageMediumSize}"/>
|
|
<TextBlock Text="Update" FontSize="{x:Static symbols:SymbolGlobals.DefaultImageMediumSize}"/>
|
|
</StackPanel>
|
|
|
|
<!-- Inherit from -->
|
|
<Label Grid.Row="1" Grid.Column="0" Content="Inherit from" Target="TextBoxUpdateActionInheritFrom"/>
|
|
<TextBox
|
|
Grid.Row="1" Grid.Column="1"
|
|
x:Name="TextBoxUpdateActionInheritFrom"
|
|
Text="{Binding InheritFrom}"/>
|
|
|
|
<!-- Update type -->
|
|
<Label Grid.Row="2" Grid.Column="0" Content="Update type" Target="ComboBoxUpdateActionSourceType"/>
|
|
<ComboBox
|
|
Grid.Row="2" Grid.Column="1"
|
|
x:Name="ComboBoxUpdateActionSourceType"
|
|
ItemsSource="{x:Static vm:MainWindowGridRow.UpdateActionTypes}"
|
|
DisplayMemberBinding="{Binding Value}"
|
|
SelectedValueBinding="{Binding Key}"
|
|
SelectedValue="{Binding UpdateType}"/>
|
|
|
|
<!-- Source path -->
|
|
<Label Grid.Row="3" Grid.Column="0" Content="Source path" Target="TextBoxInstallActionSourcePath"/>
|
|
<TextBox
|
|
Grid.Row="3" Grid.Column="1"
|
|
x:Name="TextBoxInstallActionSourcePath"
|
|
Text="{Binding SrcPath}"/>
|
|
|
|
<!-- Is Directory -->
|
|
<CheckBox Grid.Row="4" Grid.Column="1"
|
|
x:Name="CheckBoxUpdateActionIsDir"
|
|
Content="Is Directory"
|
|
IsChecked="{Binding IsDirectory}"/>
|
|
</Grid>
|
|
|
|
<!-- General -->
|
|
<Grid
|
|
ColumnDefinitions="150,*"
|
|
RowDefinitions="Auto,Auto,Auto,Auto,Auto"
|
|
RowSpacing="6"
|
|
ColumnSpacing="6">
|
|
|
|
<!-- Header -->
|
|
<StackPanel
|
|
Grid.ColumnSpan="2"
|
|
Orientation="Horizontal"
|
|
Spacing="6">
|
|
|
|
<Image
|
|
x:Name="ImageGeneral"
|
|
Width="{x:Static symbols:SymbolGlobals.DefaultImageMediumSize}"/>
|
|
<TextBlock Text="General" FontSize="20"/>
|
|
</StackPanel>
|
|
|
|
<!-- Id -->
|
|
<Label Grid.Row="1" Grid.Column="0" Content="Id" Target="TextBoxInstallActionId"/>
|
|
<TextBox
|
|
Grid.Row="1" Grid.Column="1"
|
|
x:Name="TextBoxInstallActionId"
|
|
Text="{Binding Id}"/>
|
|
|
|
<!-- Name -->
|
|
<Label Grid.Row="2" Grid.Column="0" Content="Name" Target="TextBoxInstallActionName"/>
|
|
<TextBox
|
|
Grid.Row="2" Grid.Column="1"
|
|
x:Name="TextBoxInstallActionName"
|
|
Text="{Binding Name}"/>
|
|
|
|
<!-- Side -->
|
|
<Label Grid.Row="3" Grid.Column="0" Content="Side" Target="ComboBoxInstallActionSide"/>
|
|
<ComboBox
|
|
Grid.Row="3" Grid.Column="1"
|
|
x:Name="ComboBoxInstallActionSide"
|
|
ItemsSource="{x:Static vm:MainWindowGridRow.Sides}"
|
|
DisplayMemberBinding="{Binding Value}"
|
|
SelectedValueBinding="{Binding Key}"
|
|
SelectedValue="{Binding Side}"/>
|
|
|
|
<!-- Is Extra -->
|
|
<CheckBox
|
|
Grid.Row="4" Grid.Column="1"
|
|
x:Name="CheckBoxInstallActionIsExtra"
|
|
Content="Is Extra"
|
|
IsChecked="{Binding IsExtra}"/>
|
|
</Grid>
|
|
|
|
<!-- Destination -->
|
|
<Grid
|
|
ColumnDefinitions="150,*"
|
|
RowDefinitions="Auto,Auto"
|
|
RowSpacing="6"
|
|
ColumnSpacing="6">
|
|
|
|
<!-- Header -->
|
|
<StackPanel
|
|
Grid.ColumnSpan="2"
|
|
Orientation="Horizontal"
|
|
Spacing="6">
|
|
|
|
<Image
|
|
x:Name="ImageDestination"
|
|
Width="{x:Static symbols:SymbolGlobals.DefaultImageMediumSize}"/>
|
|
<TextBlock Text="Destination" FontSize="20"/>
|
|
</StackPanel>
|
|
|
|
<!-- Destination path -->
|
|
<Label Grid.Row="1" Grid.Column="0" Content="Destination path" Target="TextBoxInstallDestPath"/>
|
|
<TextBox
|
|
Grid.Row="1" Grid.Column="1"
|
|
x:Name="TextBoxInstallDestPath"
|
|
Text="{Binding DestPath}"/>
|
|
</Grid>
|
|
|
|
<!-- Source -->
|
|
<Grid
|
|
ColumnDefinitions="150,*"
|
|
RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto"
|
|
RowSpacing="6"
|
|
ColumnSpacing="6">
|
|
|
|
<!-- Header -->
|
|
<StackPanel
|
|
Grid.ColumnSpan="2"
|
|
Orientation="Horizontal"
|
|
Spacing="6">
|
|
|
|
<Image
|
|
x:Name="ImageSource"
|
|
Width="{x:Static symbols:SymbolGlobals.DefaultImageMediumSize}"/>
|
|
<TextBlock Text="Source" FontSize="20"/>
|
|
</StackPanel>
|
|
|
|
<!-- Source types -->
|
|
<Label Grid.Row="1" Grid.Column="0" Content="Source type" Target="CheckBoxInstallActionSourceType"/>
|
|
<ComboBox
|
|
Grid.Row="1" Grid.Column="1"
|
|
x:Name="CheckBoxInstallActionSourceType"
|
|
ItemsSource="{x:Static vm:MainWindowGridRow.SourceTypes}"
|
|
DisplayMemberBinding="{Binding Value}"
|
|
SelectedValueBinding="{Binding Key}"
|
|
SelectedValue="{Binding SourceType}"/>
|
|
|
|
<!-- Is Zip -->
|
|
<CheckBox Grid.Row="2" Grid.Column="1"
|
|
x:Name="CheckBoxInstallActionIsZip"
|
|
Content="Is Zip archive"
|
|
IsChecked="{Binding IsZip}"/>
|
|
|
|
<!-- Source owner -->
|
|
<Label Grid.Row="3" Grid.Column="0" Content="Source owner" Target="TextBoxInstallActionSourceOwner"/>
|
|
<TextBox
|
|
Grid.Row="3" Grid.Column="1"
|
|
x:Name="TextBoxInstallActionSourceOwner"
|
|
Text="{Binding SourceOwner}"/>
|
|
|
|
<!-- Source name -->
|
|
<Label Grid.Row="4" Grid.Column="0" Content="Source name" Target="TextBoxInstallActionSourceName"/>
|
|
<TextBox
|
|
Grid.Row="4" Grid.Column="1"
|
|
x:Name="TextBoxInstallActionSourceName"
|
|
Text="{Binding SourceName}"/>
|
|
|
|
<!-- Source RegEx -->
|
|
<Label Grid.Row="5" Grid.Column="0" Content="Source RegEx" Target="TextBoxInstallActionSourceRegEx"/>
|
|
<TextBox
|
|
Grid.Row="5" Grid.Column="1"
|
|
x:Name="TextBoxInstallActionSourceRegEx"
|
|
Text="{Binding SourceRegex}"/>
|
|
|
|
<!-- Source url -->
|
|
<Label Grid.Row="6" Grid.Column="0" Content="Source URL" Target="TextBoxInstallActionSourceUrl"/>
|
|
<TextBox
|
|
Grid.Row="6" Grid.Column="1"
|
|
x:Name="TextBoxInstallActionSourceUrl" Text="{Binding SourceUrl}"/>
|
|
|
|
<!-- Zip archive path -->
|
|
<Label Grid.Row="7" Grid.Column="0" Content="ZIP archive path" Target="TextBoxInstallActionZipArchivePath"/>
|
|
<TextBox
|
|
Grid.Row="7" Grid.Column="1"
|
|
x:Name="TextBoxInstallActionZipArchivePath"
|
|
Text="{Binding SourceUrl}"/>
|
|
</Grid>
|
|
|
|
<!-- Metadata -->
|
|
<Grid
|
|
ColumnDefinitions="150,*"
|
|
RowDefinitions="Auto,Auto"
|
|
RowSpacing="6"
|
|
ColumnSpacing="6"
|
|
VerticalAlignment="Center">
|
|
|
|
<!-- Header -->
|
|
<StackPanel
|
|
Grid.ColumnSpan="2"
|
|
Orientation="Horizontal"
|
|
Spacing="6">
|
|
|
|
<Image
|
|
x:Name="ImageMetadata"
|
|
Width="{x:Static symbols:SymbolGlobals.DefaultImageMediumSize}"/>
|
|
<TextBlock Text="Metadata" FontSize="20"/>
|
|
</StackPanel>
|
|
|
|
<!-- Website -->
|
|
<Label Grid.Row="1" Grid.Column="0" Content="Website" Target="TextBoxInstallActionWebsite"/>
|
|
<TextBox
|
|
Grid.Row="1" Grid.Column="1"
|
|
x:Name="TextBoxInstallActionWebsite"
|
|
Text="{Binding Website}"/>
|
|
</Grid>
|
|
</StackPanel>
|
|
</ScrollViewer>
|
|
</Grid>
|
|
</Window> |