diff options
author | Robert Pösel <robyer@seznam.cz> | 2014-07-20 13:44:24 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2014-07-20 13:44:24 +0000 |
commit | 5161dd2a33e0e2147a40865a42461837aee5d7ed (patch) | |
tree | 639179332e9ca9201f6fb2fc82a8d2699591c41e /plugins/PluginUpdater/src/DlgUpdate.cpp | |
parent | 2d3b85b61fbd644508fac957e194a1618830191b (diff) |
Plugin Updater: Fixed various issues
- Checking after resume from hibernation finally works
- Checking after having opened update dialog for too long works
- After closing update dialog without updating and checking for updates again now correctly checks for new updates (and not show old unusable window)
git-svn-id: http://svn.miranda-ng.org/main/trunk@9888 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/PluginUpdater/src/DlgUpdate.cpp')
-rw-r--r-- | plugins/PluginUpdater/src/DlgUpdate.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp index c899444eea..c7f02157ce 100644 --- a/plugins/PluginUpdater/src/DlgUpdate.cpp +++ b/plugins/PluginUpdater/src/DlgUpdate.cpp @@ -138,6 +138,7 @@ static void ApplyUpdates(void *param) // 5) Prepare Restart
int rc = MessageBox(hDlg, TranslateT("Update complete. Press Yes to restart Miranda now or No to postpone a restart until the exit."), TranslateT("Plugin Updater"), MB_YESNO | MB_ICONQUESTION);
EndDialog(hDlg, 0);
+ PostMessage(hDlg, WM_DESTROY, 0, 0); // why do we have to call this manually?
if (rc == IDYES)
CallFunctionAsync(RestartMe, 0);
}
@@ -319,6 +320,10 @@ static INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM opts.bSilent = true;
delete (OBJLIST<FILEINFO> *)GetWindowLongPtr(hDlg, GWLP_USERDATA);
SetWindowLongPtr(hDlg, GWLP_USERDATA, 0);
+ #if MIRANDA_VER >= 0x0A00
+ db_set_dw(NULL, MODNAME, "LastUpdate", time(NULL));
+ #endif
+ mir_forkthread(InitTimer, (void*)0);
break;
}
@@ -713,13 +718,13 @@ static void CheckUpdates(void *) }
else opts.bSilent = true;
- InitTimer(success ? 0 : 2);
+ mir_forkthread(InitTimer, (void*)(success ? 0 : 2));
hashes.destroy();
hCheckThread = NULL;
}
-void DoCheck(int iFlag)
+void DoCheck()
{
if (hCheckThread)
ShowPopup(0, LPGENT("Plugin Updater"), LPGENT("Update checking already started!"), 2, 0);
@@ -727,8 +732,7 @@ void DoCheck(int iFlag) ShowWindow(hwndDialog, SW_SHOW);
SetForegroundWindow(hwndDialog);
SetFocus(hwndDialog);
- }
- else if (iFlag) {
+ } else {
#if MIRANDA_VER >= 0x0A00
db_set_dw(NULL, MODNAME, "LastUpdate", time(NULL));
#endif
@@ -745,7 +749,7 @@ void UninitCheck() INT_PTR MenuCommand(WPARAM,LPARAM)
{
opts.bSilent = false;
- DoCheck(true);
+ DoCheck();
return 0;
}
|