Skip to content

Commit

Permalink
feat: check packages update with overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraZiling committed Apr 14, 2024
1 parent d03064c commit 3e49056
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 108 deletions.
27 changes: 27 additions & 0 deletions src/PipManager/Languages/Lang.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions src/PipManager/Languages/Lang.resx
Original file line number Diff line number Diff line change
Expand Up @@ -735,4 +735,13 @@
<data name="Dialog_Title_DownloadDistributions" xml:space="preserve">
<value>Open download folder (for wheel files)</value>
</data>
<data name="Overlay_Title_PackageUpdate" xml:space="preserve">
<value>New Versions Found</value>
</data>
<data name="Overlay_Button_Cancel" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="Overlay_Button_Update" xml:space="preserve">
<value>Update</value>
</data>
</root>
9 changes: 9 additions & 0 deletions src/PipManager/Languages/Lang.zh-cn.resx
Original file line number Diff line number Diff line change
Expand Up @@ -735,4 +735,13 @@
<data name="Dialog_Title_DownloadDistributions" xml:space="preserve">
<value>打开下载文件夹</value>
</data>
<data name="Overlay_Title_PackageUpdate" xml:space="preserve">
<value>发现新版本</value>
</data>
<data name="Overlay_Button_Cancel" xml:space="preserve">
<value>取消</value>
</data>
<data name="Overlay_Button_Update" xml:space="preserve">
<value>更新</value>
</data>
</root>
49 changes: 0 additions & 49 deletions src/PipManager/Resources/Library/CheckUpdateContentDialog.cs

This file was deleted.

54 changes: 0 additions & 54 deletions src/PipManager/Resources/Library/LibraryStyles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,60 +36,6 @@
</ScrollViewer>
</Grid>

<Grid x:Key="LibraryCheckUpdateContentDialogContent" VerticalAlignment="Top">
<Grid.Resources>
<valueConverters:BoolToVisibilityConverter x:Key="BoolToVisibility" FalseValue="Collapsed" />
<valueConverters:ValueConverterGroup x:Key="InverseBoolToVisibility">
<valueConverters:InverseBoolConverter />
<valueConverters:BoolToVisibilityConverter FalseValue="Collapsed" />
</valueConverters:ValueConverterGroup>
</Grid.Resources>
<TextBlock
VerticalAlignment="Top"
FontSize="16"
Text="{I18N {x:Static lang:LangKeys.ContentDialog_Message_FindUpdate}}"
Visibility="Collapsed" />
<TextBlock
VerticalAlignment="Top"
FontSize="16"
Text="{I18N {x:Static lang:LangKeys.ContentDialog_Message_PackageIsLatest}}"
Visibility="Collapsed" />
<ScrollViewer Margin="0,30,0,0" VerticalAlignment="Top">
<ItemsControl x:Name="LibraryCheckUpdateContentDialogContentListView">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type library:LibraryCheckUpdateContentDialogContentListItem}">
<StackPanel>
<StackPanel Margin="7,0,0,0" Orientation="Horizontal">
<ui:SymbolIcon Symbol="TabDesktopNewPage20" Visibility="{Binding NeedUpdate, Converter={StaticResource InverseBoolToVisibility}}" />
<ui:SymbolIcon
Foreground="LimeGreen"
Symbol="ArrowCircleUp24"
Visibility="{Binding NeedUpdate, Converter={StaticResource BoolToVisibility}}" />
<TextBlock
Margin="3,0,0,0"
VerticalAlignment="Center"
FontSize="14"
Text="{Binding PackageName}" />
<TextBlock FontSize="14" Text=" " />
</StackPanel>
<StackPanel Margin="20,3,0,0" Orientation="Horizontal">
<ui:Badge
Appearance="Primary"
Content="{Binding PackageVersion}"
FontSize="12" />
<ui:Badge
Appearance="Success"
Content="{Binding NewVersion}"
FontSize="12"
Visibility="{Binding NeedUpdate, Converter={StaticResource BoolToVisibility}}" />
</StackPanel>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Grid>

<Grid
x:Key="LibraryInstallAddContentDialogContent"
MinWidth="200"
Expand Down
10 changes: 5 additions & 5 deletions src/PipManager/Views/Pages/Overlay/OverlayPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
xmlns:xamlFlair="clr-namespace:XamlFlair;assembly=XamlFlair.WPF"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
xmlns:package="clr-namespace:PipManager.Models.Package"
xmlns:lang="clr-namespace:PipManager.Languages"
d:DesignHeight="700"
d:DesignWidth="1200"
d:DataContext="{d:DesignInstance local:OverlayPage,
Expand All @@ -26,7 +27,7 @@
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
</Grid.RowDefinitions>
<ui:TextBlock Text="New Versions" FontTypography="TitleLarge"/>
<ui:TextBlock Text="{I18N {x:Static lang:LangKeys.Overlay_Title_PackageUpdate}}" FontTypography="TitleLarge"/>
<ScrollViewer Grid.Row="1" >
<ItemsControl ItemsSource="{Binding ViewModel.PackageUpdateItems}">
<ItemsControl.ItemTemplate>
Expand All @@ -41,17 +42,16 @@
<StackPanel Grid.Column="1" Orientation="Horizontal">
<ui:TextBlock Text="{Binding PackageVersion}" Foreground="Gray"></ui:TextBlock>
<ui:SymbolIcon Margin="10, 0, 0, 0" Symbol="ChevronRight24"/>
<ui:TextBlock Margin="10, 0, 0, 0" Text="{Binding NewVersion}" Foreground="Gray"></ui:TextBlock>
<ui:TextBlock Margin="10, 0, 0, 0" Text="{Binding NewVersion}"></ui:TextBlock>
</StackPanel>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
<StackPanel Grid.Row="2" HorizontalAlignment="Right" Orientation="Horizontal">
<ui:Button Appearance="Secondary" Content="Close" Command="{Binding ViewModel.CloseOverlayCommand}"></ui:Button>
<ui:Button Appearance="Success" Margin="5, 0, 0, 0" Content="Update" Command="{Binding ViewModel.ConfirmCommand}"></ui:Button>

<ui:Button Appearance="Secondary" Icon="{ui:SymbolIcon Dismiss24}" Content="{I18N {x:Static lang:LangKeys.Overlay_Button_Cancel}}" Command="{Binding ViewModel.CloseOverlayCommand}"></ui:Button>
<ui:Button Appearance="Success" Icon="{ui:SymbolIcon ArrowCircleUp24}" Margin="7, 0, 0, 0" Content="{I18N {x:Static lang:LangKeys.Overlay_Button_Update}}" Command="{Binding ViewModel.ConfirmCommand}"></ui:Button>
</StackPanel>
</Grid>
</UserControl>

0 comments on commit 3e49056

Please sign in to comment.