diff options
author | Dmitry Kuzkin <bio@ktaspb.ru> | 2015-06-18 12:36:07 +0000 |
---|---|---|
committer | Dmitry Kuzkin <bio@ktaspb.ru> | 2015-06-18 12:36:07 +0000 |
commit | 1bb9a86b26d3a9964844d42fa25690ce0a028258 (patch) | |
tree | 6c0645ade07ec6b4d36e38a1ba77e457e8cf6ade /plugins/DbEditorPP/src/modules.cpp | |
parent | a27ae3e0c1f1f17596db3abeae16ec3fc4b4ba80 (diff) |
true unicode build (ansi build is possible but useless)
new search/replace dialog
edit improvements (type check)
resident settings support (fully resident modules are still invisible)
remove obsolete things
code cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@14243 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/DbEditorPP/src/modules.cpp')
-rw-r--r-- | plugins/DbEditorPP/src/modules.cpp | 95 |
1 files changed, 0 insertions, 95 deletions
diff --git a/plugins/DbEditorPP/src/modules.cpp b/plugins/DbEditorPP/src/modules.cpp deleted file mode 100644 index f0793a9853..0000000000 --- a/plugins/DbEditorPP/src/modules.cpp +++ /dev/null @@ -1,95 +0,0 @@ -#include "headers.h"
-
-void renameModule(char* oldName, char* newName, MCONTACT hContact)
-{
- DBVARIANT dbv;
- ModuleSettingLL settinglist;
- ModSetLinkLinkItem *setting;
-
- if (!EnumSettings(hContact, oldName, &settinglist)) { msg(Translate("Error Loading Setting List"), modFullname); return; }
-
- setting = settinglist.first;
- while (setting) {
- if (!GetSetting(hContact, oldName, setting->name, &dbv)) {
- switch (dbv.type) {
- case DBVT_BYTE:
- db_set_b(hContact, newName, setting->name, dbv.bVal);
- break;
- case DBVT_WORD:
- db_set_w(hContact, newName, setting->name, dbv.wVal);
- break;
- case DBVT_DWORD:
- db_set_dw(hContact, newName, setting->name, dbv.dVal);
- break;
- case DBVT_ASCIIZ:
- db_set_s(hContact, newName, setting->name, dbv.pszVal);
- break;
- case DBVT_UTF8:
- db_set_utf(hContact, newName, setting->name, dbv.pszVal);
- break;
- case DBVT_BLOB:
- db_set_blob(hContact, newName, setting->name, dbv.pbVal, dbv.cpbVal);
- break;
-
- }
- db_unset(hContact, oldName, setting->name);
- }
- db_free(&dbv);
- setting = (ModSetLinkLinkItem *)setting->next;
- }
- FreeModuleSettingLL(&settinglist);
-}
-
-INT_PTR CALLBACK AddModDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- if (msg == WM_INITDIALOG) {
- SetWindowLongPtr(hwnd, GWLP_USERDATA, lParam);
- TranslateDialogDefault(hwnd);
- }
-
- if (msg == WM_COMMAND) {
- switch (LOWORD(wParam)) {
- case IDOK:
- if (GetWindowTextLength(GetDlgItem(hwnd, IDC_MODNAME))) {
- char modulename[256];
- GetDlgItemText(hwnd, IDC_MODNAME, modulename, SIZEOF(modulename));
- if (IsDlgButtonChecked(hwnd, CHK_ADD2ALL)) {
- // null contact
- db_set_b(NULL, modulename, "(Default)", 0);
- for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
- db_set_b(hContact, modulename, "(Default)", 0);
- }
- else db_set_b((MCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA), modulename, "(Default)", 0);
-
- refreshTree(1);
- }
- // fall through
- case IDCANCEL:
- DestroyWindow(hwnd);
- break;
- }
- }
- return 0;
-}
-
-int CloneContact(MCONTACT hContact)
-{
- MCONTACT newContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- if (!newContact)
- return 0;
-
- // enum all the modules
- ModuleSettingLL modlist;
- if (!EnumModules(&modlist)) {
- msg(Translate("Error loading module list"), modFullname);
- return 0;
- }
-
- ModSetLinkLinkItem *mod = modlist.first;
- while (mod) {
- copyModule(mod->name, hContact, newContact);
- mod = (ModSetLinkLinkItem *)mod->next;
- }
- FreeModuleSettingLL(&modlist);
- return 1;
-}
|