summaryrefslogtreecommitdiff
path: root/plugins/DbEditorPP
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-10-15 11:45:00 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-10-15 11:45:00 +0000
commit57d7a593cb444941ade06bde7911aaa77d431cc4 (patch)
treeee2d415eeaa421c99854173b3755ff7e6ff1a535 /plugins/DbEditorPP
parent7e54472de6322d6929874dc8acb66229590d250f (diff)
code cleanup
registermodule service removed git-svn-id: http://svn.miranda-ng.org/main/trunk@6497 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/DbEditorPP')
-rw-r--r--plugins/DbEditorPP/dbeditorpp_10.vcxproj1
-rw-r--r--plugins/DbEditorPP/dbeditorpp_10.vcxproj.filters3
-rw-r--r--plugins/DbEditorPP/dbeditorpp_11.vcxproj1
-rw-r--r--plugins/DbEditorPP/dbeditorpp_11.vcxproj.filters3
-rw-r--r--plugins/DbEditorPP/res/Red.icobin1150 -> 0 bytes
-rw-r--r--plugins/DbEditorPP/res/Red_open.icobin1150 -> 0 bytes
-rw-r--r--plugins/DbEditorPP/res/resource.rc24
-rw-r--r--plugins/DbEditorPP/src/headers.h11
-rw-r--r--plugins/DbEditorPP/src/icons.cpp2
-rw-r--r--plugins/DbEditorPP/src/knownmodules.cpp84
-rw-r--r--plugins/DbEditorPP/src/main.cpp47
-rw-r--r--plugins/DbEditorPP/src/main_window.cpp8
-rw-r--r--plugins/DbEditorPP/src/modsettingenum.h1
-rw-r--r--plugins/DbEditorPP/src/moduletree.cpp114
-rw-r--r--plugins/DbEditorPP/src/options.cpp11
-rw-r--r--plugins/DbEditorPP/src/resource.h4
16 files changed, 34 insertions, 280 deletions
diff --git a/plugins/DbEditorPP/dbeditorpp_10.vcxproj b/plugins/DbEditorPP/dbeditorpp_10.vcxproj
index 6f5cecc9d8..5531534e76 100644
--- a/plugins/DbEditorPP/dbeditorpp_10.vcxproj
+++ b/plugins/DbEditorPP/dbeditorpp_10.vcxproj
@@ -183,7 +183,6 @@
<ItemGroup>
<ClCompile Include="src\exportimport.cpp" />
<ClCompile Include="src\icons.cpp" />
- <ClCompile Include="src\knownmodules.cpp" />
<ClCompile Include="src\stdafx.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
diff --git a/plugins/DbEditorPP/dbeditorpp_10.vcxproj.filters b/plugins/DbEditorPP/dbeditorpp_10.vcxproj.filters
index a23baf1b16..8b6ce891ed 100644
--- a/plugins/DbEditorPP/dbeditorpp_10.vcxproj.filters
+++ b/plugins/DbEditorPP/dbeditorpp_10.vcxproj.filters
@@ -27,9 +27,6 @@
<ClCompile Include="src\icons.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="src\knownmodules.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="src\main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
diff --git a/plugins/DbEditorPP/dbeditorpp_11.vcxproj b/plugins/DbEditorPP/dbeditorpp_11.vcxproj
index 98c896d7d0..295c1f8e8a 100644
--- a/plugins/DbEditorPP/dbeditorpp_11.vcxproj
+++ b/plugins/DbEditorPP/dbeditorpp_11.vcxproj
@@ -186,7 +186,6 @@
<ItemGroup>
<ClCompile Include="src\exportimport.cpp" />
<ClCompile Include="src\icons.cpp" />
- <ClCompile Include="src\knownmodules.cpp" />
<ClCompile Include="src\stdafx.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
diff --git a/plugins/DbEditorPP/dbeditorpp_11.vcxproj.filters b/plugins/DbEditorPP/dbeditorpp_11.vcxproj.filters
index a23baf1b16..8b6ce891ed 100644
--- a/plugins/DbEditorPP/dbeditorpp_11.vcxproj.filters
+++ b/plugins/DbEditorPP/dbeditorpp_11.vcxproj.filters
@@ -27,9 +27,6 @@
<ClCompile Include="src\icons.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="src\knownmodules.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="src\main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
diff --git a/plugins/DbEditorPP/res/Red.ico b/plugins/DbEditorPP/res/Red.ico
deleted file mode 100644
index 3e313e5413..0000000000
--- a/plugins/DbEditorPP/res/Red.ico
+++ /dev/null
Binary files differ
diff --git a/plugins/DbEditorPP/res/Red_open.ico b/plugins/DbEditorPP/res/Red_open.ico
deleted file mode 100644
index d9c7b92692..0000000000
--- a/plugins/DbEditorPP/res/Red_open.ico
+++ /dev/null
Binary files differ
diff --git a/plugins/DbEditorPP/res/resource.rc b/plugins/DbEditorPP/res/resource.rc
index 5c766e606b..66a873c4bf 100644
--- a/plugins/DbEditorPP/res/resource.rc
+++ b/plugins/DbEditorPP/res/resource.rc
@@ -62,20 +62,14 @@ BEGIN
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,13,283,10
CONTROL "Automatically expand ""settings"" when Database Editor ++ starts",IDC_EXPANDSETTINGS,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,26,283,10
- CONTROL "Use known modules list",IDC_USEKNOWNMODS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,39,253,10
- CONTROL "Warn when deleting modules",IDC_WARNONDEL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,52,280,10
- CONTROL """Open user tree in DBE++"" menu item",IDC_MENU,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,65,280,10
+ CONTROL "Warn when deleting modules",IDC_WARNONDEL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,39,280,10
+ CONTROL """Open user tree in DBE++"" menu item",IDC_MENU,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,52,280,10
CONTROL "Use popups when watched settings change values",IDC_POPUPS,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,78,275,10
- EDITTEXT IDC_POPUPTIMEOUT,144,89,20,12,ES_NUMBER
- CONTROL "",IDC_COLOUR,"ColourPicker",WS_TABSTOP,257,89,26,12
- EDITTEXT IDC_MODULES,12,140,288,46,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL
- GROUPBOX "Modules to ALWAYS mark as known (e.g core modules)",IDC_STATIC,7,105,300,96
- LTEXT "Put a space or comma between each module name",IDC_STATIC,12,116,286,8
- LTEXT "Changes to this list will take effect next time miranda starts",IDC_STATIC,12,189,284,8
- RTEXT "Popup timeout (0 for infinite)",IDC_STATIC,35,91,103,8
- RTEXT "Background color",IDC_STATIC,177,91,77,8
- LTEXT "If the module name has a space in it, put a \\ before the space. eg ""aaa\\ bbb""",IDC_STATIC,12,127,286,8
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,65,275,10
+ EDITTEXT IDC_POPUPTIMEOUT,144,76,20,12,ES_NUMBER
+ CONTROL "",IDC_COLOUR,"ColourPicker",WS_TABSTOP,257,76,26,12
+ RTEXT "Popup timeout (0 for infinite)",IDC_STATIC,35,78,103,8
+ RTEXT "Background color",IDC_STATIC,177,78,77,8
END
IDD_ADD_MODULE DIALOGEX 0, 0, 186, 67
@@ -253,8 +247,6 @@ END
// remains consistent on all systems.
ICO_KNOWN ICON "Yellow.ico"
ICO_KNOWNOPEN ICON "Yellow_open.ico"
-ICO_UNKNOWNOPEN ICON "Red_open.ico"
-ICO_UNKNOWN ICON "Red.ico"
ICO_SETTINGS ICON "Icon_4.ico"
ICO_ONLINE ICON "online2.ico"
ICO_REGEDIT ICON "Icon_1.ico"
@@ -393,7 +385,6 @@ BEGIN
MENUITEM "Copy To Contact", MENU_COPY_MOD
MENUITEM SEPARATOR
MENUITEM "Export Module", MENU_EXPORTMODULE
- MENUITEM "Add To Known Modules", MENU_ADDKNOWN
MENUITEM SEPARATOR
MENUITEM "&Watch", MENU_WATCH_ITEM
MENUITEM "&Delete", MENU_DELETE_MOD
@@ -438,7 +429,6 @@ BEGIN
MENUITEM SEPARATOR
MENUITEM "Export Module", MENU_EXPORTMODULE
MENUITEM "Export Module from all contacts", MENU_EXPORTDB
- MENUITEM "Add To Known Modules", MENU_ADDKNOWN
MENUITEM SEPARATOR
MENUITEM "&Watch", MENU_WATCH_ITEM
MENUITEM "&Delete", MENU_DELETE_MOD
diff --git a/plugins/DbEditorPP/src/headers.h b/plugins/DbEditorPP/src/headers.h
index 6d34b06761..15735b3cf0 100644
--- a/plugins/DbEditorPP/src/headers.h
+++ b/plugins/DbEditorPP/src/headers.h
@@ -46,7 +46,7 @@
#include "Version.h"
#include "modsettingenum.h"
-#define DEF_ICON 7
+#define DEF_ICON 5
#define crlf_string "\r\n\0"
/////// icons support
@@ -103,7 +103,6 @@ extern HGENMENU hUserMenu;
#define CONTACT 1
#define MODULE 0x2
#define KNOWN_MODULE 2
-#define UNKNOWN_MODULE 3
#define STUB 4
#define EMPTY 8
@@ -228,14 +227,6 @@ void ImportSettingsFromFileMenuItem(HANDLE hContact, char* FilePath);
// find window.c
INT_PTR CALLBACK FindWindowDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
-// knownmodules.c
-extern BYTE UseKnownModList;
-INT_PTR RegisterModule(WPARAM wParam, LPARAM lParam);
-INT_PTR RegisterSingleModule(WPARAM wParam, LPARAM lParam);
-void FreeKnownModuleList();
-int IsModuleKnown(char* moduleName);
-void doOldKnownModulesList();
-
// copymodule.c
void copyModuleMenuItem(char* module, HANDLE hContact);
void copyModule(char* module, HANDLE hContactFrom, HANDLE hContactTo);
diff --git a/plugins/DbEditorPP/src/icons.cpp b/plugins/DbEditorPP/src/icons.cpp
index 88de410477..7aab4906e7 100644
--- a/plugins/DbEditorPP/src/icons.cpp
+++ b/plugins/DbEditorPP/src/icons.cpp
@@ -6,8 +6,6 @@ static IconItem iconList[] =
{
{ LPGENT("Closed Known Module"), "DBE++_1", ICO_KNOWN },
{ LPGENT("Open Known Module"), "DBE++_2", ICO_KNOWNOPEN },
- { LPGENT("Closed Unknown Module"), "DBE++_3", ICO_UNKNOWN },
- { LPGENT("Open Unknown Module"), "DBE++_4", ICO_UNKNOWNOPEN },
{ LPGENT("Settings"), "DBE++_5", ICO_SETTINGS },
{ LPGENT("Contacts Group"), "DBE++_6", ICO_CONTACTS },
{ LPGENT("Unknown Contact"), "DBE++_7", ICO_OFFLINE },
diff --git a/plugins/DbEditorPP/src/knownmodules.cpp b/plugins/DbEditorPP/src/knownmodules.cpp
deleted file mode 100644
index 4e44aa740c..0000000000
--- a/plugins/DbEditorPP/src/knownmodules.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-#include "headers.h"
-
-BYTE UseKnownModList;
-
-#define MAXMODS 1024
-char *KnownModules[MAXMODS];
-int KnownModulesCount = 0;
-
-INT_PTR RegisterModule(WPARAM wParam, LPARAM lParam)
-{
- char **mods = (char**)wParam;
- int count = lParam;
- int i;
- for (i=0;i<count && KnownModulesCount<MAXMODS;i++)
- KnownModules[KnownModulesCount++] = mir_tstrdup(mods[i]);
- return 0;
-}
-
-INT_PTR RegisterSingleModule(WPARAM wParam, LPARAM lParam)
-{
- char *mods = (char*)wParam;
- if (KnownModulesCount<MAXMODS)
- KnownModules[KnownModulesCount++] = mir_tstrdup(mods);
- return 0;
-}
-
-int IsModuleKnown(char *module)
-{
- int i;
-
- if (!UseKnownModList) return 1; // not using known list so all are "known"
-
- for(i=0;i<KnownModulesCount;i++)
- {
- if (KnownModules[i] && !mir_strcmp(module,KnownModules[i]))
- return 1;
- }
-
- return 0;
-}
-
-void FreeKnownModuleList()
-{
- int i;
- for(i=0;i<KnownModulesCount;i++)
- {
- mir_free(KnownModules[i]);
- }
-}
-
-void doOldKnownModulesList()
-{
- ModuleSettingLL msll;
- struct ModSetLinkLinkItem *setting;
- DBVARIANT dbv;
- char *var, *temp;
-
- if (!EnumSettings(NULL,"KnownModules", &msll)) return;
-
- setting = msll.first;
- while(setting)
- {
- if (!db_get(NULL,"KnownModules",setting->name,&dbv) && dbv.type == DBVT_ASCIIZ)
- {
- temp = (char*)mir_alloc((strlen(dbv.pszVal)+5)*sizeof(char));
- if (!temp) break;
- strcpy(temp,dbv.pszVal);
- strcat(temp,",\0");
- var = strtok(temp,", ");
- while (var)
- {
- if (KnownModulesCount<MAXMODS)
- KnownModules[KnownModulesCount++] = mir_tstrdup(var);
- var = strtok(NULL,", ");
- }
- mir_free(temp);
- }
- db_free(&dbv);
- setting = (struct ModSetLinkLinkItem *)setting->next;
- }
- FreeModuleSettingLL(&msll);
-
- UseKnownModList = db_get_b(NULL,modname,"UseKnownModList",0);
-}
diff --git a/plugins/DbEditorPP/src/main.cpp b/plugins/DbEditorPP/src/main.cpp
index b45cc87f3d..7461e12bdd 100644
--- a/plugins/DbEditorPP/src/main.cpp
+++ b/plugins/DbEditorPP/src/main.cpp
@@ -11,7 +11,7 @@ BYTE nameOrder[NAMEORDERCOUNT];
HGENMENU hUserMenu;
WatchListArrayStruct WatchListArray;
HANDLE hRestore;
-HANDLE sMenuCommand, sRegisterModule, sRegisterSingleModule, sImport, sServicemodeLaunch;
+HANDLE sMenuCommand, sImport, sServicemodeLaunch;
HANDLE hModulesLoadedHook = NULL, hSettingsChangedHook=NULL, hOptInitHook=NULL, hPreShutdownHook=NULL;
//========================
@@ -181,52 +181,20 @@ int ModulesLoaded(WPARAM wParam,LPARAM lParam)
hkd.DefHotKey = HOTKEYCODE(HOTKEYF_SHIFT|HOTKEYF_EXT, 'D');
Hotkey_Register(&hkd);
- DBVARIANT dbv;
- char *coreMods = "";
- char *mods;
- char mod[64] = "";
- TCHAR szModuleFileName[MAX_PATH];
- int i=0, len;
- if (!db_get(NULL,modname,"CoreModules",&dbv) && dbv.type == DBVT_ASCIIZ)
- mods = dbv.pszVal;
- else {
- db_set_s(NULL,modname,"CoreModules",coreMods);
- mods = coreMods;
- }
-
- len = (int)strlen(mods);
- while (i < len) {
- if (mods[i] == '\\' && mods[i+1] == ' ') {
- strcat(mod," ");
- i++;
- }
- else if (mods[i] == ' ' || mods[i] == ',' || mods[i] == '\r' || mods[i] == '\n'|| mods[i] == '\0') {
- if (mod[0])
- CallService("DBEditorpp/RegisterSingleModule",(WPARAM)mod,0);
- mod[0] = '\0';
- }
- else strncat(mod,&mods[i],1);
- i++;
- }
-
- if (mod[0])
- CallService("DBEditorpp/RegisterSingleModule",(WPARAM)mod,0);
-
- doOldKnownModulesList(); // add the old plugins which havnt been changed over yet..
-
// icons
+ TCHAR szModuleFileName[MAX_PATH];
if (GetModuleFileName(hInst, szModuleFileName, MAX_PATH))
addIcons(szModuleFileName);
- db_free(&dbv);
UnhookEvent(hModulesLoadedHook);
usePopups = db_get_b(NULL,modname,"UsePopUps",0);
// Load the name order
- for(i=0; i < NAMEORDERCOUNT; i++)
+ for(int i=0; i < NAMEORDERCOUNT; i++)
nameOrder[i] = i;
+ DBVARIANT dbv;
if (!db_get(NULL,"Contact","NameOrder",&dbv)) {
CopyMemory(nameOrder,dbv.pbVal,dbv.cpbVal);
db_free(&dbv);
@@ -252,8 +220,6 @@ int PreShutdown(WPARAM wParam,LPARAM lParam)
DestroyServiceFunction(sServicemodeLaunch);
DestroyServiceFunction(sMenuCommand);
- DestroyServiceFunction(sRegisterModule);
- DestroyServiceFunction(sRegisterSingleModule);
DestroyServiceFunction(sImport);
return 0;
}
@@ -283,14 +249,10 @@ extern "C" __declspec(dllexport) int Load(void)
hPreShutdownHook = HookEvent(ME_SYSTEM_PRESHUTDOWN, PreShutdown);
hModulesLoadedHook = HookEvent(ME_SYSTEM_MODULESLOADED,ModulesLoaded);
sMenuCommand = CreateServiceFunction("DBEditorpp/MenuCommand", DBEditorppMenuCommand);
- sRegisterModule = CreateServiceFunction("DBEditorpp/RegisterModule", RegisterModule);
- sRegisterSingleModule = CreateServiceFunction("DBEditorpp/RegisterSingleModule", RegisterSingleModule);
sImport = CreateServiceFunction("DBEditorpp/Import", ImportFromFile);
sServicemodeLaunch = CreateServiceFunction(MS_SERVICEMODE_LAUNCH, ServiceMode);
- CallService("DBEditorpp/RegisterSingleModule",(WPARAM)modname,0);
-
// Ensure that the common control DLL is loaded.
INITCOMMONCONTROLSEX icex;
icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
@@ -303,7 +265,6 @@ extern "C" __declspec(dllexport) int Load(void)
extern "C" __declspec(dllexport) int Unload(void)
{
- FreeKnownModuleList();
freeAllWatches();
return 0;
}
diff --git a/plugins/DbEditorPP/src/main_window.cpp b/plugins/DbEditorPP/src/main_window.cpp
index 9a8facfbd8..d068c854fa 100644
--- a/plugins/DbEditorPP/src/main_window.cpp
+++ b/plugins/DbEditorPP/src/main_window.cpp
@@ -133,7 +133,7 @@ LRESULT CALLBACK ModuleTreeSubclassProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM
TreeView_DeleteItem(hwnd,tvi.hItem);
}
}
- else if (wParam == VK_F2 && (mtis->type == MODULE || mtis->type == UNKNOWN_MODULE))
+ else if (wParam == VK_F2 && mtis->type == MODULE)
TreeView_EditLabel(hwnd,tvi.hItem);
else if (wParam == VK_F5) {
refreshTree(1);
@@ -253,10 +253,6 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
numberOfIcons++;
if (AddIconToList(himl, LoadSkinnedDBEIcon(ICO_OFFLINE)))
numberOfIcons++;
- if (AddIconToList(himl, LoadSkinnedDBEIcon(ICO_UNKNOWN)))
- numberOfIcons++;
- if (AddIconToList(himl, LoadSkinnedDBEIcon(ICO_UNKNOWNOPEN)))
- numberOfIcons++;
if (AddIconToList(himl, LoadSkinnedDBEIcon(ICO_ONLINE)))
numberOfIcons++;
@@ -457,7 +453,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
if (tvi.lParam)
{
mtis = (ModuleTreeInfoStruct *)tvi.lParam;
- if (mtis->type == MODULE || mtis->type == UNKNOWN_MODULE)
+ if (mtis->type == MODULE)
PopulateSettings(GetDlgItem(hwnd, IDC_SETTINGS), mtis->hContact, module);
else ClearListview(GetDlgItem(hwnd, IDC_SETTINGS));
}
diff --git a/plugins/DbEditorPP/src/modsettingenum.h b/plugins/DbEditorPP/src/modsettingenum.h
index 0ef32f8cc5..9d1e0eff47 100644
--- a/plugins/DbEditorPP/src/modsettingenum.h
+++ b/plugins/DbEditorPP/src/modsettingenum.h
@@ -1,7 +1,6 @@
struct ModSetLinkLinkItem {
char *name;
BYTE *next; //struct ModSetLinkLinkItem
- int known;
};
typedef struct {
diff --git a/plugins/DbEditorPP/src/moduletree.cpp b/plugins/DbEditorPP/src/moduletree.cpp
index 6e3f8f35fd..992bf1733d 100644
--- a/plugins/DbEditorPP/src/moduletree.cpp
+++ b/plugins/DbEditorPP/src/moduletree.cpp
@@ -98,16 +98,9 @@ int doContacts(HWND hwnd2Tree,HTREEITEM contactsRoot,ModuleSettingLL *modlist, H
lParam = (ModuleTreeInfoStruct *)mir_calloc(sizeof(ModuleTreeInfoStruct));
lParam->hContact = hContact;
- if (!module->known) {
- tvi.item.iImage = 5;
- tvi.item.iSelectedImage = 6;
- lParam->type = UNKNOWN_MODULE;
- }
- else {
- tvi.item.iImage = 1;
- tvi.item.iSelectedImage = 2;
- lParam->type = KNOWN_MODULE;
- }
+ tvi.item.iImage = 1;
+ tvi.item.iSelectedImage = 2;
+ lParam->type = KNOWN_MODULE;
tvi.item.lParam = (LPARAM)lParam;
TreeView_InsertItem(hwnd2Tree, &tvi);
@@ -177,16 +170,9 @@ void doItems(HWND hwnd2Tree,ModuleSettingLL *modlist, int count)
lParam = (ModuleTreeInfoStruct *)mir_calloc(sizeof(ModuleTreeInfoStruct));
lParam->hContact = hContact;
- if (!module->known) {
- tvi.item.iImage = 5;
- tvi.item.iSelectedImage = 6;
- lParam->type = UNKNOWN_MODULE;
- }
- else {
- tvi.item.iImage = 1;
- tvi.item.iSelectedImage = 2;
- lParam->type = KNOWN_MODULE;
- }
+ tvi.item.iImage = 1;
+ tvi.item.iSelectedImage = 2;
+ lParam->type = KNOWN_MODULE;
tvi.item.lParam = (LPARAM)lParam;
TreeView_InsertItem(hwnd2Tree, &tvi);
@@ -352,17 +338,9 @@ void replaceTreeItem(HWND hwnd, HANDLE hContact, const char *module, const char
lParam = (ModuleTreeInfoStruct *)mir_calloc(sizeof(ModuleTreeInfoStruct));
lParam->hContact = hContact;
- lParam->type = IsModuleKnown((char*)newModule)?KNOWN_MODULE:UNKNOWN_MODULE;
- if (lParam->type == UNKNOWN_MODULE)
- {
- tvi.item.iImage = 5;
- tvi.item.iSelectedImage = 6;
- }
- else
- {
- tvi.item.iImage = 1;
- tvi.item.iSelectedImage = 2;
- }
+ lParam->type = KNOWN_MODULE;
+ tvi.item.iImage = 1;
+ tvi.item.iSelectedImage = 2;
tvi.item.lParam = (LPARAM)lParam;
@@ -372,7 +350,6 @@ void replaceTreeItem(HWND hwnd, HANDLE hContact, const char *module, const char
void refreshTree(int restore)
{
- UseKnownModList = db_get_b(NULL,modname,"UseKnownModList",0);
if (populating) return;
populating = 1;
forkthread(PopulateModuleTreeThreadFunc,0,(HWND)restore);
@@ -488,9 +465,6 @@ void __cdecl PopulateModuleTreeThreadFunc(LPVOID di)
module = modlist.first;
while (module)
{
- // set the module status type for the icon
- module->known = IsModuleKnown(module->name);
-
if (!IsModuleEmpty(hContact,module->name))
{
tvi.hParent = contact;
@@ -500,18 +474,9 @@ void __cdecl PopulateModuleTreeThreadFunc(LPVOID di)
lParam = (ModuleTreeInfoStruct *)mir_calloc(sizeof(ModuleTreeInfoStruct));
lParam->hContact = hContact;
- if (!module->known)
- {
- tvi.item.iImage = 5;
- tvi.item.iSelectedImage = 6;
- lParam->type = UNKNOWN_MODULE;
- }
- else
- {
- tvi.item.iImage = 1;
- tvi.item.iSelectedImage = 2;
- lParam->type = KNOWN_MODULE;
- }
+ tvi.item.iImage = 1;
+ tvi.item.iSelectedImage = 2;
+ lParam->type = KNOWN_MODULE;
tvi.item.lParam = (LPARAM)lParam;
@@ -612,18 +577,9 @@ void moduleListWM_NOTIFY(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)// hwnd
_lParam = (ModuleTreeInfoStruct *)mir_calloc(sizeof(ModuleTreeInfoStruct));
_lParam->hContact = hContact;
- if (IsModuleKnown(module->name))
- {
- tvi.item.iImage = 5;
- tvi.item.iSelectedImage = 6;
- _lParam->type = KNOWN_MODULE;
- }
- else
- {
- tvi.item.iImage = 1;
- tvi.item.iSelectedImage = 2;
- _lParam->type = UNKNOWN_MODULE;
- }
+ tvi.item.iImage = 5;
+ tvi.item.iSelectedImage = 6;
+ _lParam->type = KNOWN_MODULE;
tvi.item.lParam = (LPARAM)_lParam;
TreeView_InsertItem(hwnd2Tree, &tvi);
@@ -659,7 +615,7 @@ void moduleListWM_NOTIFY(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)// hwnd
if (populating) Select = 0;
- if (mtis->type == MODULE || mtis->type == UNKNOWN_MODULE) {
+ if (mtis->type == MODULE) {
SettingListInfo *info = (SettingListInfo*)GetWindowLongPtr(hwnd2Settings,GWLP_USERDATA);
BOOL refresh = 1;
@@ -776,14 +732,8 @@ void moduleListWM_NOTIFY(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)// hwnd
if (TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom, &tvi)) {
tvi.mask = TVIF_IMAGE|TVIF_SELECTEDIMAGE;
- if (!IsModuleKnown(newtext)) {
- tvi.iImage = 5;
- tvi.iSelectedImage = 6;
- }
- else {
- tvi.iImage = 1;
- tvi.iSelectedImage = 2;
- }
+ tvi.iImage = 1;
+ tvi.iSelectedImage = 2;
TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom, &tvi);
PopulateSettings(GetDlgItem(hwnd, IDC_SETTINGS), mtis->hContact, newtext);
@@ -823,10 +773,10 @@ void moduleListRightClick(HWND hwnd, WPARAM wParam,LPARAM lParam) // hwnd here i
hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXTMENU));
TranslateMenu(hMenu);
if (mtis->type == CONTACT && hContact) menuNumber = 2;
- else if ((mtis->type == MODULE || mtis->type == UNKNOWN_MODULE) && !hContact) menuNumber = 1;
+ else if ((mtis->type == MODULE) && !hContact) menuNumber = 1;
else if (mtis->type == CONTACT && !hContact) menuNumber = 3;
else if (mtis->type == CONTACT_ROOT_ITEM && !hContact) menuNumber = 4;
- else if ((mtis->type == MODULE || mtis->type == UNKNOWN_MODULE) && hContact) menuNumber = 5;
+ else if ((mtis->type == MODULE) && hContact) menuNumber = 5;
else return;
hSubMenu = GetSubMenu(hMenu, menuNumber);
@@ -882,30 +832,6 @@ void moduleListRightClick(HWND hwnd, WPARAM wParam,LPARAM lParam) // hwnd here i
case MENU_EXPORTDB:
exportDB(INVALID_HANDLE_VALUE, module);
break;
-
- case MENU_ADDKNOWN:
- {
- DBVARIANT dbv;
- char *moduletemp = (char*)_alloca(strlen(module)*3);
- unsigned int i;
- moduletemp[0] = '\0';
- for(i=0; i < strlen(module); i++) {
- if (module[i]==' ')
- strcat(moduletemp,"\\ ");
- else strncat(moduletemp,&module[i],1);
- }
-
- if ( !db_get(NULL,modname,"CoreModules",&dbv) && dbv.type == DBVT_ASCIIZ) {
- int len = (int)strlen(dbv.pszVal) + 10 + (int)strlen(moduletemp);
- char* temp = (char*)_alloca(len);
- mir_snprintf(temp, len, "%s, %s", dbv.pszVal, moduletemp);
- db_set_s(NULL,modname,"CoreModules",temp);
- db_free(&dbv);
- }
- else db_set_s(NULL,modname,"CoreModules",moduletemp);
- RegisterSingleModule((WPARAM)module,0);
- }
- break;
}
}
break;
diff --git a/plugins/DbEditorPP/src/options.cpp b/plugins/DbEditorPP/src/options.cpp
index 70319c0c31..d30e3b7e97 100644
--- a/plugins/DbEditorPP/src/options.cpp
+++ b/plugins/DbEditorPP/src/options.cpp
@@ -8,16 +8,11 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
case WM_INITDIALOG:
{
bInitDone = false;
- DBVARIANT dbv;
CheckDlgButton(hwnd,IDC_EXPANDSETTINGS,db_get_b(NULL,modname,"ExpandSettingsOnOpen",0));
CheckDlgButton(hwnd,IDC_RESTORESETTINGS,db_get_b(NULL,modname,"RestoreOnOpen",1));
- CheckDlgButton(hwnd,IDC_USEKNOWNMODS,db_get_b(NULL,modname,"UseKnownModList",0));
CheckDlgButton(hwnd,IDC_WARNONDEL,db_get_b(NULL,modname,"WarnOnDelete",1));
CheckDlgButton(hwnd,IDC_MENU,db_get_b(NULL,modname,"UserMenuItem",0));
CheckDlgButton(hwnd,IDC_POPUPS,usePopups);
- if (!db_get(NULL,modname,"CoreModules",&dbv) && dbv.type == DBVT_ASCIIZ)
- SetDlgItemText(hwnd,IDC_MODULES,dbv.pszVal);
- db_free(&dbv);
SetDlgItemInt(hwnd,IDC_POPUPTIMEOUT,db_get_w(NULL,modname,"PopupDelay",4),0);
SendDlgItemMessage(hwnd, IDC_COLOUR, CPM_SETCOLOUR, 0, (LPARAM)db_get_dw(NULL,modname,"PopupColour",RGB(255,0,0)));
TranslateDialogDefault(hwnd);
@@ -29,7 +24,6 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
case IDC_RESTORESETTINGS:
case IDC_EXPANDSETTINGS:
- case IDC_USEKNOWNMODS:
case IDC_MENU:
case IDC_POPUPS:
case IDC_WARNONDEL:
@@ -37,7 +31,6 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
break;
case IDC_POPUPTIMEOUT:
- case IDC_MODULES:
if(bInitDone && (HIWORD(wParam) == EN_CHANGE))
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
break;
@@ -51,16 +44,12 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
case PSN_APPLY:
{
- char mods[4096];
db_set_b(NULL,modname,"ExpandSettingsOnOpen",(BYTE)IsDlgButtonChecked(hwnd,IDC_EXPANDSETTINGS));
db_set_b(NULL,modname,"RestoreOnOpen",(BYTE)IsDlgButtonChecked(hwnd,IDC_RESTORESETTINGS));
db_set_b(NULL,modname,"WarnOnDelete",(BYTE)IsDlgButtonChecked(hwnd,IDC_WARNONDEL));
db_set_b(NULL,modname,"UserMenuItem",(BYTE)IsDlgButtonChecked(hwnd,IDC_MENU));
- db_set_b(NULL,modname,"UseKnownModList",(BYTE)IsDlgButtonChecked(hwnd,IDC_USEKNOWNMODS));
usePopups = IsDlgButtonChecked(hwnd,IDC_POPUPS);
db_set_b(NULL,modname,"UsePopUps",(BYTE)usePopups);
- if (GetDlgItemText(hwnd,IDC_MODULES,mods,4096))
- db_set_s(NULL,modname,"CoreModules",mods);
db_set_w(NULL,modname,"PopupDelay",(WORD)GetDlgItemInt(hwnd,IDC_POPUPTIMEOUT,NULL,0));
db_set_dw(NULL,modname,"PopupColour",(DWORD)SendDlgItemMessage(hwnd, IDC_COLOUR, CPM_GETCOLOUR, 0, 0));
diff --git a/plugins/DbEditorPP/src/resource.h b/plugins/DbEditorPP/src/resource.h
index c32d146126..708b4195a1 100644
--- a/plugins/DbEditorPP/src/resource.h
+++ b/plugins/DbEditorPP/src/resource.h
@@ -29,8 +29,6 @@
#define IDD_OPTIONS 122
#define ICO_KNOWN 124
#define ICO_KNOWNOPEN 125
-#define ICO_UNKNOWNOPEN 126
-#define ICO_UNKNOWN 127
#define ICO_SETTINGS 128
#define ICO_ONLINE 129
#define IDC_MODULES 1000
@@ -72,7 +70,6 @@
#define IDC_SEARCH 1042
#define IDC_EXACT 1043
#define IDC_EXPANDSETTINGS 1044
-#define IDC_USEKNOWNMODS 1045
#define IDC_WARNONDEL 1047
#define IDC_POPUPS 1048
#define IDC_POPUPTIMEOUT 1049
@@ -138,7 +135,6 @@
#define MENU_OPTIONS 40056
#define MENU_DELETE 40057
#define MENU_REFRESH 40058
-#define MENU_ADDKNOWN 40059
#define MENU_FILTER_ALL 40060
#define MENU_FILTER_LOADED 40061
#define MENU_FILTER_UNLOADED 40062