From 423be683866fd8e305457eb725d8cdbe1f297fbd Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 27 Feb 2019 12:43:20 +0300 Subject: popup code cleaning (cause we have no tchar.h) --- plugins/PackUpdater/Src/Notifications.cpp | 16 ++++++++-------- plugins/PackUpdater/Src/Options.cpp | 6 +++--- plugins/PackUpdater/Src/Utils.cpp | 10 +++++----- 3 files changed, 16 insertions(+), 16 deletions(-) (limited to 'plugins/PackUpdater') diff --git a/plugins/PackUpdater/Src/Notifications.cpp b/plugins/PackUpdater/Src/Notifications.cpp index 1ad3c1cbe2..9512a700c7 100644 --- a/plugins/PackUpdater/Src/Notifications.cpp +++ b/plugins/PackUpdater/Src/Notifications.cpp @@ -111,12 +111,12 @@ void show_popup(HWND hDlg, LPCTSTR pszTitle, LPCTSTR pszText, int iNumber, int A if (!pmpd) return; - POPUPDATAT_V2 pd = { 0 }; + POPUPDATAW_V2 pd = { 0 }; pd.cbSize = sizeof(pd); pd.lchContact = NULL; //(HANDLE)wParam; pd.lchIcon = Skin_LoadIcon(PopupsList[iNumber].Icon); - mir_wstrncpy(pd.lptzText, pszText, _countof(pd.lptzText)); - mir_wstrncpy(pd.lptzContactName, pszTitle, _countof(pd.lptzContactName)); + mir_wstrncpy(pd.lpwzText, pszText, _countof(pd.lpwzText)); + mir_wstrncpy(pd.lpwzContactName, pszTitle, _countof(pd.lpwzContactName)); switch (MyOptions.DefColors) { case byCOLOR_WINDOWS: pd.colorBack = GetSysColor(COLOR_BTNFACE); @@ -148,7 +148,7 @@ void show_popup(HWND hDlg, LPCTSTR pszTitle, LPCTSTR pszText, int iNumber, int A MakePopupAction(pmpd->pa[pd.actionCount++], IDNO); } - CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&pd, APF_NEWDATA); + CallService(MS_POPUP_ADDPOPUPW, (WPARAM)&pd, APF_NEWDATA); } INT_PTR CALLBACK DlgDownload(HWND hDlg, UINT message, WPARAM, LPARAM) @@ -176,7 +176,7 @@ INT_PTR CALLBACK DlgDownloadPop(HWND hDlg, UINT uMsg, WPARAM, LPARAM) static void __stdcall CreateDownloadDialog(void*) { - if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(0, "Popup", "ModuleIsEnabled", 1) && g_plugin.getByte("Popups3", DEFAULT_POPUP_ENABLED)) + if (ServiceExists(MS_POPUP_ADDPOPUPW) && db_get_b(0, "Popup", "ModuleIsEnabled", 1) && g_plugin.getByte("Popups3", DEFAULT_POPUP_ENABLED)) hDlgDld = CreateDialog(g_plugin.getInst(), MAKEINTRESOURCE(IDD_POPUPDUMMI), nullptr, DlgDownloadPop); else if (g_plugin.getByte("Popups3M", DEFAULT_MESSAGE_ENABLED)) { mir_wstrncpy(tszDialogMsg, Text, _countof(tszDialogMsg)); @@ -195,7 +195,7 @@ void DlgDownloadProc() if (!DownloadFile(pFileUrl->tszDownloadURL, pFileUrl->tszDiskPath)) { Title = TranslateT("Pack Updater"); Text = TranslateT("An error occurred while downloading the update."); - if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(0, "Popup", "ModuleIsEnabled", 1) && g_plugin.getByte("Popups1", DEFAULT_POPUP_ENABLED)) { + if (ServiceExists(MS_POPUP_ADDPOPUPW) && db_get_b(0, "Popup", "ModuleIsEnabled", 1) && g_plugin.getByte("Popups1", DEFAULT_POPUP_ENABLED)) { Number = 1; show_popup(nullptr, Title, Text, Number, 0); } @@ -420,7 +420,7 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam INT rc = -1; Title = TranslateT("Pack Updater"); Text = tszBuff; - if (ServiceExists(MS_POPUP_ADDPOPUPT) && ServiceExists(MS_POPUP_REGISTERACTIONS) && db_get_b(0, "Popup", "ModuleIsEnabled", 1) && g_plugin.getByte("Popups0", DEFAULT_POPUP_ENABLED) && (db_get_dw(0, "Popup", "Actions", 0) & 1)) + if (ServiceExists(MS_POPUP_ADDPOPUPW) && ServiceExists(MS_POPUP_REGISTERACTIONS) && db_get_b(0, "Popup", "ModuleIsEnabled", 1) && g_plugin.getByte("Popups0", DEFAULT_POPUP_ENABLED) && (db_get_dw(0, "Popup", "Actions", 0) & 1)) rc = DialogBox(g_plugin.getInst(), MAKEINTRESOURCE(IDD_POPUPDUMMI), nullptr, DlgMsgPop); else rc = MessageBox(nullptr, tszBuff, Title, MB_YESNO | MB_ICONQUESTION); @@ -508,7 +508,7 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam mir_snwprintf(tszBuff, TranslateT("You have chosen not to install the pack update immediately.\nYou can install it manually from this location:\n\n%s"), arFilePath[0].c_str()); Title = TranslateT("Pack Updater"); Text = tszBuff; - if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(0, "Popup", "ModuleIsEnabled", 1) && g_plugin.getByte("Popups2", DEFAULT_POPUP_ENABLED)) { + if (ServiceExists(MS_POPUP_ADDPOPUPW) && db_get_b(0, "Popup", "ModuleIsEnabled", 1) && g_plugin.getByte("Popups2", DEFAULT_POPUP_ENABLED)) { Number = 2; show_popup(nullptr, Title, Text, Number, 0); } diff --git a/plugins/PackUpdater/Src/Options.cpp b/plugins/PackUpdater/Src/Options.cpp index e1768b9426..b662b16a54 100644 --- a/plugins/PackUpdater/Src/Options.cpp +++ b/plugins/PackUpdater/Src/Options.cpp @@ -55,7 +55,7 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA ComboBox_SetCurSel(GetDlgItem(hwndDlg, IDC_PERIODMEASURE), PeriodMeasure); CheckDlgButton(hwndDlg, IDC_REMINDER, Reminder ? BST_CHECKED : BST_UNCHECKED); - if (ServiceExists(MS_POPUP_ADDPOPUPT)) { + if (ServiceExists(MS_POPUP_ADDPOPUPW)) { ShowWindow(GetDlgItem(hwndDlg, IDC_NOTIFY2), SW_HIDE); ShowWindow(GetDlgItem(hwndDlg, IDC_MSG_BOXES2), SW_HIDE); ShowWindow(GetDlgItem(hwndDlg, IDC_ERRORS2), SW_HIDE); @@ -141,7 +141,7 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA g_plugin.setByte("PeriodMeasure", PeriodMeasure); Reminder = IsDlgButtonChecked(hwndDlg, IDC_REMINDER); g_plugin.setByte("Reminder", Reminder); - if (!ServiceExists(MS_POPUP_ADDPOPUPT)) { + if (!ServiceExists(MS_POPUP_ADDPOPUPW)) { for (int i = 1; i < POPUPS; i++) { mir_snprintf(str, "Popups%dM", i); g_plugin.setByte(str, (BYTE)(IsDlgButtonChecked(hwndDlg, (i + 1029)))); @@ -389,7 +389,7 @@ int OptInit(WPARAM wParam, LPARAM) odp.pfnDlgProc = UpdateNotifyOptsProc; g_plugin.addOptions(wParam, &odp); - if (ServiceExists(MS_POPUP_ADDPOPUPT)) { + if (ServiceExists(MS_POPUP_ADDPOPUPW)) { odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUP); odp.szGroup.w = LPGENW("Popups"); odp.szTitle.w = LPGENW("Pack Updater"); diff --git a/plugins/PackUpdater/Src/Utils.cpp b/plugins/PackUpdater/Src/Utils.cpp index 0502640ba3..2ff8415ef9 100644 --- a/plugins/PackUpdater/Src/Utils.cpp +++ b/plugins/PackUpdater/Src/Utils.cpp @@ -193,7 +193,7 @@ static void CheckUpdates(void *) if (!tszDownloadURL) { // URL is not set Title = TranslateT("Pack Updater"); Text = TranslateT("URL for checking updates not found."); - if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(0, "Popup", "ModuleIsEnabled", 1) && g_plugin.getByte("Popups1", DEFAULT_POPUP_ENABLED)) { + if (ServiceExists(MS_POPUP_ADDPOPUPW) && db_get_b(0, "Popup", "ModuleIsEnabled", 1) && g_plugin.getByte("Popups1", DEFAULT_POPUP_ENABLED)) { Number = 1; show_popup(nullptr, Title, Text, Number, 0); } @@ -248,7 +248,7 @@ static void CheckUpdates(void *) if (wcsstr(tszBuff, L"\\")) { //check update name Title = TranslateT("Pack Updater"); Text = TranslateT("Name of Update's file is not supported."); - if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(0, "Popup", "ModuleIsEnabled", 1) && g_plugin.getByte("Popups1", DEFAULT_POPUP_ENABLED)) { + if (ServiceExists(MS_POPUP_ADDPOPUPW) && db_get_b(0, "Popup", "ModuleIsEnabled", 1) && g_plugin.getByte("Popups1", DEFAULT_POPUP_ENABLED)) { Number = 1; show_popup(nullptr, Title, Text, Number, 0); } @@ -339,7 +339,7 @@ static void CheckUpdates(void *) if (!UpdatesCount && !Silent) { Title = TranslateT("Pack Updater"); Text = TranslateT("No updates found."); - if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(0, "Popup", "ModuleIsEnabled", 1) && g_plugin.getByte("Popups2", DEFAULT_POPUP_ENABLED)) { + if (ServiceExists(MS_POPUP_ADDPOPUPW) && db_get_b(0, "Popup", "ModuleIsEnabled", 1) && g_plugin.getByte("Popups2", DEFAULT_POPUP_ENABLED)) { Number = 2; show_popup(nullptr, Title, Text, Number, 0); } @@ -350,7 +350,7 @@ static void CheckUpdates(void *) if (!FileCount) { Title = TranslateT("Pack Updater"); Text = TranslateT("No files for update."); - if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(0, "Popup", "ModuleIsEnabled", 1) && g_plugin.getByte("Popups2", DEFAULT_POPUP_ENABLED)) { + if (ServiceExists(MS_POPUP_ADDPOPUPW) && db_get_b(0, "Popup", "ModuleIsEnabled", 1) && g_plugin.getByte("Popups2", DEFAULT_POPUP_ENABLED)) { Number = 2; show_popup(nullptr, Title, Text, Number, 0); } @@ -365,7 +365,7 @@ void DoCheck(int iFlag) if (hCheckThread != nullptr) { Title = TranslateT("Pack Updater"); Text = TranslateT("Update checking already started!"); - if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(0, "Popup", "ModuleIsEnabled", 1) && g_plugin.getByte("Popups2", DEFAULT_POPUP_ENABLED)) { + if (ServiceExists(MS_POPUP_ADDPOPUPW) && db_get_b(0, "Popup", "ModuleIsEnabled", 1) && g_plugin.getByte("Popups2", DEFAULT_POPUP_ENABLED)) { Number = 2; show_popup(nullptr, Title, Text, Number, 0); } -- cgit v1.2.3