summaryrefslogtreecommitdiff
path: root/plugins/PluginUpdater/src/DlgListNew.cpp
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2016-04-16 12:44:19 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2016-04-16 12:44:19 +0000
commitd368658d9c25278e62023be7ebe573d04309be43 (patch)
tree8911a7e4c7f029243efc2d2967bcd8a6cef284cf /plugins/PluginUpdater/src/DlgListNew.cpp
parent403ee5e18b2393a430ff5e9d3f0cb5feccdb341e (diff)
PluginUpdater:
- more fixes for the options dialog - Added feature to install a list of predefined item: In module PluginUpdaterNewFiles, create a BYTE entry for each item you want to install (Name as in the options dialog, BYTE value 1) When you open "Available components list", those entries will be preselected. git-svn-id: http://svn.miranda-ng.org/main/trunk@16675 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/PluginUpdater/src/DlgListNew.cpp')
-rw-r--r--plugins/PluginUpdater/src/DlgListNew.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/plugins/PluginUpdater/src/DlgListNew.cpp b/plugins/PluginUpdater/src/DlgListNew.cpp
index 860400c560..cab362e895 100644
--- a/plugins/PluginUpdater/src/DlgListNew.cpp
+++ b/plugins/PluginUpdater/src/DlgListNew.cpp
@@ -72,6 +72,7 @@ static void ApplyDownloads(void *param)
ListView_SetItemText(hwndList, i, 1, TranslateT("Succeeded."));
if (unzip(todo[i].File.tszDiskPath, tszMirandaPath, tszFileBack,false))
SafeDeleteFile(todo[i].File.tszDiskPath); // remove .zip after successful update
+ db_unset(NULL, DB_MODULE_NEW_FILES, StrToLower(_T2A(todo[i].tszOldName)));
}
else
ListView_SetItemText(hwndList, i, 1, TranslateT("Failed!"));
@@ -220,6 +221,7 @@ INT_PTR CALLBACK DlgList(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
ListView_DeleteAllItems(hwndList);
///
+ bool enableOk = false;
OBJLIST<FILEINFO> &todo = *(OBJLIST<FILEINFO> *)lParam;
for (int i = 0; i < todo.getCount(); ++i) {
LVITEM lvi = {0};
@@ -235,7 +237,15 @@ INT_PTR CALLBACK DlgList(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
lvi.iImage = ((groupId ==1) ? 0 : -1);
lvi.pszText = todo[i].tszOldName;
ListView_InsertItem(hwndList, &lvi);
+
+ if (todo[i].bEnabled)
+ {
+ enableOk = true;
+ ListView_SetCheckState(hwndList, lvi.iItem, 1);
+ }
}
+ if (enableOk)
+ EnableWindow(GetDlgItem(hDlg, IDOK), TRUE);
}
// do this after filling list - enables 'ITEMCHANGED' below
@@ -334,9 +344,6 @@ static void __stdcall LaunchListDialog(void *param)
hwndDialog = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_LIST), GetDesktopWindow(), DlgList, (LPARAM)param);
}
-/////////////////////////////////////////////////////////////////////////////////////////
-// building file list in the separate thread
-
static FILEINFO* ServerEntryToFileInfo(const ServListEntry &hash, const TCHAR* tszBaseUrl, const TCHAR* tszPath)
{
FILEINFO *FileInfo = new FILEINFO;
@@ -360,11 +367,15 @@ static FILEINFO* ServerEntryToFileInfo(const ServListEntry &hash, const TCHAR* t
for (tp = _tcschr(FileInfo->File.tszDownloadURL, '\\'); tp != 0; tp = _tcschr(tp, '\\'))
*tp++ = '/';
FileInfo->File.CRCsum = hash.m_crc;
- // Deselect all plugins by default
- FileInfo->bEnabled = false;
+ // Load list of checked Plugins from database
+ Netlib_LogfT(hNetlibUser, _T("File %s found"), FileInfo->tszOldName);
+ FileInfo->bEnabled = db_get_b(NULL, DB_MODULE_NEW_FILES, _T2A(FileInfo->tszOldName)) != 0;
return FileInfo;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+// building file list in the separate thread
+//
static void GetList(void *)
{
TCHAR tszTempPath[MAX_PATH];