Skip to content

Commit

Permalink
Periodically check for updates.
Browse files Browse the repository at this point in the history
Reorder settings in the settings category view.
  • Loading branch information
Alexandru Macocian committed Apr 14, 2021
1 parent c169ca1 commit 98bd1b2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Daybreak/Daybreak.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
<LangVersion>preview</LangVersion>
<ApplicationIcon>Daybreak.ico</ApplicationIcon>
<Version>0.6.0</Version>
<Version>0.6.1</Version>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>

Expand Down
12 changes: 12 additions & 0 deletions Daybreak/Launch/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,21 @@ private async void CheckForUpdates()
else
{
this.viewManager.ShowView<MainView>();
this.PeriodicallyCheckForUpdates();
}
}

private void PeriodicallyCheckForUpdates()
{
TaskExtensions.RunPeriodicAsync(async () =>
{
if (await this.applicationUpdater.UpdateAvailable())
{
this.Dispatcher.Invoke(() => this.viewManager.ShowView<AskUpdateView>());
}
}, TimeSpan.FromMinutes(15), TimeSpan.FromMinutes(15), CancellationToken.None);
}

private static Color GetAverageColor(BitmapSource bitmap)
{
var format = bitmap.Format;
Expand Down
18 changes: 9 additions & 9 deletions Daybreak/Views/SettingsCategoryView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,30 @@
Clicked="BackButton_Clicked" VerticalAlignment="Top" HorizontalAlignment="Left"></controls:BackButton>
<WrapPanel Orientation="Vertical" VerticalAlignment="Bottom">
<WrapPanel Orientation="Horizontal">
<controls:TileButton Grid.Row="5" Title="Account settings" Foreground="White" BorderBrush="White" BorderThickness="2"
<controls:TileButton Title="Account settings" Foreground="White" BorderBrush="White" BorderThickness="2"
HighlightColor="White" Clicked="AccountButton_Clicked" Width="150" Height="150">
<controls:TileButton.InnerContent>
<controls:AvatarGlyph></controls:AvatarGlyph>
</controls:TileButton.InnerContent>
</controls:TileButton>
<controls:TileButton Grid.Row="5" Grid.Column="1" Title="Launcher settings" Foreground="White" BorderBrush="White" BorderThickness="2"
<controls:TileButton Title="Guildwars settings" Foreground="White" BorderBrush="White" BorderThickness="2"
HighlightColor="White" Clicked="FileButton_Clicked" Height="150" Width="150">
<controls:TileButton.InnerContent>
<controls:FileGlyph></controls:FileGlyph>
</controls:TileButton.InnerContent>
</controls:TileButton>
<controls:TileButton Title="Launcher settings" Foreground="White" BorderBrush="White" BorderThickness="2"
HighlightColor="White" Clicked="LauncherButton_Clicked" Width="150" Height="150">
<controls:TileButton.InnerContent>
<controls:GoldenArrowGlyph></controls:GoldenArrowGlyph>
</controls:TileButton.InnerContent>
</controls:TileButton>
<controls:TileButton Grid.Row="5" Grid.Column="2" Title="Experimental settings" Foreground="White" BorderBrush="White" BorderThickness="2"
<controls:TileButton Title="Experimental settings" Foreground="White" BorderBrush="White" BorderThickness="2"
HighlightColor="White" Clicked="ExperimentalButton_Clicked" Height="150" Width="150">
<controls:TileButton.InnerContent>
<controls:ExperimentGlyph></controls:ExperimentGlyph>
</controls:TileButton.InnerContent>
</controls:TileButton>
<controls:TileButton Grid.Row="5" Grid.Column="2" Title="Guildwars settings" Foreground="White" BorderBrush="White" BorderThickness="2"
HighlightColor="White" Clicked="FileButton_Clicked" Height="150" Width="150">
<controls:TileButton.InnerContent>
<controls:FileGlyph></controls:FileGlyph>
</controls:TileButton.InnerContent>
</controls:TileButton>
</WrapPanel>
</WrapPanel>
</Grid>
Expand Down

0 comments on commit 98bd1b2

Please sign in to comment.