From 4207fda2535b6c1c1aa8e242da2de04ab40ba76b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 6 Aug 2012 12:08:39 +0000 Subject: - added "Update Icons" option; - removed some garbage from options dialog; - modeless Apply Updates dialog git-svn-id: http://svn.miranda-ng.org/main/trunk@1377 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/PluginUpdater/src/Scanner.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'plugins/PluginUpdater/src/Scanner.cpp') diff --git a/plugins/PluginUpdater/src/Scanner.cpp b/plugins/PluginUpdater/src/Scanner.cpp index 9edd0b69d5..929999c80b 100644 --- a/plugins/PluginUpdater/src/Scanner.cpp +++ b/plugins/PluginUpdater/src/Scanner.cpp @@ -103,7 +103,7 @@ static void ScanFolder(const TCHAR* tszFolder, const TCHAR* tszBaseUrl, hashMap& static void __stdcall LaunchDialog(void* param) { - DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_UPDATE), GetDesktopWindow(), DlgUpdate, (LPARAM)param); + CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_UPDATE), GetDesktopWindow(), DlgUpdate, (LPARAM)param); } static void CheckUpdates(void *) @@ -115,9 +115,6 @@ static void CheckUpdates(void *) if (!Exists(tszRoot)) CreateDirectoryTreeT(tszRoot); - //Files.clear(); - Reminder = DBGetContactSettingByte(NULL, MODNAME, "Reminder", DEFAULT_REMINDER); - // Load files info if (DBGetContactSettingTString(NULL, MODNAME, "UpdateURL", &dbVar)) { // URL is not set DBWriteContactSettingTString(NULL, MODNAME, "UpdateURL", _T(DEFAULT_UPDATE_URL)); @@ -127,17 +124,16 @@ static void CheckUpdates(void *) DBFreeVariant(&dbVar); // Download version info - FILEURL *pFileUrl = (FILEURL *)mir_alloc(sizeof(*pFileUrl)); - mir_sntprintf(pFileUrl->tszDownloadURL, SIZEOF(pFileUrl->tszDownloadURL), _T("%s/hashes.txt"), tszBaseUrl); + FILEURL pFileUrl; + mir_sntprintf(pFileUrl.tszDownloadURL, SIZEOF(pFileUrl.tszDownloadURL), _T("%s/hashes.txt"), tszBaseUrl); mir_sntprintf(tszBuff, SIZEOF(tszBuff), _T("%s\\tmp.ini"), tszRoot); - lstrcpyn(pFileUrl->tszDiskPath, tszBuff, SIZEOF(pFileUrl->tszDiskPath)); + lstrcpyn(pFileUrl.tszDiskPath, tszBuff, SIZEOF(pFileUrl.tszDiskPath)); lstrcpyn(tszTmpIni, tszBuff, SIZEOF(tszTmpIni)); - PopupDataText temp; - temp.Title = TranslateT("Plugin Updater"); - temp.Text = TranslateT("Downloading version info..."); - DlgDownloadProc(pFileUrl, temp); - mir_free(pFileUrl); - if (!DlgDld) { + + ShowPopup(NULL, TranslateT("Plugin Updater"), TranslateT("Downloading version info..."), 3, 0); + + if (!DownloadFile(pFileUrl.tszDownloadURL, pFileUrl.tszDiskPath)) { + ShowPopup(0, LPGENT("Plugin Updater"), LPGENT("An error occured while downloading the update."), 1, 0); CheckThread = NULL; return; } @@ -169,7 +165,7 @@ static void CheckUpdates(void *) // Show dialog if (UpdateFiles->size() == 0) { - if ( !Silent) + if ( !opts.bSilent) ShowPopup(0, LPGENT("Plugin Updater"), LPGENT("No updates found."), 2, 0); } else CallFunctionAsync(LaunchDialog, UpdateFiles); -- cgit v1.2.3