Skip to content

Commit

Permalink
[Store] Implement drag-and-drop (offline) installs
Browse files Browse the repository at this point in the history
  • Loading branch information
KimihikoAkayasaki committed Mar 12, 2023
1 parent 2b87e95 commit ace4ed8
Show file tree
Hide file tree
Showing 4 changed files with 561 additions and 4 deletions.
15 changes: 15 additions & 0 deletions Amethyst/Assets/Strings/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,21 @@
"/SharedStrings/Plugins/Store/Statuses/Downloading": "Downloading {0} {1}...",
"/SharedStrings/Plugins/Store/Statuses/Error": "Error installing {0}!",

"/SharedStrings/Plugins/Drop/Headers/Error/Validating": "Error validating {0}!",
"/SharedStrings/Plugins/Drop/Headers/Error/Installing": "Error installing {0}!",
"/SharedStrings/Plugins/Drop/Headers/Error/Exception": "Error installing the package!",
"/SharedStrings/Plugins/Drop/Headers/Validating": "Validating {0}...",
"/SharedStrings/Plugins/Drop/Headers/Installing": "Installing {0}...",
"/SharedStrings/Plugins/Drop/Headers/Installed": "Installed {0}!",
"/SharedStrings/Plugins/Drop/Statuses/Error/NotFound": "{0} does not contain a plugin class library file (plugin*.dll) and can't be installed. Please validate the package manually.",
"/SharedStrings/Plugins/Drop/Statuses/Error/NotFound/Plural": "{0} do not contain a plugin class library file (plugin*.dll) and can't be installed. Please validate the package manually.",
"/SharedStrings/Plugins/Drop/Statuses/Error/Invalid": "{0} is not a valid plugin package (has to be a .zip file) and can't be installed. Please validate the package manually.",
"/SharedStrings/Plugins/Drop/Statuses/Error/Exception": "Couldn't process the package due to an exception: {0}. Please install the package manually.",
"/SharedStrings/Plugins/Drop/Statuses/Installed": "Successfully parsed the plugin package! {0} will have been installed by the next time Amethyst opens!",
"/SharedStrings/Plugins/Drop/Resources/Files": "files",
"/SharedStrings/Plugins/Drop/Resources/Folder": "folder",
"/SharedStrings/Plugins/Drop/Resources/Package": "package",

"/PluginStore/Titles/Install": "Install {0} {1}",
"/PluginStore/Titles/Installing/Setup": "Enqueued {0} installation!",
"/PluginStore/Titles/Uninstalling/Notice": "Enqueued {0} removal!",
Expand Down
53 changes: 51 additions & 2 deletions Amethyst/Pages/Plugins.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,53 @@
</Grid.OpacityTransition>
</Grid>

<Grid Grid.Row="0" Opacity="0.0" x:Name="DropInstallerGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="8*" MinWidth="250" MaxWidth="500" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="1" Orientation="Vertical" VerticalAlignment="Center"
HorizontalAlignment="Center" Margin="0,-15,0,0">
<Grid HorizontalAlignment="Center">
<ProgressRing Opacity="0.0" IsIndeterminate="True"
x:Name="DropInstallerProgressRing" Value="100"
Margin="-8,-8,0,25" Height="120" Width="120">
<ProgressRing.OpacityTransition>
<ScalarTransition />
</ProgressRing.OpacityTransition>
</ProgressRing>
<FontIcon Opacity="0.0" x:Name="DropInstallerErrorIcon" FontSize="120"
Margin="0,0,0,25" Glyph="&#xE783;">
<FontIcon.OpacityTransition>
<ScalarTransition />
</FontIcon.OpacityTransition>
</FontIcon>
</Grid>

<TextBlock HorizontalAlignment="Center" TextWrapping="WrapWholeWords"
x:Name="DropInstallerHeaderTextBlock"
Style="{ThemeResource TitleTextBlockStyle}"
HorizontalTextAlignment="Center"
TextTrimming="CharacterEllipsis"
Text="{x:Bind util:Translator.Get.String('/SharedStrings/Plugins/Drop/Headers/Validating'), Mode=OneWay}" />

<TextBlock HorizontalAlignment="Center" TextWrapping="WrapWholeWords"
x:Name="DropInstallerMessageTextBlock"
FontSize="14" Opacity="0.0"
HorizontalTextAlignment="Center"
TextTrimming="CharacterEllipsis"
Text="{x:Bind util:Translator.Get.String('/SharedStrings/Plugins/Drop/Headers/Validating'), Mode=OneWay}">
<TextBlock.OpacityTransition>
<ScalarTransition />
</TextBlock.OpacityTransition>
</TextBlock>
</StackPanel>
<Grid.OpacityTransition>
<ScalarTransition />
</Grid.OpacityTransition>
</Grid>

<Grid Grid.Row="0" Opacity="0.0" x:Name="SearchResultsGrid">
<ScrollViewer Margin="0,20,0,20" Padding="0,-20,0,-20"
HorizontalAlignment="Stretch">
Expand Down Expand Up @@ -265,7 +312,8 @@
<ScalarTransition />
</InfoBar.OpacityTransition>
<InfoBar.ActionButton>
<Button HorizontalAlignment="Right" Margin="0,0,-8,0"
<Button HorizontalAlignment="Right"
Margin="0,0,-8,0"
Content="{x:Bind util:Translator.Get.String('/GeneralPage/Buttons/Cancel'), Mode=OneWay}"
Click="{x:Bind CancelPluginUninstall, Mode=OneWay}" />
</InfoBar.ActionButton>
Expand All @@ -283,7 +331,8 @@
<ScalarTransition />
</InfoBar.OpacityTransition>
<InfoBar.ActionButton>
<Button HorizontalAlignment="Right" Margin="0,0,-8,0"
<Button HorizontalAlignment="Right"
Margin="0,0,-8,0"
Content="{x:Bind util:Translator.Get.String('/GeneralPage/Buttons/Cancel'), Mode=OneWay}"
Click="{x:Bind CancelPluginInstall, Mode=OneWay}" />
</InfoBar.ActionButton>
Expand Down
Loading

0 comments on commit ace4ed8

Please sign in to comment.