From 5129d51c859daf669ef01099a563621f85037405 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 31 Dec 2014 21:32:42 +0000 Subject: automated conversion mode git-svn-id: http://svn.miranda-ng.org/main/trunk@11702 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/DbChecker/src/dbchecker.h | 2 +- plugins/DbChecker/src/main.cpp | 5 +-- plugins/DbChecker/src/progress.cpp | 72 ++++++++++++++++++++------------------ plugins/DbChecker/src/version.h | 4 +-- 4 files changed, 43 insertions(+), 40 deletions(-) diff --git a/plugins/DbChecker/src/dbchecker.h b/plugins/DbChecker/src/dbchecker.h index 1e97526d96..c2235a6c4c 100644 --- a/plugins/DbChecker/src/dbchecker.h +++ b/plugins/DbChecker/src/dbchecker.h @@ -58,7 +58,7 @@ extern DbToolOptions opts; extern HANDLE hEventRun, hEventAbort; extern int errorCount; extern LRESULT wizardResult; -extern bool bServiceMode, bLaunchMiranda, bShortMode; +extern bool bServiceMode, bLaunchMiranda, bShortMode, bAutoExit; int DoMyControlProcessing(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam, INT_PTR *bReturn); diff --git a/plugins/DbChecker/src/main.cpp b/plugins/DbChecker/src/main.cpp index 6f9cc48fbc..6b6c8603c0 100644 --- a/plugins/DbChecker/src/main.cpp +++ b/plugins/DbChecker/src/main.cpp @@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. HINSTANCE hInst; int hLangpack = 0; -bool bServiceMode, bLaunchMiranda, bShortMode; +bool bServiceMode, bLaunchMiranda, bShortMode, bAutoExit; HANDLE hService; DbToolOptions opts = { 0 }; @@ -61,7 +61,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_SERVIC static INT_PTR ServiceMode(WPARAM, LPARAM) { - bLaunchMiranda = bShortMode = false; + bLaunchMiranda = bShortMode = bAutoExit = false; bServiceMode = true; DialogBox(hInst, MAKEINTRESOURCE(IDD_WIZARD), NULL, WizardDlgProc); return (bLaunchMiranda) ? SERVICE_CONTINUE : SERVICE_FAILED; @@ -71,6 +71,7 @@ static INT_PTR CheckProfile(WPARAM wParam, LPARAM lParam) { bShortMode = true; bLaunchMiranda = lParam != 0; + bAutoExit = lParam == 2; bServiceMode = false; _tcsncpy(opts.filename, (TCHAR*)wParam, SIZEOF(opts.filename)); return DialogBox(hInst, MAKEINTRESOURCE(IDD_WIZARD), NULL, WizardDlgProc); diff --git a/plugins/DbChecker/src/progress.cpp b/plugins/DbChecker/src/progress.cpp index a01591b805..9a20a9ca0c 100644 --- a/plugins/DbChecker/src/progress.cpp +++ b/plugins/DbChecker/src/progress.cpp @@ -112,45 +112,45 @@ INT_PTR CALLBACK ProgressDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM return TRUE; case WM_MEASUREITEM: - { - LPMEASUREITEMSTRUCT mis = (LPMEASUREITEMSTRUCT)lParam; - mis->itemWidth = listWidth; - mis->itemHeight = fontHeight; - } - return TRUE; + { + LPMEASUREITEMSTRUCT mis = (LPMEASUREITEMSTRUCT)lParam; + mis->itemWidth = listWidth; + mis->itemHeight = fontHeight; + } + return TRUE; case WM_DRAWITEM: - { - LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam; TCHAR str[256]; - int bold = 0; - HFONT hoFont = NULL; - if ((int)dis->itemID == -1) break; - SendMessage(dis->hwndItem, LB_GETTEXT, dis->itemID, (LPARAM)str); - switch (dis->itemData & STATUS_CLASSMASK) { - case STATUS_MESSAGE: - SetTextColor(dis->hDC, RGB(0, 0, 0)); - break; - case STATUS_WARNING: - SetTextColor(dis->hDC, RGB(192, 128, 0)); - break; - case STATUS_ERROR: - SetTextColor(dis->hDC, RGB(192, 0, 0)); - break; - case STATUS_FATAL: - bold = 1; - SetTextColor(dis->hDC, RGB(192, 0, 0)); - break; - case STATUS_SUCCESS: - bold = 1; - SetTextColor(dis->hDC, RGB(0, 192, 0)); - break; + { + LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam; + int bold = 0; + HFONT hoFont = NULL; + if ((int)dis->itemID == -1) break; + SendMessage(dis->hwndItem, LB_GETTEXT, dis->itemID, (LPARAM)str); + switch (dis->itemData & STATUS_CLASSMASK) { + case STATUS_MESSAGE: + SetTextColor(dis->hDC, RGB(0, 0, 0)); + break; + case STATUS_WARNING: + SetTextColor(dis->hDC, RGB(192, 128, 0)); + break; + case STATUS_ERROR: + SetTextColor(dis->hDC, RGB(192, 0, 0)); + break; + case STATUS_FATAL: + bold = 1; + SetTextColor(dis->hDC, RGB(192, 0, 0)); + break; + case STATUS_SUCCESS: + bold = 1; + SetTextColor(dis->hDC, RGB(0, 192, 0)); + break; + } + if (bold) hoFont = (HFONT)SelectObject(dis->hDC, hBoldFont); + ExtTextOut(dis->hDC, dis->rcItem.left, dis->rcItem.top, ETO_CLIPPED | ETO_OPAQUE, &dis->rcItem, str, (UINT)_tcslen(str), NULL); + if (bold) SelectObject(dis->hDC, hoFont); } - if (bold) hoFont = (HFONT)SelectObject(dis->hDC, hBoldFont); - ExtTextOut(dis->hDC, dis->rcItem.left, dis->rcItem.top, ETO_CLIPPED | ETO_OPAQUE, &dis->rcItem, str, (UINT)_tcslen(str), NULL); - if (bold) SelectObject(dis->hDC, hoFont); - } - return TRUE; + return TRUE; case WM_PROCESSINGDONE: SetProgressBar(1000); @@ -159,6 +159,8 @@ INT_PTR CALLBACK ProgressDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM EnableWindow(GetDlgItem(GetParent(hdlg), IDOK), FALSE); SetDlgItemText(GetParent(hdlg), IDCANCEL, TranslateT("&Finish")); bShortModeDone = true; + if (bAutoExit) + PostMessage(GetParent(hdlg), WM_COMMAND, IDCANCEL, 0); } else { AddToStatus(STATUS_SUCCESS, TranslateT("Click Next to continue")); diff --git a/plugins/DbChecker/src/version.h b/plugins/DbChecker/src/version.h index 452246d18e..1c880d370f 100644 --- a/plugins/DbChecker/src/version.h +++ b/plugins/DbChecker/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0 #define __MINOR_VERSION 95 -#define __RELEASE_NUM 0 -#define __BUILD_NUM 3 +#define __RELEASE_NUM 3 +#define __BUILD_NUM 1 #include -- cgit v1.2.3