From d9fddc0cfa9066eb1b5ad3f4807b37426ae6ca88 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 5 Mar 2019 21:10:22 +0300 Subject: Popup: - wiping out checks for service presence; - code cleaning --- plugins/UserInfoEx/src/dlg_msgbox.cpp | 3 +-- plugins/UserInfoEx/src/psp_options.cpp | 14 ++++++-------- plugins/UserInfoEx/src/svc_refreshci.cpp | 8 +++----- plugins/UserInfoEx/src/svc_reminder.cpp | 2 +- 4 files changed, 11 insertions(+), 16 deletions(-) (limited to 'plugins/UserInfoEx') diff --git a/plugins/UserInfoEx/src/dlg_msgbox.cpp b/plugins/UserInfoEx/src/dlg_msgbox.cpp index 05583dbdf8..4adbd1fdeb 100644 --- a/plugins/UserInfoEx/src/dlg_msgbox.cpp +++ b/plugins/UserInfoEx/src/dlg_msgbox.cpp @@ -567,7 +567,7 @@ static INT_PTR CALLBACK MsgBoxPop(HWND hDlg, UINT uMsg, WPARAM, LPARAM lParam) } // create popup - CallService(MS_POPUP_ADDPOPUPW, (WPARAM)&pd, APF_NEWDATA); + PUAddPopupW(&pd, APF_NEWDATA); if (MB_TYPE(pMsgBox->uType) == MB_OK) EndDialog(hDlg, IDOK); } @@ -642,7 +642,6 @@ INT_PTR MsgBoxService(WPARAM, LPARAM lParam) if (PtrIsValid(pMsgBox) && pMsgBox->cbSize == sizeof(MSGBOX)) { // Shall the MessageBox displayed as popup? if (!(pMsgBox->uType & (MB_INFOBAR | MB_NOPOPUP)) // message box can be a popup? - && ServiceExists(MS_POPUP_ADDPOPUPW) // popups exist? && myGlobals.PopupActionsExist == 1 // popup support ext stuct? && (db_get_dw(0, "Popup", "Actions", 0) & 1) // popup++ actions on? && g_plugin.getByte(SET_POPUPMSGBOX, DEFVAL_POPUPMSGBOX)) // user likes popups? diff --git a/plugins/UserInfoEx/src/psp_options.cpp b/plugins/UserInfoEx/src/psp_options.cpp index 7888950cc6..ca4830974c 100644 --- a/plugins/UserInfoEx/src/psp_options.cpp +++ b/plugins/UserInfoEx/src/psp_options.cpp @@ -1068,13 +1068,11 @@ int OnInitOptions(WPARAM wParam, LPARAM) g_plugin.addOptions(wParam, &odp); // Popups page - if (ServiceExists(MS_POPUP_ADDPOPUPW)) { - odp.szTitle.a = MODULELONGNAME; - odp.szGroup.a = LPGEN("Popups"); - odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_POPUP); - odp.pfnDlgProc = DlgProc_Popups; - odp.flags = ODPF_BOLDGROUPS; - g_plugin.addOptions(wParam, &odp); - } + odp.szTitle.a = MODULELONGNAME; + odp.szGroup.a = LPGEN("Popups"); + odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_POPUP); + odp.pfnDlgProc = DlgProc_Popups; + odp.flags = ODPF_BOLDGROUPS; + g_plugin.addOptions(wParam, &odp); return MIR_OK; } diff --git a/plugins/UserInfoEx/src/svc_refreshci.cpp b/plugins/UserInfoEx/src/svc_refreshci.cpp index 6ad7be5009..f7a11d62c4 100644 --- a/plugins/UserInfoEx/src/svc_refreshci.cpp +++ b/plugins/UserInfoEx/src/svc_refreshci.cpp @@ -409,7 +409,7 @@ public: mir_wstrcpy(pd.lpwzText, L" "); _pFnCallBack = pFnCallBack; - _hWnd = (HWND)CallService(MS_POPUP_ADDPOPUPW, (WPARAM)&pd, APF_RETURN_HWND | APF_NEWDATA); + _hWnd = (HWND)PUAddPopupW(&pd, APF_RETURN_HWND | APF_NEWDATA); return _hWnd; } @@ -635,12 +635,10 @@ public: iWait += 5000; if (Size() && !_pProgress) { - if (ServiceExists(MS_POPUP_CHANGETEXTW) && g_plugin.getByte("PopupProgress", FALSE)) { + if (g_plugin.getByte("PopupProgress", FALSE)) _pProgress = new CPopupUpdProgress(this); - } - else { + else _pProgress = new CDlgUpdProgress(this); - } _pProgress->Create(TranslateT("Refresh contact details"), (PUpdCallback)CContactUpdater::DlgProc); _pProgress->SetText(TranslateT("Preparing...")); diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp index 4f5677e4d6..4dc19b4602 100644 --- a/plugins/UserInfoEx/src/svc_reminder.cpp +++ b/plugins/UserInfoEx/src/svc_reminder.cpp @@ -830,7 +830,7 @@ void SvcReminderEnable(BYTE bEnable) gRemindOpts.bCListExtraIcon = g_plugin.getByte(SET_REMIND_EXTRAICON, 1); gRemindOpts.bCheckVisibleOnly = g_plugin.getByte(SET_REMIND_CHECKVISIBLE, DEFVAL_REMIND_CHECKVISIBLE); gRemindOpts.bFlashCList = g_plugin.getByte(SET_REMIND_FLASHICON, FALSE); - gRemindOpts.bPopups = ServiceExists(MS_POPUP_ADDPOPUPW) && g_plugin.getByte(SET_POPUP_ENABLED, DEFVAL_POPUP_ENABLED); + gRemindOpts.bPopups = g_plugin.getByte(SET_POPUP_ENABLED, DEFVAL_POPUP_ENABLED); // init the timer UpdateTimer(TRUE); -- cgit v1.2.3