Add upgrade dialog

This commit is contained in:
qianlifeng
2015-02-01 22:46:56 +08:00
parent 691cf1ce72
commit 5ef72b81ae
14 changed files with 507 additions and 266 deletions

View File

@@ -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);