Skip to content

Commit

Permalink
(GH-769) Added icon to the main UI to reload packages.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkevenaar committed Apr 29, 2020
1 parent 1cbbb50 commit 46de272
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,17 @@ public bool CanExportAll()
return _exportAll;
}

public bool CanCheckForUpdate()
{
return HasLoaded && !IsLoading;
}

// TODO: Change code!
public async void CheckForUpdate()
{
await LoadPackages();
}

public bool CanRefreshPackages()
{
return HasLoaded && !IsLoading;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,15 @@
IsEnabled="{Binding IsShowOnlyPackagesWithUpdateEnabled}"/>
</WrapPanel>
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="10,6">
<Button Command="{commands:DataContextCommandAdapter CheckForUpdate, CanCheckForUpdate}"
ToolTipService.ShowOnDisabled="True"
VerticalAlignment="Center"
Style="{DynamicResource IconFlatButtonStyle}" ToolTip="{x:Static properties:Resources.LocalSourceView_ButtonCheckUpdatePkgs}" Margin="0,0,2,0">
<StackPanel Orientation="Horizontal">
<iconPacks:PackIconFontAwesome Kind="SyncSolid" />
<iconPacks:PackIconFontAwesome Kind="BoxSolid" Margin="2 0 0 0" />
</StackPanel>
</Button>
<Button Command="{commands:DataContextCommandAdapter RefreshPackages, CanRefreshPackages}"
ToolTipService.ShowOnDisabled="True"
VerticalAlignment="Center"
Expand Down
9 changes: 9 additions & 0 deletions Source/ChocolateyGui.Common/Properties/Resources.Designer.cs

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

3 changes: 3 additions & 0 deletions Source/ChocolateyGui.Common/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ Error: {1}{2}</value>
<data name="LocalSourceView_ButtonRefreshPkgs" xml:space="preserve">
<value>Refresh Packages</value>
</data>
<data name="LocalSourceView_ButtonCheckUpdatePkgs" xml:space="preserve">
<value>Check for outdated packages</value>
</data>
<data name="LocalSourceView_ButtonUpdateAll" xml:space="preserve">
<value>Update All</value>
</data>
Expand Down

0 comments on commit 46de272

Please sign in to comment.