Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
JusterZhu committed Sep 18, 2024
2 parents 8988a81 + 0479c34 commit 37268db
Show file tree
Hide file tree
Showing 4 changed files with 260 additions and 75 deletions.
19 changes: 13 additions & 6 deletions src/WPF/GeneralUpdate.Packet/App.xaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
<Application x:Class="GeneralUpdate.Packet.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:GeneralUpdate.Packet"
StartupUri="MainWindow.xaml">
<Application
x:Class="GeneralUpdate.Packet.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:GeneralUpdate.Packet"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>

<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ui:ThemesDictionary Theme="Light" />
<ui:ControlsDictionary />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
2 changes: 1 addition & 1 deletion src/WPF/GeneralUpdate.Packet/GeneralUpdate.Packet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.1" />
<PackageReference Include="GeneralUpdate.Differential" Version="1.4.3" />
<PackageReference Include="GeneralUpdate.Zip" Version="2.3.2" />
<PackageReference Include="MaterialDesignThemes" Version="4.9.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="WindowsAPICodePack" Version="7.0.4" />
<PackageReference Include="WPF-UI" Version="3.0.4" />
</ItemGroup>

<ItemGroup>
Expand Down
37 changes: 24 additions & 13 deletions src/WPF/GeneralUpdate.Packet/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
<Window x:Class="GeneralUpdate.Packet.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:GeneralUpdate.Packet"
mc:Ignorable="d"
Title="GeneralUpdate.Packet" Height="640" Width="900">
<Window
x:Class="GeneralUpdate.Packet.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:GeneralUpdate.Packet"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
Title="GeneralUpdate.Packet"
Width="900"
Height="660"
mc:Ignorable="d">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="100"></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition Height="100" />
<RowDefinition />
</Grid.RowDefinitions>
<Image Source=".\Resource\GeneralUpdate_h.png"></Image>
<TabControl Grid.Row="1" ItemsSource="{Binding Modules}" SelectedItem="{Binding CurrentModule}" TabStripPlacement="Left">
<Image Source=".\Resource\GeneralUpdate_h.png" />
<TabControl
Grid.Row="1"
ItemsSource="{Binding Modules}"
SelectedItem="{Binding CurrentModule}"
TabStripPlacement="Bottom">
<TabControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</TabControl.ItemTemplate>
<TabControl.ContentTemplate>
<DataTemplate>
<ContentPresenter Width="Auto" Height="Auto" Content="{Binding View}" />
<ContentPresenter
Width="Auto"
Height="Auto"
Content="{Binding View}" />
</DataTemplate>
</TabControl.ContentTemplate>
</TabControl>
Expand Down
277 changes: 222 additions & 55 deletions src/WPF/GeneralUpdate.Packet/Views/PacketView.xaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
<UserControl x:Class="GeneralUpdate.Packet.Views.PacketView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:GeneralUpdate.Packet.Views"
mc:Ignorable="d"
d:DesignHeight="490" d:DesignWidth="800">
<UserControl
x:Class="GeneralUpdate.Packet.Views.PacketView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:GeneralUpdate.Packet.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
d:DesignHeight="500"
d:DesignWidth="800"
mc:Ignorable="d">

