diff options
Diffstat (limited to 'plugins')
7 files changed, 14 insertions, 22 deletions
diff --git a/plugins/ExternalAPI/m_statusplugins.h b/plugins/ExternalAPI/m_statusplugins.h index 1e1c57f2a3..a13fb31c44 100644 --- a/plugins/ExternalAPI/m_statusplugins.h +++ b/plugins/ExternalAPI/m_statusplugins.h @@ -35,11 +35,6 @@ typedef struct { // returns 0 on success
#define MS_CS_SETSTATUSEX "CommonStatus/SetStatusEx"
-// wParam = PROTOCOLSETTINGEX*** (keep it like this for compatibility)
-// lParam = timeout
-// returns hwnd
-#define MS_CS_SHOWCONFIRMDLGEX "CommonStatus/ShowConfirmDialogEx"
-
// wParam = 0
// lParam = 0
// returns the number of protocols registerd
diff --git a/plugins/StatusManager/src/AdvancedAutoAway/advancedautoaway.cpp b/plugins/StatusManager/src/AdvancedAutoAway/advancedautoaway.cpp index 97ddeaef97..c15fc40239 100644 --- a/plugins/StatusManager/src/AdvancedAutoAway/advancedautoaway.cpp +++ b/plugins/StatusManager/src/AdvancedAutoAway/advancedautoaway.cpp @@ -370,7 +370,7 @@ static VOID CALLBACK AutoAwayTimer(HWND, UINT, UINT_PTR, DWORD) } if (confirm) - confirmDialog = (HWND)CallService(MS_CS_SHOWCONFIRMDLGEX, (WPARAM)&ps, db_get_w(NULL, AAAMODULENAME, SETTING_CONFIRMDELAY, 5)); + confirmDialog = ShowConfirmDialogEx((TProtoSettings*)&ps, db_get_w(NULL, AAAMODULENAME, SETTING_CONFIRMDELAY, 5)); else if (statusChanged) CallService(MS_CS_SETSTATUSEX, (WPARAM)&ps, 0); } diff --git a/plugins/StatusManager/src/StartupStatus/ss_profiles.cpp b/plugins/StatusManager/src/StartupStatus/ss_profiles.cpp index 275883d9ce..ba056510f5 100644 --- a/plugins/StatusManager/src/StartupStatus/ss_profiles.cpp +++ b/plugins/StatusManager/src/StartupStatus/ss_profiles.cpp @@ -206,7 +206,7 @@ INT_PTR LoadAndSetProfile(WPARAM iProfileNo, LPARAM) if (!db_get_b(NULL, SSMODULENAME, setting, 0)) CallService(MS_CS_SETSTATUSEX, (WPARAM)&profileSettings, 0); else - CallService(MS_CS_SHOWCONFIRMDLGEX, (WPARAM)&profileSettings, (LPARAM)db_get_dw(NULL, SSMODULENAME, SETTING_DLGTIMEOUT, 5)); + ShowConfirmDialogEx((TProtoSettings*)&profileSettings, db_get_dw(NULL, SSMODULENAME, SETTING_DLGTIMEOUT, 5)); } // add timer here diff --git a/plugins/StatusManager/src/StartupStatus/startupstatus.cpp b/plugins/StatusManager/src/StartupStatus/startupstatus.cpp index ccfa0819a7..fb2b87ea0f 100644 --- a/plugins/StatusManager/src/StartupStatus/startupstatus.cpp +++ b/plugins/StatusManager/src/StartupStatus/startupstatus.cpp @@ -421,7 +421,7 @@ int SSModuleLoaded(WPARAM, LPARAM) // set the status! if (showDialogOnStartup || db_get_b(NULL, SSMODULENAME, SETTING_SHOWDIALOG, 0)) - CallService(MS_CS_SHOWCONFIRMDLGEX, (WPARAM)&startupSettings, db_get_dw(NULL, SSMODULENAME, SETTING_DLGTIMEOUT, 5)); + ShowConfirmDialogEx((TProtoSettings*)&startupSettings, db_get_dw(NULL, SSMODULENAME, SETTING_DLGTIMEOUT, 5)); else if (db_get_b(NULL, SSMODULENAME, SETTING_SETPROFILE, 1)) { // set hooks for override if (db_get_b(NULL, SSMODULENAME, SETTING_OVERRIDE, 1)) { diff --git a/plugins/StatusManager/src/commonstatus.cpp b/plugins/StatusManager/src/commonstatus.cpp index be3f778397..6869550b1a 100644 --- a/plugins/StatusManager/src/commonstatus.cpp +++ b/plugins/StatusManager/src/commonstatus.cpp @@ -33,9 +33,6 @@ INT_PTR SetStatusEx(WPARAM wParam, LPARAM lParam); int InitCommonStatus(); int GetProtoCount(); -// extern -extern INT_PTR ShowConfirmDialogEx(WPARAM wParam, LPARAM lParam); - // some helpers from awaymsg.c ================================================================ char *StatusModeToDbSetting(int status, const char *suffix) { @@ -284,7 +281,6 @@ static int CreateServices() hCSStatusChangedExEvent = CreateHookableEvent(ME_CS_STATUSCHANGEEX); CreateServiceFunction(MS_CS_SETSTATUSEX, SetStatusEx); - CreateServiceFunction(MS_CS_SHOWCONFIRMDLGEX, ShowConfirmDialogEx); CreateServiceFunction(MS_CS_GETPROTOCOUNT, GetProtocolCountService); return 0; } diff --git a/plugins/StatusManager/src/commonstatus.h b/plugins/StatusManager/src/commonstatus.h index 59a39708b6..438a4f6614 100644 --- a/plugins/StatusManager/src/commonstatus.h +++ b/plugins/StatusManager/src/commonstatus.h @@ -79,7 +79,11 @@ bool IsSuitableProto(PROTOACCOUNT *pa); // allways returns 1 #define MS_SA_ISSARUNNING "SimpleAway/IsSARunning" +typedef OBJLIST<PROTOCOLSETTINGEX> TProtoSettings; + extern HINSTANCE hInst; -extern OBJLIST<PROTOCOLSETTINGEX>* protoList; +extern TProtoSettings *protoList; + +HWND ShowConfirmDialogEx(TProtoSettings *params, int _timeout); #endif //COMMONSTATUSHEADER diff --git a/plugins/StatusManager/src/confirmdialog.cpp b/plugins/StatusManager/src/confirmdialog.cpp index 82225f2320..c3d093738b 100644 --- a/plugins/StatusManager/src/confirmdialog.cpp +++ b/plugins/StatusManager/src/confirmdialog.cpp @@ -206,6 +206,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP else SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_SETCURSEL, defaultProfile, 0); } + // start timer if (timeOut > 0) { wchar_t text[32]; @@ -400,19 +401,15 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP return 0; } -INT_PTR ShowConfirmDialogEx(WPARAM wParam, LPARAM lParam) +HWND ShowConfirmDialogEx(OBJLIST<PROTOCOLSETTINGEX> *params, int _timeout) { - if (wParam == 0) - return -1; - delete confirmSettings; confirmSettings = new OBJLIST<TConfirmSetting>(10, CompareSettings); - OBJLIST<PROTOCOLSETTINGEX>& param = *(OBJLIST<PROTOCOLSETTINGEX>*)wParam; - for (int i = 0; i < param.getCount(); i++) - confirmSettings->insert(new TConfirmSetting(param[i])); + for (int i = 0; i < params->getCount(); i++) + confirmSettings->insert(new TConfirmSetting((*params)[i])); - timeOut = lParam; + timeOut = _timeout; if (timeOut < 0) timeOut = DEF_CLOSE_TIME; @@ -421,5 +418,5 @@ INT_PTR ShowConfirmDialogEx(WPARAM wParam, LPARAM lParam) EnableWindow(win, TRUE); } - return (INT_PTR)win; + return win; } |