mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +02:00
Add upgrade dialog
This commit is contained in:
@@ -238,9 +238,30 @@ namespace Wox
|
||||
|
||||
InitProgressbarAnimation();
|
||||
WindowIntelopHelper.DisableControlBox(this);
|
||||
CheckUpdate();
|
||||
}
|
||||
|
||||
private void CheckUpdate()
|
||||
{
|
||||
UpdaterManager.Instance.PrepareUpdateReady+=OnPrepareUpdateReady;
|
||||
UpdaterManager.Instance.UpdateError += OnUpdateError;
|
||||
UpdaterManager.Instance.CheckUpdate();
|
||||
}
|
||||
|
||||
void OnUpdateError(object sender, EventArgs e)
|
||||
{
|
||||
string updateError = InternationalizationManager.Instance.GetTranslation("update_wox_update_error");
|
||||
MessageBox.Show(updateError);
|
||||
}
|
||||
|
||||
private void OnPrepareUpdateReady(object sender, EventArgs e)
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
new WoxUpdate().ShowDialog();
|
||||
}));
|
||||
}
|
||||
|
||||
public void SetHotkey(string hotkeyStr, EventHandler<HotkeyEventArgs> action)
|
||||
{
|
||||
var hotkey = new HotkeyModel(hotkeyStr);
|
||||
|
||||
Reference in New Issue
Block a user