<Grid>
<Grid.RowDefinitions>
<RowDefinition />
Expand All @@ -24,65 +28,228 @@
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
<Image Width="100" Height="100" Source="generalupdate_img.png" />
<Image
Width="100"
Height="100"
Source="generalupdate_img.png" />
</StackPanel>
<StackPanel Grid.Row="1" Orientation="Horizontal" Height="40" HorizontalAlignment="Center">
<TextBlock VerticalAlignment="Center" Text="Source path :" />
<TextBox Width="400" Height="30" Margin="3,0,3,0" Text="{Binding SourcePath}" VerticalContentAlignment="Center" />
<Button Width="110" Height="30" Content="Pick folder" Command="{Binding SelectFolderCommand}" CommandParameter="Source" />
<TextBlock Text="*" Foreground="Red" VerticalAlignment="Center" />
<StackPanel
Grid.Row="1"
Height="40"
HorizontalAlignment="Center"
Orientation="Horizontal">
<TextBlock VerticalAlignment="Center" Text="Source path :" />
<TextBox
Width="400"
Height="35"
Margin="3,0,3,0"
VerticalContentAlignment="Center"
Text="{Binding SourcePath}" />
<Button
Width="110"
Height="35"
Command="{Binding SelectFolderCommand}"
CommandParameter="Source"
Content="Pick folder" />
<TextBlock
VerticalAlignment="Center"
Foreground="Red"
Text="*" />
</StackPanel>
<StackPanel Grid.Row="2" Orientation="Horizontal" Height="40" HorizontalAlignment="Center">
<TextBlock VerticalAlignment="Center" Text="Target path :" />
<TextBox Width="400" Height="30" Margin="5,0,3,0" Text="{Binding TargetPath}" VerticalContentAlignment="Center" />
<Button Width="110" Height="30" Content="Pick folder" Command="{Binding SelectFolderCommand}" CommandParameter="Target" />
<TextBlock Text="*" Foreground="Red" VerticalAlignment="Center" />
<StackPanel
Grid.Row="2"
Height="40"
HorizontalAlignment="Center"
Orientation="Horizontal">
<TextBlock VerticalAlignment="Center" Text="Target path :" />
<TextBox
Width="400"
Height="35"
Margin="5,0,3,0"
VerticalContentAlignment="Center"
Text="{Binding TargetPath}" />
<Button
Width="110"
Height="35"
Command="{Binding SelectFolderCommand}"
CommandParameter="Target"
Content="Pick folder" />
<TextBlock
VerticalAlignment="Center"
Foreground="Red"
Text="*" />
</StackPanel>
<StackPanel Grid.Row="3" Orientation="Horizontal" Height="40" HorizontalAlignment="Center">
<TextBlock VerticalAlignment="Center" Text="Patch path :" />
<TextBox Width="400" Height="30" Margin="9,0,3,0" Text="{Binding PatchPath}" VerticalContentAlignment="Center" />
<Button Width="110" Height="30" Content="Pick folder" Command="{Binding SelectFolderCommand}" CommandParameter="Patch" />
<TextBlock Text="*" Foreground="Red" VerticalAlignment="Center" />
<StackPanel
Grid.Row="3"
Height="40"
HorizontalAlignment="Center"
Orientation="Horizontal">
<TextBlock VerticalAlignment="Center" Text="Patch path :" />
<TextBox
Width="400"
Height="35"
Margin="9,0,3,0"
VerticalContentAlignment="Center"
Text="{Binding PatchPath}" />
<Button
Width="110"
Height="35"
Command="{Binding SelectFolderCommand}"
CommandParameter="Patch"
Content="Pick folder" />
<TextBlock
VerticalAlignment="Center"
Foreground="Red"
Text="*" />
</StackPanel>
<StackPanel Margin="0,0,120,0" Grid.Row="4" Orientation="Horizontal" Height="40" HorizontalAlignment="Center">
<TextBlock VerticalAlignment="Center" Text="Packet name :" />
<TextBox Width="400" Height="30" Margin="9,0,3,0" Text="{Binding PacketName , Mode=TwoWay}" VerticalContentAlignment="Center" />
<TextBlock Text="*" Foreground="Red" VerticalAlignment="Center" />
<StackPanel
Grid.Row="4"
Height="40"
Margin="0,0,120,0"
HorizontalAlignment="Center"
Orientation="Horizontal">
<TextBlock VerticalAlignment="Center" Text="Packet name :" />
<TextBox
Width="400"
Height="35"
Margin="9,0,3,0"
VerticalContentAlignment="Center"
Text="{Binding PacketName, Mode=TwoWay}" />
<TextBlock
VerticalAlignment="Center"
Foreground="Red"
Text="*" />
</StackPanel>
<StackPanel Margin="0,0,85,0" Grid.Row="5" Orientation="Horizontal" Height="40" HorizontalAlignment="Center">
<TextBlock VerticalAlignment="Center" Text="Format :" />
<ComboBox Width="400" Height="30" Margin="9,0,3,0" ItemsSource="{Binding Formats}" SelectedItem="{Binding CurrentFormat}" VerticalContentAlignment="Center" />
<TextBlock Text="*" Foreground="Red" VerticalAlignment="Center" />
<StackPanel
Grid.Row="5"
Height="40"
Margin="0,0,85,0"
HorizontalAlignment="Center"
Orientation="Horizontal">
<TextBlock VerticalAlignment="Center" Text="Format :" />
<ComboBox
Width="400"
Height="35"
Margin="9,0,3,0"
VerticalContentAlignment="Center"
ItemsSource="{Binding Formats}"
SelectedItem="{Binding CurrentFormat}" />
<TextBlock
VerticalAlignment="Center"
Foreground="Red"
Text="*" />
</StackPanel>
<StackPanel Margin="0,0,100,0" Grid.Row="6" Orientation="Horizontal" Height="40" HorizontalAlignment="Center">
<TextBlock VerticalAlignment="Center" Text="Encoding :" />
<ComboBox Width="400" Height="30" Margin="9,0,3,0" SelectedIndex="0" ItemsSource="{Binding Encodings}" SelectedItem="{Binding CurrentEncoding}" VerticalContentAlignment="Center" />
<TextBlock Text="*" Foreground="Red" VerticalAlignment="Center" />
<StackPanel
Grid.Row="6"
Height="40"
Margin="0,0,100,0"
HorizontalAlignment="Center"
Orientation="Horizontal">
<TextBlock VerticalAlignment="Center" Text="Encoding :" />
<ComboBox
Width="400"
Height="35"
Margin="9,0,3,0"
VerticalContentAlignment="Center"
ItemsSource="{Binding Encodings}"
SelectedIndex="0"
SelectedItem="{Binding CurrentEncoding}" />
<TextBlock
VerticalAlignment="Center"
Foreground="Red"
Text="*" />
</StackPanel>
<StackPanel Margin="0,0,135,0" Grid.Row="7" Orientation="Horizontal" Height="40" HorizontalAlignment="Center">
<TextBlock VerticalAlignment="Center" Text="Client app key :" />
<TextBox Width="400" Height="30" Margin="9,0,3,0" Text="{Binding CurrentClientAppKey}" VerticalContentAlignment="Center" />
<StackPanel
Grid.Row="7"
Height="40"
Margin="0,0,135,0"
HorizontalAlignment="Center"
Orientation="Horizontal">
<TextBlock VerticalAlignment="Center" Text="Client app key :" />
<TextBox
Width="400"
Height="35"
Margin="9,0,3,0"
VerticalContentAlignment="Center"
Text="{Binding CurrentClientAppKey}" />
</StackPanel>
<StackPanel Margin="0,0,115,0" Grid.Row="8" Orientation="Horizontal" Height="40" HorizontalAlignment="Center">
<TextBlock VerticalAlignment="Center" Text="Client type :" />
<ComboBox Width="400" Height="32" Margin="9,0,3,0" ItemsSource="{Binding AppTypes}" SelectedItem="{Binding CurrentAppType}" VerticalContentAlignment="Center" />
<StackPanel
Grid.Row="8"
Height="40"
Margin="0,0,115,0"
HorizontalAlignment="Center"
Orientation="Horizontal">
<TextBlock VerticalAlignment="Center" Text="Client type :" />
<ComboBox
Width="400"
Height="35"
Margin="9,0,3,0"
VerticalContentAlignment="Center"
ItemsSource="{Binding AppTypes}"
SelectedItem="{Binding CurrentAppType}" />
</StackPanel>
<StackPanel Margin="0,5,110,5" Grid.Row="9" Orientation="Horizontal" HorizontalAlignment="Center">
<TextBlock VerticalAlignment="Center" Text="Server url :" />
<TextBox Width="400" Height="30" Margin="9,0,3,0" Text="{Binding Url}" VerticalContentAlignment="Center" />
<StackPanel
Grid.Row="9"
Margin="0,5,110,5"
HorizontalAlignment="Center"
Orientation="Horizontal">
<TextBlock VerticalAlignment="Center" Text="Server url :" />
<TextBox
Width="400"
Height="35"
Margin="9,0,3,0"
VerticalContentAlignment="Center"
Text="{Binding Url}" />
</StackPanel>
<StackPanel Margin="0,0,145,0" Grid.Row="10" Orientation="Horizontal" HorizontalAlignment="Center">
<TextBlock VerticalAlignment="Center" Text="Currnet version :" />
<TextBox Width="400" Height="30" Margin="9,0,3,0" Text="{Binding CurrentVersion}" VerticalContentAlignment="Center" />
<StackPanel
Grid.Row="10"
Margin="0,0,145,0"
HorizontalAlignment="Center"
Orientation="Horizontal">
<TextBlock VerticalAlignment="Center" Text="Currnet version :" />
<TextBox
Width="400"
Height="35"
Margin="9,0,3,0"
VerticalContentAlignment="Center"
Text="{Binding CurrentVersion}" />
</StackPanel>
<StackPanel Grid.Row="11" Orientation="Horizontal" Height="40" HorizontalAlignment="Center">
<TextBlock VerticalAlignment="Center" Text="Driver dir :" />
<TextBox Width="400" Height="30" Margin="9,0,3,0" Text="{Binding PatchPath}" VerticalContentAlignment="Center" />
<Button Width="110" Height="30" Content="Pick driver" Command="{Binding SelectFolderCommand}" CommandParameter="Driver" />
<StackPanel
Grid.Row="11"
Height="40"
HorizontalAlignment="Center"
Orientation="Horizontal">
<TextBlock VerticalAlignment="Center" Text="Driver dir :" />
<TextBox
Width="400"
Height="35"
Margin="9,0,3,0"
VerticalContentAlignment="Center"
Text="{Binding PatchPath}" />
<Button
Width="110"
Height="35"
Command="{Binding SelectFolderCommand}"
CommandParameter="Driver"
Content="Pick driver" />
</StackPanel>
<StackPanel HorizontalAlignment="Center" Grid.Row="12" Orientation="Horizontal">
<Button Margin="5" HorizontalAlignment="Center" Content="Build" Width="110" Height="30" Command="{Binding BuildCommand}" ToolTipService.ToolTip="The binary differential patch package is generated based on the difference between the two versions." />
<CheckBox Margin="10,0,0,0" IsChecked="{Binding IsPublish}" Content="publish" VerticalAlignment="Center" />
<StackPanel
Grid.Row="12"
HorizontalAlignment="Center"
Orientation="Horizontal">
<Button
Width="110"
Height="35"
Margin="5"
HorizontalAlignment="Center"
Command="{Binding BuildCommand}"
Content="Build"
ToolTipService.ToolTip="The binary differential patch package is generated based on the difference between the two versions." />
<CheckBox
Margin="10,0,0,0"
VerticalAlignment="Center"
Content="publish"
IsChecked="{Binding IsPublish}" />
</StackPanel>
</Grid>
</UserControl>

0 comments on commit 37268db

Please sign in to comment.