mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 12:18:50 +02:00
Add upgrade dialog
This commit is contained in:
34
Wox/WoxUpdate.xaml.cs
Normal file
34
Wox/WoxUpdate.xaml.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.Windows;
|
||||
using MarkdownSharp;
|
||||
using Wox.Core.i18n;
|
||||
using Wox.Core.Updater;
|
||||
|
||||
namespace Wox
|
||||
{
|
||||
public partial class WoxUpdate : Window
|
||||
{
|
||||
public WoxUpdate()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
string newVersionAvailable = string.Format(
|
||||
InternationalizationManager.Instance.GetTranslation("update_wox_update_new_version_available"),
|
||||
UpdaterManager.Instance.NewRelease);
|
||||
tbNewVersionAvailable.Text = newVersionAvailable;
|
||||
Markdown markdown = new Markdown();
|
||||
wbDetails.NavigateToString(markdown.Transform(UpdaterManager.Instance.NewRelease.description));
|
||||
lbUpdatedFiles.ItemsSource = UpdaterManager.Instance.GetAvailableUpdateFiles();
|
||||
}
|
||||
|
||||
private void btnUpdate_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
UpdaterManager.Instance.ApplyUpdates();
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
UpdaterManager.Instance.CleanUp();
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user