From 82fc26a0fdbd50cf60b2c93f456cbef33046ac48 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sun, 14 Dec 2014 15:31:37 +0000 Subject: DbEditorPP: changed warning lavel to w4 git-svn-id: http://svn.miranda-ng.org/main/trunk@11414 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/DbEditorPP/src/deletemodule.cpp | 76 ++++++++++++++++----------------- 1 file changed, 38 insertions(+), 38 deletions(-) (limited to 'plugins/DbEditorPP/src/deletemodule.cpp') diff --git a/plugins/DbEditorPP/src/deletemodule.cpp b/plugins/DbEditorPP/src/deletemodule.cpp index f933bb758d..7f94d13cd5 100644 --- a/plugins/DbEditorPP/src/deletemodule.cpp +++ b/plugins/DbEditorPP/src/deletemodule.cpp @@ -8,15 +8,15 @@ int deleteModule(char *module, MCONTACT hContact, int fromMenu) if (!module) return 0; - if (!fromMenu && db_get_b(NULL,modname, "WarnOnDelete",1)) { + if (!fromMenu && db_get_b(NULL, modname, "WarnOnDelete", 1)) { char msg[1024]; mir_snprintf(msg, SIZEOF(msg), Translate("Are you sure you want to delete module \"%s\"?"), module); - if (MessageBox(0,msg, Translate("Confirm module deletion"), MB_YESNO|MB_ICONEXCLAMATION) == IDNO) + if (MessageBox(0, msg, Translate("Confirm module deletion"), MB_YESNO | MB_ICONEXCLAMATION) == IDNO) return 0; } ModuleSettingLL settinglist; - if (!EnumSettings(hContact,module,&settinglist)) + if (!EnumSettings(hContact, module, &settinglist)) return 0; for (ModSetLinkLinkItem *setting = settinglist.first; setting; setting = setting->next) { @@ -40,29 +40,29 @@ void __cdecl PopulateModuleDropListThreadFunc(void *di) while (module && working) { moduleEmpty = 1; // check the null - if (!IsModuleEmpty(NULL,module->name)) { - SendDlgItemMessage(hwnd,IDC_CONTACTS,CB_ADDSTRING,0,(LPARAM)module->name); + if (!IsModuleEmpty(NULL, module->name)) { + SendDlgItemMessage(hwnd, IDC_CONTACTS, CB_ADDSTRING, 0, (LPARAM)module->name); moduleEmpty = 0; module = module->next; continue; } - for (MCONTACT hContact = db_find_first();moduleEmpty && hContact;hContact = db_find_next(hContact)) { - if (!IsModuleEmpty(hContact,module->name)) { - SendDlgItemMessage(hwnd,IDC_CONTACTS,CB_ADDSTRING,0,(LPARAM)module->name); + for (MCONTACT hContact = db_find_first(); moduleEmpty && hContact; hContact = db_find_next(hContact)) { + if (!IsModuleEmpty(hContact, module->name)) { + SendDlgItemMessage(hwnd, IDC_CONTACTS, CB_ADDSTRING, 0, (LPARAM)module->name); moduleEmpty = 0; break; } } module = module->next; - SendDlgItemMessage(hwnd,IDC_CONTACTS,CB_SETCURSEL,0,0); + SendDlgItemMessage(hwnd, IDC_CONTACTS, CB_SETCURSEL, 0, 0); } - SendDlgItemMessage(hwnd,IDC_CONTACTS,CB_SETCURSEL,0,0); + SendDlgItemMessage(hwnd, IDC_CONTACTS, CB_SETCURSEL, 0, 0); FreeModuleSettingLL(&msll); - SetWindowText(hwnd,Translate("Delete module from database")); - EnableWindow(GetDlgItem(hwnd,IDC_CONTACTS),1); - EnableWindow(GetDlgItem(hwnd,IDOK),1); - EnableWindow(GetDlgItem(hwnd,IDCANCEL),1); + SetWindowText(hwnd, Translate("Delete module from database")); + EnableWindow(GetDlgItem(hwnd, IDC_CONTACTS), 1); + EnableWindow(GetDlgItem(hwnd, IDOK), 1); + EnableWindow(GetDlgItem(hwnd, IDCANCEL), 1); if (!working) PostMessage(hwnd, WM_COMMAND, (WPARAM)IDCANCEL, 0); @@ -70,42 +70,42 @@ void __cdecl PopulateModuleDropListThreadFunc(void *di) working = 2; } -INT_PTR CALLBACK DeleteModuleDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK DeleteModuleDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM) { - switch(msg) { + switch (msg) { case WM_INITDIALOG: - SetWindowText(hwnd,Translate("Delete module from database... Loading")); - EnableWindow(GetDlgItem(hwnd,IDC_CONTACTS),0); - EnableWindow(GetDlgItem(hwnd,IDOK),0); - SetDlgItemText(hwnd,IDC_INFOTEXT, Translate("Delete module from database")); - SetDlgItemText(hwnd,CHK_COPY2ALL, Translate("Delete module from all contacts (including Setting)")); - EnableWindow(GetDlgItem(hwnd,CHK_COPY2ALL),0); + SetWindowText(hwnd, Translate("Delete module from database... Loading")); + EnableWindow(GetDlgItem(hwnd, IDC_CONTACTS), 0); + EnableWindow(GetDlgItem(hwnd, IDOK), 0); + SetDlgItemText(hwnd, IDC_INFOTEXT, Translate("Delete module from database")); + SetDlgItemText(hwnd, CHK_COPY2ALL, Translate("Delete module from all contacts (including Setting)")); + EnableWindow(GetDlgItem(hwnd, CHK_COPY2ALL), 0); CheckDlgButton(hwnd, CHK_COPY2ALL, BST_CHECKED); TranslateDialogDefault(hwnd); working = 1; - forkthread(PopulateModuleDropListThreadFunc,0,hwnd); + forkthread(PopulateModuleDropListThreadFunc, 0, hwnd); return TRUE; case WM_COMMAND: - switch(LOWORD(wParam)) { + switch (LOWORD(wParam)) { case IDOK: - { - char text[128]; - GetDlgItemText(hwnd,IDC_CONTACTS,text,SIZEOF(text)); - SetCursor(LoadCursor(NULL,IDC_WAIT)); - for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) - deleteModule(text,hContact,1); + { + char text[128]; + GetDlgItemText(hwnd, IDC_CONTACTS, text, SIZEOF(text)); + SetCursor(LoadCursor(NULL, IDC_WAIT)); + for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) + deleteModule(text, hContact, 1); - // do the null - deleteModule(text,NULL,1); - SetCursor(LoadCursor(NULL,IDC_ARROW)); - refreshTree(1); - } - // fall through + // do the null + deleteModule(text, NULL, 1); + SetCursor(LoadCursor(NULL, IDC_ARROW)); + refreshTree(1); + } + // fall through case IDCANCEL: if (working == 1) { working = 0; - EnableWindow(GetDlgItem(hwnd,IDCANCEL),0); + EnableWindow(GetDlgItem(hwnd, IDCANCEL), 0); } else DestroyWindow(hwnd); } @@ -120,7 +120,7 @@ INT_PTR CALLBACK DeleteModuleDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM void deleteModuleGui() { - if (!hwnd2Delete) + if (!hwnd2Delete) hwnd2Delete = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_COPY_MOD), hwnd2mainWindow, DeleteModuleDlgProc, 0); else SetForegroundWindow(hwnd2Delete); -- cgit v1.2.3