From 3848407a857f905a5d67d913a8d789554b662704 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 22 Oct 2016 19:56:37 +0300 Subject: - warning fixes; - resource optimization --- plugins/StatusManager/res/StartupStatus.rc | 70 -------------------------- plugins/StatusManager/res/resource.rc | 7 +++ plugins/StatusManager/src/aaa_options.cpp | 54 ++++++++++---------- plugins/StatusManager/src/advancedautoaway.cpp | 8 +-- plugins/StatusManager/src/commonstatus.h | 2 - plugins/StatusManager/src/stdafx.cxx | 2 +- 6 files changed, 39 insertions(+), 104 deletions(-) delete mode 100644 plugins/StatusManager/res/StartupStatus.rc diff --git a/plugins/StatusManager/res/StartupStatus.rc b/plugins/StatusManager/res/StartupStatus.rc deleted file mode 100644 index 8cbed066dc..0000000000 --- a/plugins/StatusManager/res/StartupStatus.rc +++ /dev/null @@ -1,70 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "..\src\resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "..\\src\\resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDI_TTBDOWN ICON "res\\ttbDown.ico" -IDI_TTBUP ICON "res\\ttbUp.ico" - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED diff --git a/plugins/StatusManager/res/resource.rc b/plugins/StatusManager/res/resource.rc index 873c8cf182..730ac2a883 100644 --- a/plugins/StatusManager/res/resource.rc +++ b/plugins/StatusManager/res/resource.rc @@ -44,6 +44,13 @@ END #endif // APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDI_TTBDOWN ICON "res\\ttbDown.ico" +IDI_TTBUP ICON "res\\ttbUp.ico" ///////////////////////////////////////////////////////////////////////////// // diff --git a/plugins/StatusManager/src/aaa_options.cpp b/plugins/StatusManager/src/aaa_options.cpp index 88c02a1d1f..2b519b2d6a 100644 --- a/plugins/StatusManager/src/aaa_options.cpp +++ b/plugins/StatusManager/src/aaa_options.cpp @@ -200,7 +200,7 @@ static INT_PTR CALLBACK DlgProcAutoAwayRulesOpts(HWND hwndDlg, UINT msg, WPARAM // clear box and add new status, loop status and check if compatible with proto SendDlgItemMessage(hwndDlg, IDC_LV1STATUS, CB_RESETCONTENT, 0, 0); SendDlgItemMessage(hwndDlg, IDC_LV2STATUS, CB_RESETCONTENT, 0, 0); - for (int i=0; i < _countof(statusModeList); i++) { + for (int i = 0; i < _countof(statusModeList); i++) { if ((flags & statusModePf2List[i]) || statusModePf2List[i] == PF2_OFFLINE || bSettingSame) { wchar_t *statusMode = pcli->pfnGetStatusModeDescription(statusModeList[i], 0); int item = SendDlgItemMessage(hwndDlg, IDC_LV1STATUS, CB_ADDSTRING, 0, (LPARAM)statusMode); @@ -221,7 +221,7 @@ static INT_PTR CALLBACK DlgProcAutoAwayRulesOpts(HWND hwndDlg, UINT msg, WPARAM case IDC_LV1STATUS: if (HIWORD(wParam) == CBN_SELCHANGE) - SendMessage(GetParent(hwndDlg),PSM_CHANGED,0,0); + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); setting->lv1Status = (int)SendDlgItemMessage(hwndDlg, IDC_LV1STATUS, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_LV1STATUS, CB_GETCURSEL, 0, 0), 0); SetDlgItemText(hwndDlg, IDC_SETNASTR, CMStringW(FORMAT, TranslateT("minutes of %s mode"), pcli->pfnGetStatusModeDescription(setting->lv1Status, 0))); @@ -229,7 +229,7 @@ static INT_PTR CALLBACK DlgProcAutoAwayRulesOpts(HWND hwndDlg, UINT msg, WPARAM case IDC_LV2STATUS: if (HIWORD(wParam) == CBN_SELCHANGE) - SendMessage(GetParent(hwndDlg),PSM_CHANGED,0,0); + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); setting->lv2Status = (int)SendDlgItemMessage(hwndDlg, IDC_LV2STATUS, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_LV2STATUS, CB_GETCURSEL, 0, 0), 0); break; @@ -260,30 +260,30 @@ static INT_PTR CALLBACK DlgProcAutoAwayRulesOpts(HWND hwndDlg, UINT msg, WPARAM break; case IDC_AWAYTIME: - setting->awayTime = GetDlgItemInt(hwndDlg,IDC_AWAYTIME, NULL, FALSE); + setting->awayTime = GetDlgItemInt(hwndDlg, IDC_AWAYTIME, NULL, FALSE); break; case IDC_NATIME: - setting->naTime = GetDlgItemInt(hwndDlg,IDC_NATIME, NULL, FALSE); + setting->naTime = GetDlgItemInt(hwndDlg, IDC_NATIME, NULL, FALSE); break; case IDC_LV2ONINACTIVE: - setting->optionFlags^=FLAG_LV2ONINACTIVE; + setting->optionFlags ^= FLAG_LV2ONINACTIVE; SetDialogItems(hwndDlg, setting); break; case IDC_CONFIRM: - setting->optionFlags^=FLAG_CONFIRM; + setting->optionFlags ^= FLAG_CONFIRM; SetDialogItems(hwndDlg, setting); break; case IDC_RESETSTATUS: - setting->optionFlags^=FLAG_RESET; + setting->optionFlags ^= FLAG_RESET; SetDialogItems(hwndDlg, setting); break; case IDC_MONITORMIRANDA: - setting->optionFlags^=FLAG_MONITORMIRANDA; + setting->optionFlags ^= FLAG_MONITORMIRANDA; SetDialogItems(hwndDlg, setting); break; } @@ -300,12 +300,12 @@ static INT_PTR CALLBACK DlgProcAutoAwayRulesOpts(HWND hwndDlg, UINT msg, WPARAM break; case WM_NOTIFY: - switch(((NMHDR*)lParam)->idFrom) { + switch (((NMHDR*)lParam)->idFrom) { case IDC_STATUSLIST: if (init) break; - switch(((NMHDR*)lParam)->code) { + switch (((NMHDR*)lParam)->code) { case LVN_ITEMCHANGED: NMLISTVIEW *nmlv = (NMLISTVIEW*)lParam; if (IsWindowVisible(GetDlgItem(hwndDlg, IDC_STATUSLIST)) && ((nmlv->uNewState ^ nmlv->uOldState) & LVIS_STATEIMAGEMASK)) { @@ -334,7 +334,7 @@ static INT_PTR CALLBACK DlgProcAutoAwayRulesOpts(HWND hwndDlg, UINT msg, WPARAM if (bSettingSame) WriteAutoAwaySetting(*sameSetting, SETTING_ALL); else { - for (int i=0; i < optionSettings.getCount(); i++ ) + for (int i = 0; i < optionSettings.getCount(); i++) WriteAutoAwaySetting(optionSettings[i], optionSettings[i].szName); } LoadOptions(autoAwaySettings, FALSE); @@ -371,18 +371,18 @@ static INT_PTR CALLBACK DlgProcAutoAwayGeneralOpts(HWND hwndDlg, UINT msg, WPARA case WM_SHOWWINDOW: ShowWindow(GetDlgItem(hwndDlg, IDC_IDLEWARNING), (db_get_b(NULL, "Idle", "AAEnable", 0))); break; - + case WM_COMMAND: - if (( HIWORD(wParam) == EN_CHANGE || HIWORD(wParam) == BN_CLICKED ) && (HWND)lParam == GetFocus()) + if ((HIWORD(wParam) == EN_CHANGE || HIWORD(wParam) == BN_CLICKED) && (HWND)lParam == GetFocus()) SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - switch(LOWORD(wParam)) { + switch (LOWORD(wParam)) { case IDC_MONITORMOUSE: - CheckDlgButton(hwndDlg, IDC_MONITORMOUSE, (((BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_MONITORMOUSE))&&(BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_MONITORKEYBOARD)))||(IsDlgButtonChecked(hwndDlg, IDC_MONITORMOUSE)) ? BST_CHECKED : BST_UNCHECKED)); + CheckDlgButton(hwndDlg, IDC_MONITORMOUSE, (((BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_MONITORMOUSE)) && (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_MONITORKEYBOARD))) || (IsDlgButtonChecked(hwndDlg, IDC_MONITORMOUSE)) ? BST_CHECKED : BST_UNCHECKED)); break; case IDC_MONITORKEYBOARD: - CheckDlgButton(hwndDlg, IDC_MONITORKEYBOARD, (((BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_MONITORMOUSE))&&(BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_MONITORKEYBOARD)))||(IsDlgButtonChecked(hwndDlg, IDC_MONITORKEYBOARD)) ? BST_CHECKED : BST_UNCHECKED)); + CheckDlgButton(hwndDlg, IDC_MONITORKEYBOARD, (((BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_MONITORMOUSE)) && (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_MONITORKEYBOARD))) || (IsDlgButtonChecked(hwndDlg, IDC_MONITORKEYBOARD)) ? BST_CHECKED : BST_UNCHECKED)); break; case IDC_SAMESETTINGS: @@ -393,7 +393,7 @@ static INT_PTR CALLBACK DlgProcAutoAwayGeneralOpts(HWND hwndDlg, UINT msg, WPARA break; case WM_NOTIFY: - if (((LPNMHDR)lParam)->code == PSN_APPLY ) { + if (((LPNMHDR)lParam)->code == PSN_APPLY) { db_set_b(NULL, AAAMODULENAME, SETTING_IGNLOCK, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNLOCK)); db_set_b(NULL, AAAMODULENAME, SETTING_IGNSYSKEYS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNSYSKEYS)); db_set_b(NULL, AAAMODULENAME, SETTING_IGNALTCOMBO, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNALTCOMBO)); @@ -412,9 +412,9 @@ static INT_PTR CALLBACK DlgProcAutoAwayGeneralOpts(HWND hwndDlg, UINT msg, WPARA ///////////////////////////////////////////////////////////////////////////////////////// // Tab window procedure -static INT_PTR CALLBACK DlgProcAutoAwayTabs(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +static INT_PTR CALLBACK DlgProcAutoAwayTabs(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam) { - switch(msg) { + switch (msg) { case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); { @@ -436,36 +436,36 @@ static INT_PTR CALLBACK DlgProcAutoAwayTabs(HWND hwndDlg, UINT msg, WPARAM wPara tci.lParam = (LPARAM)hPage; GetClientRect(hPage, &rcPage); - MoveWindow(hPage, (rcTabs.left - rcOptions.left) + ((rcTabs.right-rcTabs.left)-(rcPage.right-rcPage.left))/2, 10 + (rcTabs.top - rcOptions.top) + ((rcTabs.bottom-rcTabs.top)-(rcPage.bottom-rcPage.top))/2, rcPage.right-rcPage.left, rcPage.bottom-rcPage.top, TRUE); + MoveWindow(hPage, (rcTabs.left - rcOptions.left) + ((rcTabs.right - rcTabs.left) - (rcPage.right - rcPage.left)) / 2, 10 + (rcTabs.top - rcOptions.top) + ((rcTabs.bottom - rcTabs.top) - (rcPage.bottom - rcPage.top)) / 2, rcPage.right - rcPage.left, rcPage.bottom - rcPage.top, TRUE); ShowWindow(hPage, SW_HIDE); TabCtrl_InsertItem(hTab, tabCount++, &tci); HWND hShow = hPage; // rules tab - tci.mask = TCIF_TEXT|TCIF_PARAM; + tci.mask = TCIF_TEXT | TCIF_PARAM; tci.pszText = TranslateT("Rules"); hPage = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_OPT_AUTOAWAY), hwndDlg, DlgProcAutoAwayRulesOpts, (LPARAM)GetParent(hwndDlg)); EnableThemeDialogTexture(hPage, ETDT_ENABLETAB); tci.lParam = (LPARAM)hPage; GetClientRect(hPage, &rcPage); - MoveWindow(hPage, (rcTabs.left - rcOptions.left) + ((rcTabs.right-rcTabs.left)-(rcPage.right-rcPage.left))/2, 10 + (rcTabs.top - rcOptions.top) + ((rcTabs.bottom-rcTabs.top)-(rcPage.bottom-rcPage.top))/2, rcPage.right-rcPage.left, rcPage.bottom-rcPage.top, TRUE); + MoveWindow(hPage, (rcTabs.left - rcOptions.left) + ((rcTabs.right - rcTabs.left) - (rcPage.right - rcPage.left)) / 2, 10 + (rcTabs.top - rcOptions.top) + ((rcTabs.bottom - rcTabs.top) - (rcPage.bottom - rcPage.top)) / 2, rcPage.right - rcPage.left, rcPage.bottom - rcPage.top, TRUE); ShowWindow(hPage, SW_HIDE); TabCtrl_InsertItem(hTab, tabCount++, &tci); // messages tab - tci.mask = TCIF_TEXT|TCIF_PARAM; + tci.mask = TCIF_TEXT | TCIF_PARAM; tci.pszText = TranslateT("Status messages"); hPage = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_OPT_AUTOAWAYMSG), hwndDlg, DlgProcAutoAwayMsgOpts, (LPARAM)GetParent(hwndDlg)); EnableThemeDialogTexture(hPage, ETDT_ENABLETAB); tci.lParam = (LPARAM)hPage; GetClientRect(hPage, &rcPage); - MoveWindow(hPage, (rcTabs.left - rcOptions.left) + ((rcTabs.right-rcTabs.left)-(rcPage.right-rcPage.left))/2, 10 + (rcTabs.top - rcOptions.top) + ((rcTabs.bottom-rcTabs.top)-(rcPage.bottom-rcPage.top))/2, rcPage.right-rcPage.left, rcPage.bottom-rcPage.top, TRUE); + MoveWindow(hPage, (rcTabs.left - rcOptions.left) + ((rcTabs.right - rcTabs.left) - (rcPage.right - rcPage.left)) / 2, 10 + (rcTabs.top - rcOptions.top) + ((rcTabs.bottom - rcTabs.top) - (rcPage.bottom - rcPage.top)) / 2, rcPage.right - rcPage.left, rcPage.bottom - rcPage.top, TRUE); ShowWindow(hPage, SW_HIDE); TabCtrl_InsertItem(hTab, tabCount++, &tci); - ShowWindow(hShow, SW_SHOW); + ShowWindow(hShow, SW_SHOW); } break; @@ -508,7 +508,7 @@ static INT_PTR CALLBACK DlgProcAutoAwayTabs(HWND hwndDlg, UINT msg, WPARAM wPara ///////////////////////////////////////////////////////////////////////////////////////// // Options initialization procedure -int AutoAwayOptInitialise(WPARAM wParam,LPARAM lParam) +int AutoAwayOptInitialise(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = { 0 }; odp.position = 1000000000; diff --git a/plugins/StatusManager/src/advancedautoaway.cpp b/plugins/StatusManager/src/advancedautoaway.cpp index 3c4e58efd4..7f09466bd2 100644 --- a/plugins/StatusManager/src/advancedautoaway.cpp +++ b/plugins/StatusManager/src/advancedautoaway.cpp @@ -160,7 +160,7 @@ int LoadAutoAwaySetting(TAAAProtoSetting &autoAwaySetting, char* protoName) return 0; } -static int ProcessProtoAck(WPARAM wParam, LPARAM lParam) +static int ProcessProtoAck(WPARAM, LPARAM lParam) { ACKDATA *ack = (ACKDATA*)lParam; if (ack->type != ACKTYPE_STATUS || ack->result != ACKRESULT_SUCCESS) @@ -252,7 +252,7 @@ static int changeState(TAAAProtoSetting &setting, STATES newState) return 0; } -static VOID CALLBACK AutoAwayTimer(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime) +static VOID CALLBACK AutoAwayTimer(HWND, UINT, UINT_PTR, DWORD) { int statusChanged = FALSE; int confirm = FALSE; @@ -548,7 +548,7 @@ static LRESULT CALLBACK KeyBoardHookFunction(int code, WPARAM wParam, LPARAM lPa ///////////////////////////////////////////////////////////////////////////////////////// // Inits & stuff -static int AutoAwayShutdown(WPARAM wParam, LPARAM lParam) +static int AutoAwayShutdown(WPARAM, LPARAM) { KillTimer(NULL, hAutoAwayTimer); @@ -562,7 +562,7 @@ static int AutoAwayShutdown(WPARAM wParam, LPARAM lParam) return 0; } -int AAACSModuleLoaded(WPARAM wParam, LPARAM lParam) +int AAACSModuleLoaded(WPARAM, LPARAM) { HookEvent(ME_PROTO_ACCLISTCHANGED, OnAAAAccChanged); HookEvent(ME_OPT_INITIALISE, AutoAwayOptInitialise); diff --git a/plugins/StatusManager/src/commonstatus.h b/plugins/StatusManager/src/commonstatus.h index 352b9f1f93..45e23ef2b6 100644 --- a/plugins/StatusManager/src/commonstatus.h +++ b/plugins/StatusManager/src/commonstatus.h @@ -22,8 +22,6 @@ #ifndef COMMONSTATUSHEADER #define COMMONSTATUSHEADER -#define _CRT_SECURE_NO_WARNINGS - #include #include #include diff --git a/plugins/StatusManager/src/stdafx.cxx b/plugins/StatusManager/src/stdafx.cxx index 3968e037fa..3034680058 100644 --- a/plugins/StatusManager/src/stdafx.cxx +++ b/plugins/StatusManager/src/stdafx.cxx @@ -15,4 +15,4 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "stdafx.h" \ No newline at end of file +#include "stdafx.h" -- cgit v1.2.3 From 49d5538a982dde9d9a28c69b127f9058d5a16e58 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 22 Oct 2016 20:05:23 +0300 Subject: fix for a typo --- plugins/StatusManager/StatusManager.vcxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/StatusManager/StatusManager.vcxproj b/plugins/StatusManager/StatusManager.vcxproj index ce24ad8420..8fb9c5748d 100644 --- a/plugins/StatusManager/StatusManager.vcxproj +++ b/plugins/StatusManager/StatusManager.vcxproj @@ -20,7 +20,7 @@ {D2EF305F-5255-49E8-A738-D4206D62D2B8} - SatatusManager + StatusManager @@ -39,4 +39,4 @@ Sync - + \ No newline at end of file -- cgit v1.2.3 From 1778d952619d9a97e07ddd84d4c814bd84bae043 Mon Sep 17 00:00:00 2001 From: aunsane Date: Sat, 22 Oct 2016 21:21:51 +0300 Subject: Dropbox: deprecated method replaced with new one --- plugins/Dropbox/src/api/upload.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Dropbox/src/api/upload.h b/plugins/Dropbox/src/api/upload.h index 7e1c501297..098d53e2d2 100644 --- a/plugins/Dropbox/src/api/upload.h +++ b/plugins/Dropbox/src/api/upload.h @@ -38,7 +38,7 @@ class AppendToUploadSessionRequest : public HttpRequest { public: AppendToUploadSessionRequest(const char *token, const char *sessionId, size_t offset, const char *data, size_t size) : - HttpRequest(REQUEST_POST, DROPBOX_API_CU "/files/upload_session/append") + HttpRequest(REQUEST_POST, DROPBOX_API_CU "/files/upload_session/append_v2") { AddBearerAuthHeader(token); AddHeader("Content-Type", "application/octet-stream"); -- cgit v1.2.3 From 0bc507b918370e559309958c5347985777558a10 Mon Sep 17 00:00:00 2001 From: watcher Date: Sat, 22 Oct 2016 21:29:22 +0300 Subject: Status Plugins are merged as StatusManager --- bin10/mir_dev.sln | 40 +- bin10/mir_full.sln | 44 +- bin10/mir_full_pro.sln | 47 +- bin12/mir_dev.sln | 44 +- bin12/mir_full.sln | 44 +- bin14/mir_dev.sln | 46 +- bin14/mir_full.sln | 46 +- plugins/PluginUpdater/src/DlgUpdate.cpp | 3 + .../AdvancedAutoAway/AdvancedAutoAway_10.vcxproj | 248 ---- .../AdvancedAutoAway_10.vcxproj.filters | 67 -- .../AdvancedAutoAway/AdvancedAutoAway_12.vcxproj | 251 ---- .../AdvancedAutoAway_12.vcxproj.filters | 67 -- .../AdvancedAutoAway/AdvancedAutoAway_14.vcxproj | 251 ---- .../AdvancedAutoAway_14.vcxproj.filters | 67 -- .../AdvancedAutoAway/advancedautoaway.cpp | 593 ---------- .../AdvancedAutoAway/advancedautoaway.h | 93 -- plugins/StatusPlugins/AdvancedAutoAway/fsm.jpg | Bin 62997 -> 0 bytes plugins/StatusPlugins/AdvancedAutoAway/main.cpp | 93 -- .../StatusPlugins/AdvancedAutoAway/msgoptions.cpp | 180 --- plugins/StatusPlugins/AdvancedAutoAway/options.cpp | 526 --------- plugins/StatusPlugins/AdvancedAutoAway/version.h | 17 - plugins/StatusPlugins/KeepStatus/KeepStatus.txt | 145 --- .../StatusPlugins/KeepStatus/KeepStatus_10.vcxproj | 226 ---- .../KeepStatus/KeepStatus_10.vcxproj.filters | 59 - .../StatusPlugins/KeepStatus/KeepStatus_12.vcxproj | 229 ---- .../KeepStatus/KeepStatus_12.vcxproj.filters | 59 - .../StatusPlugins/KeepStatus/KeepStatus_14.vcxproj | 229 ---- .../KeepStatus/KeepStatus_14.vcxproj.filters | 59 - plugins/StatusPlugins/KeepStatus/keepstatus.cpp | 1209 -------------------- plugins/StatusPlugins/KeepStatus/keepstatus.h | 139 --- plugins/StatusPlugins/KeepStatus/main.cpp | 116 -- plugins/StatusPlugins/KeepStatus/options.cpp | 591 ---------- plugins/StatusPlugins/KeepStatus/version.h | 17 - .../StatusPlugins/StartupStatus/StartupStatus.rc | 70 -- .../StartupStatus/StartupStatus_10.vcxproj | 228 ---- .../StartupStatus/StartupStatus_10.vcxproj.filters | 68 -- .../StartupStatus/StartupStatus_12.vcxproj | 231 ---- .../StartupStatus/StartupStatus_12.vcxproj.filters | 68 -- .../StartupStatus/StartupStatus_14.vcxproj | 231 ---- .../StartupStatus/StartupStatus_14.vcxproj.filters | 68 -- plugins/StatusPlugins/StartupStatus/main.cpp | 116 -- plugins/StatusPlugins/StartupStatus/options.cpp | 932 --------------- plugins/StatusPlugins/StartupStatus/profiles.cpp | 348 ------ .../StatusPlugins/StartupStatus/res/ttbDown.ico | Bin 1150 -> 0 bytes plugins/StatusPlugins/StartupStatus/res/ttbUp.ico | Bin 1150 -> 0 bytes .../StatusPlugins/StartupStatus/startupstatus.cpp | 487 -------- .../StatusPlugins/StartupStatus/startupstatus.h | 161 --- plugins/StatusPlugins/StartupStatus/toolbars.cpp | 77 -- plugins/StatusPlugins/StartupStatus/version.h | 23 - plugins/StatusPlugins/commonstatus.cpp | 328 ------ plugins/StatusPlugins/commonstatus.h | 88 -- plugins/StatusPlugins/confirmdialog.cpp | 426 ------- plugins/StatusPlugins/copying.txt | 346 ------ plugins/StatusPlugins/notick.ico | Bin 1150 -> 0 bytes plugins/StatusPlugins/notick1.ico | Bin 1150 -> 0 bytes plugins/StatusPlugins/resource.h | 168 --- plugins/StatusPlugins/resource.rc | 409 ------- plugins/StatusPlugins/stdafx.cpp | 18 - plugins/StatusPlugins/useronli.ico | Bin 1150 -> 0 bytes plugins/StatusPlugins/version.rc | 43 - .../AdvancedAutoAway/AdvancedAutoAway_10.vcxproj | 248 ++++ .../AdvancedAutoAway_10.vcxproj.filters | 67 ++ .../AdvancedAutoAway/AdvancedAutoAway_12.vcxproj | 251 ++++ .../AdvancedAutoAway_12.vcxproj.filters | 67 ++ .../AdvancedAutoAway/AdvancedAutoAway_14.vcxproj | 251 ++++ .../AdvancedAutoAway_14.vcxproj.filters | 67 ++ .../AdvancedAutoAway/advancedautoaway.cpp | 593 ++++++++++ .../AdvancedAutoAway/advancedautoaway.h | 93 ++ .../StatusPlugins/AdvancedAutoAway/fsm.jpg | Bin 0 -> 62997 bytes .../StatusPlugins/AdvancedAutoAway/main.cpp | 93 ++ .../StatusPlugins/AdvancedAutoAway/msgoptions.cpp | 180 +++ .../StatusPlugins/AdvancedAutoAway/options.cpp | 526 +++++++++ .../StatusPlugins/AdvancedAutoAway/version.h | 17 + .../StatusPlugins/KeepStatus/KeepStatus.txt | 145 +++ .../StatusPlugins/KeepStatus/KeepStatus_10.vcxproj | 226 ++++ .../KeepStatus/KeepStatus_10.vcxproj.filters | 59 + .../StatusPlugins/KeepStatus/KeepStatus_12.vcxproj | 229 ++++ .../KeepStatus/KeepStatus_12.vcxproj.filters | 59 + .../StatusPlugins/KeepStatus/KeepStatus_14.vcxproj | 229 ++++ .../KeepStatus/KeepStatus_14.vcxproj.filters | 59 + .../StatusPlugins/KeepStatus/keepstatus.cpp | 1209 ++++++++++++++++++++ .../StatusPlugins/KeepStatus/keepstatus.h | 139 +++ .../_deprecated/StatusPlugins/KeepStatus/main.cpp | 116 ++ .../StatusPlugins/KeepStatus/options.cpp | 591 ++++++++++ .../_deprecated/StatusPlugins/KeepStatus/version.h | 17 + .../StatusPlugins/StartupStatus/StartupStatus.rc | 70 ++ .../StartupStatus/StartupStatus_10.vcxproj | 228 ++++ .../StartupStatus/StartupStatus_10.vcxproj.filters | 68 ++ .../StartupStatus/StartupStatus_12.vcxproj | 231 ++++ .../StartupStatus/StartupStatus_12.vcxproj.filters | 68 ++ .../StartupStatus/StartupStatus_14.vcxproj | 231 ++++ .../StartupStatus/StartupStatus_14.vcxproj.filters | 68 ++ .../StatusPlugins/StartupStatus/main.cpp | 116 ++ .../StatusPlugins/StartupStatus/options.cpp | 932 +++++++++++++++ .../StatusPlugins/StartupStatus/profiles.cpp | 348 ++++++ .../StatusPlugins/StartupStatus/res/ttbDown.ico | Bin 0 -> 1150 bytes .../StatusPlugins/StartupStatus/res/ttbUp.ico | Bin 0 -> 1150 bytes .../StatusPlugins/StartupStatus/startupstatus.cpp | 487 ++++++++ .../StatusPlugins/StartupStatus/startupstatus.h | 161 +++ .../StatusPlugins/StartupStatus/toolbars.cpp | 77 ++ .../StatusPlugins/StartupStatus/version.h | 23 + tools/_deprecated/StatusPlugins/commonstatus.cpp | 328 ++++++ tools/_deprecated/StatusPlugins/commonstatus.h | 88 ++ tools/_deprecated/StatusPlugins/confirmdialog.cpp | 426 +++++++ tools/_deprecated/StatusPlugins/copying.txt | 346 ++++++ tools/_deprecated/StatusPlugins/notick.ico | Bin 0 -> 1150 bytes tools/_deprecated/StatusPlugins/notick1.ico | Bin 0 -> 1150 bytes tools/_deprecated/StatusPlugins/resource.h | 168 +++ tools/_deprecated/StatusPlugins/resource.rc | 409 +++++++ tools/_deprecated/StatusPlugins/stdafx.cpp | 18 + tools/_deprecated/StatusPlugins/useronli.ico | Bin 0 -> 1150 bytes tools/_deprecated/StatusPlugins/version.rc | 43 + 112 files changed, 10552 insertions(+), 10692 deletions(-) delete mode 100644 plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj delete mode 100644 plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj.filters delete mode 100644 plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_12.vcxproj delete mode 100644 plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_12.vcxproj.filters delete mode 100644 plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_14.vcxproj delete mode 100644 plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_14.vcxproj.filters delete mode 100644 plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp delete mode 100644 plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.h delete mode 100644 plugins/StatusPlugins/AdvancedAutoAway/fsm.jpg delete mode 100644 plugins/StatusPlugins/AdvancedAutoAway/main.cpp delete mode 100644 plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp delete mode 100644 plugins/StatusPlugins/AdvancedAutoAway/options.cpp delete mode 100644 plugins/StatusPlugins/AdvancedAutoAway/version.h delete mode 100644 plugins/StatusPlugins/KeepStatus/KeepStatus.txt delete mode 100644 plugins/StatusPlugins/KeepStatus/KeepStatus_10.vcxproj delete mode 100644 plugins/StatusPlugins/KeepStatus/KeepStatus_10.vcxproj.filters delete mode 100644 plugins/StatusPlugins/KeepStatus/KeepStatus_12.vcxproj delete mode 100644 plugins/StatusPlugins/KeepStatus/KeepStatus_12.vcxproj.filters delete mode 100644 plugins/StatusPlugins/KeepStatus/KeepStatus_14.vcxproj delete mode 100644 plugins/StatusPlugins/KeepStatus/KeepStatus_14.vcxproj.filters delete mode 100644 plugins/StatusPlugins/KeepStatus/keepstatus.cpp delete mode 100644 plugins/StatusPlugins/KeepStatus/keepstatus.h delete mode 100644 plugins/StatusPlugins/KeepStatus/main.cpp delete mode 100644 plugins/StatusPlugins/KeepStatus/options.cpp delete mode 100644 plugins/StatusPlugins/KeepStatus/version.h delete mode 100644 plugins/StatusPlugins/StartupStatus/StartupStatus.rc delete mode 100644 plugins/StatusPlugins/StartupStatus/StartupStatus_10.vcxproj delete mode 100644 plugins/StatusPlugins/StartupStatus/StartupStatus_10.vcxproj.filters delete mode 100644 plugins/StatusPlugins/StartupStatus/StartupStatus_12.vcxproj delete mode 100644 plugins/StatusPlugins/StartupStatus/StartupStatus_12.vcxproj.filters delete mode 100644 plugins/StatusPlugins/StartupStatus/StartupStatus_14.vcxproj delete mode 100644 plugins/StatusPlugins/StartupStatus/StartupStatus_14.vcxproj.filters delete mode 100644 plugins/StatusPlugins/StartupStatus/main.cpp delete mode 100644 plugins/StatusPlugins/StartupStatus/options.cpp delete mode 100644 plugins/StatusPlugins/StartupStatus/profiles.cpp delete mode 100644 plugins/StatusPlugins/StartupStatus/res/ttbDown.ico delete mode 100644 plugins/StatusPlugins/StartupStatus/res/ttbUp.ico delete mode 100644 plugins/StatusPlugins/StartupStatus/startupstatus.cpp delete mode 100644 plugins/StatusPlugins/StartupStatus/startupstatus.h delete mode 100644 plugins/StatusPlugins/StartupStatus/toolbars.cpp delete mode 100644 plugins/StatusPlugins/StartupStatus/version.h delete mode 100644 plugins/StatusPlugins/commonstatus.cpp delete mode 100644 plugins/StatusPlugins/commonstatus.h delete mode 100644 plugins/StatusPlugins/confirmdialog.cpp delete mode 100644 plugins/StatusPlugins/copying.txt delete mode 100644 plugins/StatusPlugins/notick.ico delete mode 100644 plugins/StatusPlugins/notick1.ico delete mode 100644 plugins/StatusPlugins/resource.h delete mode 100644 plugins/StatusPlugins/resource.rc delete mode 100644 plugins/StatusPlugins/stdafx.cpp delete mode 100644 plugins/StatusPlugins/useronli.ico delete mode 100644 plugins/StatusPlugins/version.rc create mode 100644 tools/_deprecated/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj create mode 100644 tools/_deprecated/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj.filters create mode 100644 tools/_deprecated/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_12.vcxproj create mode 100644 tools/_deprecated/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_12.vcxproj.filters create mode 100644 tools/_deprecated/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_14.vcxproj create mode 100644 tools/_deprecated/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_14.vcxproj.filters create mode 100644 tools/_deprecated/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp create mode 100644 tools/_deprecated/StatusPlugins/AdvancedAutoAway/advancedautoaway.h create mode 100644 tools/_deprecated/StatusPlugins/AdvancedAutoAway/fsm.jpg create mode 100644 tools/_deprecated/StatusPlugins/AdvancedAutoAway/main.cpp create mode 100644 tools/_deprecated/StatusPlugins/AdvancedAutoAway/msgoptions.cpp create mode 100644 tools/_deprecated/StatusPlugins/AdvancedAutoAway/options.cpp create mode 100644 tools/_deprecated/StatusPlugins/AdvancedAutoAway/version.h create mode 100644 tools/_deprecated/StatusPlugins/KeepStatus/KeepStatus.txt create mode 100644 tools/_deprecated/StatusPlugins/KeepStatus/KeepStatus_10.vcxproj create mode 100644 tools/_deprecated/StatusPlugins/KeepStatus/KeepStatus_10.vcxproj.filters create mode 100644 tools/_deprecated/StatusPlugins/KeepStatus/KeepStatus_12.vcxproj create mode 100644 tools/_deprecated/StatusPlugins/KeepStatus/KeepStatus_12.vcxproj.filters create mode 100644 tools/_deprecated/StatusPlugins/KeepStatus/KeepStatus_14.vcxproj create mode 100644 tools/_deprecated/StatusPlugins/KeepStatus/KeepStatus_14.vcxproj.filters create mode 100644 tools/_deprecated/StatusPlugins/KeepStatus/keepstatus.cpp create mode 100644 tools/_deprecated/StatusPlugins/KeepStatus/keepstatus.h create mode 100644 tools/_deprecated/StatusPlugins/KeepStatus/main.cpp create mode 100644 tools/_deprecated/StatusPlugins/KeepStatus/options.cpp create mode 100644 tools/_deprecated/StatusPlugins/KeepStatus/version.h create mode 100644 tools/_deprecated/StatusPlugins/StartupStatus/StartupStatus.rc create mode 100644 tools/_deprecated/StatusPlugins/StartupStatus/StartupStatus_10.vcxproj create mode 100644 tools/_deprecated/StatusPlugins/StartupStatus/StartupStatus_10.vcxproj.filters create mode 100644 tools/_deprecated/StatusPlugins/StartupStatus/StartupStatus_12.vcxproj create mode 100644 tools/_deprecated/StatusPlugins/StartupStatus/StartupStatus_12.vcxproj.filters create mode 100644 tools/_deprecated/StatusPlugins/StartupStatus/StartupStatus_14.vcxproj create mode 100644 tools/_deprecated/StatusPlugins/StartupStatus/StartupStatus_14.vcxproj.filters create mode 100644 tools/_deprecated/StatusPlugins/StartupStatus/main.cpp create mode 100644 tools/_deprecated/StatusPlugins/StartupStatus/options.cpp create mode 100644 tools/_deprecated/StatusPlugins/StartupStatus/profiles.cpp create mode 100644 tools/_deprecated/StatusPlugins/StartupStatus/res/ttbDown.ico create mode 100644 tools/_deprecated/StatusPlugins/StartupStatus/res/ttbUp.ico create mode 100644 tools/_deprecated/StatusPlugins/StartupStatus/startupstatus.cpp create mode 100644 tools/_deprecated/StatusPlugins/StartupStatus/startupstatus.h create mode 100644 tools/_deprecated/StatusPlugins/StartupStatus/toolbars.cpp create mode 100644 tools/_deprecated/StatusPlugins/StartupStatus/version.h create mode 100644 tools/_deprecated/StatusPlugins/commonstatus.cpp create mode 100644 tools/_deprecated/StatusPlugins/commonstatus.h create mode 100644 tools/_deprecated/StatusPlugins/confirmdialog.cpp create mode 100644 tools/_deprecated/StatusPlugins/copying.txt create mode 100644 tools/_deprecated/StatusPlugins/notick.ico create mode 100644 tools/_deprecated/StatusPlugins/notick1.ico create mode 100644 tools/_deprecated/StatusPlugins/resource.h create mode 100644 tools/_deprecated/StatusPlugins/resource.rc create mode 100644 tools/_deprecated/StatusPlugins/stdafx.cpp create mode 100644 tools/_deprecated/StatusPlugins/useronli.ico create mode 100644 tools/_deprecated/StatusPlugins/version.rc diff --git a/bin10/mir_dev.sln b/bin10/mir_dev.sln index 725e7935cb..a798819c6a 100644 --- a/bin10/mir_dev.sln +++ b/bin10/mir_dev.sln @@ -104,12 +104,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SmileyAdd", "..\plugins\Smi EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SplashScreen", "..\plugins\SplashScreen\splashscreen.vcxproj", "{5A6095F4-B037-4DA8-8410-8004A90C961A}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AdvancedAutoAway", "..\plugins\StatusPlugins\AdvancedAutoAway\AdvancedAutoAway_10.vcxproj", "{66503A70-B1E8-4545-B4FF-2108DFB40C72}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KeepStatus", "..\plugins\StatusPlugins\KeepStatus\KeepStatus_10.vcxproj", "{D548A54E-310B-4A86-A545-64BDD5748745}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StartupStatus", "..\plugins\StatusPlugins\StartupStatus\StartupStatus_10.vcxproj", "{1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StopSpam", "..\plugins\StopSpamPlus\stopspam.vcxproj", "{3E6CEC79-5E93-4607-B10E-498586ECF6A6}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tipper", "..\plugins\TipperYM\tipper_ym.vcxproj", "{2C818919-A38F-44FF-BD91-A6A204AC592A}" @@ -445,6 +439,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "m_msg_buttonsbar", "..\plug EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libevent", "..\libs\libevent\libevent.vcxproj", "{46D53888-E60E-32A7-91EB-6336DE0D84D8}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StatusManager", "..\plugins\StatusManager\StatusManager.vcxproj", "{D2EF305F-5255-49E8-A738-D4206D62D2B8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -853,30 +849,6 @@ Global {5A6095F4-B037-4DA8-8410-8004A90C961A}.Release|Win32.Build.0 = Release|Win32 {5A6095F4-B037-4DA8-8410-8004A90C961A}.Release|x64.ActiveCfg = Release|x64 {5A6095F4-B037-4DA8-8410-8004A90C961A}.Release|x64.Build.0 = Release|x64 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Debug|Win32.ActiveCfg = Debug|Win32 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Debug|Win32.Build.0 = Debug|Win32 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Debug|x64.ActiveCfg = Debug|x64 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Debug|x64.Build.0 = Debug|x64 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Release|Win32.ActiveCfg = Release|Win32 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Release|Win32.Build.0 = Release|Win32 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Release|x64.ActiveCfg = Release|x64 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Release|x64.Build.0 = Release|x64 - {D548A54E-310B-4A86-A545-64BDD5748745}.Debug|Win32.ActiveCfg = Debug|Win32 - {D548A54E-310B-4A86-A545-64BDD5748745}.Debug|Win32.Build.0 = Debug|Win32 - {D548A54E-310B-4A86-A545-64BDD5748745}.Debug|x64.ActiveCfg = Debug|x64 - {D548A54E-310B-4A86-A545-64BDD5748745}.Debug|x64.Build.0 = Debug|x64 - {D548A54E-310B-4A86-A545-64BDD5748745}.Release|Win32.ActiveCfg = Release|Win32 - {D548A54E-310B-4A86-A545-64BDD5748745}.Release|Win32.Build.0 = Release|Win32 - {D548A54E-310B-4A86-A545-64BDD5748745}.Release|x64.ActiveCfg = Release|x64 - {D548A54E-310B-4A86-A545-64BDD5748745}.Release|x64.Build.0 = Release|x64 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Debug|Win32.ActiveCfg = Debug|Win32 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Debug|Win32.Build.0 = Debug|Win32 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Debug|x64.ActiveCfg = Debug|x64 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Debug|x64.Build.0 = Debug|x64 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Release|Win32.ActiveCfg = Release|Win32 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Release|Win32.Build.0 = Release|Win32 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Release|x64.ActiveCfg = Release|x64 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Release|x64.Build.0 = Release|x64 {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Debug|Win32.ActiveCfg = Debug|Win32 {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Debug|Win32.Build.0 = Debug|Win32 {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Debug|x64.ActiveCfg = Debug|x64 @@ -2036,6 +2008,14 @@ Global {46D53888-E60E-32A7-91EB-6336DE0D84D8}.Release|Win32.Build.0 = Release|Win32 {46D53888-E60E-32A7-91EB-6336DE0D84D8}.Release|x64.ActiveCfg = Release|x64 {46D53888-E60E-32A7-91EB-6336DE0D84D8}.Release|x64.Build.0 = Release|x64 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Debug|Win32.ActiveCfg = Debug|Win32 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Debug|Win32.Build.0 = Debug|Win32 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Debug|x64.ActiveCfg = Debug|x64 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Debug|x64.Build.0 = Debug|x64 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Release|Win32.ActiveCfg = Release|Win32 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Release|Win32.Build.0 = Release|Win32 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Release|x64.ActiveCfg = Release|x64 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/bin10/mir_full.sln b/bin10/mir_full.sln index 85b0f2dda1..11156a43b5 100644 --- a/bin10/mir_full.sln +++ b/bin10/mir_full.sln @@ -1,5 +1,5 @@ Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual C++ Express 2010 +# Visual Studio 2010 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Miranda", "..\src\miranda32\miranda32.vcxproj", "{F9916510-9055-4C9F-997A-3755DEC1511B}" ProjectSection(ProjectDependencies) = postProject {538E451F-E667-4D07-BCE6-976ECC7BB8D1} = {538E451F-E667-4D07-BCE6-976ECC7BB8D1} @@ -104,12 +104,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SmileyAdd", "..\plugins\Smi EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SplashScreen", "..\plugins\SplashScreen\splashscreen.vcxproj", "{5A6095F4-B037-4DA8-8410-8004A90C961A}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AdvancedAutoAway", "..\plugins\StatusPlugins\AdvancedAutoAway\AdvancedAutoAway_10.vcxproj", "{66503A70-B1E8-4545-B4FF-2108DFB40C72}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KeepStatus", "..\plugins\StatusPlugins\KeepStatus\KeepStatus_10.vcxproj", "{D548A54E-310B-4A86-A545-64BDD5748745}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StartupStatus", "..\plugins\StatusPlugins\StartupStatus\StartupStatus_10.vcxproj", "{1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StopSpam", "..\plugins\StopSpamPlus\stopspam.vcxproj", "{3E6CEC79-5E93-4607-B10E-498586ECF6A6}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tipper", "..\plugins\TipperYM\tipper_ym.vcxproj", "{2C818919-A38F-44FF-BD91-A6A204AC592A}" @@ -427,7 +421,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblua", "..\libs\liblua\li EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winapi", "..\plugins\MirLua\Modules\WinAPI\WinAPI.vcxproj", "{045BAC91-34D1-4B43-B52B-566801BE7F85}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "json", "..\plugins\MirLua\Modules\m_json\m_json.vcxproj", "{8A645067-7F45-4E65-AAFC-AFDA81C29A1D}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "m_json", "..\plugins\MirLua\Modules\m_json\m_json.vcxproj", "{8A645067-7F45-4E65-AAFC-AFDA81C29A1D}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libaxolotl", "..\libs\libaxolotl\libaxolotl.vcxproj", "{620E0BE7-3763-4F35-9DBD-4770104E269C}" EndProject @@ -443,6 +437,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "m_msg_buttonsbar", "..\plug EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libevent", "..\libs\libevent\libevent.vcxproj", "{46D53888-E60E-32A7-91EB-6336DE0D84D8}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StatusManager", "..\plugins\StatusManager\StatusManager.vcxproj", "{D2EF305F-5255-49E8-A738-D4206D62D2B8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -851,30 +847,6 @@ Global {5A6095F4-B037-4DA8-8410-8004A90C961A}.Release|Win32.Build.0 = Release|Win32 {5A6095F4-B037-4DA8-8410-8004A90C961A}.Release|x64.ActiveCfg = Release|x64 {5A6095F4-B037-4DA8-8410-8004A90C961A}.Release|x64.Build.0 = Release|x64 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Debug|Win32.ActiveCfg = Debug|Win32 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Debug|Win32.Build.0 = Debug|Win32 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Debug|x64.ActiveCfg = Debug|x64 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Debug|x64.Build.0 = Debug|x64 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Release|Win32.ActiveCfg = Release|Win32 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Release|Win32.Build.0 = Release|Win32 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Release|x64.ActiveCfg = Release|x64 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Release|x64.Build.0 = Release|x64 - {D548A54E-310B-4A86-A545-64BDD5748745}.Debug|Win32.ActiveCfg = Debug|Win32 - {D548A54E-310B-4A86-A545-64BDD5748745}.Debug|Win32.Build.0 = Debug|Win32 - {D548A54E-310B-4A86-A545-64BDD5748745}.Debug|x64.ActiveCfg = Debug|x64 - {D548A54E-310B-4A86-A545-64BDD5748745}.Debug|x64.Build.0 = Debug|x64 - {D548A54E-310B-4A86-A545-64BDD5748745}.Release|Win32.ActiveCfg = Release|Win32 - {D548A54E-310B-4A86-A545-64BDD5748745}.Release|Win32.Build.0 = Release|Win32 - {D548A54E-310B-4A86-A545-64BDD5748745}.Release|x64.ActiveCfg = Release|x64 - {D548A54E-310B-4A86-A545-64BDD5748745}.Release|x64.Build.0 = Release|x64 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Debug|Win32.ActiveCfg = Debug|Win32 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Debug|Win32.Build.0 = Debug|Win32 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Debug|x64.ActiveCfg = Debug|x64 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Debug|x64.Build.0 = Debug|x64 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Release|Win32.ActiveCfg = Release|Win32 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Release|Win32.Build.0 = Release|Win32 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Release|x64.ActiveCfg = Release|x64 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Release|x64.Build.0 = Release|x64 {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Debug|Win32.ActiveCfg = Debug|Win32 {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Debug|Win32.Build.0 = Debug|Win32 {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Debug|x64.ActiveCfg = Debug|x64 @@ -2015,6 +1987,14 @@ Global {46D53888-E60E-32A7-91EB-6336DE0D84D8}.Release|Win32.Build.0 = Release|Win32 {46D53888-E60E-32A7-91EB-6336DE0D84D8}.Release|x64.ActiveCfg = Release|x64 {46D53888-E60E-32A7-91EB-6336DE0D84D8}.Release|x64.Build.0 = Release|x64 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Debug|Win32.ActiveCfg = Debug|Win32 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Debug|Win32.Build.0 = Debug|Win32 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Debug|x64.ActiveCfg = Debug|x64 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Debug|x64.Build.0 = Debug|x64 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Release|Win32.ActiveCfg = Release|Win32 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Release|Win32.Build.0 = Release|Win32 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Release|x64.ActiveCfg = Release|x64 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/bin10/mir_full_pro.sln b/bin10/mir_full_pro.sln index aa3013391b..d50ee63fa5 100644 --- a/bin10/mir_full_pro.sln +++ b/bin10/mir_full_pro.sln @@ -104,12 +104,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SmileyAdd", "..\plugins\Smi EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SplashScreen", "..\plugins\SplashScreen\splashscreen.vcxproj", "{5A6095F4-B037-4DA8-8410-8004A90C961A}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AdvancedAutoAway", "..\plugins\StatusPlugins\AdvancedAutoAway\AdvancedAutoAway_10.vcxproj", "{66503A70-B1E8-4545-B4FF-2108DFB40C72}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KeepStatus", "..\plugins\StatusPlugins\KeepStatus\KeepStatus_10.vcxproj", "{D548A54E-310B-4A86-A545-64BDD5748745}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StartupStatus", "..\plugins\StatusPlugins\StartupStatus\StartupStatus_10.vcxproj", "{1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StopSpam", "..\plugins\StopSpamPlus\stopspam.vcxproj", "{3E6CEC79-5E93-4607-B10E-498586ECF6A6}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tipper", "..\plugins\TipperYM\tipper_ym.vcxproj", "{2C818919-A38F-44FF-BD91-A6A204AC592A}" @@ -461,7 +455,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblua", "..\libs\liblua\li EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winapi", "..\plugins\MirLua\Modules\WinAPI\WinAPI.vcxproj", "{045BAC91-34D1-4B43-B52B-566801BE7F85}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "json", "..\plugins\MirLua\Modules\m_json\m_json.vcxproj", "{8A645067-7F45-4E65-AAFC-AFDA81C29A1D}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "m_json", "..\plugins\MirLua\Modules\m_json\m_json.vcxproj", "{8A645067-7F45-4E65-AAFC-AFDA81C29A1D}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libaxolotl", "..\libs\libaxolotl\libaxolotl.vcxproj", "{620E0BE7-3763-4F35-9DBD-4770104E269C}" EndProject @@ -477,6 +471,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "m_msg_buttonsbar", "..\plug EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libevent", "..\libs\libevent\libevent.vcxproj", "{46D53888-E60E-32A7-91EB-6336DE0D84D8}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StatusManager", "..\plugins\StatusManager\StatusManager.vcxproj", "{D2EF305F-5255-49E8-A738-D4206D62D2B8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -885,30 +881,6 @@ Global {5A6095F4-B037-4DA8-8410-8004A90C961A}.Release|Win32.Build.0 = Release|Win32 {5A6095F4-B037-4DA8-8410-8004A90C961A}.Release|x64.ActiveCfg = Release|x64 {5A6095F4-B037-4DA8-8410-8004A90C961A}.Release|x64.Build.0 = Release|x64 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Debug|Win32.ActiveCfg = Debug|Win32 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Debug|Win32.Build.0 = Debug|Win32 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Debug|x64.ActiveCfg = Debug|x64 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Debug|x64.Build.0 = Debug|x64 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Release|Win32.ActiveCfg = Release|Win32 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Release|Win32.Build.0 = Release|Win32 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Release|x64.ActiveCfg = Release|x64 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Release|x64.Build.0 = Release|x64 - {D548A54E-310B-4A86-A545-64BDD5748745}.Debug|Win32.ActiveCfg = Debug|Win32 - {D548A54E-310B-4A86-A545-64BDD5748745}.Debug|Win32.Build.0 = Debug|Win32 - {D548A54E-310B-4A86-A545-64BDD5748745}.Debug|x64.ActiveCfg = Debug|x64 - {D548A54E-310B-4A86-A545-64BDD5748745}.Debug|x64.Build.0 = Debug|x64 - {D548A54E-310B-4A86-A545-64BDD5748745}.Release|Win32.ActiveCfg = Release|Win32 - {D548A54E-310B-4A86-A545-64BDD5748745}.Release|Win32.Build.0 = Release|Win32 - {D548A54E-310B-4A86-A545-64BDD5748745}.Release|x64.ActiveCfg = Release|x64 - {D548A54E-310B-4A86-A545-64BDD5748745}.Release|x64.Build.0 = Release|x64 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Debug|Win32.ActiveCfg = Debug|Win32 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Debug|Win32.Build.0 = Debug|Win32 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Debug|x64.ActiveCfg = Debug|x64 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Debug|x64.Build.0 = Debug|x64 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Release|Win32.ActiveCfg = Release|Win32 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Release|Win32.Build.0 = Release|Win32 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Release|x64.ActiveCfg = Release|x64 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Release|x64.Build.0 = Release|x64 {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Debug|Win32.ActiveCfg = Debug|Win32 {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Debug|Win32.Build.0 = Debug|Win32 {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Debug|x64.ActiveCfg = Debug|x64 @@ -2041,6 +2013,14 @@ Global {46D53888-E60E-32A7-91EB-6336DE0D84D8}.Release|Win32.Build.0 = Release|Win32 {46D53888-E60E-32A7-91EB-6336DE0D84D8}.Release|x64.ActiveCfg = Release|x64 {46D53888-E60E-32A7-91EB-6336DE0D84D8}.Release|x64.Build.0 = Release|x64 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Debug|Win32.ActiveCfg = Debug|Win32 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Debug|Win32.Build.0 = Debug|Win32 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Debug|x64.ActiveCfg = Debug|x64 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Debug|x64.Build.0 = Debug|x64 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Release|Win32.ActiveCfg = Release|Win32 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Release|Win32.Build.0 = Release|Win32 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Release|x64.ActiveCfg = Release|x64 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2127,7 +2107,6 @@ Global {B8928210-546C-4AE3-956B-E2B724E6B8E5} = {87D96006-542C-4396-87EF-68E3C3D2797F} {6DA1396F-2A44-4D5C-8442-012F71006217} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4} {3A12F777-56A8-42EC-BD17-8F325524241E} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4} - {E42870DB-9FED-44E7-9C93-4E64D0C87F51} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4} {01DDCB36-4DE2-405D-BC36-2C8BDEB86659} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4} {33276462-8313-4192-8306-13717ECCA60A} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4} {7B0F213E-C15E-4219-8AE5-49DD3D3D553D} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4} @@ -2216,14 +2195,12 @@ Global {7B072B7F-E2AA-4935-AAF5-5BEF99665AD3} = {99B819F8-65D9-45BC-B0C4-8C2B0F63AD46} {8ACA3C8B-BDFA-47B2-8578-069555BA05B3} = {99B819F8-65D9-45BC-B0C4-8C2B0F63AD46} {EDAAD28B-505B-4969-A8BB-97EAE818DEEA} = {99B819F8-65D9-45BC-B0C4-8C2B0F63AD46} - {66503A70-B1E8-4545-B4FF-2108DFB40C72} = {74981ED5-7A15-4C46-AECF-DA229AF9CC9D} - {D548A54E-310B-4A86-A545-64BDD5748745} = {74981ED5-7A15-4C46-AECF-DA229AF9CC9D} - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2} = {74981ED5-7A15-4C46-AECF-DA229AF9CC9D} {D3D80E27-D099-41EC-AFB2-A891A33F1608} = {74981ED5-7A15-4C46-AECF-DA229AF9CC9D} {2AD2FF74-06E1-4BD8-984A-526F3C6315B3} = {74981ED5-7A15-4C46-AECF-DA229AF9CC9D} {D09881C7-E189-49AD-919E-F64355F8EFD0} = {74981ED5-7A15-4C46-AECF-DA229AF9CC9D} {10F78F26-2B20-4158-869F-CB29533B4C2C} = {74981ED5-7A15-4C46-AECF-DA229AF9CC9D} {6A516E27-AC50-5374-756B-A1558DB2EFA9} = {74981ED5-7A15-4C46-AECF-DA229AF9CC9D} + {D2EF305F-5255-49E8-A738-D4206D62D2B8} = {74981ED5-7A15-4C46-AECF-DA229AF9CC9D} {9DE1F0B0-B9D1-4681-82E7-13CC3E047445} = {8BAD5E57-11F5-4C44-8FFA-D589B658421B} {07137F45-8B5F-4561-BEC8-B883E9123785} = {8BAD5E57-11F5-4C44-8FFA-D589B658421B} {850EC838-0EAD-45EB-6F1B-16DC90DCE18D} = {8BAD5E57-11F5-4C44-8FFA-D589B658421B} diff --git a/bin12/mir_dev.sln b/bin12/mir_dev.sln index fe6c566b22..006ab68354 100644 --- a/bin12/mir_dev.sln +++ b/bin12/mir_dev.sln @@ -1,5 +1,5 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 +# Visual Studio Express 2013 for Windows Desktop VisualStudioVersion = 12.0.40629.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Miranda", "..\src\miranda32\miranda32.vcxproj", "{F9916510-9055-4C9F-997A-3755DEC1511B}" @@ -106,12 +106,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SmileyAdd", "..\plugins\Smi EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SplashScreen", "..\plugins\SplashScreen\splashscreen.vcxproj", "{5A6095F4-B037-4DA8-8410-8004A90C961A}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AdvancedAutoAway", "..\plugins\StatusPlugins\AdvancedAutoAway\AdvancedAutoAway_12.vcxproj", "{66503A70-B1E8-4545-B4FF-2108DFB40C72}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KeepStatus", "..\plugins\StatusPlugins\KeepStatus\KeepStatus_12.vcxproj", "{D548A54E-310B-4A86-A545-64BDD5748745}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StartupStatus", "..\plugins\StatusPlugins\StartupStatus\StartupStatus_12.vcxproj", "{1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StopSpam", "..\plugins\StopSpamPlus\stopspam.vcxproj", "{3E6CEC79-5E93-4607-B10E-498586ECF6A6}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tipper", "..\plugins\TipperYM\tipper_ym.vcxproj", "{2C818919-A38F-44FF-BD91-A6A204AC592A}" @@ -433,7 +427,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblua", "..\libs\liblua\li EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winapi", "..\plugins\MirLua\Modules\WinAPI\WinAPI.vcxproj", "{045BAC91-34D1-4B43-B52B-566801BE7F85}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "json", "..\plugins\MirLua\Modules\m_json\m_json.vcxproj", "{8A645067-7F45-4E65-AAFC-AFDA81C29A1D}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "m_json", "..\plugins\MirLua\Modules\m_json\m_json.vcxproj", "{8A645067-7F45-4E65-AAFC-AFDA81C29A1D}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libaxolotl", "..\libs\libaxolotl\libaxolotl.vcxproj", "{620E0BE7-3763-4F35-9DBD-4770104E269C}" EndProject @@ -449,6 +443,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "m_msg_buttonsbar", "..\plug EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libevent", "..\libs\libevent\libevent.vcxproj", "{46D53888-E60E-32A7-91EB-6336DE0D84D8}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StatusManager", "..\plugins\StatusManager\StatusManager.vcxproj", "{D2EF305F-5255-49E8-A738-D4206D62D2B8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -857,30 +853,6 @@ Global {5A6095F4-B037-4DA8-8410-8004A90C961A}.Release|Win32.Build.0 = Release|Win32 {5A6095F4-B037-4DA8-8410-8004A90C961A}.Release|x64.ActiveCfg = Release|x64 {5A6095F4-B037-4DA8-8410-8004A90C961A}.Release|x64.Build.0 = Release|x64 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Debug|Win32.ActiveCfg = Debug|Win32 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Debug|Win32.Build.0 = Debug|Win32 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Debug|x64.ActiveCfg = Debug|x64 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Debug|x64.Build.0 = Debug|x64 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Release|Win32.ActiveCfg = Release|Win32 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Release|Win32.Build.0 = Release|Win32 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Release|x64.ActiveCfg = Release|x64 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Release|x64.Build.0 = Release|x64 - {D548A54E-310B-4A86-A545-64BDD5748745}.Debug|Win32.ActiveCfg = Debug|Win32 - {D548A54E-310B-4A86-A545-64BDD5748745}.Debug|Win32.Build.0 = Debug|Win32 - {D548A54E-310B-4A86-A545-64BDD5748745}.Debug|x64.ActiveCfg = Debug|x64 - {D548A54E-310B-4A86-A545-64BDD5748745}.Debug|x64.Build.0 = Debug|x64 - {D548A54E-310B-4A86-A545-64BDD5748745}.Release|Win32.ActiveCfg = Release|Win32 - {D548A54E-310B-4A86-A545-64BDD5748745}.Release|Win32.Build.0 = Release|Win32 - {D548A54E-310B-4A86-A545-64BDD5748745}.Release|x64.ActiveCfg = Release|x64 - {D548A54E-310B-4A86-A545-64BDD5748745}.Release|x64.Build.0 = Release|x64 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Debug|Win32.ActiveCfg = Debug|Win32 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Debug|Win32.Build.0 = Debug|Win32 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Debug|x64.ActiveCfg = Debug|x64 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Debug|x64.Build.0 = Debug|x64 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Release|Win32.ActiveCfg = Release|Win32 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Release|Win32.Build.0 = Release|Win32 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Release|x64.ActiveCfg = Release|x64 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Release|x64.Build.0 = Release|x64 {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Debug|Win32.ActiveCfg = Debug|Win32 {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Debug|Win32.Build.0 = Debug|Win32 {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Debug|x64.ActiveCfg = Debug|x64 @@ -2047,6 +2019,14 @@ Global {46D53888-E60E-32A7-91EB-6336DE0D84D8}.Release|Win32.Build.0 = Release|Win32 {46D53888-E60E-32A7-91EB-6336DE0D84D8}.Release|x64.ActiveCfg = Release|x64 {46D53888-E60E-32A7-91EB-6336DE0D84D8}.Release|x64.Build.0 = Release|x64 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Debug|Win32.ActiveCfg = Debug|Win32 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Debug|Win32.Build.0 = Debug|Win32 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Debug|x64.ActiveCfg = Debug|x64 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Debug|x64.Build.0 = Debug|x64 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Release|Win32.ActiveCfg = Release|Win32 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Release|Win32.Build.0 = Release|Win32 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Release|x64.ActiveCfg = Release|x64 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/bin12/mir_full.sln b/bin12/mir_full.sln index f916bd77e8..72d5774113 100644 --- a/bin12/mir_full.sln +++ b/bin12/mir_full.sln @@ -1,5 +1,5 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 +# Visual Studio Express 2013 for Windows Desktop VisualStudioVersion = 12.0.40629.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Miranda", "..\src\miranda32\miranda32.vcxproj", "{F9916510-9055-4C9F-997A-3755DEC1511B}" @@ -106,12 +106,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SmileyAdd", "..\plugins\Smi EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SplashScreen", "..\plugins\SplashScreen\splashscreen.vcxproj", "{5A6095F4-B037-4DA8-8410-8004A90C961A}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AdvancedAutoAway", "..\plugins\StatusPlugins\AdvancedAutoAway\AdvancedAutoAway_12.vcxproj", "{66503A70-B1E8-4545-B4FF-2108DFB40C72}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KeepStatus", "..\plugins\StatusPlugins\KeepStatus\KeepStatus_12.vcxproj", "{D548A54E-310B-4A86-A545-64BDD5748745}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StartupStatus", "..\plugins\StatusPlugins\StartupStatus\StartupStatus_12.vcxproj", "{1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StopSpam", "..\plugins\StopSpamPlus\stopspam.vcxproj", "{3E6CEC79-5E93-4607-B10E-498586ECF6A6}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tipper", "..\plugins\TipperYM\tipper_ym.vcxproj", "{2C818919-A38F-44FF-BD91-A6A204AC592A}" @@ -431,7 +425,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblua", "..\libs\liblua\li EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winapi", "..\plugins\MirLua\Modules\WinAPI\WinAPI.vcxproj", "{045BAC91-34D1-4B43-B52B-566801BE7F85}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "json", "..\plugins\MirLua\Modules\m_json\m_json.vcxproj", "{8A645067-7F45-4E65-AAFC-AFDA81C29A1D}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "m_json", "..\plugins\MirLua\Modules\m_json\m_json.vcxproj", "{8A645067-7F45-4E65-AAFC-AFDA81C29A1D}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libaxolotl", "..\libs\libaxolotl\libaxolotl.vcxproj", "{620E0BE7-3763-4F35-9DBD-4770104E269C}" EndProject @@ -447,6 +441,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "m_msg_buttonsbar", "..\plug EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libevent", "..\libs\libevent\libevent.vcxproj", "{46D53888-E60E-32A7-91EB-6336DE0D84D8}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StatusManager", "..\plugins\StatusManager\StatusManager.vcxproj", "{D2EF305F-5255-49E8-A738-D4206D62D2B8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -855,30 +851,6 @@ Global {5A6095F4-B037-4DA8-8410-8004A90C961A}.Release|Win32.Build.0 = Release|Win32 {5A6095F4-B037-4DA8-8410-8004A90C961A}.Release|x64.ActiveCfg = Release|x64 {5A6095F4-B037-4DA8-8410-8004A90C961A}.Release|x64.Build.0 = Release|x64 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Debug|Win32.ActiveCfg = Debug|Win32 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Debug|Win32.Build.0 = Debug|Win32 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Debug|x64.ActiveCfg = Debug|x64 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Debug|x64.Build.0 = Debug|x64 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Release|Win32.ActiveCfg = Release|Win32 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Release|Win32.Build.0 = Release|Win32 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Release|x64.ActiveCfg = Release|x64 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Release|x64.Build.0 = Release|x64 - {D548A54E-310B-4A86-A545-64BDD5748745}.Debug|Win32.ActiveCfg = Debug|Win32 - {D548A54E-310B-4A86-A545-64BDD5748745}.Debug|Win32.Build.0 = Debug|Win32 - {D548A54E-310B-4A86-A545-64BDD5748745}.Debug|x64.ActiveCfg = Debug|x64 - {D548A54E-310B-4A86-A545-64BDD5748745}.Debug|x64.Build.0 = Debug|x64 - {D548A54E-310B-4A86-A545-64BDD5748745}.Release|Win32.ActiveCfg = Release|Win32 - {D548A54E-310B-4A86-A545-64BDD5748745}.Release|Win32.Build.0 = Release|Win32 - {D548A54E-310B-4A86-A545-64BDD5748745}.Release|x64.ActiveCfg = Release|x64 - {D548A54E-310B-4A86-A545-64BDD5748745}.Release|x64.Build.0 = Release|x64 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Debug|Win32.ActiveCfg = Debug|Win32 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Debug|Win32.Build.0 = Debug|Win32 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Debug|x64.ActiveCfg = Debug|x64 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Debug|x64.Build.0 = Debug|x64 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Release|Win32.ActiveCfg = Release|Win32 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Release|Win32.Build.0 = Release|Win32 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Release|x64.ActiveCfg = Release|x64 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Release|x64.Build.0 = Release|x64 {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Debug|Win32.ActiveCfg = Debug|Win32 {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Debug|Win32.Build.0 = Debug|Win32 {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Debug|x64.ActiveCfg = Debug|x64 @@ -2027,6 +1999,14 @@ Global {46D53888-E60E-32A7-91EB-6336DE0D84D8}.Release|Win32.Build.0 = Release|Win32 {46D53888-E60E-32A7-91EB-6336DE0D84D8}.Release|x64.ActiveCfg = Release|x64 {46D53888-E60E-32A7-91EB-6336DE0D84D8}.Release|x64.Build.0 = Release|x64 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Debug|Win32.ActiveCfg = Debug|Win32 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Debug|Win32.Build.0 = Debug|Win32 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Debug|x64.ActiveCfg = Debug|x64 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Debug|x64.Build.0 = Debug|x64 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Release|Win32.ActiveCfg = Release|Win32 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Release|Win32.Build.0 = Release|Win32 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Release|x64.ActiveCfg = Release|x64 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/bin14/mir_dev.sln b/bin14/mir_dev.sln index 315285d83c..4c098dc407 100644 --- a/bin14/mir_dev.sln +++ b/bin14/mir_dev.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 +# Visual Studio Express 14 for Windows Desktop +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Miranda", "..\src\miranda32\miranda32.vcxproj", "{F9916510-9055-4C9F-997A-3755DEC1511B}" ProjectSection(ProjectDependencies) = postProject @@ -106,12 +106,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SmileyAdd", "..\plugins\Smi EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SplashScreen", "..\plugins\SplashScreen\splashscreen.vcxproj", "{5A6095F4-B037-4DA8-8410-8004A90C961A}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AdvancedAutoAway", "..\plugins\StatusPlugins\AdvancedAutoAway\AdvancedAutoAway_14.vcxproj", "{66503A70-B1E8-4545-B4FF-2108DFB40C72}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KeepStatus", "..\plugins\StatusPlugins\KeepStatus\KeepStatus_14.vcxproj", "{D548A54E-310B-4A86-A545-64BDD5748745}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StartupStatus", "..\plugins\StatusPlugins\StartupStatus\StartupStatus_14.vcxproj", "{1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StopSpam", "..\plugins\StopSpamPlus\stopspam.vcxproj", "{3E6CEC79-5E93-4607-B10E-498586ECF6A6}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tipper", "..\plugins\TipperYM\tipper_ym.vcxproj", "{2C818919-A38F-44FF-BD91-A6A204AC592A}" @@ -433,7 +427,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblua", "..\libs\liblua\li EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winapi", "..\plugins\MirLua\Modules\WinAPI\WinAPI.vcxproj", "{045BAC91-34D1-4B43-B52B-566801BE7F85}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "json", "..\plugins\MirLua\Modules\m_json\m_json.vcxproj", "{8A645067-7F45-4E65-AAFC-AFDA81C29A1D}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "m_json", "..\plugins\MirLua\Modules\m_json\m_json.vcxproj", "{8A645067-7F45-4E65-AAFC-AFDA81C29A1D}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libaxolotl", "..\libs\libaxolotl\libaxolotl.vcxproj", "{620E0BE7-3763-4F35-9DBD-4770104E269C}" EndProject @@ -449,6 +443,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "m_msg_buttonsbar", "..\plug EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libevent", "..\libs\libevent\libevent.vcxproj", "{46D53888-E60E-32A7-91EB-6336DE0D84D8}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StatusManager", "..\plugins\StatusManager\StatusManager.vcxproj", "{D2EF305F-5255-49E8-A738-D4206D62D2B8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -857,30 +853,6 @@ Global {5A6095F4-B037-4DA8-8410-8004A90C961A}.Release|Win32.Build.0 = Release|Win32 {5A6095F4-B037-4DA8-8410-8004A90C961A}.Release|x64.ActiveCfg = Release|x64 {5A6095F4-B037-4DA8-8410-8004A90C961A}.Release|x64.Build.0 = Release|x64 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Debug|Win32.ActiveCfg = Debug|Win32 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Debug|Win32.Build.0 = Debug|Win32 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Debug|x64.ActiveCfg = Debug|x64 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Debug|x64.Build.0 = Debug|x64 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Release|Win32.ActiveCfg = Release|Win32 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Release|Win32.Build.0 = Release|Win32 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Release|x64.ActiveCfg = Release|x64 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Release|x64.Build.0 = Release|x64 - {D548A54E-310B-4A86-A545-64BDD5748745}.Debug|Win32.ActiveCfg = Debug|Win32 - {D548A54E-310B-4A86-A545-64BDD5748745}.Debug|Win32.Build.0 = Debug|Win32 - {D548A54E-310B-4A86-A545-64BDD5748745}.Debug|x64.ActiveCfg = Debug|x64 - {D548A54E-310B-4A86-A545-64BDD5748745}.Debug|x64.Build.0 = Debug|x64 - {D548A54E-310B-4A86-A545-64BDD5748745}.Release|Win32.ActiveCfg = Release|Win32 - {D548A54E-310B-4A86-A545-64BDD5748745}.Release|Win32.Build.0 = Release|Win32 - {D548A54E-310B-4A86-A545-64BDD5748745}.Release|x64.ActiveCfg = Release|x64 - {D548A54E-310B-4A86-A545-64BDD5748745}.Release|x64.Build.0 = Release|x64 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Debug|Win32.ActiveCfg = Debug|Win32 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Debug|Win32.Build.0 = Debug|Win32 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Debug|x64.ActiveCfg = Debug|x64 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Debug|x64.Build.0 = Debug|x64 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Release|Win32.ActiveCfg = Release|Win32 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Release|Win32.Build.0 = Release|Win32 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Release|x64.ActiveCfg = Release|x64 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Release|x64.Build.0 = Release|x64 {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Debug|Win32.ActiveCfg = Debug|Win32 {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Debug|Win32.Build.0 = Debug|Win32 {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Debug|x64.ActiveCfg = Debug|x64 @@ -2047,6 +2019,14 @@ Global {46D53888-E60E-32A7-91EB-6336DE0D84D8}.Release|Win32.Build.0 = Release|Win32 {46D53888-E60E-32A7-91EB-6336DE0D84D8}.Release|x64.ActiveCfg = Release|x64 {46D53888-E60E-32A7-91EB-6336DE0D84D8}.Release|x64.Build.0 = Release|x64 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Debug|Win32.ActiveCfg = Debug|Win32 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Debug|Win32.Build.0 = Debug|Win32 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Debug|x64.ActiveCfg = Debug|x64 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Debug|x64.Build.0 = Debug|x64 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Release|Win32.ActiveCfg = Release|Win32 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Release|Win32.Build.0 = Release|Win32 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Release|x64.ActiveCfg = Release|x64 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/bin14/mir_full.sln b/bin14/mir_full.sln index bdde48d36b..434a8c80c6 100644 --- a/bin14/mir_full.sln +++ b/bin14/mir_full.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 +# Visual Studio Express 14 for Windows Desktop +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Miranda", "..\src\miranda32\miranda32.vcxproj", "{F9916510-9055-4C9F-997A-3755DEC1511B}" ProjectSection(ProjectDependencies) = postProject @@ -106,12 +106,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SmileyAdd", "..\plugins\Smi EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SplashScreen", "..\plugins\SplashScreen\splashscreen.vcxproj", "{5A6095F4-B037-4DA8-8410-8004A90C961A}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AdvancedAutoAway", "..\plugins\StatusPlugins\AdvancedAutoAway\AdvancedAutoAway_14.vcxproj", "{66503A70-B1E8-4545-B4FF-2108DFB40C72}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KeepStatus", "..\plugins\StatusPlugins\KeepStatus\KeepStatus_14.vcxproj", "{D548A54E-310B-4A86-A545-64BDD5748745}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StartupStatus", "..\plugins\StatusPlugins\StartupStatus\StartupStatus_14.vcxproj", "{1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StopSpam", "..\plugins\StopSpamPlus\stopspam.vcxproj", "{3E6CEC79-5E93-4607-B10E-498586ECF6A6}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tipper", "..\plugins\TipperYM\tipper_ym.vcxproj", "{2C818919-A38F-44FF-BD91-A6A204AC592A}" @@ -431,7 +425,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblua", "..\libs\liblua\li EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winapi", "..\plugins\MirLua\Modules\WinAPI\WinAPI.vcxproj", "{045BAC91-34D1-4B43-B52B-566801BE7F85}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "json", "..\plugins\MirLua\Modules\m_json\m_json.vcxproj", "{8A645067-7F45-4E65-AAFC-AFDA81C29A1D}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "m_json", "..\plugins\MirLua\Modules\m_json\m_json.vcxproj", "{8A645067-7F45-4E65-AAFC-AFDA81C29A1D}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libaxolotl", "..\libs\libaxolotl\libaxolotl.vcxproj", "{620E0BE7-3763-4F35-9DBD-4770104E269C}" EndProject @@ -447,6 +441,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "m_msg_buttonsbar", "..\plug EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libevent", "..\libs\libevent\libevent.vcxproj", "{46D53888-E60E-32A7-91EB-6336DE0D84D8}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StatusManager", "..\plugins\StatusManager\StatusManager.vcxproj", "{D2EF305F-5255-49E8-A738-D4206D62D2B8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -855,30 +851,6 @@ Global {5A6095F4-B037-4DA8-8410-8004A90C961A}.Release|Win32.Build.0 = Release|Win32 {5A6095F4-B037-4DA8-8410-8004A90C961A}.Release|x64.ActiveCfg = Release|x64 {5A6095F4-B037-4DA8-8410-8004A90C961A}.Release|x64.Build.0 = Release|x64 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Debug|Win32.ActiveCfg = Debug|Win32 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Debug|Win32.Build.0 = Debug|Win32 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Debug|x64.ActiveCfg = Debug|x64 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Debug|x64.Build.0 = Debug|x64 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Release|Win32.ActiveCfg = Release|Win32 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Release|Win32.Build.0 = Release|Win32 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Release|x64.ActiveCfg = Release|x64 - {66503A70-B1E8-4545-B4FF-2108DFB40C72}.Release|x64.Build.0 = Release|x64 - {D548A54E-310B-4A86-A545-64BDD5748745}.Debug|Win32.ActiveCfg = Debug|Win32 - {D548A54E-310B-4A86-A545-64BDD5748745}.Debug|Win32.Build.0 = Debug|Win32 - {D548A54E-310B-4A86-A545-64BDD5748745}.Debug|x64.ActiveCfg = Debug|x64 - {D548A54E-310B-4A86-A545-64BDD5748745}.Debug|x64.Build.0 = Debug|x64 - {D548A54E-310B-4A86-A545-64BDD5748745}.Release|Win32.ActiveCfg = Release|Win32 - {D548A54E-310B-4A86-A545-64BDD5748745}.Release|Win32.Build.0 = Release|Win32 - {D548A54E-310B-4A86-A545-64BDD5748745}.Release|x64.ActiveCfg = Release|x64 - {D548A54E-310B-4A86-A545-64BDD5748745}.Release|x64.Build.0 = Release|x64 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Debug|Win32.ActiveCfg = Debug|Win32 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Debug|Win32.Build.0 = Debug|Win32 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Debug|x64.ActiveCfg = Debug|x64 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Debug|x64.Build.0 = Debug|x64 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Release|Win32.ActiveCfg = Release|Win32 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Release|Win32.Build.0 = Release|Win32 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Release|x64.ActiveCfg = Release|x64 - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2}.Release|x64.Build.0 = Release|x64 {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Debug|Win32.ActiveCfg = Debug|Win32 {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Debug|Win32.Build.0 = Debug|Win32 {3E6CEC79-5E93-4607-B10E-498586ECF6A6}.Debug|x64.ActiveCfg = Debug|x64 @@ -2027,6 +1999,14 @@ Global {46D53888-E60E-32A7-91EB-6336DE0D84D8}.Release|Win32.Build.0 = Release|Win32 {46D53888-E60E-32A7-91EB-6336DE0D84D8}.Release|x64.ActiveCfg = Release|x64 {46D53888-E60E-32A7-91EB-6336DE0D84D8}.Release|x64.Build.0 = Release|x64 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Debug|Win32.ActiveCfg = Debug|Win32 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Debug|Win32.Build.0 = Debug|Win32 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Debug|x64.ActiveCfg = Debug|x64 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Debug|x64.Build.0 = Debug|x64 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Release|Win32.ActiveCfg = Release|Win32 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Release|Win32.Build.0 = Release|Win32 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Release|x64.ActiveCfg = Release|x64 + {D2EF305F-5255-49E8-A738-D4206D62D2B8}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp index c744c94139..0831e8053d 100644 --- a/plugins/PluginUpdater/src/DlgUpdate.cpp +++ b/plugins/PluginUpdater/src/DlgUpdate.cpp @@ -554,6 +554,9 @@ static renameTable[] = { L"skype.dll", L"Plugins\\skypeweb.dll" }, { L"skypeclassic.dll", L"Plugins\\skypeweb.dll" }, { L"historysweeper.dll", L"Plugins\\historysweeperlight.dll" }, + { L"advancedautoaway.dll", L"Plugins\\statusmanager.dll" }, + { L"keepstatus.dll", L"Plugins\\statusmanager.dll" }, + { L"startupstatus.dll", L"Plugins\\statusmanager.dll" }, #if MIRANDA_VER >= 0x0A00 { L"dbx_mmap_sa.dll", L"Plugins\\dbx_mmap.dll" }, diff --git a/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj b/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj deleted file mode 100644 index 98d9991c15..0000000000 --- a/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj +++ /dev/null @@ -1,248 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - AdvancedAutoAway - {66503A70-B1E8-4545-B4FF-2108DFB40C72} - - - - DynamicLibrary - Unicode - true - - - DynamicLibrary - Unicode - - - DynamicLibrary - true - Unicode - - - DynamicLibrary - Unicode - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - true - - - - Disabled - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;_USRDLL;ADVANCEDAUTOAWAY_EXPORTS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Use - ..\commonstatus.h - Level3 - EditAndContinue - 4996;%(DisableSpecificWarnings) - false - - - _DEBUG;%(PreprocessorDefinitions) - ..\..\..\include\msapi - - - true - $(IntDir)$(TargetName).lib - Windows - 0x11bd0000 - false - $(ProfileDir)..\..\..\bin10\lib - UxTheme.lib;%(AdditionalDependencies) - - - - - Full - OnlyExplicitInline - Size - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;_USRDLL;ADVANCEDAUTOAWAY_EXPORTS;%(PreprocessorDefinitions) - true - true - Use - ..\commonstatus.h - Level3 - 4996;%(DisableSpecificWarnings) - false - false - Fast - - - NDEBUG;%(PreprocessorDefinitions) - ..\..\..\include\msapi - - - true - true - true - 0x11bd0000 - $(IntDir)$(TargetName).lib - Windows - false - $(ProfileDir)..\..\..\bin10\lib - /PDBALTPATH:%_PDB% - UxTheme.lib;%(AdditionalDependencies) - - - - - Full - - - - - OnlyExplicitInline - - - - - - - - - Size - - - - - true - false - false - Fast - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - Use - ..\commonstatus.h - Level3 - NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - 4996;%(DisableSpecificWarnings) - AssemblyAndSourceCode - - - true - $(SolutionDir)\lib - - - true - true - $(IntDir)$(TargetName).lib - Windows - false - 0x11bd0000 - $(ProfileDir)..\..\..\bin10\lib - /PDBALTPATH:%_PDB% - UxTheme.lib;%(AdditionalDependencies) - - - ..\..\..\include\msapi - NDEBUG;%(PreprocessorDefinitions) - - - - - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - Use - ..\commonstatus.h - Level3 - Disabled - _DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - EnableFastChecks - 4996;%(DisableSpecificWarnings) - false - - - true - $(IntDir)$(TargetName).lib - Windows - false - 0x11bd0000 - $(ProfileDir)..\..\..\bin10\lib - UxTheme.lib;%(AdditionalDependencies) - - - ..\..\..\include\msapi - - - - - Create - commonstatus.h - - - - commonstatus.h - Use - - - commonstatus.h - - - NotUsing - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj.filters b/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj.filters deleted file mode 100644 index fc5daed232..0000000000 --- a/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj.filters +++ /dev/null @@ -1,67 +0,0 @@ - - - - - {6b60d98e-019d-49ff-a906-9090232d9213} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {b2e98f78-44f0-4095-880b-46a0ede02428} - h;hpp;hxx;hm;inl - - - {2d794d19-0987-4aa7-940d-2378ba7e4fdb} - ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - - - Resource Files - - - Resource Files - - - \ No newline at end of file diff --git a/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_12.vcxproj b/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_12.vcxproj deleted file mode 100644 index c1b9ee6adb..0000000000 --- a/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_12.vcxproj +++ /dev/null @@ -1,251 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - AdvancedAutoAway - {66503A70-B1E8-4545-B4FF-2108DFB40C72} - - - - DynamicLibrary - Unicode - true - v120_xp - - - DynamicLibrary - Unicode - v120_xp - - - DynamicLibrary - true - Unicode - v120_xp - - - DynamicLibrary - Unicode - v120_xp - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - true - - - - Disabled - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;_USRDLL;ADVANCEDAUTOAWAY_EXPORTS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Use - ..\commonstatus.h - Level3 - EditAndContinue - 4996;%(DisableSpecificWarnings) - false - - - _DEBUG;%(PreprocessorDefinitions) - ..\..\..\include\msapi - - - true - $(IntDir)$(TargetName).lib - Windows - 0x11bd0000 - false - $(ProfileDir)..\..\..\bin12\lib - false - UxTheme.lib;%(AdditionalDependencies) - - - - - Full - OnlyExplicitInline - Size - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;_USRDLL;ADVANCEDAUTOAWAY_EXPORTS;%(PreprocessorDefinitions) - true - true - Use - ..\commonstatus.h - Level3 - 4996;%(DisableSpecificWarnings) - false - false - Fast - - - NDEBUG;%(PreprocessorDefinitions) - ..\..\..\include\msapi - - - true - true - true - 0x11bd0000 - $(IntDir)$(TargetName).lib - Windows - false - $(ProfileDir)..\..\..\bin12\lib - UxTheme.lib;%(AdditionalDependencies) - - - - - Full - - - - - OnlyExplicitInline - - - - - - - - - Size - - - - - true - false - false - Fast - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - Use - ..\commonstatus.h - Level3 - NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - 4996;%(DisableSpecificWarnings) - AssemblyAndSourceCode - - - true - $(SolutionDir)\lib - - - true - true - $(IntDir)$(TargetName).lib - Windows - false - 0x11bd0000 - $(ProfileDir)..\..\..\bin12\lib - UxTheme.lib;%(AdditionalDependencies) - - - ..\..\..\include\msapi - NDEBUG;%(PreprocessorDefinitions) - - - - - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - Use - ..\commonstatus.h - Level3 - Disabled - _DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - EnableFastChecks - 4996;%(DisableSpecificWarnings) - false - - - true - $(IntDir)$(TargetName).lib - Windows - false - 0x11bd0000 - $(ProfileDir)..\..\..\bin12\lib - UxTheme.lib;%(AdditionalDependencies) - - - ..\..\..\include\msapi - - - - - Create - commonstatus.h - - - - commonstatus.h - Use - - - commonstatus.h - - - NotUsing - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_12.vcxproj.filters b/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_12.vcxproj.filters deleted file mode 100644 index fc5daed232..0000000000 --- a/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_12.vcxproj.filters +++ /dev/null @@ -1,67 +0,0 @@ - - - - - {6b60d98e-019d-49ff-a906-9090232d9213} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {b2e98f78-44f0-4095-880b-46a0ede02428} - h;hpp;hxx;hm;inl - - - {2d794d19-0987-4aa7-940d-2378ba7e4fdb} - ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - - - Resource Files - - - Resource Files - - - \ No newline at end of file diff --git a/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_14.vcxproj b/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_14.vcxproj deleted file mode 100644 index e8467e23d8..0000000000 --- a/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_14.vcxproj +++ /dev/null @@ -1,251 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - AdvancedAutoAway - {66503A70-B1E8-4545-B4FF-2108DFB40C72} - - - - DynamicLibrary - Unicode - true - v140_xp - - - DynamicLibrary - Unicode - v140_xp - - - DynamicLibrary - true - Unicode - v140_xp - - - DynamicLibrary - Unicode - v140_xp - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - true - - - - Disabled - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;_USRDLL;ADVANCEDAUTOAWAY_EXPORTS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Use - ..\commonstatus.h - Level3 - EditAndContinue - 4996;%(DisableSpecificWarnings) - false - - - _DEBUG;%(PreprocessorDefinitions) - ..\..\..\include\msapi - - - true - $(IntDir)$(TargetName).lib - Windows - 0x11bd0000 - false - $(ProfileDir)..\..\..\bin14\lib - false - UxTheme.lib;%(AdditionalDependencies) - - - - - Full - OnlyExplicitInline - Size - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;_USRDLL;ADVANCEDAUTOAWAY_EXPORTS;%(PreprocessorDefinitions) - true - true - Use - ..\commonstatus.h - Level3 - 4996;%(DisableSpecificWarnings) - false - false - Fast - - - NDEBUG;%(PreprocessorDefinitions) - ..\..\..\include\msapi - - - true - true - true - 0x11bd0000 - $(IntDir)$(TargetName).lib - Windows - false - $(ProfileDir)..\..\..\bin14\lib - UxTheme.lib;%(AdditionalDependencies) - - - - - Full - - - - - OnlyExplicitInline - - - - - - - - - Size - - - - - true - false - false - Fast - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - Use - ..\commonstatus.h - Level3 - NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - 4996;%(DisableSpecificWarnings) - AssemblyAndSourceCode - - - true - $(SolutionDir)\lib - - - true - true - $(IntDir)$(TargetName).lib - Windows - false - 0x11bd0000 - $(ProfileDir)..\..\..\bin14\lib - UxTheme.lib;%(AdditionalDependencies) - - - ..\..\..\include\msapi - NDEBUG;%(PreprocessorDefinitions) - - - - - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - Use - ..\commonstatus.h - Level3 - Disabled - _DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - EnableFastChecks - 4996;%(DisableSpecificWarnings) - false - - - true - $(IntDir)$(TargetName).lib - Windows - false - 0x11bd0000 - $(ProfileDir)..\..\..\bin14\lib - UxTheme.lib;%(AdditionalDependencies) - - - ..\..\..\include\msapi - - - - - Create - commonstatus.h - - - - commonstatus.h - Use - - - commonstatus.h - - - NotUsing - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_14.vcxproj.filters b/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_14.vcxproj.filters deleted file mode 100644 index fc5daed232..0000000000 --- a/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_14.vcxproj.filters +++ /dev/null @@ -1,67 +0,0 @@ - - - - - {6b60d98e-019d-49ff-a906-9090232d9213} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {b2e98f78-44f0-4095-880b-46a0ede02428} - h;hpp;hxx;hm;inl - - - {2d794d19-0987-4aa7-940d-2378ba7e4fdb} - ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - - - Resource Files - - - Resource Files - - - \ No newline at end of file diff --git a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp deleted file mode 100644 index 021674ab22..0000000000 --- a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp +++ /dev/null @@ -1,593 +0,0 @@ -/* - AdvancedAutoAway Plugin for Miranda-IM (www.miranda-im.org) - Copyright 2003-2006 P. Boon - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - Some code is copied from Miranda's AutoAway module -*/ -#include "../commonstatus.h" -#include "advancedautoaway.h" -#include "../resource.h" -#include - -#ifdef _DEBUG - #define SECS_PER_MINUTE 20 /* speedup */ -#else - #define SECS_PER_MINUTE 60 /* default I believe */ -#endif - -///////////////////////////////////////////////////////////////////////////////////////// - -int CompareSettings(const TAAAProtoSetting *p1, const TAAAProtoSetting *p2) -{ - return mir_strcmp(p1->szName, p2->szName); -} - -TAAAProtoSettingList autoAwaySettings(10, CompareSettings); - -TAAAProtoSetting::TAAAProtoSetting(PROTOACCOUNT *pa) -{ - cbSize = sizeof(PROTOCOLSETTINGEX); - szName = pa->szModuleName; - tszAccName = pa->tszAccountName; - lastStatus = status = originalStatusMode = ID_STATUS_CURRENT; - szMsg = NULL; - curState = ACTIVE; - mStatus = FALSE; -} - -TAAAProtoSetting::~TAAAProtoSetting() -{ - free(szMsg); -} - -///////////////////////////////////////////////////////////////////////////////////////// - -extern HANDLE hStateChangedEvent; - -static BOOL ignoreLockKeys = FALSE; -static BOOL ignoreSysKeys = FALSE; -static BOOL ignoreAltCombo = FALSE; -static BOOL monitorMouse = TRUE; -static BOOL monitorKeyboard = TRUE; -static HWND confirmDialog; -static int mouseStationaryTimer; -HHOOK hMirandaMouseHook = NULL; -HHOOK hMirandaKeyBoardHook = NULL; -#pragma data_seg("Shared") -DWORD lastInput = 0; -POINT lastMousePos = {0}; -HHOOK hMouseHook = NULL; -HHOOK hKeyBoardHook = NULL; -#pragma data_seg() -#pragma comment(linker, "/section:Shared,rws") -DWORD lastMirandaInput = 0; -static UINT_PTR hAutoAwayTimer; -// prototypes -extern DWORD StatusModeToProtoFlag(int status); -extern int InitCommonStatus(); -static int HookWindowsHooks(int hookMiranda, int hookAll); -static int UnhookWindowsHooks(); -static LRESULT CALLBACK MouseHookFunction(int code, WPARAM wParam, LPARAM lParam); -static LRESULT CALLBACK KeyBoardHookFunction(int code, WPARAM wParam, LPARAM lParam); -static LRESULT CALLBACK MirandaMouseHookFunction(int code, WPARAM wParam, LPARAM lParam); -static LRESULT CALLBACK MirandaKeyBoardHookFunction(int code, WPARAM wParam, LPARAM lParam); -BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved); - -static VOID CALLBACK AutoAwayTimer(HWND hwnd,UINT message,UINT_PTR idEvent,DWORD dwTime); -extern int AutoAwayOptInitialise(WPARAM wParam,LPARAM lParam); -extern int AutoAwayMsgOptInitialise(WPARAM wParam,LPARAM lParam); -extern int SetStatus(WPARAM wParam, LPARAM lParam); -extern int ShowConfirmDialog(WPARAM wParam, LPARAM lParam); -extern char *StatusModeToDbSetting(int status,const char *suffix); - -///////////////////////////////////////////////////////////////////////////////////////// -// Load from DB - -void LoadOptions(TAAAProtoSettingList &loadSettings, BOOL override) -{ - // if override is enabled, samesettings will be ignored (for options loading) - int monitorMiranda = FALSE; // use windows hooks? - int monitorAll = FALSE; // use windows hooks? - - if (!override) - UnhookWindowsHooks(); - if (hAutoAwayTimer != 0) - KillTimer(NULL, hAutoAwayTimer); - - ignoreLockKeys = db_get_b(NULL, MODULENAME, SETTING_IGNLOCK, FALSE); - ignoreSysKeys = db_get_b(NULL, MODULENAME, SETTING_IGNSYSKEYS, FALSE); - ignoreAltCombo = db_get_b(NULL, MODULENAME, SETTING_IGNALTCOMBO, FALSE); - monitorMouse = db_get_b(NULL, MODULENAME, SETTING_MONITORMOUSE, TRUE); - monitorKeyboard = db_get_b(NULL, MODULENAME, SETTING_MONITORKEYBOARD, TRUE); - lastInput = lastMirandaInput = GetTickCount(); - - for (int i = 0; i < loadSettings.getCount(); i++) { - char* protoName; - if ((db_get_b(NULL, MODULENAME, SETTING_SAMESETTINGS, 0)) && !override) - protoName = SETTING_ALL; - else - protoName = loadSettings[i].szName; - LoadAutoAwaySetting(loadSettings[i], protoName); - if (!override) { - if (loadSettings[i].optionFlags & FLAG_MONITORMIRANDA) - monitorMiranda = TRUE; - else if (ignoreLockKeys || ignoreSysKeys || ignoreAltCombo || (monitorMouse != monitorKeyboard)) - monitorAll = TRUE; - } - } - - if (db_get_b(NULL, "Idle", "AAEnable", 0)) - return; - - HookWindowsHooks(monitorMiranda, monitorAll); - hAutoAwayTimer = SetTimer(NULL, 0, db_get_w(NULL, MODULENAME, SETTING_AWAYCHECKTIMEINSECS, 5) * 1000, AutoAwayTimer); -} - -int LoadAutoAwaySetting(TAAAProtoSetting &autoAwaySetting, char* protoName) -{ - char setting[128]; - mir_snprintf(setting, "%s_OptionFlags", protoName); - autoAwaySetting.optionFlags = db_get_w(NULL, MODULENAME, setting, FLAG_LV2ONINACTIVE | FLAG_RESET); - mir_snprintf(setting, "%s_AwayTime", protoName); - autoAwaySetting.awayTime = db_get_w(NULL, MODULENAME, setting, SETTING_AWAYTIME_DEFAULT); - mir_snprintf(setting, "%s_NATime", protoName); - autoAwaySetting.naTime = db_get_w(NULL, MODULENAME, setting, SETTING_NATIME_DEFAULT); - mir_snprintf(setting, "%s_StatusFlags", protoName); - autoAwaySetting.statusFlags = db_get_w(NULL, MODULENAME, setting, StatusModeToProtoFlag(ID_STATUS_ONLINE) | StatusModeToProtoFlag(ID_STATUS_FREECHAT)); - - int flags; - if (db_get_b(NULL, MODULENAME, SETTING_SAMESETTINGS, 0)) - flags = 0xFFFFFF; - else - flags = CallProtoService(protoName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(protoName, PS_GETCAPS, (WPARAM)PFLAGNUM_5, 0); - mir_snprintf(setting, "%s_Lv1Status", protoName); - autoAwaySetting.lv1Status = db_get_w(NULL, MODULENAME, setting, (flags&StatusModeToProtoFlag(ID_STATUS_AWAY)) ? ID_STATUS_AWAY : ID_STATUS_OFFLINE); - mir_snprintf(setting, "%s_Lv2Status", protoName); - autoAwaySetting.lv2Status = db_get_w(NULL, MODULENAME, setting, (flags&StatusModeToProtoFlag(ID_STATUS_NA)) ? ID_STATUS_NA : ID_STATUS_OFFLINE); - - return 0; -} - -static int ProcessProtoAck(WPARAM wParam, LPARAM lParam) -{ - ACKDATA *ack = (ACKDATA*)lParam; - if (ack->type != ACKTYPE_STATUS || ack->result != ACKRESULT_SUCCESS) - return 0; - - log_debugA("ProcessProtoAck: ack->szModule: %s", ack->szModule); - for (int i = 0; i < autoAwaySettings.getCount(); i++) { - TAAAProtoSetting &p = autoAwaySettings[i]; - log_debugA("chk: %s", p.szName); - if (!mir_strcmp(p.szName, ack->szModule)) { - log_debugA("ack->szModule: %s p.statusChanged: %d", ack->szModule, p.statusChanged); - if (!p.statusChanged) - p.mStatus = TRUE; - - p.statusChanged = FALSE; - } - } - - return 0; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// Account control event - -int OnAccChanged(WPARAM wParam, LPARAM lParam) -{ - PROTOACCOUNT *pa = (PROTOACCOUNT*)lParam; - switch (wParam) { - case PRAC_ADDED: - autoAwaySettings.insert(new TAAAProtoSetting(pa)); - break; - - case PRAC_REMOVED: - for (int i = 0; i < autoAwaySettings.getCount(); i++) { - if (!mir_strcmp(autoAwaySettings[i].szName, pa->szModuleName)) { - autoAwaySettings.remove(i); - break; - } - } - break; - } - - return 0; -} - -static char* status2descr(int status) -{ - switch (status) { - case ACTIVE: return "ACTIVE"; - case STATUS1_SET: return "STATUS1_SET"; - case STATUS2_SET: return "STATUS2_SET"; - case SET_ORGSTATUS: return "SET_ORGSTATUS"; - case HIDDEN_ACTIVE: return "HIDDEN_ACTIVE"; - } - return "ERROR"; -} - -static int changeState(TAAAProtoSetting &setting, STATES newState) -{ - if (setting.curState == newState) - return 0; - - setting.oldState = setting.curState; - setting.curState = newState; - - log_debugA("%s state change: %s -> %s", setting.szName, status2descr(setting.oldState), status2descr(setting.curState)); - - NotifyEventHooks(hStateChangedEvent, 0, (LPARAM)&setting); - if (setting.curState != SET_ORGSTATUS && setting.curState != ACTIVE && setting.statusChanged) { - /* change the awaymessage */ - if (setting.szMsg != NULL) { - free(setting.szMsg); - setting.szMsg = NULL; - } - - if (db_get_b(NULL, MODULENAME, StatusModeToDbSetting(setting.status, SETTING_MSGCUSTOM), FALSE)) { - DBVARIANT dbv; - if (!db_get_ws(NULL, MODULENAME, StatusModeToDbSetting(setting.status, SETTING_STATUSMSG), &dbv)) { - setting.szMsg = wcsdup(dbv.ptszVal); - db_free(&dbv); - } - } - } - else if (setting.szMsg != NULL) { - free(setting.szMsg); - setting.szMsg = NULL; - } - - return 0; -} - -static VOID CALLBACK AutoAwayTimer(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime) -{ - int statusChanged = FALSE; - int confirm = FALSE; - - for (int i = 0; i < autoAwaySettings.getCount(); i++) { - TAAAProtoSetting& aas = autoAwaySettings[i]; - aas.status = ID_STATUS_DISABLED; - - BOOL bTrigger = false; - - if (aas.optionFlags & FLAG_MONITORMIRANDA) - mouseStationaryTimer = (GetTickCount() - lastMirandaInput) / 1000; - else { - LASTINPUTINFO ii = { sizeof(ii) }; - GetLastInputInfo(&ii); - mouseStationaryTimer = (GetTickCount() - ii.dwTime) / 1000; - } - - int sts1Time = aas.awayTime * SECS_PER_MINUTE; - int sts2Time = aas.naTime * SECS_PER_MINUTE; - int sts1setTime = aas.sts1setTimer == 0 ? 0 : (GetTickCount() - aas.sts1setTimer) / 1000; - int currentMode = CallProtoService(aas.szName, PS_GETSTATUS, 0, 0); - - if (aas.optionFlags & FLAG_ONSAVER) - bTrigger |= IsScreenSaverRunning(); - if (aas.optionFlags & FLAG_ONLOCK) - bTrigger |= IsWorkstationLocked(); - if (aas.optionFlags & FLAG_FULLSCREEN) - bTrigger |= IsFullScreen(); - - /* check states */ - if (aas.curState == ACTIVE) { - if (((mouseStationaryTimer >= sts1Time && (aas.optionFlags & FLAG_ONMOUSE)) || bTrigger) && currentMode != aas.lv1Status && aas.statusFlags&StatusModeToProtoFlag(currentMode)) { - /* from ACTIVE to STATUS1_SET */ - aas.lastStatus = aas.originalStatusMode = CallProtoService(aas.szName, PS_GETSTATUS, 0, 0); - aas.status = aas.lv1Status; - aas.sts1setTimer = GetTickCount(); - sts1setTime = 0; - aas.statusChanged = statusChanged = TRUE; - changeState(aas, STATUS1_SET); - } - else if (mouseStationaryTimer >= sts2Time && currentMode == aas.lv1Status && currentMode != aas.lv2Status && (aas.optionFlags & FLAG_SETNA) && (aas.statusFlags & StatusModeToProtoFlag(currentMode))) { - /* from ACTIVE to STATUS2_SET */ - aas.lastStatus = aas.originalStatusMode = CallProtoService(aas.szName, PS_GETSTATUS, 0, 0); - aas.status = aas.lv2Status; - aas.statusChanged = statusChanged = TRUE; - changeState(aas, STATUS2_SET); - } - } - - if (aas.curState == STATUS1_SET) { - if ((mouseStationaryTimer < sts1Time && !bTrigger) && !(aas.optionFlags & FLAG_RESET)) { - /* from STATUS1_SET to HIDDEN_ACTIVE */ - changeState(aas, HIDDEN_ACTIVE); - aas.lastStatus = CallProtoService(aas.szName, PS_GETSTATUS, 0, 0); - } - else if (((mouseStationaryTimer < sts1Time) && !bTrigger) && - ((aas.optionFlags & FLAG_LV2ONINACTIVE) || (!(aas.optionFlags&FLAG_SETNA))) && - (aas.optionFlags & FLAG_RESET)) { - /* from STATUS1_SET to SET_ORGSTATUS */ - changeState(aas, SET_ORGSTATUS); - } - else if ((aas.optionFlags & FLAG_SETNA) && sts1setTime >= sts2Time) { - /* when set STATUS2, currentMode doesn't have to be in the selected status list (statusFlags) */ - /* from STATUS1_SET to STATUS2_SET */ - aas.lastStatus = CallProtoService(aas.szName, PS_GETSTATUS, 0, 0); - aas.status = aas.lv2Status; - aas.statusChanged = statusChanged = TRUE; - changeState(aas, STATUS2_SET); - } - } - - if (aas.curState == STATUS2_SET) { - if (mouseStationaryTimer < sts2Time && !bTrigger && (aas.optionFlags & FLAG_RESET)) { - /* from STATUS2_SET to SET_ORGSTATUS */ - changeState(aas, SET_ORGSTATUS); - } - else if (mouseStationaryTimer < sts2Time && !bTrigger && !(aas.optionFlags & FLAG_RESET)) { - /* from STATUS2_SET to HIDDEN_ACTIVE */ - /* Remember: after status1 is set, and "only on inactive" is NOT set, it implies !reset. */ - changeState(aas, HIDDEN_ACTIVE); - aas.lastStatus = CallProtoService(aas.szName, PS_GETSTATUS, 0, 0); - } - } - - if (aas.curState == HIDDEN_ACTIVE) { - if (aas.mStatus) { - /* HIDDEN_ACTIVE to ACTIVE */ - //aas.statusChanged = FALSE; - changeState(aas, ACTIVE); - aas.sts1setTimer = 0; - aas.mStatus = FALSE; - } - else if ((aas.optionFlags & FLAG_SETNA) && currentMode == aas.lv1Status && - currentMode != aas.lv2Status && (aas.statusFlags & StatusModeToProtoFlag(currentMode)) && - (mouseStationaryTimer >= sts2Time || (sts1setTime >= sts2Time && !(aas.optionFlags & FLAG_LV2ONINACTIVE)))) { - /* HIDDEN_ACTIVE to STATUS2_SET */ - aas.lastStatus = aas.originalStatusMode = CallProtoService(aas.szName, PS_GETSTATUS, 0, 0); - aas.status = aas.lv2Status; - aas.statusChanged = statusChanged = TRUE; - changeState(aas, STATUS2_SET); - } - } - if (aas.curState == SET_ORGSTATUS) { - /* SET_ORGSTATUS to ACTIVE */ - aas.lastStatus = CallProtoService(aas.szName, PS_GETSTATUS, 0, 0); - aas.status = aas.originalStatusMode; - confirm = (aas.optionFlags&FLAG_CONFIRM) ? TRUE : confirm; - aas.statusChanged = statusChanged = TRUE; - changeState(aas, ACTIVE); - aas.sts1setTimer = 0; - } - autoAwaySettings[i].mStatus = FALSE; - } - - if (confirm || statusChanged) { - TAAAProtoSettingList ps = autoAwaySettings; - for (int i = 0; i < ps.getCount(); i++) { - if (ps[i].szMsg) - ps[i].szMsg = wcsdup(ps[i].szMsg); - - if (ps[i].status == ID_STATUS_DISABLED) - ps[i].szName = ""; - } - - if (confirm) - confirmDialog = (HWND)CallService(MS_CS_SHOWCONFIRMDLGEX, (WPARAM)&ps, db_get_w(NULL, MODULENAME, SETTING_CONFIRMDELAY, 5)); - else if (statusChanged) - CallService(MS_CS_SETSTATUSEX, (WPARAM)&ps, 0); - } -} - -///////////////////////////////////////////////////////////////////////////////////////// -// Windows hooks - -static int HookWindowsHooks(int hookMiranda, int hookAll) -{ - if (hookMiranda) { - if (monitorKeyboard && hMirandaKeyBoardHook == NULL) - hMirandaKeyBoardHook = SetWindowsHookEx(WH_KEYBOARD, MirandaKeyBoardHookFunction, NULL, GetCurrentThreadId()); - if (monitorMouse && hMirandaMouseHook == NULL) - hMirandaMouseHook = SetWindowsHookEx(WH_MOUSE, MirandaMouseHookFunction, NULL, GetCurrentThreadId()); - } - if (hookAll) { - if (monitorKeyboard && hKeyBoardHook == NULL) - hKeyBoardHook = SetWindowsHookEx(WH_KEYBOARD, KeyBoardHookFunction, 0, GetCurrentThreadId()); - if (monitorMouse && hMouseHook == NULL) - hMouseHook = SetWindowsHookEx(WH_MOUSE, MouseHookFunction, 0, GetCurrentThreadId()); - } - - return 0; -} - -static int UnhookWindowsHooks() -{ - UnhookWindowsHookEx(hMouseHook); - UnhookWindowsHookEx(hKeyBoardHook); - UnhookWindowsHookEx(hMirandaMouseHook); - UnhookWindowsHookEx(hMirandaKeyBoardHook); - - hMouseHook = hKeyBoardHook = hMirandaMouseHook = hMirandaKeyBoardHook = NULL; - return 0; -} - -static LRESULT CALLBACK MirandaMouseHookFunction(int code, WPARAM wParam, LPARAM lParam) -{ - if (code >= 0) { - PMOUSEHOOKSTRUCT mouseInfo = (PMOUSEHOOKSTRUCT)lParam; - POINT pt = mouseInfo->pt; - - /* TioDuke's KeyBoardNotifyExt: only update if a Miranda window is focused */ - DWORD pid; - GetWindowThreadProcessId(GetForegroundWindow(), &pid); - if (pid != GetCurrentProcessId()) - return CallNextHookEx(hMirandaMouseHook, code, wParam, lParam); - - if (pt.x != lastMousePos.x || pt.y != lastMousePos.y) { - lastMousePos = pt; - lastMirandaInput = GetTickCount(); - } - } - - return CallNextHookEx(hMirandaMouseHook, code, wParam, lParam); -} - -static LRESULT CALLBACK MirandaKeyBoardHookFunction(int code, WPARAM wParam, LPARAM lParam) -{ - if (code >= 0) { - if (ignoreAltCombo) { - if (((GetKeyState(VK_MENU) < 0) || (wParam == VK_MENU)) || - ((GetKeyState(VK_TAB) < 0) || (wParam == VK_TAB)) || - ((GetKeyState(VK_SHIFT) < 0) || (wParam == VK_SHIFT)) || - ((GetKeyState(VK_CONTROL) < 0) || (wParam == VK_CONTROL)) || - ((GetKeyState(VK_ESCAPE) < 0) || (wParam == VK_ESCAPE)) || - ((GetKeyState(VK_LWIN) < 0) || (wParam == VK_LWIN)) || - ((GetKeyState(VK_RWIN) < 0) || (wParam == VK_RWIN))) - { - return CallNextHookEx(hMirandaKeyBoardHook, code, wParam, lParam); - } - } - - switch (wParam) { - case VK_NUMLOCK: - case VK_CAPITAL: - case VK_SCROLL: - if (!ignoreLockKeys) - lastMirandaInput = GetTickCount(); - break; - - case VK_TAB: - case VK_SHIFT: - case VK_CONTROL: - case VK_MENU: - case VK_ESCAPE: - case VK_LWIN: - case VK_RWIN: - if (!ignoreSysKeys) - lastMirandaInput = GetTickCount(); - break; - - default: - lastMirandaInput = GetTickCount(); - break; - } - } - - return CallNextHookEx(hMirandaKeyBoardHook, code, wParam, lParam); -} - -static LRESULT CALLBACK MouseHookFunction(int code, WPARAM wParam, LPARAM lParam) -{ - if (code >= 0) { - PMOUSEHOOKSTRUCT mouseInfo = (PMOUSEHOOKSTRUCT)lParam; - POINT pt = mouseInfo->pt; - - /* TioDuke's KeyBoardNotifyExt: also grab clicks */ - if ((wParam >= WM_NCLBUTTONDOWN && wParam <= WM_NCXBUTTONDBLCLK && wParam != 0x00AA) || (wParam >= WM_LBUTTONDOWN && wParam <= WM_XBUTTONDBLCLK)) - lastInput = GetTickCount(); - - if (pt.x != lastMousePos.x || pt.y != lastMousePos.y) { - lastMousePos = pt; - lastInput = GetTickCount(); - } - } - - return CallNextHookEx(hMouseHook, code, wParam, lParam); -} - -static LRESULT CALLBACK KeyBoardHookFunction(int code, WPARAM wParam, LPARAM lParam) -{ - if (code >= 0) { - if (ignoreAltCombo) { - if (((GetKeyState(VK_MENU) < 0) || (wParam == VK_MENU)) || - ((GetKeyState(VK_TAB) < 0) || (wParam == VK_TAB)) || - ((GetKeyState(VK_SHIFT) < 0) || (wParam == VK_SHIFT)) || - ((GetKeyState(VK_CONTROL) < 0) || (wParam == VK_CONTROL)) || - ((GetKeyState(VK_ESCAPE) < 0) || (wParam == VK_ESCAPE)) || - ((GetKeyState(VK_LWIN) < 0) || (wParam == VK_LWIN)) || - ((GetKeyState(VK_RWIN) < 0) || (wParam == VK_RWIN))) - { - return CallNextHookEx(hKeyBoardHook, code, wParam, lParam); - } - } - - switch (wParam) { - case VK_NUMLOCK: - case VK_CAPITAL: - case VK_SCROLL: - if (!ignoreLockKeys) - lastInput = GetTickCount(); - break; - - case VK_TAB: - case VK_SHIFT: - case VK_CONTROL: - case VK_MENU: - case VK_ESCAPE: - case VK_LWIN: - case VK_RWIN: - if (!ignoreSysKeys) - lastInput = GetTickCount(); - break; - - default: - lastInput = GetTickCount(); - break; - } - } - - return CallNextHookEx(hKeyBoardHook, code, wParam, lParam); -} - -///////////////////////////////////////////////////////////////////////////////////////// -// Inits & stuff - -static int AutoAwayShutdown(WPARAM wParam, LPARAM lParam) -{ - KillTimer(NULL, hAutoAwayTimer); - -#ifdef TRIGGERPLUGIN - DeInitTrigger(); -#endif - UnhookWindowsHooks(); - DestroyHookableEvent(hStateChangedEvent); - - autoAwaySettings.destroy(); - return 0; -} - -int CSModuleLoaded(WPARAM wParam, LPARAM lParam) -{ - HookEvent(ME_PROTO_ACCLISTCHANGED, OnAccChanged); - HookEvent(ME_OPT_INITIALISE, AutoAwayOptInitialise); - HookEvent(ME_SYSTEM_PRESHUTDOWN, AutoAwayShutdown); - HookEvent(ME_PROTO_ACK, ProcessProtoAck); - mouseStationaryTimer = 0; - lastInput = lastMirandaInput = GetTickCount(); - - //////////////////////////////////////////////////////////////////////////////////////// - - protoList = (OBJLIST*)&autoAwaySettings; - - int count; - PROTOACCOUNT** protos; - Proto_EnumAccounts(&count, &protos); - - for (int i = 0; i < count; i++) - if (IsSuitableProto(protos[i])) - autoAwaySettings.insert(new TAAAProtoSetting(protos[i])); - - //////////////////////////////////////////////////////////////////////////////////////// - - LoadOptions(autoAwaySettings, FALSE); - return 0; -} diff --git a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.h b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.h deleted file mode 100644 index 4a96da2544..0000000000 --- a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - AdvancedAutoAway Plugin for Miranda-IM (www.miranda-im.org) - Copyright 2003-2006 P. Boon - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -#ifndef __ADVANCED_AUTOAWAY_HEADER -#define __ADVANCED_AUTOAWAY_HEADER - -#include -#include "version.h" - -#define SETTING_IGNLOCK "IgnoreLockKeys" -#define SETTING_IGNSYSKEYS "IgnoreSysKeys" -#define SETTING_IGNALTCOMBO "IgnoreAltCombo" -#define SETTING_SAMESETTINGS "SameAutoAwaySettings" -#define SETTING_ALL "ALLPROTOS" -#define SETTING_MSGCUSTOM "Custom" -#define SETTING_STATUSMSG "Msg" -#define SETTING_CONFIRMDELAY "ConfirmTimeout" -#define MODULENAME "AdvancedAutoAway" - -#define SETTING_AWAYTIME_DEFAULT 5 -#define SETTING_NATIME_DEFAULT 20 -#define SETTING_AWAYCHECKTIMEINSECS "CheckInterval" - -#define STATUS_RESET 1 -#define STATUS_AUTOAWAY 2 -#define STATUS_AUTONA 3 - -#define SETTING_MONITORMOUSE "MonitorMouse" -#define SETTING_MONITORKEYBOARD "MonitorKeyboard" - -#define FLAG_ONSAVER 0x0001 // db: set lv1 status on screensaver ? -#define FLAG_ONMOUSE 0x0002 // db: set after inactivity ? -#define FLAG_SETNA 0x0004 // db: set NA after xx of away time ? -#define FLAG_CONFIRM 0x0008 // db: show confirm dialog ? -#define FLAG_RESET 0x0010 // db: restore status ? -#define FLAG_LV2ONINACTIVE 0x0020 // db: set lv2 only on inactivity -#define FLAG_MONITORMIRANDA 0x0040 // db: monitor miranda activity only -#define FLAG_ONLOCK 0x0080 // db: on work station lock -#define FLAG_FULLSCREEN 0x0100 // db: on full screen - -struct TAAAProtoSetting : public PROTOCOLSETTINGEX, public MZeroedObject -{ - TAAAProtoSetting(PROTOACCOUNT *pa); - ~TAAAProtoSetting(); - - int originalStatusMode; - STATES - oldState, - curState; - BOOL statusChanged; // AAA changed the status, don't update mStatus - BOOL mStatus; // status changed manually or not ? - int optionFlags, // db: see above - awayTime, // db: time to wait for inactivity - naTime, // db: time to wait after away is set - statusFlags; // db: set lv1 status if this is original status - WORD lv1Status, // db - lv2Status; // db - unsigned int sts1setTimer; -}; - -struct AAMSGSETTING -{ - short useCustom; - int status; - char* msg; -}; - -extern HINSTANCE hInst; - -int CompareSettings( const TAAAProtoSetting *p1, const TAAAProtoSetting *p2 ); - -typedef OBJLIST TAAAProtoSettingList; -extern TAAAProtoSettingList autoAwaySettings; - -int LoadAutoAwaySetting(TAAAProtoSetting &autoAwaySetting, char *protoName); -void LoadOptions(TAAAProtoSettingList &settings, BOOL override); - -#endif diff --git a/plugins/StatusPlugins/AdvancedAutoAway/fsm.jpg b/plugins/StatusPlugins/AdvancedAutoAway/fsm.jpg deleted file mode 100644 index 21066a3939..0000000000 Binary files a/plugins/StatusPlugins/AdvancedAutoAway/fsm.jpg and /dev/null differ diff --git a/plugins/StatusPlugins/AdvancedAutoAway/main.cpp b/plugins/StatusPlugins/AdvancedAutoAway/main.cpp deleted file mode 100644 index e271378c20..0000000000 --- a/plugins/StatusPlugins/AdvancedAutoAway/main.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - AdvancedAutoAway Plugin for Miranda-IM (www.miranda-im.org) - Copyright 2003-2006 P. Boon - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - Some code is copied from Miranda's AutoAway module -*/ - -#include "../commonstatus.h" -#include "advancedautoaway.h" -#include "../resource.h" - -HINSTANCE hInst; -CLIST_INTERFACE *pcli; - -HANDLE hCSModuleLoadedHook; -HANDLE hStateChangedEvent; -int hLangpack = 0; - -int CSModuleLoaded(WPARAM wParam, LPARAM lParam); - -///////////////////////////////////////////////////////////////////////////////////////// -// dll entry point - -BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved) -{ - if (fdwReason == DLL_PROCESS_ATTACH) - hInst = hinstDLL; - - return TRUE; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// returns plugin's extended information - -PLUGININFOEX pluginInfoEx={ - sizeof(PLUGININFOEX), - __PLUGIN_NAME, - PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), - __DESC, - __AUTHOR, - __AUTHOREMAIL, - __COPYRIGHT, - __AUTHORWEB, - UNICODE_AWARE, - { 0xf0fdf73a, 0x753d, 0x499d, { 0x8d, 0xba, 0x33, 0x6d, 0xb7, 0x9c, 0xdd, 0x41 } } // {F0FDF73A-753D-499d-8DBA-336DB79CDD41} -}; - -extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) -{ - return &pluginInfoEx; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// interfaces - -extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_AUTOAWAY, MIID_LAST }; - -///////////////////////////////////////////////////////////////////////////////////////// -// plugin's entry point - -extern "C" __declspec(dllexport) int Load(void) -{ - mir_getLP(&pluginInfoEx); - pcli = Clist_GetInterface(); - - InitCommonStatus(); - hCSModuleLoadedHook = HookEvent(ME_SYSTEM_MODULESLOADED, CSModuleLoaded); - hStateChangedEvent = CreateHookableEvent(ME_AAA_STATECHANGED); - return 0; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// plugin's exit point - -extern "C" __declspec(dllexport) int Unload(void) -{ - return 0; -} diff --git a/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp b/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp deleted file mode 100644 index 9435d0db54..0000000000 --- a/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp +++ /dev/null @@ -1,180 +0,0 @@ -/* - AdvancedAutoAway Plugin for Miranda-IM (www.miranda-im.org) - Copyright 2003-2006 P. Boon - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -#include "../commonstatus.h" -#include "advancedautoaway.h" -#include "../resource.h" - -extern char *StatusModeToDbSetting(int status,const char *suffix); - -void DisableDialog(HWND hwndDlg) -{ - EnableWindow(GetDlgItem(hwndDlg, IDC_STATUS), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_STATUSMSG), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_VARIABLESHELP), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_RADUSECUSTOM), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_RADUSEMIRANDA), FALSE); -} - -INT_PTR CALLBACK DlgProcAutoAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) -{ - static AAMSGSETTING** settings; - static int last, count; - - switch( msg ) { - case WM_INITDIALOG: - TranslateDialogDefault( hwndDlg ); - { - ShowWindow(GetDlgItem(hwndDlg, IDC_VARIABLESHELP), ServiceExists(MS_VARS_SHOWHELP)?SW_SHOW:SW_HIDE); - count = 0; - last = -1; - - PROTOACCOUNT** proto; - int protoCount = 0; - Proto_EnumAccounts(&protoCount, &proto); - if (protoCount <= 0) - { - DisableDialog(hwndDlg); - break; - } - - DWORD protoModeMsgFlags = 0; - for (int i=0; i < protoCount; i++) - if (CallProtoService(proto[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND & ~PF1_INDIVMODEMSG) - protoModeMsgFlags |= CallProtoService( proto[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0 ); - - if (protoModeMsgFlags == 0) - { - DisableDialog(hwndDlg); - break; - } - - settings = ( AAMSGSETTING** )malloc(sizeof(AAMSGSETTING*)); - count = 0; - for (int i=0; i < _countof(statusModeList); i++ ) { - if ( !( protoModeMsgFlags & Proto_Status2Flag( statusModeList[i] ))) - continue; - - int j = SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_ADDSTRING, 0, (LPARAM)pcli->pfnGetStatusModeDescription(statusModeList[i], 0)); - SendDlgItemMessage( hwndDlg, IDC_STATUS, CB_SETITEMDATA, j, statusModeList[i] ); - settings = ( AAMSGSETTING** )realloc(settings, (count+1)*sizeof(AAMSGSETTING*)); - settings[count] = ( AAMSGSETTING* )malloc(sizeof(AAMSGSETTING)); - settings[count]->status = statusModeList[i]; - - DBVARIANT dbv; - if ( !db_get(NULL, MODULENAME, StatusModeToDbSetting(statusModeList[i],SETTING_STATUSMSG), &dbv)) { - settings[count]->msg = ( char* )malloc(mir_strlen(dbv.pszVal) + 1); - mir_strcpy(settings[count]->msg, dbv.pszVal); - db_free(&dbv); - } - else settings[count]->msg = NULL; - - settings[count]->useCustom = db_get_b(NULL, MODULENAME, StatusModeToDbSetting(statusModeList[i], SETTING_MSGCUSTOM), FALSE); - count += 1; - } - SendDlgItemMessage(hwndDlg,IDC_STATUS,CB_SETCURSEL,0,0); - SendMessage(hwndDlg,WM_COMMAND,MAKEWPARAM(IDC_STATUS,CBN_SELCHANGE),0); - } - break; - - case WM_COMMAND: - if ( ((HIWORD(wParam) == EN_CHANGE) || (HIWORD(wParam) == BN_CLICKED)) && ((HWND)lParam == GetFocus())) - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - - switch(LOWORD(wParam)) { - case IDC_RADUSEMIRANDA: - CheckDlgButton(hwndDlg, IDC_RADUSECUSTOM, BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_RADUSEMIRANDA) ? BST_CHECKED : BST_UNCHECKED); - EnableWindow(GetDlgItem(hwndDlg, IDC_STATUSMSG), IsDlgButtonChecked(hwndDlg, IDC_RADUSECUSTOM)); - EnableWindow(GetDlgItem(hwndDlg, IDC_VARIABLESHELP), IsDlgButtonChecked(hwndDlg, IDC_RADUSECUSTOM)); - settings[SendDlgItemMessage(hwndDlg,IDC_STATUS,CB_GETCURSEL,0,0)]->useCustom = IsDlgButtonChecked(hwndDlg, IDC_RADUSECUSTOM); - break; - - case IDC_RADUSECUSTOM: - CheckDlgButton(hwndDlg, IDC_RADUSEMIRANDA, BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_RADUSECUSTOM) ? BST_CHECKED : BST_UNCHECKED); - EnableWindow(GetDlgItem(hwndDlg, IDC_STATUSMSG), IsDlgButtonChecked(hwndDlg, IDC_RADUSECUSTOM)); - EnableWindow(GetDlgItem(hwndDlg, IDC_VARIABLESHELP), IsDlgButtonChecked(hwndDlg, IDC_RADUSECUSTOM)); - settings[SendDlgItemMessage(hwndDlg,IDC_STATUS,CB_GETCURSEL,0,0)]->useCustom = IsDlgButtonChecked(hwndDlg, IDC_RADUSECUSTOM); - break; - - case IDC_STATUS: - if ( HIWORD( wParam ) == CBN_SELCHANGE ) { - int i = SendDlgItemMessage(hwndDlg,IDC_STATUS,CB_GETCURSEL,0,0); - int len = SendDlgItemMessage(hwndDlg, IDC_STATUSMSG, WM_GETTEXTLENGTH, 0, 0); - if ( last != -1 ) { - if (settings[last]->msg == NULL) - settings[last]->msg = ( char* )malloc(len+1); - else - settings[last]->msg = (char*)realloc(settings[last]->msg, len+1); - GetDlgItemTextA(hwndDlg, IDC_STATUSMSG, settings[last]->msg, (len+1)); - } - - if (i != -1) { - if (settings[i]->msg != NULL) - SetDlgItemTextA(hwndDlg, IDC_STATUSMSG, settings[i]->msg); - else { - ptrW msg((wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGW, settings[i]->status, 0)); - SetDlgItemText(hwndDlg, IDC_STATUSMSG, (msg != NULL) ? msg : L""); - } - - if (settings[i]->useCustom) { - EnableWindow(GetDlgItem(hwndDlg, IDC_STATUSMSG), TRUE); - EnableWindow(GetDlgItem(hwndDlg, IDC_VARIABLESHELP), TRUE); - CheckDlgButton(hwndDlg, IDC_RADUSECUSTOM, BST_CHECKED); - CheckDlgButton(hwndDlg, IDC_RADUSEMIRANDA, BST_UNCHECKED); - } - else { - EnableWindow(GetDlgItem(hwndDlg, IDC_STATUSMSG), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_VARIABLESHELP), FALSE); - CheckDlgButton(hwndDlg, IDC_RADUSEMIRANDA, BST_CHECKED); - CheckDlgButton(hwndDlg, IDC_RADUSECUSTOM, BST_UNCHECKED); - } - } - last = i; - } - break; - - case IDC_VARIABLESHELP: - CallService(MS_VARS_SHOWHELP, (WPARAM)GetDlgItem(hwndDlg, IDC_STATUSMSG), 0); - break; - } - break; - - case WM_NOTIFY: - switch (((LPNMHDR)lParam)->code) { - case PSN_APPLY: - SendMessage(hwndDlg,WM_COMMAND,MAKEWPARAM(IDC_STATUS,CBN_SELCHANGE),0); - for (int i=0; i < count; i++ ) { - db_set_b(NULL, MODULENAME, StatusModeToDbSetting(settings[i]->status,SETTING_MSGCUSTOM), (BYTE)settings[i]->useCustom); - if ( (settings[i]->useCustom) && (settings[i]->msg != NULL) && (settings[i]->msg[0] != '\0')) - db_set_s(NULL, MODULENAME, StatusModeToDbSetting(settings[i]->status,SETTING_STATUSMSG), settings[i]->msg); - } - break; - } - break; - - case WM_DESTROY: - for (int i=0; i < count; i++ ) { - free(settings[i]->msg); - free(settings[i]); - } - free(settings); - break; - } - - return FALSE; -} diff --git a/plugins/StatusPlugins/AdvancedAutoAway/options.cpp b/plugins/StatusPlugins/AdvancedAutoAway/options.cpp deleted file mode 100644 index 02516f3e9e..0000000000 --- a/plugins/StatusPlugins/AdvancedAutoAway/options.cpp +++ /dev/null @@ -1,526 +0,0 @@ -/* -AdvancedAutoAway Plugin for Miranda-IM (www.miranda-im.org) -Copyright 2003-2006 P. Boon - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#include "../commonstatus.h" -#include "advancedautoaway.h" -#include "../resource.h" -#include - -int LoadAutoAwaySetting(TAAAProtoSetting &autoAwaySetting, char* protoName); - -INT_PTR CALLBACK DlgProcAutoAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); - -static BOOL bSettingSame = FALSE; - -///////////////////////////////////////////////////////////////////////////////////////// -// Dialog service functions - -static int WriteAutoAwaySetting(TAAAProtoSetting &autoAwaySetting, char *protoName) -{ - char setting[128]; - mir_snprintf(setting, "%s_OptionFlags", protoName); - db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.optionFlags); - mir_snprintf(setting, "%s_AwayTime", protoName); - db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.awayTime); - mir_snprintf(setting, "%s_NATime", protoName); - db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.naTime); - mir_snprintf(setting, "%s_StatusFlags", protoName); - db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.statusFlags); - mir_snprintf(setting, "%s_Lv1Status", protoName); - db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.lv1Status); - mir_snprintf(setting, "%s_Lv2Status", protoName); - db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.lv2Status); - - return 0; -} - -static void SetDialogItems(HWND hwndDlg, TAAAProtoSetting *setting) -{ - bool bIsTimed = (setting->optionFlags & FLAG_ONMOUSE) != 0; - bool bSetNA = (setting->optionFlags & FLAG_SETNA) != 0; - bool bSaver = (setting->optionFlags & FLAG_ONSAVER) != 0; - bool bFullScr = (setting->optionFlags & FLAG_FULLSCREEN) != 0; - - CheckDlgButton(hwndDlg, IDC_FULLSCREEN, bFullScr ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_SCREENSAVE, bSaver ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_ONLOCK, (setting->optionFlags & FLAG_ONLOCK) != 0 ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_TIMED, bIsTimed ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_SETNA, bSetNA ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_CONFIRM, (setting->optionFlags & FLAG_CONFIRM) != 0 ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_RESETSTATUS, (setting->optionFlags & FLAG_RESET) != 0 ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_MONITORMIRANDA, (setting->optionFlags & FLAG_MONITORMIRANDA) != 0 ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_LV2ONINACTIVE, (setting->optionFlags & FLAG_LV2ONINACTIVE) != 0 ? BST_CHECKED : BST_UNCHECKED); - - SetDlgItemInt(hwndDlg, IDC_AWAYTIME, setting->awayTime, FALSE); - SetDlgItemInt(hwndDlg, IDC_NATIME, setting->naTime, FALSE); - - EnableWindow(GetDlgItem(hwndDlg, IDC_SETNA), bIsTimed); - EnableWindow(GetDlgItem(hwndDlg, IDC_LV2ONINACTIVE), bIsTimed && bSetNA); - EnableWindow(GetDlgItem(hwndDlg, IDC_MONITORMIRANDA), bIsTimed); - EnableWindow(GetDlgItem(hwndDlg, IDC_AWAYTIME), bIsTimed); - EnableWindow(GetDlgItem(hwndDlg, IDC_LV1AFTERSTR), bIsTimed); - EnableWindow(GetDlgItem(hwndDlg, IDC_LV1STATUS), bIsTimed || bSaver || bFullScr); - EnableWindow(GetDlgItem(hwndDlg, IDC_STATUSLIST), bIsTimed || bSaver || bFullScr); - EnableWindow(GetDlgItem(hwndDlg, IDC_RESETSTATUS), (bIsTimed || bSaver || bFullScr) && IsDlgButtonChecked(hwndDlg, IDC_LV2ONINACTIVE)); - EnableWindow(GetDlgItem(hwndDlg, IDC_CONFIRM), (bIsTimed || bSaver || bFullScr) && IsDlgButtonChecked(hwndDlg, IDC_LV2ONINACTIVE) && IsDlgButtonChecked(hwndDlg, IDC_RESETSTATUS)); - EnableWindow(GetDlgItem(hwndDlg, IDC_NATIME), bSetNA && bIsTimed); - EnableWindow(GetDlgItem(hwndDlg, IDC_SETNASTR), bSetNA && bIsTimed); - EnableWindow(GetDlgItem(hwndDlg, IDC_SETNASTR), bSetNA && bIsTimed); - EnableWindow(GetDlgItem(hwndDlg, IDC_LV2STATUS), bSetNA && bIsTimed); - EnableWindow(GetDlgItem(hwndDlg, IDC_PROTOCOL), !bSettingSame); -} - -static TAAAProtoSetting* GetSetting(HWND hwndDlg, TAAAProtoSetting *sameSetting) -{ - if (bSettingSame) - return sameSetting; - - int iItem = SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, CB_GETCURSEL, 0, 0); - if (iItem == -1) - return NULL; - - INT_PTR iData = (INT_PTR)SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, CB_GETITEMDATA, iItem, 0); - return (iData == -1) ? NULL : (TAAAProtoSetting*)iData; -} - -static void SetDialogStatus(HWND hwndDlg, TAAAProtoSetting *sameSetting) -{ - TAAAProtoSetting *setting = GetSetting(hwndDlg, sameSetting); - if (setting == NULL) - return; - - // create columns - HWND hList = GetDlgItem(hwndDlg, IDC_STATUSLIST); - ListView_SetExtendedListViewStyleEx(hList, LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES, LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES); - - LVCOLUMN lvCol = { 0 }; - lvCol.mask = LVCF_WIDTH | LVCF_TEXT; - lvCol.pszText = TranslateT("Status"); - lvCol.cx = 118; - ListView_InsertColumn(hList, 0, &lvCol); - - // get pointer to settings - SetDialogItems(hwndDlg, setting); -} - -///////////////////////////////////////////////////////////////////////////////////////// -// Rules dialog window procedure - -static TAAAProtoSettingList optionSettings(10, CompareSettings); - -static INT_PTR CALLBACK DlgProcAutoAwayRulesOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) -{ - static TAAAProtoSetting* sameSetting; - TAAAProtoSetting *setting; - static int init; - - switch (msg) { - case WM_INITDIALOG: - init = TRUE; - TranslateDialogDefault(hwndDlg); - - // copy the settings - optionSettings = autoAwaySettings; - - sameSetting = (TAAAProtoSetting*)malloc(sizeof(TAAAProtoSetting)); - LoadAutoAwaySetting(*sameSetting, SETTING_ALL); - - // fill list from currentProtoSettings - { - for (int i = 0; i < optionSettings.getCount(); i++) { - TAAAProtoSetting &p = optionSettings[i]; - int item = SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, CB_ADDSTRING, 0, (LPARAM)p.tszAccName); - SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, CB_SETITEMDATA, item, (LPARAM)&p); - } - } - // set cursor to first protocol - SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, CB_SETCURSEL, 0, 0); - - // status list - SetDialogStatus(hwndDlg, sameSetting); - - SendMessage(hwndDlg, WM_COMMAND, (WPARAM)IDC_PROTOCOL, (LPARAM)0x11111111); - init = FALSE; - break; - - case WM_COMMAND: - if ((HIWORD(wParam) == EN_CHANGE || HIWORD(wParam) == BN_CLICKED) && (HWND)lParam == GetFocus()) - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - - setting = GetSetting(hwndDlg, sameSetting); - if (!setting) - break; - - switch (LOWORD(wParam)) { - case IDC_PROTOCOL: - // status listview - init = TRUE; - { - HWND hList = GetDlgItem(hwndDlg, IDC_STATUSLIST); - ListView_DeleteAllItems(hList); - - int flags = 0; - if (!bSettingSame) - flags = CallProtoService(setting->szName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(setting->szName, PS_GETCAPS, (WPARAM)PFLAGNUM_5, 0); - - LVITEM lvItem = { 0 }; - lvItem.mask = LVIF_TEXT | LVIF_PARAM; - lvItem.iItem = 0; - lvItem.iSubItem = 0; - for (int i = 0; i < _countof(statusModeList); i++) { - if ((flags & statusModePf2List[i]) || (statusModePf2List[i] == PF2_OFFLINE) || (bSettingSame)) { - lvItem.pszText = pcli->pfnGetStatusModeDescription(statusModeList[i], 0); - lvItem.lParam = (LPARAM)statusModePf2List[i]; - ListView_InsertItem(hList, &lvItem); - ListView_SetCheckState(hList, lvItem.iItem, setting->statusFlags & statusModePf2List[i] ? TRUE : FALSE); - lvItem.iItem++; - } - } - } - init = FALSE; - // status dropdown boxes - { - int flags = 0; - if (!bSettingSame) - flags = CallProtoService(setting->szName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(setting->szName, PS_GETCAPS, (WPARAM)PFLAGNUM_5, 0); - - // clear box and add new status, loop status and check if compatible with proto - SendDlgItemMessage(hwndDlg, IDC_LV1STATUS, CB_RESETCONTENT, 0, 0); - SendDlgItemMessage(hwndDlg, IDC_LV2STATUS, CB_RESETCONTENT, 0, 0); - for (int i=0; i < _countof(statusModeList); i++) { - if ((flags & statusModePf2List[i]) || statusModePf2List[i] == PF2_OFFLINE || bSettingSame) { - wchar_t *statusMode = pcli->pfnGetStatusModeDescription(statusModeList[i], 0); - int item = SendDlgItemMessage(hwndDlg, IDC_LV1STATUS, CB_ADDSTRING, 0, (LPARAM)statusMode); - SendDlgItemMessage(hwndDlg, IDC_LV1STATUS, CB_SETITEMDATA, item, (LPARAM)statusModeList[i]); - item = SendDlgItemMessage(hwndDlg, IDC_LV2STATUS, CB_ADDSTRING, 0, (LPARAM)statusMode); - SendDlgItemMessage(hwndDlg, IDC_LV2STATUS, CB_SETITEMDATA, item, (LPARAM)statusModeList[i]); - if (statusModeList[i] == setting->lv1Status) { - SendDlgItemMessage(hwndDlg, IDC_LV1STATUS, CB_SETCURSEL, (WPARAM)item, 0); - SetDlgItemText(hwndDlg, IDC_SETNASTR, CMStringW(FORMAT, TranslateT("minutes of %s mode"), statusMode)); - } - if (statusModeList[i] == setting->lv2Status) - SendDlgItemMessage(hwndDlg, IDC_LV2STATUS, CB_SETCURSEL, (WPARAM)item, 0); - } - } - } - SetDialogItems(hwndDlg, setting); - break; - - case IDC_LV1STATUS: - if (HIWORD(wParam) == CBN_SELCHANGE) - SendMessage(GetParent(hwndDlg),PSM_CHANGED,0,0); - - setting->lv1Status = (int)SendDlgItemMessage(hwndDlg, IDC_LV1STATUS, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_LV1STATUS, CB_GETCURSEL, 0, 0), 0); - SetDlgItemText(hwndDlg, IDC_SETNASTR, CMStringW(FORMAT, TranslateT("minutes of %s mode"), pcli->pfnGetStatusModeDescription(setting->lv1Status, 0))); - break; - - case IDC_LV2STATUS: - if (HIWORD(wParam) == CBN_SELCHANGE) - SendMessage(GetParent(hwndDlg),PSM_CHANGED,0,0); - - setting->lv2Status = (int)SendDlgItemMessage(hwndDlg, IDC_LV2STATUS, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_LV2STATUS, CB_GETCURSEL, 0, 0), 0); - break; - - case IDC_FULLSCREEN: - setting->optionFlags ^= FLAG_FULLSCREEN; - SetDialogItems(hwndDlg, setting); - break; - - case IDC_SCREENSAVE: - setting->optionFlags ^= FLAG_ONSAVER; - SetDialogItems(hwndDlg, setting); - break; - - case IDC_ONLOCK: - setting->optionFlags ^= FLAG_ONLOCK; - SetDialogItems(hwndDlg, setting); - break; - - case IDC_TIMED: - setting->optionFlags ^= FLAG_ONMOUSE; - SetDialogItems(hwndDlg, setting); - break; - - case IDC_SETNA: - setting->optionFlags ^= FLAG_SETNA; - SetDialogItems(hwndDlg, setting); - break; - - case IDC_AWAYTIME: - setting->awayTime = GetDlgItemInt(hwndDlg,IDC_AWAYTIME, NULL, FALSE); - break; - - case IDC_NATIME: - setting->naTime = GetDlgItemInt(hwndDlg,IDC_NATIME, NULL, FALSE); - break; - - case IDC_LV2ONINACTIVE: - setting->optionFlags^=FLAG_LV2ONINACTIVE; - SetDialogItems(hwndDlg, setting); - break; - - case IDC_CONFIRM: - setting->optionFlags^=FLAG_CONFIRM; - SetDialogItems(hwndDlg, setting); - break; - - case IDC_RESETSTATUS: - setting->optionFlags^=FLAG_RESET; - SetDialogItems(hwndDlg, setting); - break; - - case IDC_MONITORMIRANDA: - setting->optionFlags^=FLAG_MONITORMIRANDA; - SetDialogItems(hwndDlg, setting); - break; - } - break; - - case WM_SHOWWINDOW: - init = TRUE; - - if (setting = GetSetting(hwndDlg, sameSetting)) - SetDialogItems(hwndDlg, setting); - - SendMessage(hwndDlg, WM_COMMAND, (WPARAM)IDC_PROTOCOL, (LPARAM)0x11111111); - init = FALSE; - break; - - case WM_NOTIFY: - switch(((NMHDR*)lParam)->idFrom) { - case IDC_STATUSLIST: - if (init) - break; - - switch(((NMHDR*)lParam)->code) { - case LVN_ITEMCHANGED: - NMLISTVIEW *nmlv = (NMLISTVIEW*)lParam; - if (IsWindowVisible(GetDlgItem(hwndDlg, IDC_STATUSLIST)) && ((nmlv->uNewState ^ nmlv->uOldState) & LVIS_STATEIMAGEMASK)) { - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - - if (setting = GetSetting(hwndDlg, sameSetting)) { - HWND hList = GetDlgItem(hwndDlg, IDC_STATUSLIST); - LVITEM lvItem = { 0 }; - lvItem.mask = LVIF_PARAM; - lvItem.iItem = nmlv->iItem; - ListView_GetItem(hList, &lvItem); - int pf2Status = lvItem.lParam; - if (ListView_GetCheckState(hList, lvItem.iItem)) - setting->statusFlags |= pf2Status; - else - setting->statusFlags &= ~pf2Status; - } - } - break; - } - break; - } - - switch (((LPNMHDR)lParam)->code) { - case PSN_APPLY: - if (bSettingSame) - WriteAutoAwaySetting(*sameSetting, SETTING_ALL); - else { - for (int i=0; i < optionSettings.getCount(); i++ ) - WriteAutoAwaySetting(optionSettings[i], optionSettings[i].szName); - } - LoadOptions(autoAwaySettings, FALSE); - } - break; - - case WM_DESTROY: - optionSettings.destroy(); - free(sameSetting); - break; - } - return FALSE; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// General options window procedure - -static INT_PTR CALLBACK DlgProcAutoAwayGeneralOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) -{ - switch (msg) { - case WM_INITDIALOG: - TranslateDialogDefault(hwndDlg); - CheckDlgButton(hwndDlg, IDC_IGNLOCK, db_get_b(NULL, MODULENAME, SETTING_IGNLOCK, FALSE) != 0 ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_IGNSYSKEYS, db_get_b(NULL, MODULENAME, SETTING_IGNSYSKEYS, FALSE) != 0 ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_IGNALTCOMBO, db_get_b(NULL, MODULENAME, SETTING_IGNALTCOMBO, FALSE) != 0 ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_MONITORMOUSE, db_get_b(NULL, MODULENAME, SETTING_MONITORMOUSE, BST_CHECKED) != 0 ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_MONITORKEYBOARD, db_get_b(NULL, MODULENAME, SETTING_MONITORKEYBOARD, BST_CHECKED) != 0 ? BST_CHECKED : BST_UNCHECKED); - SetDlgItemInt(hwndDlg, IDC_AWAYCHECKTIMEINSECS, db_get_w(NULL, MODULENAME, SETTING_AWAYCHECKTIMEINSECS, 5), FALSE); - SetDlgItemInt(hwndDlg, IDC_CONFIRMDELAY, db_get_w(NULL, MODULENAME, SETTING_CONFIRMDELAY, 5), FALSE); - CheckDlgButton(hwndDlg, bSettingSame ? IDC_SAMESETTINGS : IDC_PERPROTOCOLSETTINGS, BST_CHECKED); - ShowWindow(GetDlgItem(hwndDlg, IDC_IDLEWARNING), db_get_b(NULL, "Idle", "AAEnable", 0)); - break; - - case WM_SHOWWINDOW: - ShowWindow(GetDlgItem(hwndDlg, IDC_IDLEWARNING), (db_get_b(NULL, "Idle", "AAEnable", 0))); - break; - - case WM_COMMAND: - if (( HIWORD(wParam) == EN_CHANGE || HIWORD(wParam) == BN_CLICKED ) && (HWND)lParam == GetFocus()) - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - - switch(LOWORD(wParam)) { - case IDC_MONITORMOUSE: - CheckDlgButton(hwndDlg, IDC_MONITORMOUSE, (((BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_MONITORMOUSE))&&(BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_MONITORKEYBOARD)))||(IsDlgButtonChecked(hwndDlg, IDC_MONITORMOUSE)) ? BST_CHECKED : BST_UNCHECKED)); - break; - - case IDC_MONITORKEYBOARD: - CheckDlgButton(hwndDlg, IDC_MONITORKEYBOARD, (((BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_MONITORMOUSE))&&(BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_MONITORKEYBOARD)))||(IsDlgButtonChecked(hwndDlg, IDC_MONITORKEYBOARD)) ? BST_CHECKED : BST_UNCHECKED)); - break; - - case IDC_SAMESETTINGS: - case IDC_PERPROTOCOLSETTINGS: - bSettingSame = IsDlgButtonChecked(hwndDlg, IDC_SAMESETTINGS); - break; - } - break; - - case WM_NOTIFY: - if (((LPNMHDR)lParam)->code == PSN_APPLY ) { - db_set_b(NULL, MODULENAME, SETTING_IGNLOCK, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNLOCK)); - db_set_b(NULL, MODULENAME, SETTING_IGNSYSKEYS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNSYSKEYS)); - db_set_b(NULL, MODULENAME, SETTING_IGNALTCOMBO, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNALTCOMBO)); - db_set_b(NULL, MODULENAME, SETTING_SAMESETTINGS, (BYTE)bSettingSame); - db_set_w(NULL, MODULENAME, SETTING_AWAYCHECKTIMEINSECS, (WORD)GetDlgItemInt(hwndDlg, IDC_AWAYCHECKTIMEINSECS, NULL, FALSE)); - db_set_w(NULL, MODULENAME, SETTING_CONFIRMDELAY, (WORD)GetDlgItemInt(hwndDlg, IDC_CONFIRMDELAY, NULL, FALSE)); - db_set_b(NULL, MODULENAME, SETTING_MONITORMOUSE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MONITORMOUSE)); - db_set_b(NULL, MODULENAME, SETTING_MONITORKEYBOARD, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MONITORKEYBOARD)); - LoadOptions(autoAwaySettings, FALSE); - } - break; - } - return FALSE; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// Tab window procedure - -static INT_PTR CALLBACK DlgProcAutoAwayTabs(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) -{ - switch(msg) { - case WM_INITDIALOG: - TranslateDialogDefault(hwndDlg); - { - RECT rcTabs, rcOptions, rcPage; - bSettingSame = db_get_b(NULL, MODULENAME, SETTING_SAMESETTINGS, FALSE); - - // set tabs - int tabCount = 0; - HWND hTab = GetDlgItem(hwndDlg, IDC_TABS); - GetWindowRect(hTab, &rcTabs); - GetWindowRect(hwndDlg, &rcOptions); - - // general tab - TCITEM tci = { 0 }; - tci.mask = TCIF_TEXT | TCIF_PARAM; - tci.pszText = TranslateT("General"); - HWND hPage = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_OPT_GENAUTOAWAY), hwndDlg, DlgProcAutoAwayGeneralOpts, (LPARAM)GetParent(hwndDlg)); - EnableThemeDialogTexture(hPage, ETDT_ENABLETAB); - - tci.lParam = (LPARAM)hPage; - GetClientRect(hPage, &rcPage); - MoveWindow(hPage, (rcTabs.left - rcOptions.left) + ((rcTabs.right-rcTabs.left)-(rcPage.right-rcPage.left))/2, 10 + (rcTabs.top - rcOptions.top) + ((rcTabs.bottom-rcTabs.top)-(rcPage.bottom-rcPage.top))/2, rcPage.right-rcPage.left, rcPage.bottom-rcPage.top, TRUE); - ShowWindow(hPage, SW_HIDE); - TabCtrl_InsertItem(hTab, tabCount++, &tci); - HWND hShow = hPage; - - // rules tab - tci.mask = TCIF_TEXT|TCIF_PARAM; - tci.pszText = TranslateT("Rules"); - hPage = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_OPT_AUTOAWAY), hwndDlg, DlgProcAutoAwayRulesOpts, (LPARAM)GetParent(hwndDlg)); - EnableThemeDialogTexture(hPage, ETDT_ENABLETAB); - - tci.lParam = (LPARAM)hPage; - GetClientRect(hPage, &rcPage); - MoveWindow(hPage, (rcTabs.left - rcOptions.left) + ((rcTabs.right-rcTabs.left)-(rcPage.right-rcPage.left))/2, 10 + (rcTabs.top - rcOptions.top) + ((rcTabs.bottom-rcTabs.top)-(rcPage.bottom-rcPage.top))/2, rcPage.right-rcPage.left, rcPage.bottom-rcPage.top, TRUE); - ShowWindow(hPage, SW_HIDE); - TabCtrl_InsertItem(hTab, tabCount++, &tci); - - // messages tab - tci.mask = TCIF_TEXT|TCIF_PARAM; - tci.pszText = TranslateT("Status messages"); - hPage = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_OPT_AUTOAWAYMSG), hwndDlg, DlgProcAutoAwayMsgOpts, (LPARAM)GetParent(hwndDlg)); - EnableThemeDialogTexture(hPage, ETDT_ENABLETAB); - - tci.lParam = (LPARAM)hPage; - GetClientRect(hPage, &rcPage); - MoveWindow(hPage, (rcTabs.left - rcOptions.left) + ((rcTabs.right-rcTabs.left)-(rcPage.right-rcPage.left))/2, 10 + (rcTabs.top - rcOptions.top) + ((rcTabs.bottom-rcTabs.top)-(rcPage.bottom-rcPage.top))/2, rcPage.right-rcPage.left, rcPage.bottom-rcPage.top, TRUE); - ShowWindow(hPage, SW_HIDE); - TabCtrl_InsertItem(hTab, tabCount++, &tci); - - ShowWindow(hShow, SW_SHOW); - } - break; - - case PSM_CHANGED: - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - break; - - case WM_NOTIFY: - if ((((NMHDR*)lParam)->idFrom == IDC_TABS)) { - if (((NMHDR*)lParam)->code == TCN_SELCHANGING) { - TCITEM tci; - - tci.mask = TCIF_PARAM; - TabCtrl_GetItem(GetDlgItem(hwndDlg, IDC_TABS), TabCtrl_GetCurSel(GetDlgItem(hwndDlg, IDC_TABS)), &tci); - ShowWindow((HWND)tci.lParam, SW_HIDE); - } - else if (((NMHDR*)lParam)->code == TCN_SELCHANGE) { - TCITEM tci; - - tci.mask = TCIF_PARAM; - TabCtrl_GetItem(GetDlgItem(hwndDlg, IDC_TABS), TabCtrl_GetCurSel(GetDlgItem(hwndDlg, IDC_TABS)), &tci); - ShowWindow((HWND)tci.lParam, SW_SHOW); - } - } - if (((LPNMHDR)lParam)->code == PSN_APPLY) { - TCITEM tci; - tci.mask = TCIF_PARAM; - int count = TabCtrl_GetItemCount(GetDlgItem(hwndDlg, IDC_TABS)); - for (int i = 0; i < count; i++) { - TabCtrl_GetItem(GetDlgItem(hwndDlg, IDC_TABS), i, &tci); - SendMessage((HWND)tci.lParam, WM_NOTIFY, 0, lParam); - } - } - break; - } - - return FALSE; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// Options initialization procedure - -int AutoAwayOptInitialise(WPARAM wParam,LPARAM lParam) -{ - OPTIONSDIALOGPAGE odp = { 0 }; - odp.position = 1000000000; - odp.hInstance = hInst; - odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_TABS); - odp.pszTitle = LPGEN("Auto Away"); - odp.pszGroup = LPGEN("Status"); - odp.pfnDlgProc = DlgProcAutoAwayTabs; - odp.flags = ODPF_BOLDGROUPS; - Options_AddPage(wParam, &odp); - return 0; -} diff --git a/plugins/StatusPlugins/AdvancedAutoAway/version.h b/plugins/StatusPlugins/AdvancedAutoAway/version.h deleted file mode 100644 index bda6bff95c..0000000000 --- a/plugins/StatusPlugins/AdvancedAutoAway/version.h +++ /dev/null @@ -1,17 +0,0 @@ -// plugin version part -#define __MAJOR_VERSION 0 -#define __MINOR_VERSION 8 -#define __RELEASE_NUM 1 -#define __BUILD_NUM 1 - -// other stuff for Version resource -#include - -// stuff that will be used in PluginInfo section and in Version resource -#define __PLUGIN_NAME "Advanced Auto Away" -#define __FILENAME "AdvancedAutoAway.dll" -#define __DESC "An Auto Away module with some more options than the original." -#define __AUTHOR "P Boon" -#define __AUTHOREMAIL "unregistered@users.sourceforge.net" -#define __AUTHORWEB "http://miranda-ng.org/p/AdvancedAutoAway/" -#define __COPYRIGHT "© 2003-08 P. Boon, 2008-16 George Hazan" diff --git a/plugins/StatusPlugins/KeepStatus/KeepStatus.txt b/plugins/StatusPlugins/KeepStatus/KeepStatus.txt deleted file mode 100644 index 55b3992487..0000000000 --- a/plugins/StatusPlugins/KeepStatus/KeepStatus.txt +++ /dev/null @@ -1,145 +0,0 @@ -KeepStatus plugin for Miranda IM v0.0.2.x -unregistered@users.sourceforge.net - ---- About --- - -KeepStatus, a connection checker, for use with (or without) -StartupStatus and/or AdvancedAutoAway. - ---- Usage --- - -There are two tabs in the options screen, one with basic options, and -one with advanced options. - -The Basic Tab: - -[] Show popups, this will make use of the popup plugin to notify you -in case of a connection loss or reconnect attempt. - -[] Check connection, with this option you can enable or disable the -plugin. - -[count] Max. retries, in case connection is lost, this number of -reconnect attempts will be made to restore the connection. - -[secs] Delay between retries, the number of seconds to wait before a -new attempt is made. - -[] Don't reconnect if no internet connection seems available, if -enabled, KS will not reconnect if Windows reports that no internet -connection is available. - -[] Continuesly check for internet connection, if enables, KS will keep -looking for a connection, either by asking Windows, or by pinging a -host. You can specify multiple hosts by seperating them with -spaces. If one host replies, a connection is assumed to be available. - -Note: All dial-up options are experimental. I cannot test these -myself. Please let me know if you encounter problems with it (and you -are willing to run some tests ;) ) - -The Advanced Tab: - -[] Increase delay exponential, if enabled, the delay is multiplied by -2 after each check. So checks are made at t=10, t=20, t=40, t=40, -t=40, etc. if "Max. delay" = 40, "Initial delay" = 10, and connection -was lost at t=0. - -[secs] Max. delay, the maximum delay allowed in case "increase delay -exponential" is enabled. - -[secs] Max. protocol connecting time, -experimental-, this is the -maximum number of seconds a protocol is allowed to be in the -"connecting state" during a reconnect attempt. After this time, KS -will force the protocol offline and make a new connection attempt. - -[] Ignore locked status of protocols, if enabled, KS will reconnect -protocols in case of a global status change, even if they are locked -by the clist (nicer/modern). You can enable this if protocols don't -reconnect properly after a global status change using a clist that -doesn't support locking. - -[] Set protocol offline before a connection attempt, this will force a -protocol offline, before KS tries to restore its connection. - -[] Cancel all if a protocol connects from another location, this will -not reconnect any of the protocols if one of them is connected from -another location. The reason for this option is because not all -protocols can detect a second login. - -[] Reconnect on APM resume, will reconnect you when you come back from -standby or hibernation. If it for some reason fails, please try -another clist. - -[] React on login errors, influences the way KS deals with login -errors (default is to keep retrying). A login error can be "wrong -password" or "server busy" for example. - -() Stop trying to reconnect, cancels reconnecting for the protocol. - -() Set delay to [secs], this will (possibly) increase the delay before -a new attempt is made to restore the connection. - -Consider connection lost after [count] failed pings, tells KS how many -ping attempts must fail before the connection should be considered -"lost" and need to be restored. - -[secs] Continuously check interval, the delay between two pings. - ---- Notes --- - -All options regarding dial-up connections are experimental. - ---- Changelog --- - -0.0.2.92: - fixes for Miranda 0.8 (added MUID) - - some minor fixes. - -0.0.2.85: - Different handling of timers - - Partitial locked status support (full support requires changes in core) - - Fix 'random' crash - -0.0.2.74: - A few more fixes - -0.0.2.73: - Fix when setting no status message - -0.0.2.72: - Fix options dialog glitch - -0.0.2.71: - Several bug fixes - - Added options for continuously checking - - Support for "protocol locking" by clist - - Better NAS support (requires NAS v0.3.7.2 (build 2338; April 30, 2006)) - - Added more convenient service for developers MS_KS_ANNOUNCESTATUSCHANGE - - Popups stay until next retry if delay is set to 0 - - Added option "Max. connecting time", see documentation - - Added option to set protocol offline before reconnecting - - Set global status when possible - - Ping using ICMP instead of using InternetCheckConnection. - -0.0.2.4: - popups now show the icon of the first protocol that is about to be reconnected - - added popup option to show additional info in popup - -0.0.2.3: - you can now change the delay when a login error occurs - -0.0.2.2: - many bugfixes (with great help of weinstock and ghazan) - - added option to check internet connection by pinging - - added more options for popups - - added option to reconnect on APM resume (standby, hibernate) - -0.0.1.0: - doesn't reconnect when logged in from another location - - Added: option reconnect on login failures - -0.0.0.4: - fixed: now also works with popups disabled. (thanks to Stefan Waldmann) - -0.0.0.3: - Added support for PluginUninstaller - - bug fixes - -0.0.0.2: - Several bug fixes - - Better menu handling - - Fixed: Jabber/Tlen support (not in combination with (current) awaysys!) - -0.0.0.1: - First release without StartupStatus - ---- Disclaimer --- - -If something terrible happens, don't blame me. \ No newline at end of file diff --git a/plugins/StatusPlugins/KeepStatus/KeepStatus_10.vcxproj b/plugins/StatusPlugins/KeepStatus/KeepStatus_10.vcxproj deleted file mode 100644 index ac91443e1c..0000000000 --- a/plugins/StatusPlugins/KeepStatus/KeepStatus_10.vcxproj +++ /dev/null @@ -1,226 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - KeepStatus - {D548A54E-310B-4A86-A545-64BDD5748745} - - - - DynamicLibrary - Unicode - true - - - DynamicLibrary - Unicode - - - DynamicLibrary - Unicode - true - - - DynamicLibrary - Unicode - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - true - - - - Disabled - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;_USRDLL;KEEPSTATUS_EXPORTS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Use - ..\commonstatus.h - Level3 - EditAndContinue - 4996;%(DisableSpecificWarnings) - false - - - _DEBUG;%(PreprocessorDefinitions) - ..\..\..\include\msapi - - - ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies) - true - false - $(IntDir)$(TargetName).lib - Windows - 0x11cd0000 - $(ProfileDir)..\..\..\bin10\lib - - - - - Full - OnlyExplicitInline - Size - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;_USRDLL;KEEPSTATUS_EXPORTS;%(PreprocessorDefinitions) - true - false - false - true - Fast - Use - ..\commonstatus.h - Level3 - 4996;%(DisableSpecificWarnings) - - - NDEBUG;%(PreprocessorDefinitions) - ..\..\..\include\msapi - - - ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies) - true - true - true - 0x11cd0000 - false - $(IntDir)$(TargetName).lib - Windows - $(ProfileDir)..\..\..\bin10\lib - /PDBALTPATH:%_PDB% - - - - - Full - false - false - Fast - OnlyExplicitInline - Size - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - true - Use - ..\commonstatus.h - NDEBUG;_WINDOWS;_USRDLL;KEEPSTATUS_EXPORTS;%(PreprocessorDefinitions) - Level3 - 4996;%(DisableSpecificWarnings) - - - true - $(SolutionDir)\lib - - - true - ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies) - true - $(IntDir)$(TargetName).lib - Windows - false - 0x11cd0000 - $(ProfileDir)..\..\..\bin10\lib - /PDBALTPATH:%_PDB% - - - ..\..\..\include\msapi - NDEBUG;%(PreprocessorDefinitions) - - - - - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - Use - ..\commonstatus.h - _DEBUG;_WINDOWS;_USRDLL;KEEPSTATUS_EXPORTS;%(PreprocessorDefinitions) - Level3 - 4996;%(DisableSpecificWarnings) - Disabled - MultiThreadedDebugDLL - false - - - ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies) - true - $(IntDir)$(TargetName).lib - Windows - false - 0x11cd0000 - $(ProfileDir)..\..\..\bin10\lib - - - ..\..\..\include\msapi - _DEBUG;%(PreprocessorDefinitions) - - - - - Create - commonstatus.h - - - commonstatus.h - - - commonstatus.h - - - NotUsing - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/StatusPlugins/KeepStatus/KeepStatus_10.vcxproj.filters b/plugins/StatusPlugins/KeepStatus/KeepStatus_10.vcxproj.filters deleted file mode 100644 index 9d4b6dcc2d..0000000000 --- a/plugins/StatusPlugins/KeepStatus/KeepStatus_10.vcxproj.filters +++ /dev/null @@ -1,59 +0,0 @@ - - - - - {6fb49235-e0f0-4889-b5d7-c5f7a5b3a95f} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {be845fa0-70f3-4168-9620-2f231e2702af} - h;hpp;hxx;hm;inl - - - {3795d706-cfb9-43c3-a967-b0759da5b8af} - ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - Resource Files - - - \ No newline at end of file diff --git a/plugins/StatusPlugins/KeepStatus/KeepStatus_12.vcxproj b/plugins/StatusPlugins/KeepStatus/KeepStatus_12.vcxproj deleted file mode 100644 index f79e8063b6..0000000000 --- a/plugins/StatusPlugins/KeepStatus/KeepStatus_12.vcxproj +++ /dev/null @@ -1,229 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - KeepStatus - {D548A54E-310B-4A86-A545-64BDD5748745} - - - - DynamicLibrary - Unicode - true - v120_xp - - - DynamicLibrary - Unicode - v120_xp - - - DynamicLibrary - Unicode - true - v120_xp - - - DynamicLibrary - Unicode - v120_xp - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - true - - - - Disabled - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;_USRDLL;KEEPSTATUS_EXPORTS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Use - ..\commonstatus.h - Level4 - EditAndContinue - 4996;%(DisableSpecificWarnings) - false - - - _DEBUG;%(PreprocessorDefinitions) - ..\..\..\include\msapi - - - ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies) - true - false - $(IntDir)$(TargetName).lib - Windows - 0x11cd0000 - $(ProfileDir)..\..\..\bin12\lib - false - - - - - Full - OnlyExplicitInline - Size - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;_USRDLL;KEEPSTATUS_EXPORTS;%(PreprocessorDefinitions) - true - false - false - true - Fast - Use - ..\commonstatus.h - Level4 - 4996;%(DisableSpecificWarnings) - - - NDEBUG;%(PreprocessorDefinitions) - ..\..\..\include\msapi - - - ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies) - true - true - true - 0x11cd0000 - false - $(IntDir)$(TargetName).lib - Windows - $(ProfileDir)..\..\..\bin12\lib - - - - - Full - false - false - Fast - OnlyExplicitInline - Size - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - true - Use - ..\commonstatus.h - NDEBUG;_WINDOWS;_USRDLL;KEEPSTATUS_EXPORTS;%(PreprocessorDefinitions) - Level4 - 4996;%(DisableSpecificWarnings) - - - true - $(SolutionDir)\lib - - - true - ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies) - true - $(IntDir)$(TargetName).lib - Windows - false - 0x11cd0000 - $(ProfileDir)..\..\..\bin12\lib - - - ..\..\..\include\msapi - NDEBUG;%(PreprocessorDefinitions) - - - - - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - Use - ..\commonstatus.h - _DEBUG;_WINDOWS;_USRDLL;KEEPSTATUS_EXPORTS;%(PreprocessorDefinitions) - Level4 - 4996;%(DisableSpecificWarnings) - Disabled - MultiThreadedDebugDLL - false - - - ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies) - true - $(IntDir)$(TargetName).lib - Windows - false - 0x11cd0000 - $(ProfileDir)..\..\..\bin12\lib - - - ..\..\..\include\msapi - _DEBUG;%(PreprocessorDefinitions) - - - - - Create - commonstatus.h - - - commonstatus.h - - - commonstatus.h - - - NotUsing - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/StatusPlugins/KeepStatus/KeepStatus_12.vcxproj.filters b/plugins/StatusPlugins/KeepStatus/KeepStatus_12.vcxproj.filters deleted file mode 100644 index 9d4b6dcc2d..0000000000 --- a/plugins/StatusPlugins/KeepStatus/KeepStatus_12.vcxproj.filters +++ /dev/null @@ -1,59 +0,0 @@ - - - - - {6fb49235-e0f0-4889-b5d7-c5f7a5b3a95f} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {be845fa0-70f3-4168-9620-2f231e2702af} - h;hpp;hxx;hm;inl - - - {3795d706-cfb9-43c3-a967-b0759da5b8af} - ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - Resource Files - - - \ No newline at end of file diff --git a/plugins/StatusPlugins/KeepStatus/KeepStatus_14.vcxproj b/plugins/StatusPlugins/KeepStatus/KeepStatus_14.vcxproj deleted file mode 100644 index 52ab7ac406..0000000000 --- a/plugins/StatusPlugins/KeepStatus/KeepStatus_14.vcxproj +++ /dev/null @@ -1,229 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - KeepStatus - {D548A54E-310B-4A86-A545-64BDD5748745} - - - - DynamicLibrary - Unicode - true - v140_xp - - - DynamicLibrary - Unicode - v140_xp - - - DynamicLibrary - Unicode - true - v140_xp - - - DynamicLibrary - Unicode - v140_xp - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - true - - - - Disabled - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;_USRDLL;KEEPSTATUS_EXPORTS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Use - ..\commonstatus.h - Level4 - EditAndContinue - 4996;%(DisableSpecificWarnings) - false - - - _DEBUG;%(PreprocessorDefinitions) - ..\..\..\include\msapi - - - ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies) - true - false - $(IntDir)$(TargetName).lib - Windows - 0x11cd0000 - $(ProfileDir)..\..\..\bin14\lib - false - - - - - Full - OnlyExplicitInline - Size - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;_USRDLL;KEEPSTATUS_EXPORTS;%(PreprocessorDefinitions) - true - false - false - true - Fast - Use - ..\commonstatus.h - Level4 - 4996;%(DisableSpecificWarnings) - - - NDEBUG;%(PreprocessorDefinitions) - ..\..\..\include\msapi - - - ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies) - true - true - true - 0x11cd0000 - false - $(IntDir)$(TargetName).lib - Windows - $(ProfileDir)..\..\..\bin14\lib - - - - - Full - false - false - Fast - OnlyExplicitInline - Size - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - true - Use - ..\commonstatus.h - NDEBUG;_WINDOWS;_USRDLL;KEEPSTATUS_EXPORTS;%(PreprocessorDefinitions) - Level4 - 4996;%(DisableSpecificWarnings) - - - true - $(SolutionDir)\lib - - - true - ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies) - true - $(IntDir)$(TargetName).lib - Windows - false - 0x11cd0000 - $(ProfileDir)..\..\..\bin14\lib - - - ..\..\..\include\msapi - NDEBUG;%(PreprocessorDefinitions) - - - - - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - Use - ..\commonstatus.h - _DEBUG;_WINDOWS;_USRDLL;KEEPSTATUS_EXPORTS;%(PreprocessorDefinitions) - Level4 - 4996;%(DisableSpecificWarnings) - Disabled - MultiThreadedDebugDLL - false - - - ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies) - true - $(IntDir)$(TargetName).lib - Windows - false - 0x11cd0000 - $(ProfileDir)..\..\..\bin14\lib - - - ..\..\..\include\msapi - _DEBUG;%(PreprocessorDefinitions) - - - - - Create - commonstatus.h - - - commonstatus.h - - - commonstatus.h - - - NotUsing - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/StatusPlugins/KeepStatus/KeepStatus_14.vcxproj.filters b/plugins/StatusPlugins/KeepStatus/KeepStatus_14.vcxproj.filters deleted file mode 100644 index 9d4b6dcc2d..0000000000 --- a/plugins/StatusPlugins/KeepStatus/KeepStatus_14.vcxproj.filters +++ /dev/null @@ -1,59 +0,0 @@ - - - - - {6fb49235-e0f0-4889-b5d7-c5f7a5b3a95f} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {be845fa0-70f3-4168-9620-2f231e2702af} - h;hpp;hxx;hm;inl - - - {3795d706-cfb9-43c3-a967-b0759da5b8af} - ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - Resource Files - - - \ No newline at end of file diff --git a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp deleted file mode 100644 index 54cb3028d4..0000000000 --- a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp +++ /dev/null @@ -1,1209 +0,0 @@ -/* - KeepStatus Plugin for Miranda-IM (www.miranda-im.org) - Copyright 2003-2006 P. Boon - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include "../commonstatus.h" -#include "keepstatus.h" -#include "../resource.h" - -struct TimerInfo { - int timer; - int timeout; - BOOL restart; - int result; - HANDLE hEvent; -}; - -static mir_cs GenTimerCS, GenStatusCS, CheckContinueslyCS; - -static HANDLE hProtoAckHook = NULL; -static HANDLE hStatusChangeHook = NULL; -static HANDLE hCSStatusChangeHook = NULL; -static HANDLE hCSStatusChangeExHook = NULL; - -extern HANDLE hConnectionEvent; -extern PLUGININFOEX pluginInfoEx; - -static HWND hMessageWindow = NULL; - -static int CompareConnections(const TConnectionSettings *p1, const TConnectionSettings *p2) -{ - return mir_strcmp(p1->szName, p2->szName); -} - -static OBJLIST connectionSettings(10, CompareConnections); - -static UINT_PTR checkConnectionTimerId = 0; -static UINT_PTR afterCheckTimerId = 0; -static UINT_PTR processAckTimerId = 0; -static UINT_PTR checkContinTimerId = 0; -static UINT_PTR checkConnectingTimerId = 0; -static int retryCount = 0; -static BOOL bLastPingResult = TRUE; -// variables (options) -static int maxRetries = 0; -static int initDelay = 0; -static int currentDelay = 0; -static int maxDelay = 0; -static int ackDelay = 500; -static int increaseExponential = 0; -static int showConnectionPopups = 0; -// prototypes -static int StartTimer(int timer, int timeout, BOOL restart); -static int StopTimer(int timer); -int LoadMainOptions(); -static void GetCurrentConnectionSettings(); -static int AssignStatus(TConnectionSettings* connSetting, int status, int lastStatus, wchar_t *szMsg); -static int ProcessProtoAck(WPARAM wParam, LPARAM lParam); -static VOID CALLBACK CheckConnectingTimer(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime); -static VOID CALLBACK CheckAckStatusTimer(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime); -static int StatusChange(WPARAM wParam, LPARAM lParam); -static int CSStatusChange(WPARAM wParam, LPARAM lParam); -static int CSStatusChangeEx(WPARAM wParam, LPARAM lParam); -static VOID CALLBACK StatusChangeTimer(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime); -static VOID CALLBACK CheckConnectionTimer(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime); -static int StopChecking(); -static VOID CALLBACK AfterCheckTimer(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime); -static void ContinueslyCheckFunction(void *arg); -static VOID CALLBACK CheckContinueslyTimer(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime); -INT_PTR IsProtocolEnabledService(WPARAM wParam, LPARAM lParam); - -static int ProcessPopup(int reason, LPARAM lParam); -static INT_PTR ShowPopup(wchar_t *msg, HICON hIcon); -LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); -static DWORD CALLBACK MessageWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); - -// options.c -extern int OptionsInit(WPARAM wparam, LPARAM); -extern int InitCommonStatus(); - -TConnectionSettings::TConnectionSettings(PROTOACCOUNT *pa) -{ - cbSize = sizeof(PROTOCOLSETTINGEX); - szName = pa->szModuleName; - tszAccName = pa->tszAccountName; - szMsg = NULL; - - int iStatus = CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0); - AssignStatus(this, iStatus, iStatus, NULL); -} - -TConnectionSettings::~TConnectionSettings() -{ - if (szMsg != NULL) - free(szMsg); -} - -int LoadMainOptions() -{ - UnhookEvent(hProtoAckHook); - UnhookEvent(hStatusChangeHook); - UnhookEvent(hCSStatusChangeHook); - UnhookEvent(hCSStatusChangeExHook); - hProtoAckHook = hStatusChangeHook = hCSStatusChangeHook = hCSStatusChangeExHook = 0; - - if (IsWindow(hMessageWindow)) - DestroyWindow(hMessageWindow); - if (StartTimer(IDT_CHECKCONTIN, -1, FALSE)) { - WSACleanup(); - } - StopTimer(IDT_CHECKCONN | IDT_PROCESSACK | IDT_AFTERCHECK | IDT_CHECKCONTIN | IDT_CHECKCONNECTING); - - GetCurrentConnectionSettings(); - - if (db_get_b(NULL, MODULENAME, SETTING_CHECKCONNECTION, FALSE)) { - if (db_get_b(NULL, MODULENAME, SETTING_CONTCHECK, FALSE)) { - if (db_get_b(NULL, MODULENAME, SETTING_BYPING, FALSE)) { - WSADATA wsaData; - WSAStartup(MAKEWORD(2, 2), &wsaData); - } - StartTimer(IDT_CHECKCONTIN, 0, FALSE); - } - increaseExponential = db_get_b(NULL, MODULENAME, SETTING_INCREASEEXPONENTIAL, FALSE); - currentDelay = initDelay = 1000 * db_get_dw(NULL, MODULENAME, SETTING_INITDELAY, DEFAULT_INITDELAY); - maxDelay = 1000 * db_get_dw(NULL, MODULENAME, SETTING_MAXDELAY, DEFAULT_MAXDELAY); - maxRetries = db_get_b(NULL, MODULENAME, SETTING_MAXRETRIES, 0); - if (maxRetries == 0) - maxRetries = -1; - hProtoAckHook = HookEvent(ME_PROTO_ACK, ProcessProtoAck); - hStatusChangeHook = HookEvent(ME_CLIST_STATUSMODECHANGE, StatusChange); - if (ServiceExists(ME_CS_STATUSCHANGE)) - hCSStatusChangeHook = HookEvent(ME_CS_STATUSCHANGE, CSStatusChange); - hCSStatusChangeExHook = HookEvent(ME_CS_STATUSCHANGEEX, CSStatusChangeEx); - if (db_get_b(NULL, MODULENAME, SETTING_CHECKAPMRESUME, 0) && (CallService(MS_SYSTEM_GETVERSION, 0, 0) >= 0x00040000)) { - if (!IsWindow(hMessageWindow)) { - hMessageWindow = CreateWindowEx(0, L"STATIC", NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL); - SetWindowLongPtr(hMessageWindow, GWLP_WNDPROC, (LONG_PTR)MessageWndProc); - } - } - retryCount = 0; - } - - return 0; -} - -static void GetCurrentConnectionSettings() -{ - connectionSettings.destroy(); - - int count; - PROTOACCOUNT** protos; - Proto_EnumAccounts(&count, &protos); - - for (int i = 0; i < count; i++) - if (IsSuitableProto(protos[i])) - connectionSettings.insert(new TConnectionSettings(protos[i])); -} - -static PROTOCOLSETTINGEX** GetCurrentProtoSettingsCopy() -{ - mir_cslock lck(GenStatusCS); - PROTOCOLSETTINGEX **ps = (PROTOCOLSETTINGEX**)malloc(connectionSettings.getCount()*sizeof(PROTOCOLSETTINGEX *)); - if (ps == NULL) { - return NULL; - } - for (int i = 0; i < connectionSettings.getCount(); i++) { - ps[i] = (PROTOCOLSETTINGEX*)calloc(1, sizeof(PROTOCOLSETTINGEX)); - if (ps[i] == NULL) { - free(ps); - return NULL; - } - - TConnectionSettings& cs = connectionSettings[i]; - ps[i]->cbSize = sizeof(PROTOCOLSETTINGEX); - ps[i]->lastStatus = cs.lastStatus; - ps[i]->status = cs.status; - ps[i]->szMsg = NULL; - ps[i]->szName = cs.szName; - ps[i]->tszAccName = cs.tszAccName; - } - - return ps; -} - -static void FreeProtoSettings(PROTOCOLSETTINGEX** ps) -{ - for (int i = 0; i < connectionSettings.getCount(); i++) { - if (ps[i]->szMsg != NULL) - free(ps[i]->szMsg); - free(ps[i]); - } - free(ps); -} - -static int AssignStatus(TConnectionSettings* cs, int status, int lastStatus, wchar_t *szMsg) -{ - if (status < MIN_STATUS || status > MAX_STATUS) - return -1; - - mir_cslock lck(GenStatusCS); - - char dbSetting[128]; - mir_snprintf(dbSetting, "%s_enabled", cs->szName); - cs->lastStatus = lastStatus == 0 ? cs->status : lastStatus; - if (!db_get_b(NULL, MODULENAME, dbSetting, 1)) - cs->status = ID_STATUS_DISABLED; - else if (status == ID_STATUS_LAST) - cs->status = cs->lastStatus; - else - cs->status = status; - - log_infoA("KeepStatus: assigning status %d to %s", cs->status, cs->szName); - - if (szMsg != NULL && mir_wstrcmp(szMsg, cs->szMsg)) { - if (cs->szMsg != NULL) - free(cs->szMsg); - - cs->szMsg = wcsdup(szMsg); - } - else if (szMsg != cs->szMsg) { - if (cs->szMsg != NULL) - free(cs->szMsg); - - cs->szMsg = NULL; - } - return 0; -} - -static int GetStatus(const TConnectionSettings& cs) -{ - if (cs.status == ID_STATUS_CURRENT) - return CallProtoService(cs.szName, PS_GETSTATUS, 0, 0); - - return cs.status; -} - -static int SetCurrentStatus() -{ - PROTOCOLSETTINGEX **ps = GetCurrentProtoSettingsCopy(); - for (int i = 0; i < connectionSettings.getCount(); i++) { - int realStatus = CallProtoService(ps[i]->szName, PS_GETSTATUS, 0, 0); - if (ps[i]->status == ID_STATUS_DISABLED || ps[i]->status == realStatus) { // ignore this proto by removing it's name (not so nice) - ps[i]->szName = ""; - } - else if ((ps[i]->status != ID_STATUS_DISABLED) && (ps[i]->status != realStatus) && (realStatus != ID_STATUS_OFFLINE) && (db_get_b(NULL, MODULENAME, SETTING_FIRSTOFFLINE, FALSE))) { - // force offline before reconnecting - log_infoA("KeepStatus: Setting %s offline before making a new connection attempt", ps[i]->szName); - CallProtoService(ps[i]->szName, PS_SETSTATUS, (WPARAM)ID_STATUS_OFFLINE, 0); - } - } - ProcessPopup(KS_CONN_STATE_RETRY, (LPARAM)ps); - INT_PTR ret = CallService(MS_CS_SETSTATUSEX, (WPARAM)&ps, 0); - FreeProtoSettings(ps); - - return ret; -} - -static int StatusChange(WPARAM wParam, LPARAM lParam) -{ - char* szProto = (char *)lParam; - if (szProto == NULL) { // global status change - for (int i = 0; i < connectionSettings.getCount(); i++) { - TConnectionSettings& cs = connectionSettings[i]; - if (GetStatus(cs) != ID_STATUS_DISABLED) - if (db_get_b(NULL, MODULENAME, SETTING_NOLOCKED, 0) || - !db_get_b(NULL, cs.szName, "LockMainStatus", 0)) - AssignStatus(&cs, wParam, 0, cs.szMsg); - } - } - else { - for (int i = 0; i < connectionSettings.getCount(); i++) { - TConnectionSettings& cs = connectionSettings[i]; - if (GetStatus(cs) != ID_STATUS_DISABLED && !mir_strcmp(cs.szName, szProto)) - AssignStatus(&cs, wParam, 0, cs.szMsg); - } - } - - return 0; -} - -static int CSStatusChange(WPARAM wParam, LPARAM) -{ - // the status was changed by commonstatus (old) - if (wParam != 0) { - PROTOCOLSETTING** protoSettings = *(PROTOCOLSETTING***)wParam; - - if (protoSettings == NULL) - return -1; - - for (int i = 0; i < connectionSettings.getCount(); i++) { - for (int j = 0; j < connectionSettings.getCount(); j++) { - if ((protoSettings[i]->szName == NULL) || (connectionSettings[j].szName == NULL)) - continue; - - if (!mir_strcmp(protoSettings[i]->szName, connectionSettings[j].szName)) - if (GetStatus(connectionSettings[j]) != ID_STATUS_DISABLED) - AssignStatus(&connectionSettings[j], protoSettings[i]->status, protoSettings[i]->lastStatus, connectionSettings[j].szMsg); - } - } - } - - return 0; -} - -static int CSStatusChangeEx(WPARAM wParam, LPARAM) -{ - // the status was changed by commonstatus (new) - if (wParam != 0) { - PROTOCOLSETTINGEX** protoSettings = *(PROTOCOLSETTINGEX***)wParam; - - if (protoSettings == NULL) - return -1; - - for (int i = 0; i < connectionSettings.getCount(); i++) { - for (int j = 0; j < connectionSettings.getCount(); j++) { - if ((protoSettings[i]->szName == NULL) || (connectionSettings[j].szName == NULL)) - continue; - if (!mir_strcmp(protoSettings[i]->szName, connectionSettings[j].szName)) { - if (GetStatus(connectionSettings[j]) != ID_STATUS_DISABLED) - AssignStatus(&connectionSettings[j], protoSettings[i]->status, protoSettings[i]->lastStatus, protoSettings[i]->szMsg); - } - } - } - } - - return 0; -} - -static int StartTimerFunction(int timer, int timeout, BOOL restart) -{ - int res = 0; - - mir_cslock lck(GenTimerCS); - log_debugA("StartTimer: %d, %d, %d", timer, timeout, restart); - log_debugA("ack: %u, chk: %u, aft: %u, cnt: %u, con: %u", processAckTimerId, checkConnectionTimerId, afterCheckTimerId, checkContinTimerId, checkConnectingTimerId); - if (timer & IDT_PROCESSACK) { - res = (processAckTimerId == 0) ? 0 : 1; - if (((processAckTimerId == 0) && (checkConnectionTimerId == 0)) || (restart)) { - if (timeout != -1) { - if (restart) - KillTimer(NULL, processAckTimerId); - if (timeout == 0) - processAckTimerId = SetTimer(NULL, 0, ackDelay, CheckAckStatusTimer); - else - processAckTimerId = SetTimer(NULL, 0, timeout, CheckAckStatusTimer); - } - } - } - - if (timer & IDT_CHECKCONN) { - res = (checkConnectionTimerId == 0 ? 0 : 1) || res; - if ((checkConnectionTimerId == 0) || (restart)) { - if (timeout != -1) { - if (restart) - KillTimer(NULL, checkConnectionTimerId); - if (timeout == 0) - checkConnectionTimerId = SetTimer(NULL, 0, initDelay, CheckConnectionTimer); - else - checkConnectionTimerId = SetTimer(NULL, 0, timeout, CheckConnectionTimer); - } - } - } - - if (timer & IDT_AFTERCHECK) { - res = (afterCheckTimerId == 0 ? 0 : 1) || res; - if ((afterCheckTimerId == 0) || (restart)) { - if (timeout != -1) { - if (restart) - KillTimer(NULL, afterCheckTimerId); - if (timeout == 0) - afterCheckTimerId = SetTimer(NULL, 0, initDelay / 2, AfterCheckTimer); - else - afterCheckTimerId = SetTimer(NULL, 0, timeout, AfterCheckTimer); - } - } - } - - if (timer & IDT_CHECKCONTIN) { - res = (checkContinTimerId == 0 ? 0 : 1) || res; - if ((checkContinTimerId == 0) || (restart)) { - if (timeout != -1) { - if (restart) - KillTimer(NULL, checkContinTimerId); - if (timeout == 0) { - checkContinTimerId = SetTimer(NULL, 0, 1000 * db_get_dw(NULL, MODULENAME, SETTING_CNTDELAY, CHECKCONTIN_DELAY), CheckContinueslyTimer); - } - else - checkContinTimerId = SetTimer(NULL, 0, timeout, CheckContinueslyTimer); - } - } - } - - if (timer & IDT_CHECKCONNECTING) { - res = (checkConnectingTimerId == 0 ? 0 : 1) || res; - if ((checkConnectingTimerId == 0) || (restart)) { - if (timeout != -1) { - if (restart) - KillTimer(NULL, checkConnectingTimerId); - if (timeout == 0) { - timeout = initDelay / 2; - } - checkConnectingTimerId = SetTimer(NULL, 0, timeout, CheckConnectingTimer); - } - } - } - - log_debugA("ack: %u, chk: %u, aft: %u, cnt: %u, con: %u", processAckTimerId, checkConnectionTimerId, afterCheckTimerId, checkContinTimerId, checkConnectingTimerId); - log_debugA("StartTimer done %d", res); - - return res; -} - -static VOID CALLBACK StartTimerApcProc(ULONG_PTR param) -{ - struct TimerInfo *ti = (struct TimerInfo *)param; - log_debugA("StartTimerApcProc %d %d %d", ti->timer, ti->timeout, ti->restart); - ti->result = StartTimerFunction(ti->timer, ti->timeout, ti->restart); - SetEvent(ti->hEvent); -} - -static int StartTimer(int timer, int timeout, BOOL restart) -{ - if (GetCurrentThreadId() == mainThreadId) - return StartTimerFunction(timer, timeout, restart); - - TimerInfo *ti = (TimerInfo*)calloc(1, sizeof(struct TimerInfo)); - ti->timer = timer; - ti->timeout = timeout; - ti->restart = restart; - ti->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); - QueueUserAPC(StartTimerApcProc, hMainThread, (ULONG_PTR)ti); - WaitForSingleObject(ti->hEvent, INFINITE); - CloseHandle(ti->hEvent); - int res = ti->result; - free(ti); - return res; -} - -static int StopTimer(int timer) -{ - int res = 0; - - mir_cslock lck(GenTimerCS); - log_debugA("StopTimer %d", timer); - log_debugA("ack: %u, chk: %u, aft: %u, cnt: %u, con: %u", processAckTimerId, checkConnectionTimerId, afterCheckTimerId, checkContinTimerId, checkConnectingTimerId); - - if (timer & IDT_PROCESSACK) { - if (processAckTimerId == 0) - res = 0; - else { - KillTimer(NULL, processAckTimerId); - processAckTimerId = 0; - res = 1; - } - } - - if (timer & IDT_CHECKCONN) { - if (checkConnectionTimerId == 0) - res = 0 || res; - else { - KillTimer(NULL, checkConnectionTimerId); - checkConnectionTimerId = 0; - res = 1; - } - } - - if (timer & IDT_AFTERCHECK) { - if (afterCheckTimerId == 0) - res = 0 || res; - else { - KillTimer(NULL, afterCheckTimerId); - afterCheckTimerId = 0; - res = 1; - } - } - - if (timer & IDT_CHECKCONTIN) { - if (checkContinTimerId == 0) - res = 0 || res; - else { - KillTimer(NULL, checkContinTimerId); - checkContinTimerId = 0; - res = 1; - } - } - - if (timer & IDT_CHECKCONNECTING) { - if (checkConnectingTimerId == 0) - res = 0 || res; - else { - KillTimer(NULL, checkConnectingTimerId); - checkConnectingTimerId = 0; - res = 1; - } - } - - log_debugA("ack: %u, chk: %u, aft: %u, cnt: %u, con: %u", processAckTimerId, checkConnectionTimerId, afterCheckTimerId, checkContinTimerId, checkConnectingTimerId); - log_debugA("StopTimer done %d", res); - - return res; -} - -static int ProcessProtoAck(WPARAM, LPARAM lParam) -{ - ACKDATA *ack = (ACKDATA*)lParam; - - if (ack->type != ACKTYPE_STATUS && ack->type != ACKTYPE_LOGIN) - return 0; - - char dbSetting[128]; - mir_snprintf(dbSetting, "%s_enabled", ack->szModule); - if (!db_get_b(NULL, MODULENAME, dbSetting, 1)) - return 0; - - if (ack->type == ACKTYPE_STATUS && ack->result == ACKRESULT_SUCCESS) { - for (int i = 0; i < connectionSettings.getCount(); i++) { - TConnectionSettings& cs = connectionSettings[i]; - if (!mir_strcmp(cs.szName, ack->szModule)) - cs.lastStatusAckTime = GetTickCount(); - } - StartTimer(IDT_PROCESSACK, 0, FALSE); - return 0; - } - - if (ack->type == ACKTYPE_LOGIN) { - if (ack->lParam == LOGINERR_OTHERLOCATION) { - for (int i = 0; i < connectionSettings.getCount(); i++) { - TConnectionSettings& cs = connectionSettings[i]; - if (!mir_strcmp(ack->szModule, cs.szName)) { - AssignStatus(&cs, ID_STATUS_OFFLINE, 0, NULL); - if (db_get_b(NULL, MODULENAME, SETTING_CNCOTHERLOC, 0)) { - StopTimer(IDT_PROCESSACK); - for (int j = 0; j < connectionSettings.getCount(); j++) { - AssignStatus(&connectionSettings[j], ID_STATUS_OFFLINE, 0, NULL); - } - } - - NotifyEventHooks(hConnectionEvent, (WPARAM)KS_CONN_STATE_OTHERLOCATION, (LPARAM)cs.szName); - ProcessPopup(KS_CONN_STATE_OTHERLOCATION, (LPARAM)ack->szModule); - } - } - } - else if (ack->result == ACKRESULT_FAILED) { - // login failed - NotifyEventHooks(hConnectionEvent, (WPARAM)KS_CONN_STATE_LOGINERROR, (LPARAM)ack->szModule); - switch (db_get_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING)) { - case LOGINERR_CANCEL: - { - log_infoA("KeepStatus: cancel on login error (%s)", ack->szModule); - for (int i = 0; i < connectionSettings.getCount(); i++) { - TConnectionSettings& cs = connectionSettings[i]; - if (!mir_strcmp(ack->szModule, cs.szName)) - AssignStatus(&cs, ID_STATUS_OFFLINE, 0, NULL); - } - ProcessPopup(KS_CONN_STATE_LOGINERROR, (LPARAM)ack->szModule); - StopChecking(); - } - break; - - case LOGINERR_SETDELAY: - { - int newDelay = 1000 * db_get_dw(NULL, MODULENAME, SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY); - log_infoA("KeepStatus: set delay to %d on login error (%s)", newDelay / 1000, ack->szModule); - StartTimer(IDT_CHECKCONN, newDelay, TRUE); - } - ProcessPopup(KS_CONN_STATE_LOGINERROR, (LPARAM)ack->szModule); - break; - - default: - case LOGINERR_NOTHING: - StartTimer(IDT_PROCESSACK, 0, FALSE); - break; - } - } - } - - return 0; -} - -static VOID CALLBACK CheckConnectingTimer(HWND, UINT, UINT_PTR, DWORD) -{ - int maxConnectingTime; - - StopTimer(IDT_CHECKCONNECTING); - //log_debugA("KeepStatus: CheckConnectingTimer"); - for (int i = 0; i < connectionSettings.getCount(); i++) { - TConnectionSettings& cs = connectionSettings[i]; - - int curStatus = GetStatus(cs); - if (IsStatusConnecting(curStatus)) { // connecting - maxConnectingTime = db_get_dw(NULL, MODULENAME, SETTING_MAXCONNECTINGTIME, 0); - if (maxConnectingTime > 0) { - if ((unsigned int)maxConnectingTime <= ((GetTickCount() - cs.lastStatusAckTime) / 1000)) { - // set offline - log_infoA("KeepStatus: %s is too long connecting; setting offline", cs.szName); - CallProtoService(cs.szName, PS_SETSTATUS, (WPARAM)ID_STATUS_OFFLINE, 0); - } - } - } - } -} - -static VOID CALLBACK CheckAckStatusTimer(HWND, UINT, UINT_PTR, DWORD) -{ - int maxConnectingTime; - bool needChecking = false; - - StopTimer(IDT_PROCESSACK); - for (int i = 0; i < connectionSettings.getCount(); i++) { - TConnectionSettings& cs = connectionSettings[i]; - - int curStatus = GetStatus(cs); - int newStatus = CallProtoService(cs.szName, PS_GETSTATUS, 0, 0); - // ok, np - if (curStatus == ID_STATUS_CURRENT || curStatus == ID_STATUS_DISABLED || curStatus == newStatus || newStatus > MAX_STATUS) - continue; - - if (IsStatusConnecting(newStatus)) { // connecting - maxConnectingTime = db_get_dw(NULL, MODULENAME, SETTING_MAXCONNECTINGTIME, 0); - if (maxConnectingTime > 0) - StartTimer(IDT_CHECKCONNECTING, (maxConnectingTime * 1000 - (GetTickCount() - cs.lastStatusAckTime)), FALSE); - } - // keepstatus' administration was wrong! - else if (newStatus != ID_STATUS_OFFLINE) - AssignStatus(&cs, newStatus, 0, NULL); - - // connection lost - else if (newStatus == ID_STATUS_OFFLINE) {// start checking connection - if (!StartTimer(IDT_CHECKCONN, -1, FALSE)) { /* check if not already checking */ - needChecking = true; - log_infoA("KeepStatus: connection lost! (%s)", cs.szName); - NotifyEventHooks(hConnectionEvent, (WPARAM)KS_CONN_STATE_LOST, (LPARAM)cs.szName); - ProcessPopup(KS_CONN_STATE_LOST, (LPARAM)cs.szName); - } - } - } - - if (needChecking) - StartTimer(IDT_CHECKCONN, initDelay, FALSE); -} - -static VOID CALLBACK CheckConnectionTimer(HWND, UINT, UINT_PTR, DWORD) -{ - int shouldBeStatus, realStatus; - HICON hIcon; - - log_debugA("CheckConnectionTimer"); - bool setStatus = false; - if (showConnectionPopups) - hIcon = Skin_LoadIcon(SKINICON_STATUS_OFFLINE); - - for (int i = 0; i < connectionSettings.getCount() && !setStatus; i++) { - TConnectionSettings& cs = connectionSettings[i]; - realStatus = CallProtoService(cs.szName, PS_GETSTATUS, 0, 0); - shouldBeStatus = GetStatus(cs); - if (shouldBeStatus == ID_STATUS_LAST) - shouldBeStatus = cs.lastStatus; - if (shouldBeStatus == ID_STATUS_DISABLED) - continue; - if ((shouldBeStatus != realStatus) && (realStatus == ID_STATUS_OFFLINE) || (realStatus < MIN_STATUS)) { - setStatus = true; - if (showConnectionPopups) - hIcon = Skin_LoadProtoIcon(cs.szName, ID_STATUS_OFFLINE); - } - } - - // one of the status was wrong - if (setStatus && (maxRetries == -1 || retryCount < maxRetries)) { - if (increaseExponential) - currentDelay = min(2 * currentDelay, maxDelay); - - if (((db_get_b(NULL, MODULENAME, SETTING_CHKINET, 0)) && (!InternetGetConnectedState(NULL, 0))) || ((db_get_b(NULL, MODULENAME, SETTING_BYPING, FALSE)) && (!bLastPingResult))) { - // no network - NotifyEventHooks(hConnectionEvent, (WPARAM)KS_CONN_STATE_RETRYNOCONN, (LPARAM)retryCount + 1); - ProcessPopup(KS_CONN_STATE_RETRYNOCONN, 0); - } - else { - NotifyEventHooks(hConnectionEvent, (WPARAM)KS_CONN_STATE_RETRY, (LPARAM)retryCount + 1); - /* set the status */ - SetCurrentStatus(); - } - retryCount += 1; - StartTimer(IDT_AFTERCHECK, min(currentDelay, AFTERCHECK_DELAY) / 2, FALSE); - StartTimer(IDT_CHECKCONN, currentDelay, TRUE); // restart this timer - } - else // all status set ok already, or stop checking - StopChecking(); - - log_debugA("CheckConnectionTimer done"); -} - -static int StopChecking() -{ - StopTimer(IDT_CHECKCONN | IDT_PROCESSACK | IDT_AFTERCHECK | IDT_CHECKCONNECTING); - - BOOL isOk = TRUE; - for (int i = 0; i < connectionSettings.getCount() && isOk; i++) { - TConnectionSettings& cs = connectionSettings[i]; - int curStatus = GetStatus(cs); - int newStatus = CallProtoService(cs.szName, PS_GETSTATUS, 0, 0); - if (newStatus != curStatus && curStatus != ID_STATUS_DISABLED) { - AssignStatus(&cs, newStatus, 0, NULL); - isOk = FALSE; - } - } - - NotifyEventHooks(hConnectionEvent, (WPARAM)KS_CONN_STATE_STOPPEDCHECKING, (LPARAM)isOk); - ProcessPopup(KS_CONN_STATE_STOPPEDCHECKING, (LPARAM)isOk); - log_infoA("KeepStatus: stop checking (%s)", isOk ? "success" : "failure"); - retryCount = 0; - currentDelay = initDelay; - - return 0; -} - -static VOID CALLBACK AfterCheckTimer(HWND, UINT, UINT_PTR, DWORD) -{ - // after each connection check, this function is called to see if connection was recovered - StopTimer(IDT_AFTERCHECK); - - bool setStatus = false; - - for (int i = 0; i < connectionSettings.getCount(); i++) { - TConnectionSettings& cs = connectionSettings[i]; - int realStatus = CallProtoService(cs.szName, PS_GETSTATUS, 0, 0); - int shouldBeStatus = GetStatus(cs); - if (shouldBeStatus == ID_STATUS_LAST) // this should never happen - shouldBeStatus = cs.lastStatus; - if (shouldBeStatus == ID_STATUS_DISABLED) // (on ignoring proto) - continue; - if ((shouldBeStatus != realStatus) && (realStatus == ID_STATUS_OFFLINE) || (realStatus < MIN_STATUS)) - setStatus = true; - } - - if (!setStatus || retryCount == maxRetries) - StopChecking(); -} - -static void CheckContinueslyFunction(void *) -{ - Thread_SetName("KeepStatus: CheckContinueslyFunction"); - - static int pingFailures = 0; - - // one at the time is enough, do it the 'easy' way - mir_cslock lck(CheckContinueslyCS); - - // do a ping, even if reconnecting - bool doPing = false; - for (int i = 0; i < connectionSettings.getCount(); i++) { - TConnectionSettings& cs = connectionSettings[i]; - int shouldBeStatus = GetStatus(cs); - if (shouldBeStatus == ID_STATUS_LAST) - shouldBeStatus = cs.lastStatus; - - if (shouldBeStatus == ID_STATUS_DISABLED) - continue; - - if (shouldBeStatus != ID_STATUS_OFFLINE) { - log_debugA("CheckContinueslyFunction: %s should be %d", cs.szName, shouldBeStatus); - doPing = true; - } - } - - if (!doPing) { - log_debugA("CheckContinueslyFunction: All protocols should be offline, no need to check connection"); - return; - } - - BOOL ping = db_get_b(NULL, MODULENAME, SETTING_BYPING, FALSE); - if (ping) { - DBVARIANT dbv; - if (db_get(NULL, MODULENAME, SETTING_PINGHOST, &dbv)) - ping = FALSE; - else { - char *start, *end; - char host[MAX_PATH]; - DWORD *addr; - struct hostent *hostent; - char reply[sizeof(ICMP_ECHO_REPLY) + 8]; - - bLastPingResult = FALSE; - HANDLE hICMPFile = (HANDLE)IcmpCreateFile(); - if (hICMPFile == INVALID_HANDLE_VALUE) { - bLastPingResult = TRUE; - log_infoA("KeepStatus: icmp.dll error (2)"); - } - if (bLastPingResult == FALSE) { - start = dbv.pszVal; - while ((*start != '\0') && (!bLastPingResult)) { - end = start; - while ((*end != ' ') && (*end != '\0')) - end++; - memset(host, '\0', sizeof(host)); - strncpy(host, start, end - start); - hostent = gethostbyname(host); - if (hostent != NULL) { - addr = (DWORD *)(*hostent->h_addr_list); - bLastPingResult = (IcmpSendEcho(hICMPFile, *addr, 0, 0, NULL, reply, sizeof(ICMP_ECHO_REPLY) + 8, 5000) != 0); - - if (bLastPingResult) - pingFailures = 0; - else - pingFailures++; - - log_debugA("CheckContinueslyFunction: pinging %s (result: %d/%d)", host, bLastPingResult, pingFailures); - } - else log_debugA("CheckContinueslyFunction: unable to resolve %s", host); - - start = end; - while (*start == ' ') - start++; - } - } - IcmpCloseHandle(hICMPFile); - } - db_free(&dbv); - } - - if (StartTimer(IDT_CHECKCONN, -1, FALSE)) { - return; // already connecting, leave - } - - if (((!ping) && (!InternetGetConnectedState(NULL, 0))) || ((ping) && (!bLastPingResult) && (pingFailures >= db_get_w(NULL, MODULENAME, SETTING_PINGCOUNT, DEFAULT_PINGCOUNT)))) { - pingFailures = 0; - - int count; - PROTOACCOUNT** protos; - Proto_EnumAccounts(&count, &protos); - - for (int i = 0; i < count; i++) { - if (!IsSuitableProto(protos[i])) - continue; - - if (IsStatusConnecting(CallProtoService(protos[i]->szModuleName, PS_GETSTATUS, 0, 0))) { - log_debugA("CheckContinueslyFunction: %s is connecting", protos[i]->szModuleName); - continue; // connecting, leave alone - } - if (IsProtocolEnabledService(0, (LPARAM)protos[i]->szModuleName)) { - log_debugA("CheckContinueslyFunction: forcing %s offline", protos[i]->szModuleName); - CallProtoService(protos[i]->szModuleName, PS_SETSTATUS, (WPARAM)ID_STATUS_OFFLINE, 0); - } - } - if (StartTimer(IDT_CHECKCONN | IDT_PROCESSACK, -1, FALSE)) {// are our 'set offlines' noticed? - log_debugA("CheckContinueslyFunction: currently checking"); - return; - } - log_infoA("KeepStatus: connection lost! (continuesly check)"); - NotifyEventHooks(hConnectionEvent, (WPARAM)KS_CONN_STATE_LOST, 0); - ProcessPopup(KS_CONN_STATE_LOST, 0); - maxRetries = db_get_b(NULL, MODULENAME, SETTING_MAXRETRIES, 0); - if (maxRetries == 0) - maxRetries = -1; - StartTimer(IDT_CHECKCONN, initDelay, FALSE); - } -} - -static VOID CALLBACK CheckContinueslyTimer(HWND, UINT, UINT_PTR, DWORD) -{ - if (db_get_b(NULL, MODULENAME, SETTING_BYPING, FALSE)) - mir_forkthread(CheckContinueslyFunction, NULL); - else - CheckContinueslyFunction(NULL); -} - -// =============== popup ====================== -static wchar_t* GetHumanName(LPARAM lParam) -{ - PROTOACCOUNT *ProtoAccount = Proto_GetAccount((char*)lParam); - return (ProtoAccount != NULL) ? ProtoAccount->tszAccountName : TranslateT("Protocol"); -} - -static int ProcessPopup(int reason, LPARAM lParam) -{ - HICON hIcon = NULL; - wchar_t text[MAX_SECONDLINE]; - - if (!db_get_b(NULL, MODULENAME, SETTING_SHOWCONNECTIONPOPUPS, FALSE) || !ServiceExists(MS_POPUP_ADDPOPUPT)) - return -1; - - switch (reason) { - case KS_CONN_STATE_OTHERLOCATION: // lParam = 1 proto - if (!db_get_b(NULL, MODULENAME, SETTING_PUOTHER, TRUE)) - return -1; - - hIcon = Skin_LoadProtoIcon((char*)lParam, SKINICON_STATUS_OFFLINE); - mir_snwprintf(text, TranslateT("%s connected from another location"), GetHumanName(lParam)); - break; - - case KS_CONN_STATE_LOGINERROR: // lParam = 1 proto - if (!db_get_b(NULL, MODULENAME, SETTING_PUOTHER, TRUE)) - return -1; - - hIcon = Skin_LoadProtoIcon((char*)lParam, SKINICON_STATUS_OFFLINE); - if (db_get_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING) == LOGINERR_CANCEL) - mir_snwprintf(text, TranslateT("%s login error, cancel reconnecting"), GetHumanName(lParam)); - else if (db_get_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING) == LOGINERR_SETDELAY) - mir_snwprintf(text, TranslateT("%s login error (next retry (%d) in %d s)"), GetHumanName(lParam), retryCount + 1, db_get_dw(NULL, MODULENAME, SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY)); - else - return -1; - break; - - case KS_CONN_STATE_LOST: // lParam = 1 proto, or NULL - if (!db_get_b(NULL, MODULENAME, SETTING_PUCONNLOST, TRUE)) - return -1; - - if (lParam) { // Óêàçàòåëü íà èìÿ ìîäóëÿ. - hIcon = Skin_LoadProtoIcon((char*)lParam, SKINICON_STATUS_OFFLINE); - mir_snwprintf(text, TranslateT("%s status error (next retry (%d) in %d s)"), GetHumanName(lParam), retryCount + 1, currentDelay / 1000); - } - else mir_snwprintf(text, TranslateT("Status error (next retry (%d) in %d s)"), retryCount + 1, currentDelay / 1000); - break; - - case KS_CONN_STATE_RETRY: // lParam = PROTOCOLSETTINGEX** - if (!db_get_b(NULL, MODULENAME, SETTING_PUCONNRETRY, TRUE)) - return -1; - if (lParam) { - PROTOCOLSETTINGEX **ps = (PROTOCOLSETTINGEX **)lParam; - wchar_t protoInfoLine[512], protoInfo[MAX_SECONDLINE]; - memset(protoInfoLine, '\0', sizeof(protoInfoLine)); - memset(protoInfo, '\0', sizeof(protoInfo)); - mir_wstrcpy(protoInfo, L"\r\n"); - for (int i = 0; i < connectionSettings.getCount(); i++) { - if (mir_wstrlen(ps[i]->tszAccName) > 0 && mir_strlen(ps[i]->szName) > 0) { - if (db_get_b(NULL, MODULENAME, SETTING_PUSHOWEXTRA, TRUE)) { - mir_snwprintf(protoInfoLine, TranslateT("%s\t(will be set to %s)\r\n"), ps[i]->tszAccName, pcli->pfnGetStatusModeDescription(ps[i]->status, 0)); - mir_wstrncat(protoInfo, protoInfoLine, _countof(protoInfo) - mir_wstrlen(protoInfo) - 1); - } - } - } - hIcon = Skin_LoadProtoIcon(ps[0]->szName, SKINICON_STATUS_OFFLINE); - - rtrimw(protoInfo); - if (retryCount == (maxRetries - 1)) - mir_snwprintf(text, TranslateT("Resetting status... (last try (%d))%s"), retryCount + 1, protoInfo); - else - mir_snwprintf(text, TranslateT("Resetting status... (next retry (%d) in %d s)%s"), retryCount + 2, currentDelay / 1000, protoInfo); - } - break; - - case KS_CONN_STATE_RETRYNOCONN: // lParam = NULL - if (!db_get_b(NULL, MODULENAME, SETTING_PUOTHER, TRUE)) - return -1; - - if (retryCount == maxRetries - 1) - mir_snwprintf(text, TranslateT("No internet connection seems available... (last try (%d))"), retryCount + 1); - else - mir_snwprintf(text, TranslateT("No internet connection seems available... (next retry (%d) in %d s)"), retryCount + 2, currentDelay / 1000); - break; - - case KS_CONN_STATE_STOPPEDCHECKING: // lParam == BOOL succes - if (!db_get_b(NULL, MODULENAME, SETTING_PURESULT, TRUE)) - return -1; - - if (lParam) { - hIcon = Skin_LoadIcon(SKINICON_STATUS_ONLINE); - mir_snwprintf(text, TranslateT("Status was set ok")); - } - else mir_snwprintf(text, TranslateT("Giving up")); - break; - } - if (hIcon == NULL) - hIcon = Skin_LoadIcon(SKINICON_STATUS_OFFLINE); - - log_info(L"KeepStatus: %s", text); - return ShowPopup(text, hIcon); -} - -static INT_PTR ShowPopup(wchar_t *msg, HICON hIcon) -{ - POPUPDATAT ppd = { 0 }; - ppd.lchIcon = hIcon; - wcsncpy(ppd.lptzContactName, TranslateT("KeepStatus"), MAX_CONTACTNAME); - wcsncpy(ppd.lptzText, msg, MAX_SECONDLINE); - if (db_get_b(NULL, MODULENAME, SETTING_POPUP_USEWINCOLORS, 0)) { - ppd.colorBack = GetSysColor(COLOR_BTNFACE); - ppd.colorText = GetSysColor(COLOR_WINDOWTEXT); - } - else if (!db_get_b(NULL, MODULENAME, SETTING_POPUP_USEDEFCOLORS, 0)) { - ppd.colorBack = db_get_dw(NULL, MODULENAME, SETTING_POPUP_BACKCOLOR, 0xAAAAAA); - ppd.colorText = db_get_dw(NULL, MODULENAME, SETTING_POPUP_TEXTCOLOR, 0x0000CC); - } - ppd.PluginWindowProc = PopupDlgProc; - - switch (db_get_b(NULL, MODULENAME, SETTING_POPUP_DELAYTYPE, POPUP_DELAYFROMPU)) { - case POPUP_DELAYCUSTOM: - ppd.iSeconds = (int)db_get_dw(NULL, MODULENAME, SETTING_POPUP_TIMEOUT, 0); - if (ppd.iSeconds == 0) - ppd.iSeconds = currentDelay / 1000 - 1; - break; - - case POPUP_DELAYPERMANENT: - ppd.iSeconds = -1; - break; - - case POPUP_DELAYFROMPU: - default: - ppd.iSeconds = 0; - break; - } - return PUAddPopupT(&ppd); -} - -LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - switch (message) { - case WM_CONTEXTMENU: // right - case WM_COMMAND: // left - switch (db_get_b(NULL, MODULENAME, - (message == WM_COMMAND) ? SETTING_POPUP_LEFTCLICK : SETTING_POPUP_RIGHTCLICK, - POPUP_ACT_CLOSEPOPUP)) { - case POPUP_ACT_CANCEL: - // cancel timer - StopChecking(); - PUDeletePopup(hWnd); - break; - - case POPUP_ACT_CLOSEPOPUP: - // close the popup - PUDeletePopup(hWnd); - break; - } - break; - } - - return DefWindowProc(hWnd, message, wParam, lParam); -} - -// =============== services =================== -INT_PTR StopReconnectingService(WPARAM, LPARAM) -{ - int ret = StartTimer(IDT_CHECKCONN | IDT_AFTERCHECK, -1, FALSE); - StopChecking(); - return ret; -} - -INT_PTR EnableProtocolService(WPARAM wParam, LPARAM lParam) -{ - char *szProto = (char *)lParam; - if (szProto == NULL) - return -1; - - char dbSetting[128]; - mir_snprintf(dbSetting, "%s_enabled", szProto); - if (!db_get_b(NULL, MODULENAME, dbSetting, 1)) // 'hard' disabled - return -1; - - int ret = -2; - for (int i = 0; i < connectionSettings.getCount(); i++) { - TConnectionSettings& cs = connectionSettings[i]; - if (!mir_strcmp(szProto, cs.szName)) { - if (wParam) { - if (GetStatus(cs) == ID_STATUS_DISABLED) - AssignStatus(&cs, CallProtoService(cs.szName, PS_GETSTATUS, 0, 0), 0, NULL); - } - else AssignStatus(&cs, ID_STATUS_DISABLED, 0, NULL); - - ret = 0; - break; - } - } - return ret; -} - -INT_PTR IsProtocolEnabledService(WPARAM, LPARAM lParam) -{ - char *szProto = (char *)lParam; - - char dbSetting[128]; - mir_snprintf(dbSetting, "%s_enabled", szProto); - if (!db_get_b(NULL, MODULENAME, dbSetting, 1)) - return FALSE; - - for (int i = 0; i < connectionSettings.getCount(); i++) { - TConnectionSettings& cs = connectionSettings[i]; - if (!mir_strcmp(szProto, cs.szName)) - return GetStatus(cs) != ID_STATUS_DISABLED; - } - - return FALSE; -} - -INT_PTR AnnounceStatusChangeService(WPARAM, LPARAM lParam) -{ - PROTOCOLSETTINGEX *newSituation = (PROTOCOLSETTINGEX *)lParam; - log_infoA("Another plugin announced a status change to %d for %s", newSituation->status, newSituation->szName == NULL ? "all" : newSituation->szName); - - for (int i = 0; i < connectionSettings.getCount(); i++) { - TConnectionSettings& cs = connectionSettings[i]; - if (!mir_strcmp(cs.szName, newSituation->szName)) - AssignStatus(&cs, newSituation->status, newSituation->lastStatus, newSituation->szMsg); - } - - return 0; -} - -// =============== window for suspend =============== - -static DWORD CALLBACK MessageWndProc(HWND, UINT msg, WPARAM wParam, LPARAM lParam) -{ - static PROTOCOLSETTINGEX** ps = NULL; - - switch (msg) { - case WM_POWERBROADCAST: - switch (wParam) { - case PBT_APMSUSPEND: - log_infoA("KeepStatus: suspend state detected: %08X %08X", wParam, lParam); - if (ps == NULL) { - ps = GetCurrentProtoSettingsCopy(); - for (int i = 0; i < connectionSettings.getCount(); i++) - EnableProtocolService(0, (LPARAM)ps[i]->szName); - - // set proto's offline, the clist will not try to reconnect in that case - CallService(MS_CLIST_SETSTATUSMODE, (WPARAM)ID_STATUS_OFFLINE, 0); - } - break; - - //case PBT_APMRESUMEAUTOMATIC: ? - case PBT_APMRESUMESUSPEND: - case PBT_APMRESUMECRITICAL: - log_infoA("KeepStatus: resume from suspend state"); - if (ps != NULL) { - for (int i = 0; i < connectionSettings.getCount(); i++) - AssignStatus(&connectionSettings[i], ps[i]->status, ps[i]->lastStatus, ps[i]->szMsg); - FreeProtoSettings(ps); - ps = NULL; - } - StartTimer(IDT_PROCESSACK, 0, FALSE); - break; - } - break; - - case WM_DESTROY: - if (ps != NULL) { - FreeProtoSettings(ps); - ps = NULL; - } - break; - } - - return TRUE; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// Account control event - -int OnAccChanged(WPARAM wParam, LPARAM lParam) -{ - PROTOACCOUNT *pa = (PROTOACCOUNT*)lParam; - switch (wParam) { - case PRAC_ADDED: - connectionSettings.insert(new TConnectionSettings(pa)); - break; - - case PRAC_REMOVED: - for (int i = 0; i < connectionSettings.getCount(); i++) { - if (!mir_strcmp(connectionSettings[i].szName, pa->szModuleName)) { - connectionSettings.remove(i); - break; - } - } - break; - } - return 0; -} - -// =============== init stuff ================= - -static int onShutdown(WPARAM, LPARAM) -{ - UnhookEvent(hStatusChangeHook); - UnhookEvent(hProtoAckHook); - UnhookEvent(hCSStatusChangeHook); - UnhookEvent(hCSStatusChangeExHook); - - StopTimer(IDT_CHECKCONN | IDT_PROCESSACK | IDT_AFTERCHECK | IDT_CHECKCONTIN); - if (IsWindow(hMessageWindow)) - DestroyWindow(hMessageWindow); - - connectionSettings.destroy(); - - return 0; -} - -int CSModuleLoaded(WPARAM, LPARAM) -{ - protoList = (OBJLIST*)&connectionSettings; - - hMessageWindow = NULL; - LoadMainOptions(); - - HookEvent(ME_OPT_INITIALISE, OptionsInit); - HookEvent(ME_SYSTEM_PRESHUTDOWN, onShutdown); - HookEvent(ME_PROTO_ACCLISTCHANGED, OnAccChanged); - return 0; -} diff --git a/plugins/StatusPlugins/KeepStatus/keepstatus.h b/plugins/StatusPlugins/KeepStatus/keepstatus.h deleted file mode 100644 index bf9f3e48f8..0000000000 --- a/plugins/StatusPlugins/KeepStatus/keepstatus.h +++ /dev/null @@ -1,139 +0,0 @@ -/* - KeepStatus Plugin for Miranda-IM (www.miranda-im.org) - Copyright 2003-2006 P. Boon - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __KEEPSTATUS_HEADER -#define __KEEPSTATUS_HEADER - -#include -#include -#include -#include -#include - -#include -#include -#include -#include "version.h" - -#define __FILENAME "KeepStatus.dll" -#define MODULENAME "KeepStatus" -#define SETTING_CHECKCONNECTION "CheckConnection" -#define SETTING_MAXRETRIES "MaxRetries" -#define SETTING_INCREASEEXPONENTIAL "IncreaseExponential" -#define SETTING_INITDELAY "InitDelay" -#define SETTING_MAXDELAY "MaxDelay" -#define SETTING_SHOWCONNECTIONPOPUPS "ShowConnectionPopups" -#define SETTING_CHKINET "CheckInet" -#define SETTING_CNCOTHERLOC "CancelIfOtherLocation" -#define SETTING_LOGINERR "OnLoginErr" -#define SETTING_LOGINERR_DELAY "OnLoginErrDelay" -#define SETTING_CONTCHECK "ContinueslyCheck" -#define SETTING_BYPING "ByPingingHost" -#define SETTING_PINGHOST "HostToPing" -#define SETTING_CHECKAPMRESUME "CheckAPMResume" -#define SETTING_FIRSTOFFLINE "FirstOffline" -#define SETTING_NOLOCKED "NoLocked" -#define SETTING_MAXCONNECTINGTIME "MaxConnectingTime" -#define SETTING_PINGCOUNT "PingCount" -#define DEFAULT_PINGCOUNT 1 -#define SETTING_CNTDELAY "CntDelay" -#define STATUSCHANGEDELAY 500 // ms -#define DEFAULT_MAXRETRIES 0 -#define DEFAULT_INITDELAY 10 // s -#define DEFAULT_MAXDELAY 900 // s -#define AFTERCHECK_DELAY 10000 //ms (divided by 2) -#define CHECKCONTIN_DELAY 10 // s -#define SETTING_POPUP_DELAYTYPE "PopupDelayType" -#define SETTING_POPUP_USEWINCOLORS "PopupUseWinColors" -#define SETTING_POPUP_USEDEFCOLORS "PopupUseDefColors" -#define SETTING_POPUP_BACKCOLOR "PopupBackColor" -#define SETTING_POPUP_TEXTCOLOR "PopupTextColor" -#define SETTING_POPUP_TIMEOUT "PopupTimeout" -#define SETTING_POPUP_LEFTCLICK "PopupLeftClickAction" -#define SETTING_POPUP_RIGHTCLICK "PopupRightClickAction" -#define SETTING_PUOTHER "PopupShowOther" -#define SETTING_PUCONNLOST "PopupShowConnLost" -#define SETTING_PUCONNRETRY "PopupShowConnRetry" -#define SETTING_PURESULT "PopupShowResult" -#define SETTING_PUSHOWEXTRA "PopupShowExtra" -#define POPUP_ACT_NOTHING 0 -#define POPUP_ACT_CANCEL 1 -#define POPUP_ACT_CLOSEPOPUP 2 -#define POPUP_DELAYFROMPU 0 -#define POPUP_DELAYCUSTOM 1 -#define POPUP_DELAYPERMANENT 2 -#define LOGINERR_NOTHING 0 -#define LOGINERR_CANCEL 1 -#define LOGINERR_SETDELAY 2 - -#define IDT_PROCESSACK 0x01 -#define IDT_CHECKCONN 0x02 -#define IDT_AFTERCHECK 0x04 -#define IDT_CHECKCONTIN 0x08 -#define IDT_CHECKCONNECTING 0x10 - -#define KS_ISENABLED WM_APP + 10 -#define KS_ENABLEITEMS WM_APP + 11 - -// action -#define SETTING_ENABLECHECKING "EnableChecking" -// trigger -#define TRIGGERNAME "KeepStatus: Connection state change" -#define TRIGGER_CONNLOST 0x01 -#define TRIGGER_LOGINERROR 0x02 -#define TRIGGER_OTHERLOC 0x04 -#define TRIGGER_CONNRETRY 0x08 -#define TRIGGER_CONNSUCCESS 0x10 -#define TRIGGER_CONNGIVEUP 0x20 -#define SETTING_TRIGGERON "TriggerOn" - -struct TConnectionSettings : public PROTOCOLSETTINGEX -{ - TConnectionSettings(PROTOACCOUNT *pa); - ~TConnectionSettings(); - - int lastStatusAckTime; // the time the last status ack was received -}; - -/* old; replaced by PROTOCOLSETTINGEX see m_statusplugins.h */ -typedef struct { - char *szName; // pointer to protocol modulename - WORD status; // the status - WORD lastStatus;// last status -} PROTOCOLSETTING; - -/* old; replaced by ME_CS_STATUSCHANGE see m_statusplugins.h */ -// wParam = PROTOCOLSETTING** -// lParam = 0 -#define ME_CS_STATUSCHANGE "CommonStatus/StatusChange" - -///////////////////////////////////////////////////////////////////////////////////////// -// main.cpp - -extern HINSTANCE hInst; -extern HANDLE hMainThread; -extern unsigned long mainThreadId; - -///////////////////////////////////////////////////////////////////////////////////////// -// keepstatus.cpp - -int LoadMainOptions(); -LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); - -#endif //__KEEPSTATUS_HEADER diff --git a/plugins/StatusPlugins/KeepStatus/main.cpp b/plugins/StatusPlugins/KeepStatus/main.cpp deleted file mode 100644 index b67757838d..0000000000 --- a/plugins/StatusPlugins/KeepStatus/main.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* - KeepStatus Plugin for Miranda-IM (www.miranda-im.org) - Copyright 2003-2006 P. Boon - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "../commonstatus.h" -#include "keepstatus.h" -#include "../resource.h" - -HANDLE hMainThread = 0; -unsigned long mainThreadId = 0; -int hLangpack = 0; - -HANDLE hCSModuleLoadedHook = NULL; - -HANDLE hConnectionEvent = NULL; -HANDLE hStopRecon = NULL, hEnableProto = NULL, hIsProtoEnabled = NULL, hAnnounceStat = NULL; - -HINSTANCE hInst; -CLIST_INTERFACE *pcli; - -///////////////////////////////////////////////////////////////////////////////////////// -// dll entry point - -BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) -{ - hInst = hinstDLL; - return TRUE; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// returns plugin's extended information - - -PLUGININFOEX pluginInfoEx = { - sizeof(PLUGININFOEX), - __PLUGIN_NAME, - PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), - __DESC, - __AUTHOR, - __AUTHOREMAIL, - __COPYRIGHT, - __AUTHORWEB, - UNICODE_AWARE, - { 0xa5bb1b7a, 0xb7cd, 0x4cbb, { 0xa7, 0xdb, 0xce, 0xb4, 0xeb, 0x71, 0xda, 0x49 } } // {A5BB1B7A-B7CD-4cbb-A7DB-CEB4EB71DA49} -}; - -extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) -{ - return &pluginInfoEx; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// plugin's entry point - -int CSModuleLoaded(WPARAM wParam, LPARAM lParam); - -INT_PTR StopReconnectingService(WPARAM wParam, LPARAM lParam); -INT_PTR EnableProtocolService(WPARAM wParam, LPARAM lParam); -INT_PTR IsProtocolEnabledService(WPARAM wParam, LPARAM lParam); -INT_PTR AnnounceStatusChangeService(WPARAM wParam, LPARAM lParam); - -extern "C" int __declspec(dllexport) Load(void) -{ - mir_getLP(&pluginInfoEx); - pcli = Clist_GetInterface(); - - InitCommonStatus(); - - hCSModuleLoadedHook = HookEvent(ME_SYSTEM_MODULESLOADED, CSModuleLoaded); - - hConnectionEvent = CreateHookableEvent(ME_KS_CONNECTIONEVENT); - - hStopRecon = CreateServiceFunction(MS_KS_STOPRECONNECTING, StopReconnectingService); - hEnableProto = CreateServiceFunction(MS_KS_ENABLEPROTOCOL, EnableProtocolService); - hIsProtoEnabled = CreateServiceFunction(MS_KS_ISPROTOCOLENABLED, IsProtocolEnabledService); - hAnnounceStat = CreateServiceFunction(MS_KS_ANNOUNCESTATUSCHANGE, AnnounceStatusChangeService); - - DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &hMainThread, THREAD_SET_CONTEXT, FALSE, 0); - mainThreadId = GetCurrentThreadId(); - - return 0; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// plugin's exit point - -extern "C" int __declspec(dllexport) Unload(void) -{ - DestroyHookableEvent(hConnectionEvent); - - UnhookEvent(hCSModuleLoadedHook); - - if (hMainThread) - CloseHandle(hMainThread); - DestroyServiceFunction(hStopRecon); - DestroyServiceFunction(hEnableProto); - DestroyServiceFunction(hIsProtoEnabled); - DestroyServiceFunction(hAnnounceStat); - - return 0; -} diff --git a/plugins/StatusPlugins/KeepStatus/options.cpp b/plugins/StatusPlugins/KeepStatus/options.cpp deleted file mode 100644 index 3a7328a2e3..0000000000 --- a/plugins/StatusPlugins/KeepStatus/options.cpp +++ /dev/null @@ -1,591 +0,0 @@ -/* - KeepStatus Plugin for Miranda-IM (www.miranda-im.org) - Copyright 2003-2006 P. Boon - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include "../commonstatus.h" -#include "keepstatus.h" -#include "../resource.h" - -// prototypes -INT_PTR CALLBACK OptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); -INT_PTR CALLBACK PopupOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); - -static INT_PTR CALLBACK DlgProcKSBasicOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) -{ - switch (msg) { - case WM_INITDIALOG: - TranslateDialogDefault(hwndDlg); - { - LVCOLUMN lvCol; - LVITEM lvItem; - DBVARIANT dbv; - - SetDlgItemInt(hwndDlg, IDC_MAXRETRIES, db_get_b(NULL, MODULENAME, SETTING_MAXRETRIES, DEFAULT_MAXRETRIES), FALSE); - SetDlgItemInt(hwndDlg, IDC_INITDELAY, db_get_dw(NULL, MODULENAME, SETTING_INITDELAY, DEFAULT_INITDELAY), FALSE); - CheckDlgButton(hwndDlg, IDC_CHECKCONNECTION, db_get_b(NULL, MODULENAME, SETTING_CHECKCONNECTION, FALSE) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_SHOWCONNECTIONPOPUPS, (db_get_b(NULL, MODULENAME, SETTING_SHOWCONNECTIONPOPUPS, FALSE) && ServiceExists(MS_POPUP_SHOWMESSAGE)) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_CHKINET, db_get_b(NULL, MODULENAME, SETTING_CHKINET, FALSE) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_CONTCHECK, db_get_b(NULL, MODULENAME, SETTING_CONTCHECK, FALSE) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_BYPING, db_get_b(NULL, MODULENAME, SETTING_BYPING, FALSE) ? BST_CHECKED : BST_UNCHECKED); - if (!db_get_s(NULL, MODULENAME, SETTING_PINGHOST, &dbv)) { - SetDlgItemTextA(hwndDlg, IDC_PINGHOST, dbv.pszVal); - db_free(&dbv); - } - // proto list - HWND hList = GetDlgItem(hwndDlg, IDC_PROTOCOLLIST); - ListView_SetExtendedListViewStyleEx(hList, LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES, LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES); - memset(&lvCol, 0, sizeof(lvCol)); - lvCol.mask = LVCF_WIDTH | LVCF_TEXT; - lvCol.pszText = TranslateT("Protocol"); - lvCol.cx = 118; - ListView_InsertColumn(hList, 0, &lvCol); - // fill the list - memset(&lvItem, 0, sizeof(lvItem)); - lvItem.mask = LVIF_TEXT | LVIF_PARAM; - lvItem.iItem = 0; - lvItem.iSubItem = 0; - - int count; - PROTOACCOUNT** protos; - Proto_EnumAccounts(&count, &protos); - - for (int i = 0; i < count; i++) { - if (!IsSuitableProto(protos[i])) - continue; - - lvItem.pszText = protos[i]->tszAccountName; - lvItem.lParam = (LPARAM)protos[i]->szModuleName; - ListView_InsertItem(hList, &lvItem); - - char dbSetting[128]; - mir_snprintf(dbSetting, "%s_enabled", protos[i]->szModuleName); - ListView_SetCheckState(hList, lvItem.iItem, db_get_b(NULL, MODULENAME, dbSetting, TRUE)); - lvItem.iItem++; - } - EnableWindow(GetDlgItem(hwndDlg, IDC_MAXRETRIES), IsDlgButtonChecked(hwndDlg, IDC_CHECKCONNECTION)); - EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWCONNECTIONPOPUPS), ServiceExists(MS_POPUP_SHOWMESSAGE) && IsDlgButtonChecked(hwndDlg, IDC_CHECKCONNECTION)); - EnableWindow(GetDlgItem(hwndDlg, IDC_INITDELAY), IsDlgButtonChecked(hwndDlg, IDC_CHECKCONNECTION)); - EnableWindow(GetDlgItem(hwndDlg, IDC_PROTOCOLLIST), IsDlgButtonChecked(hwndDlg, IDC_CHECKCONNECTION)); - EnableWindow(GetDlgItem(hwndDlg, IDC_CHKINET), IsDlgButtonChecked(hwndDlg, IDC_CHECKCONNECTION)); - EnableWindow(GetDlgItem(hwndDlg, IDC_CONTCHECK), IsDlgButtonChecked(hwndDlg, IDC_CHECKCONNECTION)); - EnableWindow(GetDlgItem(hwndDlg, IDC_BYPING), (IsDlgButtonChecked(hwndDlg, IDC_CONTCHECK) && IsDlgButtonChecked(hwndDlg, IDC_CHECKCONNECTION)) ? TRUE : FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_PINGHOST), (IsDlgButtonChecked(hwndDlg, IDC_CONTCHECK)) && (IsDlgButtonChecked(hwndDlg, IDC_BYPING) && IsDlgButtonChecked(hwndDlg, IDC_CHECKCONNECTION)) ? TRUE : FALSE); - } - break; - - case WM_COMMAND: - if (((HIWORD(wParam) == EN_CHANGE) || (HIWORD(wParam) == BN_CLICKED)) && ((HWND)lParam == GetFocus())) - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - // something changed - switch (LOWORD(wParam)) { - case IDC_CHECKCONNECTION: - case IDC_CONTCHECK: - case IDC_BYPING: - EnableWindow(GetDlgItem(hwndDlg, IDC_MAXRETRIES), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); - EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWCONNECTIONPOPUPS), ServiceExists(MS_POPUP_SHOWMESSAGE) && SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); - EnableWindow(GetDlgItem(hwndDlg, IDC_INITDELAY), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); - EnableWindow(GetDlgItem(hwndDlg, IDC_PROTOCOLLIST), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); - EnableWindow(GetDlgItem(hwndDlg, IDC_CHKINET), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); - EnableWindow(GetDlgItem(hwndDlg, IDC_CONTCHECK), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); - EnableWindow(GetDlgItem(hwndDlg, IDC_BYPING), (IsDlgButtonChecked(hwndDlg, IDC_CONTCHECK) && SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)) ? TRUE : FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_PINGHOST), (IsDlgButtonChecked(hwndDlg, IDC_CONTCHECK)) && (IsDlgButtonChecked(hwndDlg, IDC_BYPING) && SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)) ? TRUE : FALSE); - break; - } - break; - - case WM_NOTIFY: - if (((NMHDR*)lParam)->idFrom == IDC_PROTOCOLLIST) { - switch (((NMHDR*)lParam)->code) { - case LVN_ITEMCHANGED: - { - NMLISTVIEW *nmlv = (NMLISTVIEW *)lParam; - if (IsWindowVisible(GetDlgItem(hwndDlg, IDC_PROTOCOLLIST)) && ((nmlv->uNewState^nmlv->uOldState)&LVIS_STATEIMAGEMASK)) - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - } - break; - } - } - - if (((LPNMHDR)lParam)->code == PSN_APPLY) { - int i; - LVITEM lvItem; - - db_set_b(NULL, MODULENAME, SETTING_MAXRETRIES, (BYTE)GetDlgItemInt(hwndDlg, IDC_MAXRETRIES, NULL, FALSE)); - db_set_b(NULL, MODULENAME, SETTING_CHECKCONNECTION, (BYTE)SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); - db_set_b(NULL, MODULENAME, SETTING_SHOWCONNECTIONPOPUPS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWCONNECTIONPOPUPS)); - db_set_dw(NULL, MODULENAME, SETTING_INITDELAY, (DWORD)GetDlgItemInt(hwndDlg, IDC_INITDELAY, NULL, FALSE)); - db_set_b(NULL, MODULENAME, SETTING_CHKINET, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CHKINET)); - db_set_b(NULL, MODULENAME, SETTING_CONTCHECK, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CONTCHECK)); - db_set_b(NULL, MODULENAME, SETTING_BYPING, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BYPING)); - if (IsDlgButtonChecked(hwndDlg, IDC_BYPING)) { - char *host; - - int len = SendDlgItemMessage(hwndDlg, IDC_PINGHOST, WM_GETTEXTLENGTH, 0, 0); - if (len > 0) { - host = (char*)malloc(len + 1); - if (host != NULL) { - memset(host, '\0', len + 1); - GetDlgItemTextA(hwndDlg, IDC_PINGHOST, host, len + 1); - db_set_s(NULL, MODULENAME, SETTING_PINGHOST, host); - } - } - } - HWND hList = GetDlgItem(hwndDlg, IDC_PROTOCOLLIST); - memset(&lvItem, 0, sizeof(lvItem)); - lvItem.mask = LVIF_PARAM; - for (i = 0; i < ListView_GetItemCount(hList); i++) { - lvItem.iItem = i; - lvItem.iSubItem = 0; - ListView_GetItem(hList, &lvItem); - - char dbSetting[128]; - mir_snprintf(dbSetting, "%s_enabled", (char *)lvItem.lParam); - db_set_b(NULL, MODULENAME, dbSetting, (BYTE)ListView_GetCheckState(hList, lvItem.iItem)); - } - } - break; - } - - return 0; -} - -static INT_PTR CALLBACK DlgProcKSAdvOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) -{ - switch (msg) { - case WM_INITDIALOG: { - TranslateDialogDefault(hwndDlg); - SetDlgItemInt(hwndDlg, IDC_MAXDELAY, db_get_dw(NULL, MODULENAME, SETTING_MAXDELAY, DEFAULT_MAXDELAY), FALSE); - SetDlgItemInt(hwndDlg, IDC_MAXCONNECTINGTIME, db_get_dw(NULL, MODULENAME, SETTING_MAXCONNECTINGTIME, 0), FALSE); - CheckDlgButton(hwndDlg, IDC_INCREASEEXPONENTIAL, db_get_b(NULL, MODULENAME, SETTING_INCREASEEXPONENTIAL, FALSE) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_CNCOTHERLOC, (db_get_b(NULL, MODULENAME, SETTING_CNCOTHERLOC, FALSE) && (CallService(MS_SYSTEM_GETVERSION, 0, 0) >= 0x00040000)) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_LOGINERR, db_get_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING) == LOGINERR_NOTHING ? BST_UNCHECKED : BST_CHECKED); - CheckDlgButton(hwndDlg, IDC_CHECKAPMRESUME, (db_get_b(NULL, MODULENAME, SETTING_CHECKAPMRESUME, FALSE) && (CallService(MS_SYSTEM_GETVERSION, 0, 0) >= 0x00040000)) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_FIRSTOFFLINE, (db_get_b(NULL, MODULENAME, SETTING_FIRSTOFFLINE, FALSE)) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_NOLOCKED, (db_get_b(NULL, MODULENAME, SETTING_NOLOCKED, FALSE)) ? BST_CHECKED : BST_UNCHECKED); - SetDlgItemInt(hwndDlg, IDC_LOGINERR_DELAY, db_get_dw(NULL, MODULENAME, SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY), FALSE); - SetDlgItemInt(hwndDlg, IDC_PINGCOUNT, db_get_w(NULL, MODULENAME, SETTING_PINGCOUNT, DEFAULT_PINGCOUNT), FALSE); - SetDlgItemInt(hwndDlg, IDC_CNTDELAY, db_get_dw(NULL, MODULENAME, SETTING_CNTDELAY, CHECKCONTIN_DELAY), FALSE); - switch (db_get_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_CANCEL)) { - case LOGINERR_SETDELAY: - CheckRadioButton(hwndDlg, IDC_LOGINERR_CANCEL, IDC_LOGINERR_SETDELAY, IDC_LOGINERR_SETDELAY); - break; - default: - case LOGINERR_CANCEL: - CheckRadioButton(hwndDlg, IDC_LOGINERR_CANCEL, IDC_LOGINERR_SETDELAY, IDC_LOGINERR_CANCEL); - break; - } - SendMessage(hwndDlg, KS_ENABLEITEMS, 0, 0); - break; - } - case WM_COMMAND: - if (((HIWORD(wParam) == EN_CHANGE) || (HIWORD(wParam) == BN_CLICKED)) && ((HWND)lParam == GetFocus())) - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - // something changed - switch (LOWORD(wParam)) { - case IDC_INCREASEEXPONENTIAL: - case IDC_LOGINERR: - SendMessage(hwndDlg, KS_ENABLEITEMS, 0, 0); - break; - - case IDC_LOGINERR_CANCEL: - case IDC_LOGINERR_SETDELAY: - CheckRadioButton(hwndDlg, IDC_LOGINERR_CANCEL, IDC_LOGINERR_SETDELAY, LOWORD(wParam)); - EnableWindow(GetDlgItem(hwndDlg, IDC_LOGINERR_DELAY), IsDlgButtonChecked(hwndDlg, IDC_LOGINERR_SETDELAY) && IsDlgButtonChecked(hwndDlg, IDC_LOGINERR) && SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); - break; - } - break; - - case WM_NOTIFY: - if (((LPNMHDR)lParam)->code == PSN_APPLY) { - db_set_b(NULL, MODULENAME, SETTING_INCREASEEXPONENTIAL, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_INCREASEEXPONENTIAL)); - db_set_dw(NULL, MODULENAME, SETTING_MAXDELAY, (DWORD)GetDlgItemInt(hwndDlg, IDC_MAXDELAY, NULL, FALSE)); - db_set_dw(NULL, MODULENAME, SETTING_MAXCONNECTINGTIME, (DWORD)GetDlgItemInt(hwndDlg, IDC_MAXCONNECTINGTIME, NULL, FALSE)); - db_set_b(NULL, MODULENAME, SETTING_FIRSTOFFLINE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_FIRSTOFFLINE)); - db_set_b(NULL, MODULENAME, SETTING_NOLOCKED, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOLOCKED)); - db_set_b(NULL, MODULENAME, SETTING_CNCOTHERLOC, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CNCOTHERLOC)); - db_set_b(NULL, MODULENAME, SETTING_LOGINERR, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_LOGINERR)); - if (IsDlgButtonChecked(hwndDlg, IDC_LOGINERR)) { - if (IsDlgButtonChecked(hwndDlg, IDC_LOGINERR_SETDELAY)) { - db_set_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_SETDELAY); - db_set_dw(NULL, MODULENAME, SETTING_LOGINERR_DELAY, GetDlgItemInt(hwndDlg, IDC_LOGINERR_DELAY, NULL, FALSE)); - } - else db_set_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_CANCEL); - } - else db_set_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING); - - db_set_b(NULL, MODULENAME, SETTING_CHECKAPMRESUME, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CHECKAPMRESUME)); - db_set_w(NULL, MODULENAME, SETTING_PINGCOUNT, (WORD)GetDlgItemInt(hwndDlg, IDC_PINGCOUNT, NULL, FALSE)); - db_set_dw(NULL, MODULENAME, SETTING_CNTDELAY, (DWORD)GetDlgItemInt(hwndDlg, IDC_CNTDELAY, NULL, FALSE) == 0 ? CHECKCONTIN_DELAY : GetDlgItemInt(hwndDlg, IDC_CNTDELAY, NULL, FALSE)); - } - break; - - case KS_ENABLEITEMS: - EnableWindow(GetDlgItem(hwndDlg, IDC_INCREASEEXPONENTIAL), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); - EnableWindow(GetDlgItem(hwndDlg, IDC_MAXCONNECTINGTIME), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); - EnableWindow(GetDlgItem(hwndDlg, IDC_CNCOTHERLOC), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0) && (CallService(MS_SYSTEM_GETVERSION, 0, 0) >= 0x00040000)); - EnableWindow(GetDlgItem(hwndDlg, IDC_LOGINERR), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); - EnableWindow(GetDlgItem(hwndDlg, IDC_LOGINERR_SETDELAY), IsDlgButtonChecked(hwndDlg, IDC_LOGINERR) && SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); - EnableWindow(GetDlgItem(hwndDlg, IDC_LOGINERR_DELAY), IsDlgButtonChecked(hwndDlg, IDC_LOGINERR_SETDELAY) && IsDlgButtonChecked(hwndDlg, IDC_LOGINERR) && SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); - EnableWindow(GetDlgItem(hwndDlg, IDC_LOGINERR_CANCEL), IsDlgButtonChecked(hwndDlg, IDC_LOGINERR) && SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); - EnableWindow(GetDlgItem(hwndDlg, IDC_MAXDELAY), (IsDlgButtonChecked(hwndDlg, IDC_INCREASEEXPONENTIAL) && SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)) ? TRUE : FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_CHECKAPMRESUME), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0) && (CallService(MS_SYSTEM_GETVERSION, 0, 0) >= 0x00040000)); - EnableWindow(GetDlgItem(hwndDlg, IDC_FIRSTOFFLINE), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); - EnableWindow(GetDlgItem(hwndDlg, IDC_NOLOCKED), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); - EnableWindow(GetDlgItem(hwndDlg, IDC_PINGCOUNT), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_BYPING, 0)); - EnableWindow(GetDlgItem(hwndDlg, IDC_CNTDELAY), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CONTCHECK, 0)); - break; - - case WM_SHOWWINDOW: - if (wParam) - SendMessage(hwndDlg, KS_ENABLEITEMS, 0, 0); - - break; - } - - return 0; -} - -static INT_PTR CALLBACK DlgProcKsTabs(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) -{ - static HWND hBasicTab; - - switch (msg) { - case WM_INITDIALOG: - { - HWND hShow, hPage; - RECT rcTabs, rcOptions, rcPage; - - TranslateDialogDefault(hwndDlg); - - // set tabs - int tabCount = 0; - HWND hTab = GetDlgItem(hwndDlg, IDC_TABS); - GetWindowRect(hTab, &rcTabs); - GetWindowRect(hwndDlg, &rcOptions); - - // basic tab - TCITEM tci; - memset(&tci, 0, sizeof(TCITEM)); - tci.mask = TCIF_TEXT | TCIF_PARAM; - tci.pszText = TranslateT("Basic"); - hShow = hBasicTab = hPage = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_OPT_KS_BASIC), hwndDlg, DlgProcKSBasicOpts, (LPARAM)GetParent(hwndDlg)); - EnableThemeDialogTexture(hPage, ETDT_ENABLETAB); - - tci.lParam = (LPARAM)hPage; - GetClientRect(hPage, &rcPage); - MoveWindow(hPage, (rcTabs.left - rcOptions.left) + ((rcTabs.right - rcTabs.left) - (rcPage.right - rcPage.left)) / 2, 10 + (rcTabs.top - rcOptions.top) + ((rcTabs.bottom - rcTabs.top) - (rcPage.bottom - rcPage.top)) / 2, rcPage.right - rcPage.left, rcPage.bottom - rcPage.top, TRUE); - ShowWindow(hPage, SW_HIDE); - TabCtrl_InsertItem(hTab, tabCount++, &tci); - - // advanced tab - tci.mask = TCIF_TEXT | TCIF_PARAM; - tci.pszText = TranslateT("Advanced"); - hPage = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_OPT_KS_ADV), hwndDlg, DlgProcKSAdvOpts, (LPARAM)GetParent(hwndDlg)); - EnableThemeDialogTexture(hPage, ETDT_ENABLETAB); - - tci.lParam = (LPARAM)hPage; - GetClientRect(hPage, &rcPage); - MoveWindow(hPage, (rcTabs.left - rcOptions.left) + ((rcTabs.right - rcTabs.left) - (rcPage.right - rcPage.left)) / 2, 10 + (rcTabs.top - rcOptions.top) + ((rcTabs.bottom - rcTabs.top) - (rcPage.bottom - rcPage.top)) / 2, rcPage.right - rcPage.left, rcPage.bottom - rcPage.top, TRUE); - ShowWindow(hPage, SW_HIDE); - TabCtrl_InsertItem(hTab, tabCount++, &tci); - ShowWindow(hShow, SW_SHOW); - } - break; - - case KS_ISENABLED: - SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, (LONG_PTR)IsDlgButtonChecked(hBasicTab, wParam)); - return TRUE; - - case PSM_CHANGED: - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - break; - - case WM_NOTIFY: - if ((((NMHDR*)lParam)->idFrom == IDC_TABS)) { - if (((NMHDR*)lParam)->code == TCN_SELCHANGING) { - TCITEM tci; - - tci.mask = TCIF_PARAM; - TabCtrl_GetItem(GetDlgItem(hwndDlg, IDC_TABS), TabCtrl_GetCurSel(GetDlgItem(hwndDlg, IDC_TABS)), &tci); - ShowWindow((HWND)tci.lParam, SW_HIDE); - } - else if (((NMHDR*)lParam)->code == TCN_SELCHANGE) { - TCITEM tci; - - tci.mask = TCIF_PARAM; - TabCtrl_GetItem(GetDlgItem(hwndDlg, IDC_TABS), TabCtrl_GetCurSel(GetDlgItem(hwndDlg, IDC_TABS)), &tci); - ShowWindow((HWND)tci.lParam, SW_SHOW); - } - } - if (((LPNMHDR)lParam)->code == PSN_APPLY) { - TCITEM tci; - int i, count; - - tci.mask = TCIF_PARAM; - count = TabCtrl_GetItemCount(GetDlgItem(hwndDlg, IDC_TABS)); - for (i = 0; i < count; i++) { - TabCtrl_GetItem(GetDlgItem(hwndDlg, IDC_TABS), i, &tci); - SendMessage((HWND)tci.lParam, WM_NOTIFY, 0, lParam); - } - // let main reload options - LoadMainOptions(); - } - break; - } - - return FALSE; -} - -INT_PTR CALLBACK PopupOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) -{ - static bool bFreeze = false; - - switch (msg) { - case WM_INITDIALOG: - TranslateDialogDefault(hwndDlg); - - bFreeze = true; - - // left action - switch (db_get_b(NULL, MODULENAME, SETTING_POPUP_LEFTCLICK, POPUP_ACT_CANCEL)) { - case POPUP_ACT_CLOSEPOPUP: - CheckDlgButton(hwndDlg, IDC_LCLOSE, BST_CHECKED); - break; - - case POPUP_ACT_CANCEL: - CheckDlgButton(hwndDlg, IDC_LCANCEL, BST_CHECKED); - break; - - case POPUP_ACT_NOTHING: - default: - CheckDlgButton(hwndDlg, IDC_LNOTHING, BST_CHECKED); - break; - } - // right action - switch (db_get_b(NULL, MODULENAME, SETTING_POPUP_RIGHTCLICK, POPUP_ACT_CANCEL)) { - case POPUP_ACT_CLOSEPOPUP: - CheckDlgButton(hwndDlg, IDC_RCLOSE, BST_CHECKED); - break; - - case POPUP_ACT_CANCEL: - CheckDlgButton(hwndDlg, IDC_RCANCEL, BST_CHECKED); - break; - - case POPUP_ACT_NOTHING: - default: - CheckDlgButton(hwndDlg, IDC_RNOTHING, BST_CHECKED); - break; - } - // delay - EnableWindow(GetDlgItem(hwndDlg, IDC_DELAYCUSTOM), ServiceExists(MS_POPUP_ADDPOPUPT)); - EnableWindow(GetDlgItem(hwndDlg, IDC_DELAYFROMPU), ServiceExists(MS_POPUP_ADDPOPUPT)); - EnableWindow(GetDlgItem(hwndDlg, IDC_DELAYPERMANENT), ServiceExists(MS_POPUP_ADDPOPUPT)); - EnableWindow(GetDlgItem(hwndDlg, IDC_DELAY), ServiceExists(MS_POPUP_ADDPOPUPT)); - switch (db_get_b(NULL, MODULENAME, SETTING_POPUP_DELAYTYPE, POPUP_DELAYFROMPU)) { - case POPUP_DELAYCUSTOM: - CheckDlgButton(hwndDlg, IDC_DELAYCUSTOM, BST_CHECKED); - EnableWindow(GetDlgItem(hwndDlg, IDC_DELAY), ServiceExists(MS_POPUP_ADDPOPUPT)); - break; - - case POPUP_DELAYPERMANENT: - CheckDlgButton(hwndDlg, IDC_DELAYPERMANENT, BST_CHECKED); - EnableWindow(GetDlgItem(hwndDlg, IDC_DELAY), FALSE); - break; - - case POPUP_DELAYFROMPU: - default: - CheckDlgButton(hwndDlg, IDC_DELAYFROMPU, BST_CHECKED); - EnableWindow(GetDlgItem(hwndDlg, IDC_DELAY), FALSE); - break; - } - // delay - SetDlgItemInt(hwndDlg, IDC_DELAY, db_get_dw(NULL, MODULENAME, SETTING_POPUP_TIMEOUT, 0), FALSE); - // back color - SendDlgItemMessage(hwndDlg, IDC_BGCOLOR, CPM_SETCOLOUR, 0, db_get_dw(NULL, MODULENAME, SETTING_POPUP_BACKCOLOR, 0xAAAAAA)); - // text - SendDlgItemMessage(hwndDlg, IDC_TEXTCOLOR, CPM_SETCOLOUR, 0, db_get_dw(NULL, MODULENAME, SETTING_POPUP_TEXTCOLOR, 0x0000CC)); - // wincolors - CheckDlgButton(hwndDlg, IDC_WINCOLORS, db_get_b(NULL, MODULENAME, SETTING_POPUP_USEWINCOLORS, 0) ? BST_CHECKED : BST_UNCHECKED); - // defaultcolors - CheckDlgButton(hwndDlg, IDC_DEFAULTCOLORS, ((db_get_b(NULL, MODULENAME, SETTING_POPUP_USEDEFCOLORS, 0)) && (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS))) ? BST_CHECKED : BST_UNCHECKED); - EnableWindow(GetDlgItem(hwndDlg, IDC_BGCOLOR), ((BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS)) && (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_DEFAULTCOLORS)))); - EnableWindow(GetDlgItem(hwndDlg, IDC_TEXTCOLOR), ((BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS)) && (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_DEFAULTCOLORS)))); - EnableWindow(GetDlgItem(hwndDlg, IDC_DEFAULTCOLORS), (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS))); - EnableWindow(GetDlgItem(hwndDlg, IDC_WINCOLORS), (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_DEFAULTCOLORS))); - // popup types - CheckDlgButton(hwndDlg, IDC_PUCONNLOST, db_get_b(NULL, MODULENAME, SETTING_PUCONNLOST, TRUE) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_PUOTHER, db_get_b(NULL, MODULENAME, SETTING_PUOTHER, TRUE) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_PUCONNRETRY, db_get_b(NULL, MODULENAME, SETTING_PUCONNRETRY, TRUE) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_PURESULT, db_get_b(NULL, MODULENAME, SETTING_PURESULT, TRUE) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_PUSHOWEXTRA, db_get_b(NULL, MODULENAME, SETTING_PUSHOWEXTRA, TRUE) ? BST_CHECKED : BST_UNCHECKED); - bFreeze = false; - break; - - case WM_COMMAND: - switch (LOWORD(wParam)) { - case IDC_WINCOLORS: - case IDC_DEFAULTCOLORS: - EnableWindow(GetDlgItem(hwndDlg, IDC_BGCOLOR), ((BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS)) && (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_DEFAULTCOLORS)))); - EnableWindow(GetDlgItem(hwndDlg, IDC_TEXTCOLOR), ((BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS)) && (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_DEFAULTCOLORS)))); - EnableWindow(GetDlgItem(hwndDlg, IDC_DEFAULTCOLORS), (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS))); - EnableWindow(GetDlgItem(hwndDlg, IDC_WINCOLORS), (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_DEFAULTCOLORS))); - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - break; - - case IDC_DELAYFROMPU: - case IDC_DELAYPERMANENT: - EnableWindow(GetDlgItem(hwndDlg, IDC_DELAY), FALSE); - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - break; - - case IDC_DELAYCUSTOM: - EnableWindow(GetDlgItem(hwndDlg, IDC_DELAY), TRUE); - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - break; - - case IDC_BGCOLOR: - case IDC_TEXTCOLOR: - case IDC_DELAY: - case IDC_LNOTHING: - case IDC_LCLOSE: - case IDC_LCANCEL: - case IDC_RNOTHING: - case IDC_RCLOSE: - case IDC_RCANCEL: - case IDC_PUCONNLOST: - case IDC_PUOTHER: - case IDC_PUCONNRETRY: - case IDC_PURESULT: - case IDC_PUSHOWEXTRA: - if (!bFreeze) - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - break; - - case IDC_PREV: - { - POPUPDATAT ppd = { NULL }; - - ppd.lchContact = NULL; - ppd.lchIcon = Skin_LoadIcon(SKINICON_STATUS_OFFLINE); - wcsncpy(ppd.lptzContactName, TranslateT("KeepStatus"), MAX_CONTACTNAME); - wcsncpy(ppd.lptzText, TranslateT("You broke the Internet!"), MAX_SECONDLINE); - if (IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS)) - { - ppd.colorBack = GetSysColor(COLOR_BTNFACE); - ppd.colorText = GetSysColor(COLOR_WINDOWTEXT); - } - else if (IsDlgButtonChecked(hwndDlg, IDC_DEFAULTCOLORS)) - { - ppd.colorBack = NULL; - ppd.colorText = NULL; - } - else - { - ppd.colorBack = SendDlgItemMessage(hwndDlg, IDC_BGCOLOR, CPM_GETCOLOUR, 0, 0); - ppd.colorText = SendDlgItemMessage(hwndDlg, IDC_TEXTCOLOR, CPM_GETCOLOUR, 0, 0); - } - ppd.PluginWindowProc = PopupDlgProc; - ppd.PluginData = NULL; - if (IsDlgButtonChecked(hwndDlg, IDC_DELAYFROMPU)) - { - ppd.iSeconds = 0; - } - else if (IsDlgButtonChecked(hwndDlg, IDC_DELAYCUSTOM)) - { - ppd.iSeconds = GetDlgItemInt(hwndDlg, IDC_DELAY, NULL, FALSE); - } - else if (IsDlgButtonChecked(hwndDlg, IDC_DELAYPERMANENT)) - { - ppd.iSeconds = -1; - } - PUAddPopupT(&ppd); - } - break; - } - break; - - case WM_NOTIFY: - if (((LPNMHDR)lParam)->code == PSN_APPLY) { - // left action - if (IsDlgButtonChecked(hwndDlg, IDC_LNOTHING)) - db_set_b(NULL, MODULENAME, SETTING_POPUP_LEFTCLICK, POPUP_ACT_NOTHING); - else if (IsDlgButtonChecked(hwndDlg, IDC_LCLOSE)) - db_set_b(NULL, MODULENAME, SETTING_POPUP_LEFTCLICK, POPUP_ACT_CLOSEPOPUP); - else if (IsDlgButtonChecked(hwndDlg, IDC_LCANCEL)) - db_set_b(NULL, MODULENAME, SETTING_POPUP_LEFTCLICK, POPUP_ACT_CANCEL); - // right action - if (IsDlgButtonChecked(hwndDlg, IDC_RNOTHING)) - db_set_b(NULL, MODULENAME, SETTING_POPUP_RIGHTCLICK, POPUP_ACT_NOTHING); - else if (IsDlgButtonChecked(hwndDlg, IDC_RCLOSE)) - db_set_b(NULL, MODULENAME, SETTING_POPUP_RIGHTCLICK, POPUP_ACT_CLOSEPOPUP); - else if (IsDlgButtonChecked(hwndDlg, IDC_RCANCEL)) - db_set_b(NULL, MODULENAME, SETTING_POPUP_RIGHTCLICK, POPUP_ACT_CANCEL); - // delay - if (IsDlgButtonChecked(hwndDlg, IDC_DELAYFROMPU)) - db_set_b(NULL, MODULENAME, SETTING_POPUP_DELAYTYPE, POPUP_DELAYFROMPU); - else if (IsDlgButtonChecked(hwndDlg, IDC_DELAYCUSTOM)) - db_set_b(NULL, MODULENAME, SETTING_POPUP_DELAYTYPE, POPUP_DELAYCUSTOM); - else if (IsDlgButtonChecked(hwndDlg, IDC_DELAYPERMANENT)) - db_set_b(NULL, MODULENAME, SETTING_POPUP_DELAYTYPE, POPUP_DELAYPERMANENT); - // delay - db_set_dw(NULL, MODULENAME, SETTING_POPUP_TIMEOUT, GetDlgItemInt(hwndDlg, IDC_DELAY, NULL, FALSE)); - // back color - db_set_dw(NULL, MODULENAME, SETTING_POPUP_BACKCOLOR, SendDlgItemMessage(hwndDlg, IDC_BGCOLOR, CPM_GETCOLOUR, 0, 0)); - // text color - db_set_dw(NULL, MODULENAME, SETTING_POPUP_TEXTCOLOR, SendDlgItemMessage(hwndDlg, IDC_TEXTCOLOR, CPM_GETCOLOUR, 0, 0)); - // use win - db_set_b(NULL, MODULENAME, SETTING_POPUP_USEWINCOLORS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS)); - // use def - db_set_b(NULL, MODULENAME, SETTING_POPUP_USEDEFCOLORS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DEFAULTCOLORS)); - // store types - db_set_b(NULL, MODULENAME, SETTING_PUCONNLOST, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_PUCONNLOST)); - db_set_b(NULL, MODULENAME, SETTING_PUOTHER, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_PUOTHER)); - db_set_b(NULL, MODULENAME, SETTING_PUCONNRETRY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_PUCONNRETRY)); - db_set_b(NULL, MODULENAME, SETTING_PURESULT, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_PURESULT)); - db_set_b(NULL, MODULENAME, SETTING_PUSHOWEXTRA, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_PUSHOWEXTRA)); - } - break; - } - - return 0; -} - -int OptionsInit(WPARAM wparam, LPARAM) -{ - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = hInst; - odp.pwszGroup = LPGENW("Status"); - odp.pwszTitle = LPGENW("KeepStatus"); - odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; - odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_TABS); - odp.pfnDlgProc = DlgProcKsTabs; - Options_AddPage(wparam, &odp); - - if (ServiceExists(MS_POPUP_ADDPOPUPT)) { - memset(&odp, 0, sizeof(odp)); - odp.position = 150000000; - odp.pwszGroup = LPGENW("Popups"); - odp.groupPosition = 910000000; - odp.hInstance = hInst; - odp.pszTemplate = MAKEINTRESOURCEA(IDD_PUOPT_KEEPSTATUS); - odp.pwszTitle = LPGENW("KeepStatus"); - odp.pfnDlgProc = PopupOptDlgProc; - odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; - Options_AddPage(wparam, &odp); - } - return 0; -} diff --git a/plugins/StatusPlugins/KeepStatus/version.h b/plugins/StatusPlugins/KeepStatus/version.h deleted file mode 100644 index 81672eb0d3..0000000000 --- a/plugins/StatusPlugins/KeepStatus/version.h +++ /dev/null @@ -1,17 +0,0 @@ -// plugin version part -#define __MAJOR_VERSION 0 -#define __MINOR_VERSION 9 -#define __RELEASE_NUM 0 -#define __BUILD_NUM 2 - -// other stuff for Version resource -#include - -// stuff that will be used in PluginInfo section and in Version resource -#define __PLUGIN_NAME "Keep status" -#define __FILENAME "KeepStatus.dll" -#define __DESC "KeepStatus, A connection checker, for use with (or without) StartupStatus and/or AdvancedAutoAway." -#define __AUTHOR "P Boon" -#define __AUTHOREMAIL "unregistered@users.sourceforge.net" -#define __AUTHORWEB "http://miranda-ng.org/p/KeepStatus/" -#define __COPYRIGHT "© 2003-08 P. Boon, 2008-16 George Hazan" diff --git a/plugins/StatusPlugins/StartupStatus/StartupStatus.rc b/plugins/StatusPlugins/StartupStatus/StartupStatus.rc deleted file mode 100644 index a7a2bebb2a..0000000000 --- a/plugins/StatusPlugins/StartupStatus/StartupStatus.rc +++ /dev/null @@ -1,70 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "..\resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "..\\resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDI_TTBDOWN ICON "res\\ttbDown.ico" -IDI_TTBUP ICON "res\\ttbUp.ico" - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED diff --git a/plugins/StatusPlugins/StartupStatus/StartupStatus_10.vcxproj b/plugins/StatusPlugins/StartupStatus/StartupStatus_10.vcxproj deleted file mode 100644 index 40f2155891..0000000000 --- a/plugins/StatusPlugins/StartupStatus/StartupStatus_10.vcxproj +++ /dev/null @@ -1,228 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - StartupStatus - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2} - - - - DynamicLibrary - Unicode - true - - - DynamicLibrary - Unicode - - - DynamicLibrary - true - Unicode - - - DynamicLibrary - Unicode - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - true - - - - Disabled - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;_USRDLL;STARTUPSTATUS_EXPORTS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Use - ../commonstatus.h - Level3 - EditAndContinue - 4996;%(DisableSpecificWarnings) - false - - - _DEBUG;%(PreprocessorDefinitions) - ..\..\..\include\msapi - - - true - $(IntDir)$(TargetName).lib - Windows - false - 0x11bd0000 - wininet.lib;%(AdditionalDependencies) - $(ProfileDir)..\..\..\bin10\lib - - - - - Full - OnlyExplicitInline - Size - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;_USRDLL;STARTUPSTATUS_EXPORTS;%(PreprocessorDefinitions) - true - false - false - true - Fast - Use - ../commonstatus.h - Level3 - 4996;%(DisableSpecificWarnings) - - - NDEBUG;%(PreprocessorDefinitions) - ..\..\..\include\msapi - - - wininet.lib;%(AdditionalDependencies) - true - true - true - 0x11bd0000 - $(IntDir)$(TargetName).lib - Windows - false - $(ProfileDir)..\..\..\bin10\lib - /PDBALTPATH:%_PDB% - - - - - Full - OnlyExplicitInline - Size - true - false - false - Fast - true - Use - ../commonstatus.h - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;_USRDLL;STARTUPSTATUS_EXPORTS;%(PreprocessorDefinitions) - Level3 - 4996;%(DisableSpecificWarnings) - - - wininet.lib;%(AdditionalDependencies) - true - true - true - $(IntDir)$(TargetName).lib - Windows - false - 0x11bd0000 - $(ProfileDir)..\..\..\bin10\lib - /PDBALTPATH:%_PDB% - - - ..\..\..\include\msapi - NDEBUG;%(PreprocessorDefinitions) - - - - - Use - ../commonstatus.h - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;_USRDLL;STARTUPSTATUS_EXPORTS;%(PreprocessorDefinitions) - Level3 - 4996;%(DisableSpecificWarnings) - Disabled - MultiThreadedDebugDLL - EnableFastChecks - false - - - wininet.lib;%(AdditionalDependencies) - true - $(IntDir)$(TargetName).lib - Windows - false - 0x11bd0000 - $(ProfileDir)..\..\..\bin10\lib - - - ..\..\..\include\msapi - _DEBUG;%(PreprocessorDefinitions) - - - - - Create - commonstatus.h - - - commonstatus.h - - - NotUsing - - - commonstatus.h - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/StatusPlugins/StartupStatus/StartupStatus_10.vcxproj.filters b/plugins/StatusPlugins/StartupStatus/StartupStatus_10.vcxproj.filters deleted file mode 100644 index 3078255c51..0000000000 --- a/plugins/StatusPlugins/StartupStatus/StartupStatus_10.vcxproj.filters +++ /dev/null @@ -1,68 +0,0 @@ - - - - - {05912809-2743-4a01-8ca7-689106a3141a} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {2f9d749c-d579-43b5-af4c-485fec64ddfa} - h;hpp;hxx;hm;inl - - - {3731744d-2cbc-4ec4-bc69-7e184a77f957} - ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - Resource Files - - - Resource Files - - - \ No newline at end of file diff --git a/plugins/StatusPlugins/StartupStatus/StartupStatus_12.vcxproj b/plugins/StatusPlugins/StartupStatus/StartupStatus_12.vcxproj deleted file mode 100644 index c664325d2f..0000000000 --- a/plugins/StatusPlugins/StartupStatus/StartupStatus_12.vcxproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - StartupStatus - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2} - - - - DynamicLibrary - Unicode - true - v120_xp - - - DynamicLibrary - Unicode - v120_xp - - - DynamicLibrary - true - Unicode - v120_xp - - - DynamicLibrary - Unicode - v120_xp - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - true - - - - Disabled - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;_USRDLL;STARTUPSTATUS_EXPORTS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Use - ../commonstatus.h - Level3 - EditAndContinue - 4996;%(DisableSpecificWarnings) - false - - - _DEBUG;%(PreprocessorDefinitions) - ..\..\..\include\msapi - - - true - $(IntDir)$(TargetName).lib - Windows - false - 0x11bd0000 - wininet.lib;%(AdditionalDependencies) - $(ProfileDir)..\..\..\bin12\lib - false - - - - - Full - OnlyExplicitInline - Size - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;_USRDLL;STARTUPSTATUS_EXPORTS;%(PreprocessorDefinitions) - true - false - false - true - Fast - Use - ../commonstatus.h - Level3 - 4996;%(DisableSpecificWarnings) - - - NDEBUG;%(PreprocessorDefinitions) - ..\..\..\include\msapi - - - wininet.lib;%(AdditionalDependencies) - true - true - true - 0x11bd0000 - $(IntDir)$(TargetName).lib - Windows - false - $(ProfileDir)..\..\..\bin12\lib - - - - - Full - OnlyExplicitInline - Size - true - false - false - Fast - true - Use - ../commonstatus.h - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;_USRDLL;STARTUPSTATUS_EXPORTS;%(PreprocessorDefinitions) - Level3 - 4996;%(DisableSpecificWarnings) - - - wininet.lib;%(AdditionalDependencies) - true - true - true - $(IntDir)$(TargetName).lib - Windows - false - 0x11bd0000 - $(ProfileDir)..\..\..\bin12\lib - - - ..\..\..\include\msapi - NDEBUG;%(PreprocessorDefinitions) - - - - - Use - ../commonstatus.h - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;_USRDLL;STARTUPSTATUS_EXPORTS;%(PreprocessorDefinitions) - Level3 - 4996;%(DisableSpecificWarnings) - Disabled - MultiThreadedDebugDLL - EnableFastChecks - false - - - wininet.lib;%(AdditionalDependencies) - true - $(IntDir)$(TargetName).lib - Windows - false - 0x11bd0000 - $(ProfileDir)..\..\..\bin12\lib - - - ..\..\..\include\msapi - _DEBUG;%(PreprocessorDefinitions) - - - - - Create - commonstatus.h - - - commonstatus.h - - - NotUsing - - - commonstatus.h - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/StatusPlugins/StartupStatus/StartupStatus_12.vcxproj.filters b/plugins/StatusPlugins/StartupStatus/StartupStatus_12.vcxproj.filters deleted file mode 100644 index 3078255c51..0000000000 --- a/plugins/StatusPlugins/StartupStatus/StartupStatus_12.vcxproj.filters +++ /dev/null @@ -1,68 +0,0 @@ - - - - - {05912809-2743-4a01-8ca7-689106a3141a} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {2f9d749c-d579-43b5-af4c-485fec64ddfa} - h;hpp;hxx;hm;inl - - - {3731744d-2cbc-4ec4-bc69-7e184a77f957} - ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - Resource Files - - - Resource Files - - - \ No newline at end of file diff --git a/plugins/StatusPlugins/StartupStatus/StartupStatus_14.vcxproj b/plugins/StatusPlugins/StartupStatus/StartupStatus_14.vcxproj deleted file mode 100644 index 794b36247e..0000000000 --- a/plugins/StatusPlugins/StartupStatus/StartupStatus_14.vcxproj +++ /dev/null @@ -1,231 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - StartupStatus - {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2} - - - - DynamicLibrary - Unicode - true - v140_xp - - - DynamicLibrary - Unicode - v140_xp - - - DynamicLibrary - true - Unicode - v140_xp - - - DynamicLibrary - Unicode - v140_xp - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - true - - - - Disabled - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;_USRDLL;STARTUPSTATUS_EXPORTS;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Use - ../commonstatus.h - Level4 - EditAndContinue - 4996;%(DisableSpecificWarnings) - false - - - _DEBUG;%(PreprocessorDefinitions) - ..\..\..\include\msapi - - - true - $(IntDir)$(TargetName).lib - Windows - false - 0x11bd0000 - wininet.lib;%(AdditionalDependencies) - $(ProfileDir)..\..\..\bin14\lib - false - - - - - Full - OnlyExplicitInline - Size - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;_USRDLL;STARTUPSTATUS_EXPORTS;%(PreprocessorDefinitions) - true - false - false - true - Fast - Use - ../commonstatus.h - Level4 - 4996;%(DisableSpecificWarnings) - - - NDEBUG;%(PreprocessorDefinitions) - ..\..\..\include\msapi - - - wininet.lib;%(AdditionalDependencies) - true - true - true - 0x11bd0000 - $(IntDir)$(TargetName).lib - Windows - false - $(ProfileDir)..\..\..\bin14\lib - - - - - Full - OnlyExplicitInline - Size - true - false - false - Fast - true - Use - ../commonstatus.h - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;_USRDLL;STARTUPSTATUS_EXPORTS;%(PreprocessorDefinitions) - Level4 - 4996;%(DisableSpecificWarnings) - - - wininet.lib;%(AdditionalDependencies) - true - true - true - $(IntDir)$(TargetName).lib - Windows - false - 0x11bd0000 - $(ProfileDir)..\..\..\bin14\lib - - - ..\..\..\include\msapi - NDEBUG;%(PreprocessorDefinitions) - - - - - Use - ../commonstatus.h - ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;_USRDLL;STARTUPSTATUS_EXPORTS;%(PreprocessorDefinitions) - Level4 - 4996;%(DisableSpecificWarnings) - Disabled - MultiThreadedDebugDLL - EnableFastChecks - false - - - wininet.lib;%(AdditionalDependencies) - true - $(IntDir)$(TargetName).lib - Windows - false - 0x11bd0000 - $(ProfileDir)..\..\..\bin14\lib - - - ..\..\..\include\msapi - _DEBUG;%(PreprocessorDefinitions) - - - - - Create - commonstatus.h - - - commonstatus.h - - - NotUsing - - - commonstatus.h - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/StatusPlugins/StartupStatus/StartupStatus_14.vcxproj.filters b/plugins/StatusPlugins/StartupStatus/StartupStatus_14.vcxproj.filters deleted file mode 100644 index 3078255c51..0000000000 --- a/plugins/StatusPlugins/StartupStatus/StartupStatus_14.vcxproj.filters +++ /dev/null @@ -1,68 +0,0 @@ - - - - - {05912809-2743-4a01-8ca7-689106a3141a} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {2f9d749c-d579-43b5-af4c-485fec64ddfa} - h;hpp;hxx;hm;inl - - - {3731744d-2cbc-4ec4-bc69-7e184a77f957} - ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - Resource Files - - - Resource Files - - - \ No newline at end of file diff --git a/plugins/StatusPlugins/StartupStatus/main.cpp b/plugins/StatusPlugins/StartupStatus/main.cpp deleted file mode 100644 index 9a3ceb3e84..0000000000 --- a/plugins/StatusPlugins/StartupStatus/main.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* - StartupStatus Plugin for Miranda-IM (www.miranda-im.org) - Copyright 2003-2006 P. Boon - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#include "../commonstatus.h" -#include "startupstatus.h" - - -static HANDLE - hCSModuleLoadedHook, - hGetProfileService, - hGetProfileCountService, - hGetProfileNameService; - -HINSTANCE hInst; - -int hLangpack = 0; -CLIST_INTERFACE *pcli; - -int CSModuleLoaded( WPARAM, LPARAM ); - -///////////////////////////////////////////////////////////////////////////////////////// -// dll entry point - -BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) -{ - hInst = hinstDLL; - return TRUE; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// returns plugin's extended information - -PLUGININFOEX pluginInfoEx={ - sizeof(PLUGININFOEX), - __PLUGIN_NAME, - PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), - __DESC, - __AUTHOR, - __AUTHOREMAIL, - __COPYRIGHT, - __AUTHORWEB, - UNICODE_AWARE, - { 0x4b733944, 0x5a70, 0x4b52, { 0xab, 0x2d, 0x68, 0xb1, 0xef, 0x38, 0xff, 0xe8 } } // {4B733944-5A70-4b52-AB2D-68B1EF38FFE8} -}; - -extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) -{ - return &pluginInfoEx; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// plugin's entry point - -static INT_PTR SrvGetProfile( WPARAM wParam, LPARAM lParam ) -{ return GetProfile(( int )wParam, *(TSettingsList*)lParam ); -} - -extern "C" int __declspec(dllexport) Load(void) -{ - mir_getLP( &pluginInfoEx ); - pcli = Clist_GetInterface(); - - if ( db_get_b(NULL, MODULENAME, SETTING_SETPROFILE, 1) || - db_get_b(NULL, MODULENAME, SETTING_OFFLINECLOSE, 0)) - db_set_w(NULL, "CList", "Status", (WORD)ID_STATUS_OFFLINE); - - // docking - if (db_get_b(NULL, MODULENAME, SETTING_SETDOCKED, 0)) { - int docked = db_get_b(NULL, MODULENAME, SETTING_DOCKED, DOCKED_NONE); - if ( docked == DOCKED_LEFT || docked == DOCKED_RIGHT ) - docked = -docked; - - db_set_b(NULL, MODULE_CLIST, SETTING_DOCKED, (BYTE)docked); - } - - // Create service functions; the get functions are created here; they don't rely on commonstatus - hGetProfileService = CreateServiceFunction(MS_SS_GETPROFILE, SrvGetProfile); - hGetProfileCountService = CreateServiceFunction(MS_SS_GETPROFILECOUNT, GetProfileCount); - hGetProfileNameService = CreateServiceFunction(MS_SS_GETPROFILENAME, GetProfileName); - - LoadProfileModule(); - - // protocols must be loaded first - InitCommonStatus(); - hCSModuleLoadedHook = HookEvent(ME_SYSTEM_MODULESLOADED, CSModuleLoaded); - return 0; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// plugin's exit point - -extern "C" int __declspec(dllexport) Unload(void) -{ - UnhookEvent(hCSModuleLoadedHook); - - DestroyServiceFunction(hGetProfileService); - DestroyServiceFunction(hGetProfileCountService); - DestroyServiceFunction(hGetProfileNameService); - return 0; -} diff --git a/plugins/StatusPlugins/StartupStatus/options.cpp b/plugins/StatusPlugins/StartupStatus/options.cpp deleted file mode 100644 index 87a969726b..0000000000 --- a/plugins/StatusPlugins/StartupStatus/options.cpp +++ /dev/null @@ -1,932 +0,0 @@ -/* - StartupStatus Plugin for Miranda-IM (www.miranda-im.org) - Copyright 2003-2006 P. Boon - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#include "../commonstatus.h" -#include "startupstatus.h" -#include "../resource.h" - - -///////////////////////////////////////////////////////////////////////////////////////// - -TSettingsList* GetCurrentProtoSettings() -{ - int count; - PROTOACCOUNT **protos; - Proto_EnumAccounts(&count, &protos); - - TSettingsList *result = new TSettingsList(count, CompareSettings); - if (result == NULL) - return NULL; - - for (int i=0; i < count; i++) - if ( IsSuitableProto(protos[i])) - result->insert( new TSSSetting(protos[i])); - - return result; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// Command line processing - -static char* GetStatusDesc(int status) -{ - switch (status) { - case ID_STATUS_AWAY: return "away"; - case ID_STATUS_NA: return "na"; - case ID_STATUS_DND: return "dnd"; - case ID_STATUS_OCCUPIED: return "occupied"; - case ID_STATUS_FREECHAT: return "freechat"; - case ID_STATUS_ONLINE: return "online"; - case ID_STATUS_OFFLINE: return "offline"; - case ID_STATUS_INVISIBLE: return "invisible"; - case ID_STATUS_ONTHEPHONE: return "onthephone"; - case ID_STATUS_OUTTOLUNCH: return "outtolunch"; - case ID_STATUS_LAST: return "last"; - } - return "offline"; -} - -static char* GetCMDLArguments(TSettingsList& protoSettings) -{ - if ( protoSettings.getCount() == NULL ) - return NULL; - - char *cmdl, *pnt; - pnt = cmdl = ( char* )malloc(mir_strlen(protoSettings[0].szName) + mir_strlen(GetStatusDesc(protoSettings[0].status)) + 4); - - for (int i=0; i < protoSettings.getCount(); i++ ) { - *pnt++ = '/'; - mir_strcpy(pnt, protoSettings[i].szName); - pnt += mir_strlen(protoSettings[i].szName); - *pnt++ = '='; - mir_strcpy(pnt, GetStatusDesc(protoSettings[i].status)); - pnt += mir_strlen(GetStatusDesc(protoSettings[i].status)); - if (i != protoSettings.getCount()-1) { - *pnt++ = ' '; - *pnt++ = '\0'; - cmdl = ( char* )realloc(cmdl, mir_strlen(cmdl) + mir_strlen(protoSettings[i+1].szName) + mir_strlen(GetStatusDesc(protoSettings[i+1].status)) + 4); - pnt = cmdl + mir_strlen(cmdl); - } } - - if ( db_get_b( NULL, MODULENAME, SETTING_SHOWDIALOG, FALSE ) == TRUE ) { - *pnt++ = ' '; - *pnt++ = '\0'; - cmdl = ( char* )realloc(cmdl, mir_strlen(cmdl) + 12); - pnt = cmdl + mir_strlen(cmdl); - mir_strcpy(pnt, "/showdialog"); - pnt += 11; - *pnt = '\0'; - } - - return cmdl; -} - -static char* GetCMDL(TSettingsList& protoSettings) -{ - char path[MAX_PATH]; - GetModuleFileNameA(NULL, path, MAX_PATH); - - char* cmdl = ( char* )malloc(mir_strlen(path) + 4); - mir_snprintf(cmdl, mir_strlen(path) + 4, "\"%s\" ", path); - - char* args = GetCMDLArguments(protoSettings); - if ( args ) { - cmdl = ( char* )realloc(cmdl, mir_strlen(cmdl) + mir_strlen(args) + 1); - mir_strcat(cmdl, args); - free(args); - } - return cmdl; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// Link processing - -static wchar_t* GetLinkDescription(TSettingsList& protoSettings) -{ - if ( protoSettings.getCount() == 0 ) - return NULL; - - CMStringW result(SHORTCUT_DESC); - for (int i=0; i < protoSettings.getCount(); i++) { - TSSSetting &p = protoSettings[i]; - - wchar_t *status; - if ( p.status == ID_STATUS_LAST) - status = TranslateT(""); - else if (p.status == ID_STATUS_CURRENT) - status = TranslateT(""); - else if (p.status >= MIN_STATUS && p.status <= MAX_STATUS) - status = pcli->pfnGetStatusModeDescription(p.status, 0); - else - status = NULL; - if (status == NULL) - status = TranslateT(""); - - result.AppendChar('\r'); - result.Append(p.tszAccName); - result.AppendChar(':'); - result.AppendChar(' '); - result.Append(status); - } - - return mir_wstrndup(result, result.GetLength()); -} - -HRESULT CreateLink(TSettingsList& protoSettings) -{ - wchar_t savePath[MAX_PATH]; - if (SHGetSpecialFolderPath(NULL, savePath, 0x10, FALSE)) - wcsncat_s(savePath, SHORTCUT_FILENAME, _countof(savePath) - mir_wstrlen(savePath)); - else - mir_snwprintf(savePath, L".\\%s", SHORTCUT_FILENAME); - - // Get a pointer to the IShellLink interface. - IShellLink *psl; - HRESULT hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, ( void** )&psl); - if (SUCCEEDED(hres)) { - char *args = GetCMDLArguments(protoSettings); - wchar_t *desc = GetLinkDescription(protoSettings); - - // Set the path to the shortcut target, and add the - // description. - wchar_t path[MAX_PATH]; - GetModuleFileName(NULL, path, _countof(path)); - psl->SetPath(path); - psl->SetDescription(desc); - psl->SetArguments( _A2T(args)); - - // Query IShellLink for the IPersistFile interface for saving the - // shortcut in persistent storage. - IPersistFile *ppf; - hres = psl->QueryInterface(IID_IPersistFile, ( void** )&ppf); - - if (SUCCEEDED(hres)) { - // Save the link by calling IPersistFile::Save. - hres = ppf->Save(savePath, TRUE); - ppf->Release(); - } - psl->Release(); - free(args); - free(desc); - } - - return hres; -} - -INT_PTR CALLBACK CmdlOptionsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam) -{ - static TSettingsList* optionsProtoSettings; - - switch(msg) { - case WM_INITDIALOG: - TranslateDialogDefault(hwndDlg); - { - optionsProtoSettings = (TSettingsList*)lParam; - char* cmdl = GetCMDL(*optionsProtoSettings); - SetDlgItemTextA(hwndDlg, IDC_CMDL, cmdl); - free(cmdl); - } - break; - - case WM_COMMAND: - switch (LOWORD(wParam)) { - case IDC_COPY: - if ( OpenClipboard( hwndDlg )) { - EmptyClipboard(); - - char cmdl[2048]; - GetDlgItemTextA(hwndDlg,IDC_CMDL, cmdl, _countof(cmdl)); - HGLOBAL cmdlGlob = GlobalAlloc(GMEM_MOVEABLE, sizeof(cmdl)); - if (cmdlGlob == NULL) { - CloseClipboard(); - break; - } - LPTSTR cmdlStr = ( LPTSTR )GlobalLock(cmdlGlob); - memcpy(cmdlStr, &cmdl, sizeof(cmdl)); - GlobalUnlock(cmdlGlob); - SetClipboardData(CF_TEXT, cmdlGlob); - CloseClipboard(); - } - break; - - case IDC_SHORTCUT: - CreateLink(*optionsProtoSettings); - break; - - case IDC_OK: - DestroyWindow(hwndDlg); - break; - } - break; - - case WM_CLOSE: - DestroyWindow(hwndDlg); - break; - - case WM_DESTROY: - delete optionsProtoSettings; optionsProtoSettings = 0; - break; - } - - return 0; -} - -static INT_PTR CALLBACK StartupStatusOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam) -{ - static BOOL bInitDone = FALSE; - - switch(msg) { - case WM_INITDIALOG: - bInitDone = FALSE; - - TranslateDialogDefault(hwndDlg); - CheckDlgButton(hwndDlg, IDC_SETPROFILE, db_get_b(NULL, MODULENAME, SETTING_SETPROFILE, 1) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_OVERRIDE, db_get_b(NULL, MODULENAME, SETTING_OVERRIDE, 1) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_SHOWDIALOG, db_get_b(NULL, MODULENAME, SETTING_SHOWDIALOG, 0) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_SETWINSTATE, db_get_b(NULL, MODULENAME, SETTING_SETWINSTATE, 0) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_SETWINLOCATION, db_get_b(NULL, MODULENAME, SETTING_SETWINLOCATION, 0) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_SETDOCKED, db_get_b(NULL, MODULENAME, SETTING_SETDOCKED, 0) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_SETWINSIZE, db_get_b(NULL, MODULENAME, SETTING_SETWINSIZE, 0) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_OFFLINECLOSE, db_get_b(NULL, MODULENAME, SETTING_OFFLINECLOSE, 1) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_AUTODIAL, db_get_b(NULL, MODULENAME, SETTING_AUTODIAL, 0) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_AUTOHANGUP, db_get_b(NULL, MODULENAME, SETTING_AUTOHANGUP, 0) ? BST_CHECKED : BST_UNCHECKED); - SetDlgItemInt(hwndDlg, IDC_SETPROFILEDELAY, db_get_dw(NULL, MODULENAME, SETTING_SETPROFILEDELAY, 500), FALSE); - SetDlgItemInt(hwndDlg, IDC_DLGTIMEOUT, db_get_dw(NULL, MODULENAME, SETTING_DLGTIMEOUT, 5), FALSE); - SetDlgItemInt(hwndDlg, IDC_XPOS, db_get_dw(NULL, MODULENAME, SETTING_XPOS, 0), TRUE); - SetDlgItemInt(hwndDlg, IDC_YPOS, db_get_dw(NULL, MODULENAME, SETTING_YPOS, 0), TRUE); - SetDlgItemInt(hwndDlg, IDC_WIDTH, db_get_dw(NULL, MODULENAME, SETTING_WIDTH, 0), FALSE); - SetDlgItemInt(hwndDlg, IDC_HEIGHT, db_get_dw(NULL, MODULENAME, SETTING_HEIGHT, 0), FALSE); - { - int val = db_get_b(NULL, MODULENAME, SETTING_DOCKED, DOCKED_NONE); - int item = SendDlgItemMessage(hwndDlg, IDC_DOCKED, CB_ADDSTRING, 0, (LPARAM)TranslateT("Left")); - SendDlgItemMessage(hwndDlg, IDC_DOCKED, CB_SETITEMDATA, (WPARAM)item, (LPARAM)DOCKED_LEFT); - if (val == DOCKED_LEFT) - SendDlgItemMessage(hwndDlg, IDC_DOCKED, CB_SETCURSEL, (WPARAM)item, 0); - - item = SendDlgItemMessage(hwndDlg, IDC_DOCKED, CB_ADDSTRING, 0, (LPARAM)TranslateT("Right")); - SendDlgItemMessage(hwndDlg, IDC_DOCKED, CB_SETITEMDATA, (WPARAM)item, (LPARAM)DOCKED_RIGHT); - if (val == DOCKED_RIGHT) - SendDlgItemMessage(hwndDlg, IDC_DOCKED, CB_SETCURSEL, (WPARAM)item, 0); - - item = SendDlgItemMessage(hwndDlg, IDC_DOCKED, CB_ADDSTRING, 0, (LPARAM)TranslateT("None")); - SendDlgItemMessage(hwndDlg, IDC_DOCKED, CB_SETITEMDATA, (WPARAM)item, (LPARAM)DOCKED_NONE); - if (val == DOCKED_NONE) - SendDlgItemMessage(hwndDlg, IDC_DOCKED, CB_SETCURSEL, (WPARAM)item, 0); - } - - EnableWindow(GetDlgItem(hwndDlg, IDC_PROFILE), IsDlgButtonChecked(hwndDlg, IDC_SETPROFILE)||IsDlgButtonChecked(hwndDlg, IDC_SHOWDIALOG)); - EnableWindow(GetDlgItem(hwndDlg, IDC_SETPROFILEDELAY), IsDlgButtonChecked(hwndDlg, IDC_SETPROFILE)); - EnableWindow(GetDlgItem(hwndDlg, IDC_OVERRIDE), IsDlgButtonChecked(hwndDlg, IDC_SETPROFILE)); - EnableWindow(GetDlgItem(hwndDlg, IDC_DLGTIMEOUT), IsDlgButtonChecked(hwndDlg, IDC_SHOWDIALOG)); - EnableWindow(GetDlgItem(hwndDlg, IDC_WINSTATE), IsDlgButtonChecked(hwndDlg, IDC_SETWINSTATE)); - EnableWindow(GetDlgItem(hwndDlg, IDC_XPOS), IsDlgButtonChecked(hwndDlg, IDC_SETWINLOCATION)); - EnableWindow(GetDlgItem(hwndDlg, IDC_YPOS), IsDlgButtonChecked(hwndDlg, IDC_SETWINLOCATION)); - SendMessage(hwndDlg, UM_REINITPROFILES, 0, 0); - SendMessage(hwndDlg, UM_REINITDOCKED, 0, 0); - SendMessage(hwndDlg, UM_REINITWINSTATE, 0, 0); - SendMessage(hwndDlg, UM_REINITWINSIZE, 0, 0); - SetTimer(hwndDlg, 0, 100, NULL); - bInitDone = TRUE; - break; - - case WM_TIMER: - if ( BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_SETWINLOCATION) && BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_SETWINSIZE)) { - SetDlgItemTextA(hwndDlg, IDC_CURWINSIZE, ""); - SetDlgItemTextA(hwndDlg, IDC_CURWINLOC, ""); - break; - } - else { - wchar_t text[128]; - mir_snwprintf(text, TranslateT("size: %d x %d"), - db_get_dw(NULL, MODULE_CLIST, SETTING_WIDTH, 0), - db_get_dw(NULL, MODULE_CLIST, SETTING_HEIGHT, 0)); - SetDlgItemText(hwndDlg, IDC_CURWINSIZE, text); - - mir_snwprintf(text, TranslateT("loc: %d x %d"), - db_get_dw(NULL, MODULE_CLIST, SETTING_XPOS, 0), - db_get_dw(NULL, MODULE_CLIST, SETTING_YPOS, 0)); - SetDlgItemText(hwndDlg, IDC_CURWINLOC, text); - } - break; - - case UM_REINITPROFILES: - // creates profile combo box according to 'dat' - SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_RESETCONTENT, 0, 0); - { - int defProfile; - int profileCount = GetProfileCount((WPARAM)&defProfile, 0); - for ( int i=0; i < profileCount; i++ ) { - wchar_t profileName[128]; - if ( GetProfileName(i, (LPARAM)profileName)) - continue; - - int item = SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_ADDSTRING, 0, (LPARAM)profileName); - SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_SETITEMDATA, item, i); - } - SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_SETCURSEL, defProfile, 0); - } - break; - - case UM_REINITDOCKED: - EnableWindow(GetDlgItem(hwndDlg, IDC_SETDOCKED), db_get_b(NULL, MODULE_CLIST, SETTING_TOOLWINDOW, 1)); - if (!IsWindowEnabled(GetDlgItem(hwndDlg,IDC_SETDOCKED))) - CheckDlgButton(hwndDlg, IDC_SETDOCKED, BST_UNCHECKED); - - EnableWindow(GetDlgItem(hwndDlg, IDC_DOCKED), IsDlgButtonChecked(hwndDlg, IDC_SETDOCKED)); - break; - - case UM_REINITWINSTATE: - { - int val = db_get_b(NULL, MODULENAME, SETTING_WINSTATE, SETTING_STATE_NORMAL); - SendDlgItemMessage(hwndDlg, IDC_WINSTATE, CB_RESETCONTENT, 0, 0); - - int item = SendDlgItemMessage(hwndDlg, IDC_WINSTATE, CB_ADDSTRING, 0, (LPARAM)TranslateT("Hidden")); - SendDlgItemMessage(hwndDlg, IDC_WINSTATE, CB_SETITEMDATA, item, (LPARAM)SETTING_STATE_HIDDEN); - if (val == SETTING_STATE_HIDDEN) - SendDlgItemMessage(hwndDlg, IDC_WINSTATE, CB_SETCURSEL, item, 0); - - if (!db_get_b(NULL, MODULE_CLIST, SETTING_TOOLWINDOW, 0)) { - item = SendDlgItemMessage(hwndDlg, IDC_WINSTATE, CB_ADDSTRING, 0, (LPARAM)TranslateT("Minimized")); - SendDlgItemMessage(hwndDlg, IDC_WINSTATE, CB_SETITEMDATA, item, SETTING_STATE_MINIMIZED); - if (val == SETTING_STATE_MINIMIZED) - SendDlgItemMessage(hwndDlg, IDC_WINSTATE, CB_SETCURSEL, item, 0); - } - item = SendDlgItemMessage(hwndDlg, IDC_WINSTATE, CB_ADDSTRING, 0, (LPARAM)TranslateT("Normal")); - SendDlgItemMessage(hwndDlg, IDC_WINSTATE, CB_SETITEMDATA, item, SETTING_STATE_NORMAL); - if ( val == SETTING_STATE_NORMAL || (val == SETTING_STATE_MINIMIZED) && db_get_b(NULL, MODULE_CLIST, SETTING_TOOLWINDOW, 0)) - SendDlgItemMessage(hwndDlg, IDC_WINSTATE, CB_SETCURSEL, item, 0); - } - break; - - case UM_REINITWINSIZE: - EnableWindow(GetDlgItem(hwndDlg, IDC_WIDTH), IsDlgButtonChecked(hwndDlg, IDC_SETWINSIZE)); - EnableWindow(GetDlgItem(hwndDlg, IDC_HEIGHT), !db_get_b(NULL, MODULE_CLUI, SETTING_AUTOSIZE, 0)&&IsDlgButtonChecked(hwndDlg, IDC_SETWINSIZE)); - - case WM_COMMAND: - if ( HIWORD(wParam) == BN_CLICKED || HIWORD(wParam) == LBN_SELCHANGE || HIWORD(wParam) == CBN_SELCHANGE || HIWORD(wParam) == EN_CHANGE ) - if ( bInitDone ) - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - - switch (LOWORD(wParam)) { - case IDC_SETPROFILE: - EnableWindow(GetDlgItem(hwndDlg, IDC_PROFILE), IsDlgButtonChecked(hwndDlg, IDC_SETPROFILE)||IsDlgButtonChecked(hwndDlg, IDC_SHOWDIALOG)); - EnableWindow(GetDlgItem(hwndDlg, IDC_SETPROFILEDELAY), IsDlgButtonChecked(hwndDlg, IDC_SETPROFILE)); - EnableWindow(GetDlgItem(hwndDlg, IDC_OVERRIDE), IsDlgButtonChecked(hwndDlg, IDC_SETPROFILE)); - break; - case IDC_SHOWDIALOG: - EnableWindow(GetDlgItem(hwndDlg, IDC_PROFILE), IsDlgButtonChecked(hwndDlg, IDC_SETPROFILE)||IsDlgButtonChecked(hwndDlg, IDC_SHOWDIALOG)); - EnableWindow(GetDlgItem(hwndDlg, IDC_DLGTIMEOUT), IsDlgButtonChecked(hwndDlg, IDC_SHOWDIALOG)); - break; - case IDC_SETWINSTATE: - EnableWindow(GetDlgItem(hwndDlg, IDC_WINSTATE), IsDlgButtonChecked(hwndDlg, IDC_SETWINSTATE)); - break; - case IDC_SETDOCKED: - EnableWindow(GetDlgItem(hwndDlg, IDC_DOCKED), IsDlgButtonChecked(hwndDlg, IDC_SETDOCKED)); - break; - case IDC_SETWINLOCATION: - EnableWindow(GetDlgItem(hwndDlg, IDC_XPOS), IsDlgButtonChecked(hwndDlg, IDC_SETWINLOCATION)); - EnableWindow(GetDlgItem(hwndDlg, IDC_YPOS), IsDlgButtonChecked(hwndDlg, IDC_SETWINLOCATION)); - break; - case IDC_SETWINSIZE: - SendMessage(hwndDlg, UM_REINITWINSIZE, 0, 0); - break; - case IDC_SHOWCMDL: - { - int defProfile = (int)SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETITEMDATA, - SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETCURSEL, 0, 0), 0); - - TSettingsList* ps = GetCurrentProtoSettings(); - if ( ps ) { - GetProfile( defProfile, *ps ); - for ( int i=0; i < ps->getCount(); i++ ) - if ( (*ps)[i].szMsg != NULL ) - (*ps)[i].szMsg = wcsdup( (*ps)[i].szMsg ); - - CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_CMDLOPTIONS), hwndDlg, CmdlOptionsDlgProc, (LPARAM)ps); - } - break; - } - } - break; - - case WM_SHOWWINDOW: - if (wParam == FALSE) - break; - - bInitDone = FALSE; - SendMessage(hwndDlg, UM_REINITPROFILES, 0, 0); - SendMessage(hwndDlg, UM_REINITDOCKED, 0, 0); - SendMessage(hwndDlg, UM_REINITWINSTATE, 0, 0); - SendMessage(hwndDlg, UM_REINITWINSIZE, 0, 0); - bInitDone = TRUE; - break; - - case WM_NOTIFY: - if (((LPNMHDR)lParam)->code == PSN_APPLY) { - int val; - - db_set_b(NULL, MODULENAME, SETTING_SETPROFILE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SETPROFILE)); - if (IsDlgButtonChecked(hwndDlg, IDC_SETPROFILE)) - db_set_dw(NULL, MODULENAME, SETTING_SETPROFILEDELAY, GetDlgItemInt(hwndDlg, IDC_SETPROFILEDELAY, NULL, FALSE)); - - if (IsDlgButtonChecked(hwndDlg, IDC_SETPROFILE) || IsDlgButtonChecked(hwndDlg, IDC_SHOWDIALOG)) { - val = (int)SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETITEMDATA, - SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETCURSEL, 0, 0), 0); - db_set_w(NULL, MODULENAME, SETTING_DEFAULTPROFILE, (WORD)val); - } - db_set_b(NULL, MODULENAME, SETTING_OVERRIDE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_OVERRIDE)); - db_set_b(NULL, MODULENAME, SETTING_SHOWDIALOG, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWDIALOG)); - if (IsDlgButtonChecked(hwndDlg, IDC_SHOWDIALOG)) - db_set_dw(NULL, MODULENAME, SETTING_DLGTIMEOUT, GetDlgItemInt(hwndDlg, IDC_DLGTIMEOUT, NULL, FALSE)); - - db_set_b(NULL, MODULENAME, SETTING_SETWINSTATE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SETWINSTATE)); - if (IsDlgButtonChecked(hwndDlg, IDC_SETWINSTATE)) { - val = (int)SendDlgItemMessage(hwndDlg, IDC_WINSTATE, CB_GETITEMDATA, - SendDlgItemMessage(hwndDlg, IDC_WINSTATE, CB_GETCURSEL, 0, 0), 0); - db_set_b(NULL, MODULENAME, SETTING_WINSTATE, (BYTE)val); - } - db_set_b(NULL, MODULENAME, SETTING_SETDOCKED, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SETDOCKED)); - if (IsDlgButtonChecked(hwndDlg, IDC_SETDOCKED)) { - val = (int)SendDlgItemMessage(hwndDlg, IDC_DOCKED, CB_GETITEMDATA, - SendDlgItemMessage(hwndDlg, IDC_DOCKED, CB_GETCURSEL, 0, 0), 0); - db_set_b(NULL, MODULENAME, SETTING_DOCKED, (BYTE)val); - } - db_set_b(NULL, MODULENAME, SETTING_SETWINLOCATION, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SETWINLOCATION)); - if (IsDlgButtonChecked(hwndDlg, IDC_SETWINLOCATION)) { - db_set_dw(NULL, MODULENAME, SETTING_XPOS, GetDlgItemInt(hwndDlg, IDC_XPOS, NULL, TRUE)); - db_set_dw(NULL, MODULENAME, SETTING_YPOS, GetDlgItemInt(hwndDlg, IDC_YPOS, NULL, TRUE)); - } - db_set_b(NULL, MODULENAME, SETTING_SETWINSIZE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SETWINSIZE)); - if (IsDlgButtonChecked(hwndDlg, IDC_SETWINSIZE)) { - db_set_dw(NULL, MODULENAME, SETTING_WIDTH, GetDlgItemInt(hwndDlg, IDC_WIDTH, NULL, FALSE)); - db_set_dw(NULL, MODULENAME, SETTING_HEIGHT, GetDlgItemInt(hwndDlg, IDC_HEIGHT, NULL, FALSE)); - } - db_set_b(NULL, MODULENAME, SETTING_OFFLINECLOSE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_OFFLINECLOSE)); - db_set_b(NULL, MODULENAME, SETTING_AUTODIAL, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTODIAL)); - db_set_b(NULL, MODULENAME, SETTING_AUTOHANGUP, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOHANGUP)); - } - break; - } - - return FALSE; -} - -/////////////////////////////////////////////////////////////////////////////// -// for db cleanup - -static int DeleteSetting(const char *szSetting, LPARAM lParam) -{ - LIST *p = (LIST *)lParam; - p->insert(mir_strdup(szSetting)); - return 0; -} - -static int ClearDatabase(char* filter) -{ - LIST arSettings(10); - db_enum_settings(NULL, DeleteSetting, MODULENAME, &arSettings); - - for (int i = 0; i < arSettings.getCount(); i++) { - if ((filter == NULL) || (!strncmp(filter, arSettings[i], mir_strlen(filter)))) - db_unset(NULL, MODULENAME, arSettings[i]); - mir_free(arSettings[i]); - } - - if (filter == NULL) - db_unset(NULL, "AutoAway", "Confirm"); - - return 0; -} - - -static OBJLIST arProfiles(5); - -INT_PTR CALLBACK addProfileDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) -{ - static HWND hwndParent; - - switch (msg) { - case WM_INITDIALOG: - TranslateDialogDefault(hwndDlg); - hwndParent = (HWND)lParam; - EnableWindow(GetDlgItem(hwndDlg, IDC_OK), FALSE); - break; - - case WM_COMMAND: - if (LOWORD(wParam) == IDC_OK) { - wchar_t profileName[128]; - GetDlgItemText(hwndDlg, IDC_PROFILENAME, profileName, _countof(profileName)); - SendMessage(hwndParent, UM_ADDPROFILE, 0, (LPARAM)profileName); - // done and exit - DestroyWindow(hwndDlg); - } - else if (LOWORD(wParam) == IDC_CANCEL) { - DestroyWindow(hwndDlg); - } - else if (LOWORD(wParam) == IDC_PROFILENAME) { - (SendDlgItemMessage(hwndDlg, IDC_PROFILENAME, EM_LINELENGTH, 0, 0) > 0) ? EnableWindow(GetDlgItem(hwndDlg, IDC_OK), TRUE) : EnableWindow(GetDlgItem(hwndDlg, IDC_OK), FALSE); - } - break; - - case WM_DESTROY: - EnableWindow(hwndParent, TRUE); - break; - } - - return 0; -} - -static INT_PTR CALLBACK StatusProfilesOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam) -{ - static BOOL bNeedRebuildMenu = FALSE; - static BOOL bInitDone = FALSE; - - switch(msg) { - case WM_INITDIALOG: - bInitDone = false; - - TranslateDialogDefault(hwndDlg); - SetDlgItemText(hwndDlg, IDC_CREATEMMI, TranslateT("Create a status menu item")); - { - int defProfile; - int profileCount = GetProfileCount((WPARAM)&defProfile, 0); - if (profileCount == 0) { - profileCount = 1; - defProfile = 0; - } - - for (int i=0; i < profileCount; i++) { - PROFILEOPTIONS *ppo = new PROFILEOPTIONS; - ppo->ps = GetCurrentProtoSettings(); - TSettingsList& ar = *ppo->ps; - - if ( GetProfile(i, ar) == -1) { - /* create an empty profile */ - if (i == defProfile) - ppo->tszName = mir_wstrdup( TranslateT("default")); - else - ppo->tszName = mir_wstrdup( TranslateT("unknown")); - } - else { - for (int j=0; j < ar.getCount(); j++) - if ( ar[j].szMsg != NULL) - ar[j].szMsg = wcsdup( ar[j].szMsg ); - - ppo->tszName = db_get_wsa(NULL, MODULENAME, OptName(i, SETTING_PROFILENAME)); - if (ppo->tszName == NULL) { - if (i == defProfile) - ppo->tszName = mir_wstrdup( TranslateT("default")); - else - ppo->tszName = mir_wstrdup( TranslateT("unknown")); - } - ppo->createTtb = db_get_b(NULL, MODULENAME, OptName(i, SETTING_CREATETTBBUTTON), 0); - ppo->showDialog = db_get_b(NULL, MODULENAME, OptName(i, SETTING_SHOWCONFIRMDIALOG), 0); - ppo->createMmi = db_get_b(NULL, MODULENAME, OptName(i, SETTING_CREATEMMITEM), 0); - ppo->inSubMenu = db_get_b(NULL, MODULENAME, OptName(i, SETTING_INSUBMENU), 1); - ppo->regHotkey = db_get_b(NULL, MODULENAME, OptName(i, SETTING_REGHOTKEY), 0); - ppo->hotKey = db_get_w(NULL, MODULENAME, OptName(i, SETTING_HOTKEY), MAKEWORD((char)('0'+i), HOTKEYF_CONTROL|HOTKEYF_SHIFT)); - } - arProfiles.insert(ppo); - } - if (hTTBModuleLoadedHook == NULL) - EnableWindow(GetDlgItem(hwndDlg, IDC_CREATETTB), FALSE); - - SendMessage(hwndDlg, UM_REINITPROFILES, 0, 0); - ShowWindow(GetDlgItem(hwndDlg, IDC_VARIABLESHELP), ServiceExists(MS_VARS_SHOWHELPEX)?SW_SHOW:SW_HIDE); - bInitDone = true; - } - break; - - case UM_REINITPROFILES: - bInitDone = false; - { - // creates profile combo box according to 'dat' - SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_RESETCONTENT, 0, 0); - for (int i=0; i < arProfiles.getCount(); i++ ) { - int item = SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_ADDSTRING, 0, (LPARAM)arProfiles[i].tszName); - SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_SETITEMDATA, (WPARAM)item, (LPARAM)i); - } - SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_SETCURSEL, 0, 0); - SendMessage(hwndDlg, UM_SETPROFILE, 0, 0); - } - bInitDone = true; - break; - - case UM_SETPROFILE: - { - int sel = (int)SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETITEMDATA, - SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETCURSEL, 0, 0), 0); - CheckDlgButton(hwndDlg, IDC_CREATETTB, arProfiles[sel].createTtb ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_SHOWDIALOG, arProfiles[sel].showDialog ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_CREATEMMI, arProfiles[sel].createMmi ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_INSUBMENU, arProfiles[sel].inSubMenu ? BST_CHECKED : BST_UNCHECKED); - EnableWindow(GetDlgItem(hwndDlg, IDC_INSUBMENU), IsDlgButtonChecked(hwndDlg, IDC_CREATEMMI)); - CheckDlgButton(hwndDlg, IDC_REGHOTKEY, arProfiles[sel].regHotkey ? BST_CHECKED : BST_UNCHECKED); - SendDlgItemMessage(hwndDlg, IDC_HOTKEY, HKM_SETHOTKEY, arProfiles[sel].hotKey, 0); - EnableWindow(GetDlgItem(hwndDlg, IDC_HOTKEY), IsDlgButtonChecked(hwndDlg, IDC_REGHOTKEY)); - SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, LB_RESETCONTENT, 0, 0); - - // fill proto list - TSettingsList& ar = *arProfiles[sel].ps; - for ( int i=0; i < ar.getCount(); i++ ) { - int item = SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, LB_ADDSTRING, 0, (LPARAM)ar[i].tszAccName ); - SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, LB_SETITEMDATA, (WPARAM)item, (LPARAM)&ar[i]); - } - SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, LB_SETCURSEL, 0, 0); - SendMessage(hwndDlg, UM_SETPROTOCOL, 0, 0); - } - break; - - case UM_SETPROTOCOL: - { - int idx = SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, LB_GETCURSEL, 0, 0); - if ( idx != -1 ) { - // fill status box - TSSSetting* ps = ( TSSSetting* )SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, LB_GETITEMDATA, idx, 0); - - int flags = (CallProtoService(ps->szName, PS_GETCAPS, PFLAGNUM_2, 0))&~(CallProtoService(ps->szName, PS_GETCAPS, PFLAGNUM_5, 0)); - SendDlgItemMessage(hwndDlg, IDC_STATUS, LB_RESETCONTENT, 0, 0); - for ( int i=0; i < _countof(statusModeList); i++ ) { - if ( (flags&statusModePf2List[i]) || (statusModeList[i] == ID_STATUS_OFFLINE)) { - int item = SendDlgItemMessage(hwndDlg, IDC_STATUS, LB_ADDSTRING, 0, (LPARAM)pcli->pfnGetStatusModeDescription(statusModeList[i], 0)); - SendDlgItemMessage(hwndDlg, IDC_STATUS, LB_SETITEMDATA, (WPARAM)item, (LPARAM)statusModeList[i]); - if (ps->status == statusModeList[i]) - SendDlgItemMessage(hwndDlg, IDC_STATUS, LB_SETCURSEL, (WPARAM)item, 0); - } - } - - int item = SendDlgItemMessage(hwndDlg, IDC_STATUS, LB_ADDSTRING, 0, (LPARAM)TranslateT("")); - SendDlgItemMessage(hwndDlg, IDC_STATUS, LB_SETITEMDATA, (WPARAM)item, (LPARAM)ID_STATUS_CURRENT); - if (ps->status == ID_STATUS_CURRENT) - SendDlgItemMessage(hwndDlg, IDC_STATUS, LB_SETCURSEL, (WPARAM)item, 0); - - item = SendDlgItemMessage(hwndDlg, IDC_STATUS, LB_ADDSTRING, 0, (LPARAM)TranslateT("")); - SendDlgItemMessage(hwndDlg, IDC_STATUS, LB_SETITEMDATA, (WPARAM)item, (LPARAM)ID_STATUS_LAST); - if (ps->status == ID_STATUS_LAST) - SendDlgItemMessage(hwndDlg, IDC_STATUS, LB_SETCURSEL, (WPARAM)item, 0); - } - - SendMessage(hwndDlg, UM_SETSTATUSMSG, 0, 0); - } - break; - - case UM_SETSTATUSMSG: - { - // set status message - BOOL bStatusMsg = FALSE; - int idx = SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, LB_GETCURSEL, 0, 0); - if ( idx != -1 ) { - TSSSetting* ps = ( TSSSetting* )SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, LB_GETITEMDATA, idx, 0); - - CheckRadioButton(hwndDlg, IDC_MIRANDAMSG, IDC_CUSTOMMSG, ps->szMsg!=NULL?IDC_CUSTOMMSG:IDC_MIRANDAMSG); - if (ps->szMsg != NULL) - SetDlgItemText(hwndDlg, IDC_STATUSMSG, ps->szMsg); - - bStatusMsg = ( (((CallProtoService(ps->szName, PS_GETCAPS, PFLAGNUM_1, 0)&PF1_MODEMSGSEND&~PF1_INDIVMODEMSG)) && - (CallProtoService(ps->szName, PS_GETCAPS, PFLAGNUM_3, 0)&Proto_Status2Flag(ps->status))) || (ps->status == ID_STATUS_CURRENT) || (ps->status == ID_STATUS_LAST)); - } - EnableWindow(GetDlgItem(hwndDlg, IDC_MIRANDAMSG), bStatusMsg); - EnableWindow(GetDlgItem(hwndDlg, IDC_CUSTOMMSG), bStatusMsg); - EnableWindow(GetDlgItem(hwndDlg, IDC_STATUSMSG), bStatusMsg&&IsDlgButtonChecked(hwndDlg, IDC_CUSTOMMSG)); - EnableWindow(GetDlgItem(hwndDlg, IDC_VARIABLESHELP), bStatusMsg&&IsDlgButtonChecked(hwndDlg, IDC_CUSTOMMSG)); - } - break; - - case UM_ADDPROFILE: - { - wchar_t *tszName = (wchar_t*)lParam; - if (tszName == NULL) - break; - - PROFILEOPTIONS* ppo = new PROFILEOPTIONS; - ppo->tszName = mir_wstrdup(tszName); - ppo->ps = GetCurrentProtoSettings(); - arProfiles.insert(ppo); - - SendMessage(hwndDlg, UM_REINITPROFILES, 0, 0); - } - break; - - case UM_DELPROFILE: { - // wparam == profile no - int i=(int)wParam; - - if ( arProfiles.getCount() == 1) { - MessageBox(NULL, TranslateT("At least one profile must exist"), TranslateT("StartupStatus"), MB_OK); - break; - } - - arProfiles.remove(i); - - int defProfile; - GetProfileCount((WPARAM)&defProfile, 0); - if (i == defProfile) { - MessageBox(NULL, TranslateT("Your default profile will be changed"), TranslateT("StartupStatus"), MB_OK); - db_set_w(NULL, MODULENAME, SETTING_DEFAULTPROFILE, 0); - } - SendMessage(hwndDlg, UM_REINITPROFILES, 0, 0); - break; - } - - case WM_COMMAND: - if ( ((HIWORD(wParam) == EN_CHANGE) || (HIWORD(wParam) == BN_CLICKED) || (HIWORD(wParam) == LBN_SELCHANGE)) && ((HWND)lParam == GetFocus())) - if ( bInitDone ) - SendMessage(GetParent(hwndDlg),PSM_CHANGED,0,0); - - switch (LOWORD(wParam)) { - case IDC_STATUS: - if (HIWORD(wParam) == LBN_SELCHANGE) { - int idx = SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, LB_GETCURSEL, 0, 0); - if ( idx != -1 ) { - TSSSetting* ps = ( TSSSetting* )SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, LB_GETITEMDATA, idx, 0); - ps->status = (int)SendDlgItemMessage(hwndDlg, IDC_STATUS, LB_GETITEMDATA, - SendDlgItemMessage(hwndDlg, IDC_STATUS, LB_GETCURSEL, 0, 0), 0); - } - SendMessage(hwndDlg, UM_SETSTATUSMSG, 0, 0); - } - break; - - case IDC_PROFILE: - if (HIWORD(wParam) != CBN_SELCHANGE) - break; - - SendMessage(hwndDlg, UM_SETPROFILE, 0, 0); - break; - - case IDC_PROTOCOL: - if (HIWORD(wParam) != LBN_SELCHANGE) - break; - - SendMessage(hwndDlg, UM_SETPROTOCOL, 0, 0); - break; - - case IDC_MIRANDAMSG: - case IDC_CUSTOMMSG: - { - int len; - TSSSetting* ps = ( TSSSetting* )SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, LB_GETITEMDATA, - SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, LB_GETCURSEL, 0, 0), 0); - if (ps->szMsg != NULL) - free(ps->szMsg); - - ps->szMsg = NULL; - if (IsDlgButtonChecked(hwndDlg, IDC_CUSTOMMSG)) { - len = SendDlgItemMessage(hwndDlg, IDC_STATUSMSG, WM_GETTEXTLENGTH, 0, 0); - ps->szMsg = (wchar_t*)calloc(sizeof(wchar_t), len+1); - GetDlgItemText(hwndDlg, IDC_STATUSMSG, ps->szMsg, (len + 1)); - } - SendMessage(hwndDlg, UM_SETSTATUSMSG, 0, 0); - } - break; - - case IDC_STATUSMSG: - if (HIWORD(wParam) == EN_CHANGE) { - // update the status message in memory, this is done on each character tick, not nice - // but it works - TSSSetting* ps = ( TSSSetting* )SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, LB_GETITEMDATA, - SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, LB_GETCURSEL, 0, 0), 0); - if (ps->szMsg != NULL) { - if ( *ps->szMsg ) - free(ps->szMsg); - ps->szMsg = NULL; - } - int len = SendDlgItemMessage(hwndDlg, IDC_STATUSMSG, WM_GETTEXTLENGTH, 0, 0); - ps->szMsg = (wchar_t*)calloc(sizeof(wchar_t), len+1); - GetDlgItemText(hwndDlg, IDC_STATUSMSG, ps->szMsg, (len + 1)); - } - break; - - case IDC_CREATEMMI: - EnableWindow(GetDlgItem(hwndDlg, IDC_INSUBMENU), IsDlgButtonChecked(hwndDlg, IDC_CREATEMMI)); - case IDC_INSUBMENU: - bNeedRebuildMenu = TRUE; - case IDC_REGHOTKEY: - case IDC_CREATETTB: - case IDC_SHOWDIALOG: - { - int sel = (int)SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETCURSEL, 0, 0), 0); - PROFILEOPTIONS& po = arProfiles[sel]; - po.createMmi = IsDlgButtonChecked(hwndDlg, IDC_CREATEMMI); - po.inSubMenu = IsDlgButtonChecked(hwndDlg, IDC_INSUBMENU); - po.createTtb = IsDlgButtonChecked(hwndDlg, IDC_CREATETTB); - po.regHotkey = IsDlgButtonChecked(hwndDlg, IDC_REGHOTKEY); - po.showDialog = IsDlgButtonChecked(hwndDlg, IDC_SHOWDIALOG); - EnableWindow(GetDlgItem(hwndDlg, IDC_HOTKEY), IsDlgButtonChecked(hwndDlg, IDC_REGHOTKEY)); - } - break; - - case IDC_HOTKEY: - if (HIWORD(wParam) == EN_CHANGE) { - int sel = (int)SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETITEMDATA, - SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETCURSEL, 0, 0), 0); - arProfiles[sel].hotKey = (WORD)SendDlgItemMessage(hwndDlg, IDC_HOTKEY, HKM_GETHOTKEY, 0, 0); - } - break; - - case IDC_ADDPROFILE: - // add a profile - CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_ADDPROFILE), hwndDlg, addProfileDlgProc, (LPARAM)hwndDlg); - EnableWindow(hwndDlg, FALSE); - break; - - case IDC_DELPROFILE: - { - int sel = (int)SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETITEMDATA, - SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETCURSEL, 0, 0), 0); - SendMessage(hwndDlg, UM_DELPROFILE, (WPARAM)sel, 0); - } - break; - - case IDC_VARIABLESHELP: - variables_showhelp(hwndDlg, IDC_STATUSMSG, VHF_INPUT|VHF_EXTRATEXT|VHF_HELP|VHF_FULLFILLSTRUCT|VHF_HIDESUBJECTTOKEN, NULL, "Protocol ID"); - break; - } - break; - - case WM_NOTIFY: - if (((LPNMHDR)lParam)->code == PSN_APPLY) { - char setting[128]; - int oldCount = db_get_w(NULL, MODULENAME, SETTING_PROFILECOUNT, 0); - for (int i=0; i < oldCount; i++) { - mir_snprintf(setting, "%d_", i); - ClearDatabase(setting); - } - for (int i=0; i < arProfiles.getCount(); i++) { - PROFILEOPTIONS& po = arProfiles[i]; - db_set_b(NULL, MODULENAME, OptName(i, SETTING_SHOWCONFIRMDIALOG), po.showDialog); - db_set_b(NULL, MODULENAME, OptName(i, SETTING_CREATETTBBUTTON), po.createTtb); - db_set_b(NULL, MODULENAME, OptName(i, SETTING_CREATEMMITEM), po.createMmi); - db_set_b(NULL, MODULENAME, OptName(i, SETTING_INSUBMENU), po.inSubMenu); - db_set_b(NULL, MODULENAME, OptName(i, SETTING_REGHOTKEY), po.regHotkey); - db_set_w(NULL, MODULENAME, OptName(i, SETTING_HOTKEY), po.hotKey); - db_set_ws(NULL, MODULENAME, OptName(i, SETTING_PROFILENAME), po.tszName); - - TSettingsList& ar = *po.ps; - for (int j=0; j < ar.getCount(); j++) { - if ( ar[j].szMsg != NULL ) { - mir_snprintf(setting, "%s_%s", ar[j].szName, SETTING_PROFILE_STSMSG); - db_set_ws(NULL, MODULENAME, OptName(i, setting), ar[j].szMsg); - } - db_set_w(NULL, MODULENAME, OptName(i, ar[j].szName), ar[j].status); - } - } - db_set_w(NULL, MODULENAME, SETTING_PROFILECOUNT, (WORD)arProfiles.getCount()); - - // Rebuild status menu - if (bNeedRebuildMenu) - pcli->pfnReloadProtoMenus(); - - LoadMainOptions(); - } - break; - - case WM_DESTROY: - arProfiles.destroy(); - break; - } - - return 0; -} - -int OptionsInit(WPARAM wparam,LPARAM) -{ - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = hInst; - odp.pszGroup = LPGEN("Status"); - odp.pszTitle = LPGEN("StartupStatus"); - odp.flags = ODPF_BOLDGROUPS; - - odp.pszTab = LPGEN("General"); - odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_STARTUPSTATUS); - odp.pfnDlgProc = StartupStatusOptDlgProc; - Options_AddPage(wparam,&odp); - - odp.pszTab = LPGEN("Status profiles"); - odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_STATUSPROFILES); - odp.pfnDlgProc = StatusProfilesOptDlgProc; - Options_AddPage(wparam,&odp); - return 0; -} - -char* OptName(int i, const char* setting) -{ - static char buf[100]; - mir_snprintf(buf, "%d_%s", i, setting); - return buf; -} diff --git a/plugins/StatusPlugins/StartupStatus/profiles.cpp b/plugins/StatusPlugins/StartupStatus/profiles.cpp deleted file mode 100644 index 51a4bccc71..0000000000 --- a/plugins/StatusPlugins/StartupStatus/profiles.cpp +++ /dev/null @@ -1,348 +0,0 @@ -/* - StartupStatus Plugin for Miranda-IM (www.miranda-im.org) - Copyright 2003-2006 P. Boon - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#include "../commonstatus.h" -#include "startupstatus.h" -#include "../resource.h" -#include - -#include - -#define MAX_MMITEMS 6 - -extern HINSTANCE hInst; -extern int protoCount; - -static int menuprofiles[MAX_MMITEMS]; -static HANDLE hProfileServices[MAX_MMITEMS]; -static int mcount = 0; - -static PROFILECE *pce = NULL; -static int pceCount = 0; - -static UINT_PTR releaseTtbTimerId = 0; - -static HANDLE hTBModuleLoadedHook; -static HANDLE hLoadAndSetProfileService; -static HANDLE hMessageHook = NULL; - -static HWND hMessageWindow = NULL; -static HKINFO *hkInfo = NULL; -static int hkiCount = 0; - -static HANDLE* ttbButtons = NULL; -static int ttbButtonCount = 0; - -HANDLE hTTBModuleLoadedHook; - -static INT_PTR profileService(WPARAM, LPARAM, LPARAM param) -{ - LoadAndSetProfile((WPARAM)menuprofiles[param], 0); - return 0; -} - -static int CreateMainMenuItems(WPARAM, LPARAM) -{ - CMenuItem mi; - mi.position = 2000100000; - mi.flags = CMIF_UNICODE; - mcount = 0; - int count = GetProfileCount(0, 0); - for (int i = 0; i < count && mcount < MAX_MMITEMS; i++) { - wchar_t profilename[128]; - if (!db_get_b(NULL, MODULENAME, OptName(i, SETTING_CREATEMMITEM), 0) || GetProfileName(i, (LPARAM)profilename)) - continue; - - if (db_get_b(NULL, MODULENAME, OptName(i, SETTING_INSUBMENU), 1) && !mi.root) { - mi.root = Menu_CreateRoot(MO_STATUS, LPGENW("Status profiles"), 2000100000); - Menu_ConfigureItem(mi.root, MCI_OPT_UID, "1AB30D51-BABA-4B27-9288-1A12278BAD8D"); - } - - char servicename[128]; - mir_snprintf(servicename, "%s%d", MS_SS_MENUSETPROFILEPREFIX, mcount); - hProfileServices[mcount] = CreateServiceFunctionParam(servicename, profileService, mcount); - - mi.name.w = profilename; - mi.position = 2000100000 + mcount; - mi.pszService = servicename; - if (Menu_AddStatusMenuItem(&mi)) - menuprofiles[mcount++] = i; - } - - return 0; -} - -///////////////////////////////////////////////////////////////////////////////////////// - -INT_PTR GetProfileName(WPARAM wParam, LPARAM lParam) -{ - int profile = (int)wParam; - if (profile < 0) // get default profile - profile = db_get_w(NULL, MODULENAME, SETTING_DEFAULTPROFILE, 0); - - int count = db_get_w(NULL, MODULENAME, SETTING_PROFILECOUNT, 0); - if (profile >= count && count > 0) - return -1; - - wchar_t* buf = (wchar_t*)lParam; - if (count == 0) { - wcsncpy(buf, TranslateT("default"), 128 - 1); - return 0; - } - - DBVARIANT dbv; - char setting[80]; - mir_snprintf(setting, "%d_%s", profile, SETTING_PROFILENAME); - if (db_get_ws(NULL, MODULENAME, setting, &dbv)) - return -1; - - wcsncpy(buf, dbv.ptszVal, 128 - 1); buf[127] = 0; - db_free(&dbv); - return 0; -} - -INT_PTR GetProfileCount(WPARAM wParam, LPARAM) -{ - int *def = (int*)wParam; - int count = db_get_w(NULL, MODULENAME, SETTING_PROFILECOUNT, 1); - if (def != 0) { - *def = db_get_w(NULL, MODULENAME, SETTING_DEFAULTPROFILE, 0); - if (*def >= count) - *def = 0; - } - - return count; -} - -wchar_t *GetStatusMessage(int profile, char *szProto) -{ - char dbSetting[80]; - DBVARIANT dbv; - - for (int i = 0; i < pceCount; i++) { - if ((pce[i].profile == profile) && (!mir_strcmp(pce[i].szProto, szProto))) { - mir_snprintf(dbSetting, "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG); - if (!db_get_ws(NULL, MODULENAME, dbSetting, &dbv)) { // reload from db - pce[i].msg = (wchar_t*)realloc(pce[i].msg, sizeof(wchar_t)*(mir_wstrlen(dbv.ptszVal) + 1)); - if (pce[i].msg != NULL) { - mir_wstrcpy(pce[i].msg, dbv.ptszVal); - } - db_free(&dbv); - } - else { - if (pce[i].msg != NULL) { - free(pce[i].msg); - pce[i].msg = NULL; - } - } - return pce[i].msg; - } - } - pce = (PROFILECE*)realloc(pce, (pceCount + 1)*sizeof(PROFILECE)); - if (pce == NULL) - return NULL; - - pce[pceCount].profile = profile; - pce[pceCount].szProto = _strdup(szProto); - pce[pceCount].msg = NULL; - mir_snprintf(dbSetting, "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG); - if (!db_get_ws(NULL, MODULENAME, dbSetting, &dbv)) { - pce[pceCount].msg = wcsdup(dbv.ptszVal); - db_free(&dbv); - } - pceCount++; - - return pce[pceCount - 1].msg; -} - -int GetProfile(int profile, TSettingsList& arSettings) -{ - if (profile < 0) // get default profile - profile = db_get_w(NULL, MODULENAME, SETTING_DEFAULTPROFILE, 0); - - int count = db_get_w(NULL, MODULENAME, SETTING_PROFILECOUNT, 0); - if (profile >= count && count > 0) - return -1; - - arSettings.destroy(); - - // if count == 0, continue so the default profile will be returned - PROTOACCOUNT** protos; - Proto_EnumAccounts(&count, &protos); - - for (int i = 0; i < count; i++) - if (IsSuitableProto(protos[i])) - arSettings.insert(new TSSSetting(profile, protos[i])); - - return (arSettings.getCount() == 0) ? -1 : 0; -} - -static void CALLBACK releaseTtbTimerFunction(HWND, UINT, UINT_PTR, DWORD) -{ - KillTimer(NULL, releaseTtbTimerId); - for (int i = 0; i < ttbButtonCount; i++) - CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)ttbButtons[i], 0); -} - -INT_PTR LoadAndSetProfile(WPARAM iProfileNo, LPARAM) -{ - // wParam == profile no. - int profile = (int)iProfileNo; - TSettingsList profileSettings(10, CompareSettings); - if (!GetProfile(profile, profileSettings)) { - profile = (profile >= 0) ? profile : db_get_w(NULL, MODULENAME, SETTING_DEFAULTPROFILE, 0); - - char setting[64]; - mir_snprintf(setting, "%d_%s", profile, SETTING_SHOWCONFIRMDIALOG); - if (!db_get_b(NULL, MODULENAME, setting, 0)) - CallService(MS_CS_SETSTATUSEX, (WPARAM)&profileSettings, 0); - else - CallService(MS_CS_SHOWCONFIRMDLGEX, (WPARAM)&profileSettings, (LPARAM)db_get_dw(NULL, MODULENAME, SETTING_DLGTIMEOUT, 5)); - } - - // add timer here - if (hTTBModuleLoadedHook) - releaseTtbTimerId = SetTimer(NULL, 0, 100, releaseTtbTimerFunction); - - return 0; -} - -static UINT GetFsModifiers(WORD wHotKey) -{ - UINT fsm = 0; - if (HIBYTE(wHotKey)&HOTKEYF_ALT) - fsm |= MOD_ALT; - if (HIBYTE(wHotKey)&HOTKEYF_CONTROL) - fsm |= MOD_CONTROL; - if (HIBYTE(wHotKey)&HOTKEYF_SHIFT) - fsm |= MOD_SHIFT; - if (HIBYTE(wHotKey)&HOTKEYF_EXT) - fsm |= MOD_WIN; - - return fsm; -} - -static DWORD CALLBACK MessageWndProc(HWND, UINT msg, WPARAM wParam, LPARAM) -{ - if (msg == WM_HOTKEY) { - for (int i = 0; i < hkiCount; i++) - if ((int)hkInfo[i].id == wParam) - LoadAndSetProfile((WPARAM)hkInfo[i].profile, 0); - } - - return TRUE; -} - -static int UnregisterHotKeys() -{ - if (hkInfo != NULL) { - for (int i = 0; i < hkiCount; i++) { - UnregisterHotKey(hMessageWindow, (int)hkInfo[i].id); - GlobalDeleteAtom(hkInfo[i].id); - } - free(hkInfo); - } - DestroyWindow(hMessageWindow); - - hkiCount = 0; - hkInfo = NULL; - hMessageWindow = NULL; - - return 0; -} - -// assumes UnregisterHotKeys was called before -static int RegisterHotKeys() -{ - hMessageWindow = CreateWindowEx(0, L"STATIC", NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL); - SetWindowLongPtr(hMessageWindow, GWLP_WNDPROC, (LONG_PTR)MessageWndProc); - - int count = GetProfileCount(0, 0); - for (int i = 0; i < count; i++) { - if (!db_get_b(NULL, MODULENAME, OptName(i, SETTING_REGHOTKEY), 0)) - continue; - - WORD wHotKey = db_get_w(NULL, MODULENAME, OptName(i, SETTING_HOTKEY), 0); - hkInfo = (HKINFO*)realloc(hkInfo, (hkiCount + 1)*sizeof(HKINFO)); - if (hkInfo == NULL) - return -1; - - char atomname[255]; - mir_snprintf(atomname, "StatusProfile_%d", i); - hkInfo[hkiCount].id = GlobalAddAtomA(atomname); - if (hkInfo[hkiCount].id == 0) - continue; - - hkInfo[hkiCount].profile = i; - hkiCount++; - RegisterHotKey(hMessageWindow, (int)hkInfo[hkiCount - 1].id, GetFsModifiers(wHotKey), LOBYTE(wHotKey)); - } - - if (hkiCount == 0) - UnregisterHotKeys(); - - return 0; -} - -int LoadMainOptions() -{ - if (hTTBModuleLoadedHook) { - RemoveTopToolbarButtons(); - CreateTopToolbarButtons(0, 0); - } - - UnregisterHotKeys(); - RegisterHotKeys(); - return 0; -} - -int LoadProfileModule() -{ - hLoadAndSetProfileService = CreateServiceFunction(MS_SS_LOADANDSETPROFILE, LoadAndSetProfile); - return 0; -} - -int InitProfileModule() -{ - hTTBModuleLoadedHook = HookEvent(ME_TTB_MODULELOADED, CreateTopToolbarButtons); - - HookEvent(ME_CLIST_PREBUILDSTATUSMENU, CreateMainMenuItems); - - CreateMainMenuItems(0, 0); - RegisterHotKeys(); - return 0; -} - -int DeinitProfilesModule() -{ - for (int i = 0; i < mcount; i++) - DestroyServiceFunction(hProfileServices[i]); - - if (pce) { - for (int i = 0; i < pceCount; i++) - free(pce[i].szProto); - free(pce); - } - - UnregisterHotKeys(); - RemoveTopToolbarButtons(); - - DestroyServiceFunction(hLoadAndSetProfileService); - return 0; -} diff --git a/plugins/StatusPlugins/StartupStatus/res/ttbDown.ico b/plugins/StatusPlugins/StartupStatus/res/ttbDown.ico deleted file mode 100644 index 84e3269c89..0000000000 Binary files a/plugins/StatusPlugins/StartupStatus/res/ttbDown.ico and /dev/null differ diff --git a/plugins/StatusPlugins/StartupStatus/res/ttbUp.ico b/plugins/StatusPlugins/StartupStatus/res/ttbUp.ico deleted file mode 100644 index 150d8c3b0c..0000000000 Binary files a/plugins/StatusPlugins/StartupStatus/res/ttbUp.ico and /dev/null differ diff --git a/plugins/StatusPlugins/StartupStatus/startupstatus.cpp b/plugins/StatusPlugins/StartupStatus/startupstatus.cpp deleted file mode 100644 index 3cf1f07b49..0000000000 --- a/plugins/StatusPlugins/StartupStatus/startupstatus.cpp +++ /dev/null @@ -1,487 +0,0 @@ -/* - StartupStatus Plugin for Miranda-IM (www.miranda-im.org) - Copyright 2003-2006 P. Boon - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#include "../commonstatus.h" -#include "startupstatus.h" - -static UINT_PTR setStatusTimerId = 0; - -int CompareSettings(const TSSSetting *p1, const TSSSetting *p2) -{ - return mir_strcmp(p1->szName, p2->szName); -} - -static TSettingsList startupSettings(10, CompareSettings); - -TSSSetting::TSSSetting(PROTOACCOUNT *pa) -{ - cbSize = sizeof(PROTOCOLSETTINGEX); - szName = pa->szModuleName; - tszAccName = pa->tszAccountName; - status = lastStatus = CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0); - szMsg = NULL; -} - -TSSSetting::TSSSetting(int profile, PROTOACCOUNT *pa) -{ - cbSize = sizeof(PROTOCOLSETTINGEX); - - // copy name - szName = pa->szModuleName; - tszAccName = pa->tszAccountName; - - // load status - char setting[80]; - mir_snprintf(setting, "%d_%s", profile, pa->szModuleName); - int iStatus = db_get_w(NULL, MODULENAME, setting, 0); - if (iStatus < MIN_STATUS || iStatus > MAX_STATUS) - iStatus = DEFAULT_STATUS; - status = iStatus; - - // load last status - mir_snprintf(setting, "%s%s", PREFIX_LAST, szName); - iStatus = db_get_w(NULL, MODULENAME, setting, 0); - if (iStatus < MIN_STATUS || iStatus > MAX_STATUS) - iStatus = DEFAULT_STATUS; - lastStatus = iStatus; - - szMsg = GetStatusMessage(profile, szName); - if (szMsg) - szMsg = wcsdup(szMsg); -} - -TSSSetting::~TSSSetting() -{ - free(szMsg); -} - -///////////////////////////////////////////////////////////////////////////////////////// - -static HANDLE hProtoAckHook, hCSStatusChangeHook, hStatusChangeHook; - -static HWND hMessageWindow; - -static BYTE showDialogOnStartup = 0; - -///////////////////////////////////////////////////////////////////////////////////////// -// command line options - -static PROTOCOLSETTINGEX* IsValidProtocol(TSettingsList& protoSettings, char* protoName) -{ - for (int i = 0; i < protoSettings.getCount(); i++) - if (!strncmp(protoSettings[i].szName, protoName, mir_strlen(protoSettings[i].szName))) - return &protoSettings[i]; - - return NULL; -} - -static int IsValidStatusDesc(char* statusDesc) -{ - if (!strncmp("away", statusDesc, 4)) - return ID_STATUS_AWAY; - if (!strncmp("na", statusDesc, 2)) - return ID_STATUS_NA; - if (!strncmp("dnd", statusDesc, 3)) - return ID_STATUS_DND; - if (!strncmp("occupied", statusDesc, 8)) - return ID_STATUS_OCCUPIED; - if (!strncmp("freechat", statusDesc, 8)) - return ID_STATUS_FREECHAT; - if (!strncmp("online", statusDesc, 6)) - return ID_STATUS_ONLINE; - if (!strncmp("offline", statusDesc, 7)) - return ID_STATUS_OFFLINE; - if (!strncmp("invisible", statusDesc, 9)) - return ID_STATUS_INVISIBLE; - if (!strncmp("onthephone", statusDesc, 10)) - return ID_STATUS_ONTHEPHONE; - if (!strncmp("outtolunch", statusDesc, 10)) - return ID_STATUS_OUTTOLUNCH; - if (!strncmp("last", statusDesc, 4)) - return ID_STATUS_LAST; - - return 0; -} - -static void ProcessCommandLineOptions(TSettingsList& protoSettings) -{ - if (protoSettings.getCount() == 0) - return; - - char *cmdl = GetCommandLineA(); - while (*cmdl != '\0') { - while (*cmdl != '/') { - if (*cmdl == '\0') - return; - - cmdl++; - } - if (*cmdl == '\0') - return; - - cmdl++; - if (!strncmp(cmdl, "showdialog", 10)) { - showDialogOnStartup = TRUE; - continue; - } - char *protoName = cmdl; // first protocol ? - PROTOCOLSETTINGEX* protoSetting = IsValidProtocol(protoSettings, protoName); - if (protoSetting != NULL) { - while (*cmdl != '=') { - if (*cmdl == '\0') - return; - - cmdl++; // skip to status - } - - if (*cmdl == '\0') - return; - - cmdl++; - char *statusDesc = cmdl; - int status = IsValidStatusDesc(statusDesc); - if (status != 0) - protoSetting->status = status; - } - } -} - -static void SetLastStatusMessages(TSettingsList &ps) -{ - for (int i = 0; i < ps.getCount(); i++) { - if (ps[i].status != ID_STATUS_LAST) - continue; - - char dbSetting[128]; - mir_snprintf(dbSetting, "%s%s", PREFIX_LASTMSG, ps[i].szName); - - DBVARIANT dbv; - if (ps[i].szMsg == NULL && !db_get_ws(NULL, MODULENAME, dbSetting, &dbv)) { - ps[i].szMsg = wcsdup(dbv.ptszVal); // remember this won't be freed - db_free(&dbv); - } - } -} - -///////////////////////////////////////////////////////////////////////////////////////// -// Account control event - -int OnAccChanged(WPARAM wParam, LPARAM lParam) -{ - PROTOACCOUNT *pa = (PROTOACCOUNT*)lParam; - switch (wParam) { - case PRAC_ADDED: - startupSettings.insert(new TSSSetting(-1, pa)); - break; - - case PRAC_REMOVED: - for (int i = 0; i < startupSettings.getCount(); i++) { - if (!mir_strcmp(startupSettings[i].szName, pa->szModuleName)) { - startupSettings.remove(i); - break; - } - } - break; - } - - return 0; -} - -// 'allow override' -static int ProcessProtoAck(WPARAM, LPARAM lParam) -{ - // 'something' made a status change - ACKDATA *ack = (ACKDATA*)lParam; - if (ack->type != ACKTYPE_STATUS && ack->result != ACKRESULT_FAILED) - return 0; - - if (!db_get_b(NULL, MODULENAME, SETTING_OVERRIDE, 1) || startupSettings.getCount() == 0) - return 0; - - for (int i = 0; i < startupSettings.getCount(); i++) { - if (!mir_strcmp(ack->szModule, startupSettings[i].szName)) { - startupSettings[i].szName = ""; - log_debugA("StartupStatus: %s overridden by ME_PROTO_ACK, status will not be set", ack->szModule); - } - } - - return 0; -} - -static int StatusChange(WPARAM, LPARAM lParam) -{ - // change by menu - if (!db_get_b(NULL, MODULENAME, SETTING_OVERRIDE, 1) || startupSettings.getCount() == 0) - return 0; - - char *szProto = (char *)lParam; - if (szProto == NULL) { // global status change - for (int i = 0; i < startupSettings.getCount(); i++) { - startupSettings[i].szName = ""; - log_debugA("StartupStatus: all protos overridden by ME_CLIST_STATUSMODECHANGE, status will not be set"); - } - } - else { - for (int i = 0; i < startupSettings.getCount(); i++) { - if (!mir_strcmp(startupSettings[i].szName, szProto)) { - startupSettings[i].szName = ""; - log_debugA("StartupStatus: %s overridden by ME_CLIST_STATUSMODECHANGE, status will not be set", szProto); - } - } - } - - return 0; -} - -static int CSStatusChangeEx(WPARAM wParam, LPARAM) -{ - // another status plugin made the change - if (!db_get_b(NULL, MODULENAME, SETTING_OVERRIDE, 1) || startupSettings.getCount() == 0) - return 0; - - if (wParam != 0) { - PROTOCOLSETTINGEX** ps = *(PROTOCOLSETTINGEX***)wParam; - if (ps == NULL) - return -1; - - for (int i = 0; i < startupSettings.getCount(); i++) { - for (int j = 0; j < startupSettings.getCount(); j++) { - if (ps[i]->szName == NULL || startupSettings[j].szName == NULL) - continue; - - if (!mir_strcmp(ps[i]->szName, startupSettings[j].szName)) { - log_debugA("StartupStatus: %s overridden by MS_CS_SETSTATUSEX, status will not be set", ps[i]->szName); - // use a hack to disable this proto - startupSettings[j].szName = ""; - } - } - } - } - - return 0; -} - -static void CALLBACK SetStatusTimed(HWND, UINT, UINT_PTR, DWORD) -{ - KillTimer(NULL, setStatusTimerId); - UnhookEvent(hProtoAckHook); - UnhookEvent(hCSStatusChangeHook); - UnhookEvent(hStatusChangeHook); - CallService(MS_CS_SETSTATUSEX, (WPARAM)&startupSettings, 0); -} - -static int OnOkToExit(WPARAM, LPARAM) -{ - // save last protocolstatus - int count; - PROTOACCOUNT** protos; - Proto_EnumAccounts(&count, &protos); - - for (int i = 0; i < count; i++) { - PROTOACCOUNT *pa = protos[i]; - if (!IsSuitableProto(pa)) - continue; - - if (!Proto_GetAccount(pa->szModuleName)) - continue; - - char lastName[128], lastMsg[128]; - mir_snprintf(lastName, "%s%s", PREFIX_LAST, pa->szModuleName); - db_set_w(NULL, MODULENAME, lastName, (WORD)CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0)); - mir_snprintf(lastMsg, "%s%s", PREFIX_LASTMSG, pa->szModuleName); - db_unset(NULL, MODULENAME, lastMsg); - - if (!(CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND & ~PF1_INDIVMODEMSG)) - continue; - - int status = CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0); - if (!(CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(status))) - continue; - - // NewAwaySys - if (ServiceExists(MS_NAS_GETSTATE)) { - NAS_PROTOINFO npi = { sizeof(npi) }; - npi.szProto = pa->szModuleName; - CallService(MS_NAS_GETSTATE, (WPARAM)&npi, 1); - if (npi.szMsg == NULL) { - npi.status = 0; - npi.szProto = NULL; - CallService(MS_NAS_GETSTATE, (WPARAM)&npi, 1); - } - if (npi.szMsg != NULL) { - db_set_ws(NULL, MODULENAME, lastMsg, npi.tszMsg); - mir_free(npi.tszMsg); - } - } - } - - if (db_get_b(NULL, MODULENAME, SETTING_SETPROFILE, 1) || db_get_b(NULL, MODULENAME, SETTING_OFFLINECLOSE, 0)) { - if (ServiceExists(MS_CLIST_SETSTATUSMODE)) - CallService(MS_CLIST_SETSTATUSMODE, ID_STATUS_OFFLINE, 0); - else - log_debugA("StartupStatus: MS_CLIST_SETSTATUSMODE not available!"); - } - - return 0; -} - -static int OnShutdown(WPARAM, LPARAM) -{ - DeinitProfilesModule(); - - // set windowstate and docked for next startup - if (db_get_b(NULL, MODULENAME, SETTING_SETWINSTATE, 0)) { - int state = db_get_b(NULL, MODULENAME, SETTING_WINSTATE, SETTING_STATE_NORMAL); - HWND hClist = pcli->hwndContactList; - BOOL isHidden = !IsWindowVisible(hClist); - switch (state) { - case SETTING_STATE_HIDDEN: - // try to use services where possible - if (!isHidden) - pcli->pfnShowHide(); - break; - - case SETTING_STATE_MINIMIZED: - if (!db_get_b(NULL, MODULE_CLIST, SETTING_TOOLWINDOW, 0)) - ShowWindow(hClist, SW_SHOWMINIMIZED); - break; - - case SETTING_STATE_NORMAL: - // try to use services where possible (that's what they're for) - if (isHidden) - pcli->pfnShowHide(); - break; - } - } - - // hangup - if (db_get_b(NULL, MODULENAME, SETTING_AUTOHANGUP, 0)) - InternetAutodialHangup(0); - - int state = db_get_b(NULL, MODULENAME, SETTING_WINSTATE, SETTING_STATE_NORMAL); - // set windowstate and docked for next startup - if (db_get_b(NULL, MODULENAME, SETTING_SETWINSTATE, 0)) - db_set_b(NULL, MODULE_CLIST, SETTING_WINSTATE, (BYTE)state); - - if (hMessageWindow) - DestroyWindow(hMessageWindow); - - startupSettings.destroy(); - return 0; -} - -/* Window proc for poweroff event */ -static DWORD CALLBACK MessageWndProc(HWND, UINT msg, WPARAM wParam, LPARAM) -{ - switch (msg) { - case WM_ENDSESSION: - log_debugA("WM_ENDSESSION"); - if (wParam) { - log_debugA("WM_ENDSESSION: calling exit"); - OnShutdown(0, 0); - log_debugA("WM_ENDSESSION: exit called"); - } - break; - } - - return TRUE; -} - -int CSModuleLoaded(WPARAM, LPARAM) -{ - protoList = (OBJLIST*)&startupSettings; - - InitProfileModule(); - - HookEvent(ME_PROTO_ACCLISTCHANGED, OnAccChanged); - HookEvent(ME_OPT_INITIALISE, OptionsInit); - - /* shutdown hook for normal shutdown */ - HookEvent(ME_SYSTEM_OKTOEXIT, OnOkToExit); - HookEvent(ME_SYSTEM_PRESHUTDOWN, OnShutdown); - /* message window for poweroff */ - hMessageWindow = CreateWindowEx(0, L"STATIC", NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL); - SetWindowLongPtr(hMessageWindow, GWLP_WNDPROC, (LONG_PTR)MessageWndProc); - - GetProfile(-1, startupSettings); - - // override with cmdl - ProcessCommandLineOptions(startupSettings); - if (startupSettings.getCount() == 0) - return 0;// no protocols are loaded - - SetLastStatusMessages(startupSettings); - showDialogOnStartup = (showDialogOnStartup || db_get_b(NULL, MODULENAME, SETTING_SHOWDIALOG, 0)); - - // dial - if (showDialogOnStartup || db_get_b(NULL, MODULENAME, SETTING_SETPROFILE, 1)) - if (db_get_b(NULL, MODULENAME, SETTING_AUTODIAL, 0)) - InternetAutodial(0, NULL); - - // set the status! - if (showDialogOnStartup || db_get_b(NULL, MODULENAME, SETTING_SHOWDIALOG, 0)) - CallService(MS_CS_SHOWCONFIRMDLGEX, (WPARAM)&startupSettings, db_get_dw(NULL, MODULENAME, SETTING_DLGTIMEOUT, 5)); - else if (db_get_b(NULL, MODULENAME, SETTING_SETPROFILE, 1)) { - // set hooks for override - if (db_get_b(NULL, MODULENAME, SETTING_OVERRIDE, 1)) { - hProtoAckHook = HookEvent(ME_PROTO_ACK, ProcessProtoAck); - hCSStatusChangeHook = HookEvent(ME_CS_STATUSCHANGEEX, CSStatusChangeEx); - hStatusChangeHook = HookEvent(ME_CLIST_STATUSMODECHANGE, StatusChange); - } - setStatusTimerId = SetTimer(NULL, 0, db_get_dw(NULL, MODULENAME, SETTING_SETPROFILEDELAY, 500), SetStatusTimed); - } - - // win size and location - if (db_get_b(NULL, MODULENAME, SETTING_SETWINLOCATION, 0) || db_get_b(NULL, MODULENAME, SETTING_SETWINSIZE, 0)) { - HWND hClist = pcli->hwndContactList; - - // store in db - if (db_get_b(NULL, MODULENAME, SETTING_SETWINLOCATION, 0)) { - db_set_dw(NULL, MODULE_CLIST, SETTING_XPOS, db_get_dw(NULL, MODULENAME, SETTING_XPOS, 0)); - db_set_dw(NULL, MODULE_CLIST, SETTING_YPOS, db_get_dw(NULL, MODULENAME, SETTING_YPOS, 0)); - } - if (db_get_b(NULL, MODULENAME, SETTING_SETWINSIZE, 0)) { - db_set_dw(NULL, MODULE_CLIST, SETTING_WIDTH, db_get_dw(NULL, MODULENAME, SETTING_WIDTH, 0)); - if (!db_get_b(NULL, MODULE_CLUI, SETTING_AUTOSIZE, 0)) - db_set_dw(NULL, MODULE_CLIST, SETTING_HEIGHT, db_get_dw(NULL, MODULENAME, SETTING_HEIGHT, 0)); - } - - WINDOWPLACEMENT wndpl = { sizeof(wndpl) }; - if (GetWindowPlacement(hClist, &wndpl)) { - if (wndpl.showCmd == SW_SHOWNORMAL && !Clist_IsDocked()) { - RECT rc; - if (GetWindowRect(hClist, &rc)) { - int x = rc.left; - int y = rc.top; - int width = rc.right - rc.left; - int height = rc.bottom - rc.top; - if (db_get_b(NULL, MODULENAME, SETTING_SETWINLOCATION, 0)) { - x = db_get_dw(NULL, MODULENAME, SETTING_XPOS, x); - y = db_get_dw(NULL, MODULENAME, SETTING_YPOS, y); - } - if (db_get_b(NULL, MODULENAME, SETTING_SETWINSIZE, 0)) { - width = db_get_dw(NULL, MODULENAME, SETTING_WIDTH, width); - if (!db_get_b(NULL, MODULE_CLUI, SETTING_AUTOSIZE, 0)) - height = db_get_dw(NULL, MODULENAME, SETTING_HEIGHT, height); - } - MoveWindow(hClist, x, y, width, height, TRUE); - } } } } - - return 0; -} diff --git a/plugins/StatusPlugins/StartupStatus/startupstatus.h b/plugins/StatusPlugins/StartupStatus/startupstatus.h deleted file mode 100644 index 5303ab3468..0000000000 --- a/plugins/StatusPlugins/StartupStatus/startupstatus.h +++ /dev/null @@ -1,161 +0,0 @@ -/* - StartupStatus Plugin for Miranda-IM (www.miranda-im.org) - Copyright 2003-2006 P. Boon - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -#ifndef __STARTUPSTATUSHEADER -#define __STARTUPSTATUSHEADER - -#include -#include -#include -#include -#include "version.h" - -#define MODULENAME "StartupStatus" - -struct TSSSetting : public PROTOCOLSETTINGEX, public MZeroedObject -{ - TSSSetting(PROTOACCOUNT *pa); - TSSSetting(int profile, PROTOACCOUNT *pa); - ~TSSSetting(); -}; - -typedef OBJLIST TSettingsList; - -struct PROFILECE -{ - int profile; - char *szProto; - wchar_t *msg; -}; - -struct PROFILEOPTIONS : public MZeroedObject -{ - __inline ~PROFILEOPTIONS() - { - delete ps; - mir_free(tszName); - } - - wchar_t *tszName; - TSettingsList* ps; - BOOL showDialog; - BOOL createTtb; - BOOL createMmi; - BOOL inSubMenu; - BOOL regHotkey; - WORD hotKey; -}; - -typedef struct { - ATOM id; - int profile; -} HKINFO; - -#define UM_REINITPROFILES WM_USER + 1 -#define UM_SETPROFILE WM_USER + 2 -#define UM_SETPROTOCOL WM_USER + 3 -#define UM_SETSTATUSMSG WM_USER + 4 -#define UM_ADDPROFILE WM_USER + 5 -#define UM_DELPROFILE WM_USER + 6 -#define UM_REINITDOCKED WM_USER + 7 -#define UM_REINITWINSTATE WM_USER + 8 -#define UM_REINITWINSIZE WM_USER + 9 - -#define CLUIINTM_REDRAW (WM_USER+100) - -#define MODULE_CLIST "CList" -#define MODULE_CLUI "CLUI" -#define SETTING_STATUS "Status" - -#define SETTING_SETWINSTATE "SetState" -#define SETTING_WINSTATE "State" - -#define SETTING_SETDOCKED "SetDocked" -#define SETTING_DOCKED "Docked" - -#define SETTING_SHOWDIALOG "ShowDialog" -#define SETTING_OFFLINECLOSE "OfflineOnClose" -#define SETTING_SETPROFILE "SetStatusOnStartup" -#define SETTING_AUTODIAL "AutoDial" -#define SETTING_AUTOHANGUP "AutoHangup" - -#define SETTING_TOOLWINDOW "ToolWindow" - -#define SETTING_OVERRIDE "AllowOverride" - -#define SETTING_SETWINLOCATION "SetWinLoc" -#define SETTING_XPOS "x" -#define SETTING_YPOS "y" - -#define SETTING_SETWINSIZE "SetWinSize" -#define SETTING_WIDTH "Width" -#define SETTING_HEIGHT "Height" -#define SETTING_AUTOSIZE "AutoSize" - -#define SETTING_PROFILECOUNT "ProfileCount" -#define SETTING_DEFAULTPROFILE "DefaultProfile" -#define SETTING_PROFILENAME "ProfileName" -#define SETTING_CREATETTBBUTTON "CreateTTBButton" -#define SETTING_PROFILE_STSMSG "StatusMsg" -#define SETTING_SHOWCONFIRMDIALOG "profile_ShowDialog" -#define SETTING_CREATEMMITEM "CreateMMItem" -#define SETTING_INSUBMENU "InSubMenu" -#define SETTING_REGHOTKEY "RegHotKey" -#define SETTING_HOTKEY "HotKey" -#define SETTING_PROFILENO "ProfileNo" - -#define SETTING_SETPROFILEDELAY "SetStatusDelay" -#define SETTING_DLGTIMEOUT "DialogTimeout" - -#define SHORTCUT_DESC L"Miranda NG" -#define SHORTCUT_FILENAME L"\\Miranda NG.lnk" - -#define DOCKED_NONE 0 -#define DOCKED_LEFT 1 -#define DOCKED_RIGHT 2 - -#define MS_SS_MENUSETPROFILEPREFIX "StartupStatus/SetProfile_" - -// options -int OptionsInit(WPARAM wparam,LPARAM lparam); -char* OptName(int i, const char* setting); - -// startupstatus -int LoadMainOptions(); - -int CompareSettings( const TSSSetting* p1, const TSSSetting* p2 ); - -TSettingsList* GetCurrentProtoSettings(); - -// profile -int GetProfile(int profileID, TSettingsList& arSettings ); -wchar_t *GetStatusMessage(int profile, char *szProto); - -INT_PTR LoadAndSetProfile(WPARAM wParam, LPARAM lParam); -INT_PTR GetProfileCount(WPARAM wParam, LPARAM lParam); -INT_PTR GetProfileName(WPARAM wParam, LPARAM lParam); - -extern HANDLE hTTBModuleLoadedHook; -void RemoveTopToolbarButtons(); -int CreateTopToolbarButtons(WPARAM wParam, LPARAM lParam); - -int LoadProfileModule(); -int InitProfileModule(); -int DeinitProfilesModule(); - -#endif //__STARTUPSTATUSHEADER diff --git a/plugins/StatusPlugins/StartupStatus/toolbars.cpp b/plugins/StatusPlugins/StartupStatus/toolbars.cpp deleted file mode 100644 index acb76f5c28..0000000000 --- a/plugins/StatusPlugins/StartupStatus/toolbars.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - StartupStatus Plugin for Miranda-IM (www.miranda-im.org) - Copyright 2003-2006 P. Boon - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#include "../commonstatus.h" -#include "startupstatus.h" -#include "../resource.h" -#include - -#include - -#define MAX_MMITEMS 6 - -static LIST ttbButtons(1); - -static IconItem iconList[] = -{ - { LPGEN("Pressed toolbar icon"), "StartupStatus/TtbDown", IDI_TTBDOWN }, - { LPGEN("Released toolbar icon"), "StartupStatus/TtbUp", IDI_TTBUP }, -}; - -///////////////////////////////////////////////////////////////////////////////////////// - -void RemoveTopToolbarButtons() -{ - for (int i=ttbButtons.getCount()-1; i >= 0; i--) - CallService(MS_TTB_REMOVEBUTTON, (WPARAM)ttbButtons[i], 0); - ttbButtons.destroy(); -} - -int CreateTopToolbarButtons(WPARAM, LPARAM) -{ - if (iconList[0].hIcolib == NULL) - Icon_Register(hInst, "Toolbar/StartupStatus", iconList, _countof(iconList)); - - int profileCount = CallService(MS_SS_GETPROFILECOUNT, 0, 0); - - TTBButton ttb = { 0 }; - ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP; - ttb.pszService = MS_SS_LOADANDSETPROFILE; - for (int i=0; i < profileCount; i++) { - char setting[80]; - mir_snprintf(setting, "%d_%s", i, SETTING_CREATETTBBUTTON); - if (!db_get_b(NULL, MODULENAME, setting, FALSE)) - continue; - - DBVARIANT dbv; - mir_snprintf(setting, "%d_%s", i, SETTING_PROFILENAME); - if (db_get(NULL, MODULENAME, setting, &dbv)) - continue; - - ttb.hIconHandleDn = iconList[0].hIcolib; - ttb.hIconHandleUp = iconList[1].hIcolib; - ttb.wParamDown = ttb.wParamUp = i; - ttb.name = ttb.pszTooltipUp = dbv.pszVal; - HANDLE ttbAddResult = TopToolbar_AddButton(&ttb); - if (ttbAddResult) - ttbButtons.insert(ttbAddResult); - db_free(&dbv); - } - return 0; -} diff --git a/plugins/StatusPlugins/StartupStatus/version.h b/plugins/StatusPlugins/StartupStatus/version.h deleted file mode 100644 index 1760bbdcfb..0000000000 --- a/plugins/StatusPlugins/StartupStatus/version.h +++ /dev/null @@ -1,23 +0,0 @@ -// Set the version number here - it will affect the version resource and the version field of the pluginInfo structure -// (Be careful that you don't have the resource file open when you change this and rebuild, otherwise the changes may not -// take effect within the version resource) -// Do not forget to define symbol "_DEBUG" for resource compiler if you use debug configuration (in VisualStudio you can -// find it under Project properties - Configuration properties - Resource - General - Preprocessor definitions) - -// plugin version part -#define __MAJOR_VERSION 0 -#define __MINOR_VERSION 8 -#define __RELEASE_NUM 0 -#define __BUILD_NUM 48 - -// other stuff for Version resource -#include - -// stuff that will be used in PluginInfo section and in Version resource -#define __PLUGIN_NAME "StartupStatus" -#define __FILENAME "StartupStatus.dll" -#define __DESC "StartupStatus, allows you to define the status Miranda should set on startup, configurable per protocol." -#define __AUTHOR "P Boon" -#define __AUTHOREMAIL "unregistered@users.sourceforge.net" -#define __AUTHORWEB "http://miranda-ng.org/p/StartupStatus/" -#define __COPYRIGHT "© 2003-08 P. Boon, 2008-16 George Hazan" diff --git a/plugins/StatusPlugins/commonstatus.cpp b/plugins/StatusPlugins/commonstatus.cpp deleted file mode 100644 index 621f5f372c..0000000000 --- a/plugins/StatusPlugins/commonstatus.cpp +++ /dev/null @@ -1,328 +0,0 @@ -/* - AdvancedAutoAway Plugin for Miranda-IM (www.miranda-im.org) - KeepStatus Plugin for Miranda-IM (www.miranda-im.org) - StartupStatus Plugin for Miranda-IM (www.miranda-im.org) - Copyright 2003-2006 P. Boon - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#include "commonstatus.h" - -// handles for hooks and other Miranda thingies -static HANDLE hCSStatusChangedExEvent; - -OBJLIST *protoList; - -// prototypes -char* StatusModeToDbSetting(int status, const char *suffix); -DWORD StatusModeToProtoFlag(int status); -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) -{ - char *prefix; - static char str[64]; - - switch (status) { - case ID_STATUS_AWAY: prefix = "Away"; break; - case ID_STATUS_NA: prefix = "Na"; break; - case ID_STATUS_DND: prefix = "Dnd"; break; - case ID_STATUS_OCCUPIED: prefix = "Occupied"; break; - case ID_STATUS_FREECHAT: prefix = "FreeChat"; break; - case ID_STATUS_ONLINE: prefix = "On"; break; - case ID_STATUS_OFFLINE: prefix = "Off"; break; - case ID_STATUS_INVISIBLE: prefix = "Inv"; break; - case ID_STATUS_ONTHEPHONE: prefix = "Otp"; break; - case ID_STATUS_OUTTOLUNCH: prefix = "Otl"; break; - default: return NULL; - } - mir_strcpy(str, prefix); mir_strcat(str, suffix); - return str; -} - -DWORD StatusModeToProtoFlag(int status) -{ - // *not* the same as in core, - switch (status) { - case ID_STATUS_ONLINE: return PF2_ONLINE; - case ID_STATUS_OFFLINE: return PF2_OFFLINE; - case ID_STATUS_INVISIBLE: return PF2_INVISIBLE; - case ID_STATUS_OUTTOLUNCH: return PF2_OUTTOLUNCH; - case ID_STATUS_ONTHEPHONE: return PF2_ONTHEPHONE; - case ID_STATUS_AWAY: return PF2_SHORTAWAY; - case ID_STATUS_NA: return PF2_LONGAWAY; - case ID_STATUS_OCCUPIED: return PF2_LIGHTDND; - case ID_STATUS_DND: return PF2_HEAVYDND; - case ID_STATUS_FREECHAT: return PF2_FREECHAT; - } - return 0; -} - -int GetActualStatus(PROTOCOLSETTINGEX *protoSetting) -{ - if (protoSetting->status == ID_STATUS_LAST) { - if ((protoSetting->lastStatus < MIN_STATUS) || (protoSetting->lastStatus > MAX_STATUS)) - return CallProtoService(protoSetting->szName, PS_GETSTATUS, 0, 0); - return protoSetting->lastStatus; - } - if (protoSetting->status == ID_STATUS_CURRENT) - return CallProtoService(protoSetting->szName, PS_GETSTATUS, 0, 0); - - if ((protoSetting->status < ID_STATUS_OFFLINE) || (protoSetting->status > ID_STATUS_OUTTOLUNCH)) { - log_debugA("invalid status detected: %d", protoSetting->status); - return 0; - } - return protoSetting->status; -} - -// helper, from core -static wchar_t* GetDefaultMessage(int status) -{ - switch (status) { - case ID_STATUS_AWAY: return TranslateT("I've been away since %time%."); - case ID_STATUS_NA: return TranslateT("Give it up, I'm not in!"); - case ID_STATUS_OCCUPIED: return TranslateT("Not right now."); - case ID_STATUS_DND: return TranslateT("Give a guy some peace, would ya?"); - case ID_STATUS_FREECHAT: return TranslateT("I'm a chatbot!"); - case ID_STATUS_ONLINE: return TranslateT("Yep, I'm here."); - case ID_STATUS_OFFLINE: return TranslateT("Nope, not here."); - case ID_STATUS_INVISIBLE: return TranslateT("I'm hiding from the mafia."); - case ID_STATUS_ONTHEPHONE: return TranslateT("That'll be the phone."); - case ID_STATUS_OUTTOLUNCH: return TranslateT("Mmm... food."); - case ID_STATUS_IDLE: return TranslateT("idleeeeeeee"); - } - return NULL; -} - -wchar_t* GetDefaultStatusMessage(PROTOCOLSETTINGEX *ps, int newstatus) -{ - if (ps->szMsg != NULL) {// custom message set - log_infoA("CommonStatus: Status message set by calling plugin"); - return mir_wstrdup(ps->szMsg); - } - - wchar_t *tMsg = (wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGW, newstatus, (LPARAM)ps->szName); - log_debugA("CommonStatus: Status message retrieved from general awaysys: %S", tMsg); - return tMsg; -} - -static int equalsGlobalStatus(PROTOCOLSETTINGEX **ps) -{ - - int i, j, pstatus = 0, gstatus = 0; - - for (i = 0; i < protoList->getCount(); i++) - if (ps[i]->szMsg != NULL && GetActualStatus(ps[i]) != ID_STATUS_OFFLINE) - return 0; - - int count; - PROTOACCOUNT **protos; - Proto_EnumAccounts(&count, &protos); - - for (i = 0; i < count; i++) { - if (!IsSuitableProto(protos[i])) - continue; - - pstatus = 0; - for (j = 0; j < protoList->getCount(); j++) - if (!mir_strcmp(protos[i]->szModuleName, ps[j]->szName)) - pstatus = GetActualStatus(ps[j]); - - if (pstatus == 0) - pstatus = CallProtoService(protos[i]->szModuleName, PS_GETSTATUS, 0, 0); - - if (db_get_b(NULL, protos[i]->szModuleName, "LockMainStatus", 0)) { - // if proto is locked, pstatus must be the current status - if (pstatus != CallProtoService(protos[i]->szModuleName, PS_GETSTATUS, 0, 0)) - return 0; - } - else { - if (gstatus == 0) - gstatus = pstatus; - - if (pstatus != gstatus) - return 0; - } - } - - return gstatus; -} - -static void SetStatusMsg(PROTOCOLSETTINGEX *ps, int newstatus) -{ - wchar_t* tszMsg = GetDefaultStatusMessage(ps, newstatus); - if (tszMsg) { - /* replace the default vars in msg (I believe this is from core) */ - for (int j = 0; tszMsg[j]; j++) { - if (tszMsg[j] != '%') - continue; - - wchar_t substituteStr[128]; - if (!wcsnicmp(tszMsg + j, L"%time%", 6)) - GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, 0, 0, substituteStr, _countof(substituteStr)); - else if (!wcsnicmp(tszMsg + j, L"%date%", 6)) - GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, 0, 0, substituteStr, _countof(substituteStr)); - else - continue; - - if (mir_wstrlen(substituteStr) > 6) - tszMsg = (wchar_t*)mir_realloc(tszMsg, sizeof(wchar_t)*(mir_wstrlen(tszMsg) + 1 + mir_wstrlen(substituteStr) - 6)); - memmove(tszMsg + j + mir_wstrlen(substituteStr), tszMsg + j + 6, sizeof(wchar_t)*(mir_wstrlen(tszMsg) - j - 5)); - memcpy(tszMsg + j, substituteStr, sizeof(wchar_t)*mir_wstrlen(substituteStr)); - } - - wchar_t *szFormattedMsg = variables_parsedup(tszMsg, ps->tszAccName, NULL); - if (szFormattedMsg != NULL) { - mir_free(tszMsg); - tszMsg = szFormattedMsg; - } - } - log_debugA("CommonStatus sets status message for %s directly", ps->szName); - CallProtoService(ps->szName, PS_SETAWAYMSG, newstatus, (LPARAM)tszMsg); - mir_free(tszMsg); -} - -INT_PTR SetStatusEx(WPARAM wParam, LPARAM) -{ - PROTOCOLSETTINGEX** protoSettings = *(PROTOCOLSETTINGEX***)wParam; - if (protoSettings == NULL) - return -1; - - int globStatus = equalsGlobalStatus(protoSettings); - - // issue with setting global status; - // things get messy because SRAway hooks ME_CLIST_STATUSMODECHANGE, so the status messages of SRAway and - // commonstatus will clash - NotifyEventHooks(hCSStatusChangedExEvent, (WPARAM)&protoSettings, protoList->getCount()); - - // set all status messages first - for (int i = 0; i < protoList->getCount(); i++) { - char *szProto = protoSettings[i]->szName; - if (!Proto_GetAccount(szProto)) { - log_debugA("CommonStatus: %s is not loaded", szProto); - continue; - } - // some checks - int newstatus = GetActualStatus(protoSettings[i]); - if (newstatus == 0) { - log_debugA("CommonStatus: incorrect status for %s (%d)", szProto, protoSettings[i]->status); - continue; - } - int oldstatus = CallProtoService(szProto, PS_GETSTATUS, 0, 0); - // set last status - protoSettings[i]->lastStatus = oldstatus; - if (IsStatusConnecting(oldstatus)) { - // ignore if connecting, but it didn't came this far if it did - log_debugA("CommonStatus: %s is already connecting", szProto); - continue; - } - - // status checks - long protoFlag = Proto_Status2Flag(newstatus); - int b_Caps2 = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_2, 0) & protoFlag; - int b_Caps5 = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_5, 0) & protoFlag; - if (newstatus != ID_STATUS_OFFLINE && (!b_Caps2 || b_Caps5)) { - // status and status message for this status not supported - //log_debug("CommonStatus: status not supported %s", szProto); - continue; - } - - int b_Caps1 = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND & ~PF1_INDIVMODEMSG; - int b_Caps3 = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & protoFlag; - if (newstatus == oldstatus && (!b_Caps1 || !b_Caps3)) { - // no status change and status messages are not supported - //log_debug("CommonStatus: no change, %s (%d %d)", szProto, oldstatus, newstatus); - continue; - } - - // set status message first - if (b_Caps1 && b_Caps3) - SetStatusMsg(protoSettings[i], newstatus); - - // set the status - if (newstatus != oldstatus /*&& !(b_Caps1 && b_Caps3 && ServiceExists(MS_NAS_SETSTATE))*/) { - log_debugA("CommonStatus sets status for %s to %d", szProto, newstatus); - CallProtoService(szProto, PS_SETSTATUS, newstatus, 0); - } - } - - if (globStatus != 0) { - if (!ServiceExists(MS_CLIST_SETSTATUSMODE)) { - log_debugA("CommonStatus: MS_CLIST_SETSTATUSMODE not available!"); - return -1; - } - log_debugA("CommonStatus: setting global status %u", globStatus); - CallService(MS_CLIST_SETSTATUSMODE, globStatus, 0); - } - - return 0; -} - -static INT_PTR GetProtocolCountService(WPARAM, LPARAM) -{ - return GetProtoCount(); -} - -bool IsSuitableProto(PROTOACCOUNT *pa) -{ - return (pa == NULL) ? false : (pcli->pfnGetProtocolVisibility(pa->szModuleName) != 0); -} - -int GetProtoCount() -{ - int pCount = 0, count; - PROTOACCOUNT **accs; - Proto_EnumAccounts(&count, &accs); - - for (int i = 0; i < count; i++) - if (IsSuitableProto(accs[i])) - pCount++; - - return pCount; -} - -static int CreateServices() -{ - if (ServiceExists(MS_CS_SETSTATUSEX)) - return -1; - - hCSStatusChangedExEvent = CreateHookableEvent(ME_CS_STATUSCHANGEEX); - - CreateServiceFunction(MS_CS_SETSTATUSEX, SetStatusEx); - CreateServiceFunction(MS_CS_SHOWCONFIRMDLGEX, ShowConfirmDialogEx); - CreateServiceFunction(MS_CS_GETPROTOCOUNT, GetProtocolCountService); - return 0; -} - -static int onShutdown(WPARAM, LPARAM) -{ - DestroyHookableEvent(hCSStatusChangedExEvent); - return 0; -} - -int InitCommonStatus() -{ - if (!CreateServices()) - HookEvent(ME_SYSTEM_PRESHUTDOWN, onShutdown); - - return 0; -} diff --git a/plugins/StatusPlugins/commonstatus.h b/plugins/StatusPlugins/commonstatus.h deleted file mode 100644 index 2288cc0e34..0000000000 --- a/plugins/StatusPlugins/commonstatus.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - AdvancedAutoAway Plugin for Miranda-IM (www.miranda-im.org) - KeepStatus Plugin for Miranda-IM (www.miranda-im.org) - StartupStatus Plugin for Miranda-IM (www.miranda-im.org) - Copyright 2003-2006 P. Boon - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef COMMONSTATUSHEADER -#define COMMONSTATUSHEADER - -#define _CRT_SECURE_NO_WARNINGS - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "m_statusplugins.h" -#include -#include -#include - -#if defined( _WIN64 ) -#define __PLATFORM_NAME "64" -#else -#define __PLATFORM_NAME "" -#endif - -#include "../helpers/gen_helpers.h" - -#define UM_STSMSGDLGCLOSED WM_APP+1 -#define UM_CLOSECONFIRMDLG WM_APP+2 - -#define PREFIX_LAST "last_" -#define PREFIX_LASTMSG "lastmsg_" -#define DEFAULT_STATUS ID_STATUS_LAST -#define ID_STATUS_LAST 40081 // doesn't interfere with ID_STATUS_IDLE, since we don't use it. However this *is* a good lesson not to do this again. -#define ID_STATUS_CURRENT 40082 -#define ID_STATUS_DISABLED 41083 // this should not be send to setstatus(ex) -#define MAX_STATUS ID_STATUS_CURRENT -#define MIN_STATUS ID_STATUS_OFFLINE -#define DEF_CLOSE_TIME 5 //secs -#define PF2_OFFLINE 0x00000200 -static int statusModeList[] = { ID_STATUS_OFFLINE, ID_STATUS_ONLINE, ID_STATUS_AWAY, ID_STATUS_NA, ID_STATUS_OCCUPIED, ID_STATUS_DND, ID_STATUS_FREECHAT, ID_STATUS_INVISIBLE, ID_STATUS_ONTHEPHONE, ID_STATUS_OUTTOLUNCH }; -static int statusModePf2List[] = { PF2_OFFLINE, PF2_ONLINE, PF2_SHORTAWAY, PF2_LONGAWAY, PF2_LIGHTDND, PF2_HEAVYDND, PF2_FREECHAT, PF2_INVISIBLE, PF2_ONTHEPHONE, PF2_OUTTOLUNCH }; - -wchar_t *GetDefaultStatusMessage(PROTOCOLSETTINGEX *ps, int status); -int GetActualStatus(PROTOCOLSETTINGEX *protoSetting); -int InitCommonStatus(); -bool IsSuitableProto(PROTOACCOUNT *pa); - -/* SimpleAway */ - -// wParam = 0 -// lParam = 0 -// allways returns 1 -#define MS_SA_ISSARUNNING "SimpleAway/IsSARunning" - -extern HINSTANCE hInst; -extern OBJLIST* protoList; - -#endif //COMMONSTATUSHEADER diff --git a/plugins/StatusPlugins/confirmdialog.cpp b/plugins/StatusPlugins/confirmdialog.cpp deleted file mode 100644 index e19b1d0a55..0000000000 --- a/plugins/StatusPlugins/confirmdialog.cpp +++ /dev/null @@ -1,426 +0,0 @@ -/* - AdvancedAutoAway Plugin for Miranda-IM (www.miranda-im.org) - KeepStatus Plugin for Miranda-IM (www.miranda-im.org) - StartupStatus Plugin for Miranda-IM (www.miranda-im.org) - Copyright 2003-2006 P. Boon - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#include "commonstatus.h" -#include "resource.h" - -#define TIMER_ID 1 - -// variables -static HWND win; -static int timeOut; - -struct TConfirmSetting : public PROTOCOLSETTINGEX -{ - TConfirmSetting(const PROTOCOLSETTINGEX& x) - { - memcpy(this, &x, sizeof(PROTOCOLSETTINGEX)); - if (szMsg) - szMsg = wcsdup(szMsg); - } - - ~TConfirmSetting() - { - free(szMsg); - } -}; - -static int CompareSettings(const TConfirmSetting* p1, const TConfirmSetting* p2) -{ - return mir_strcmp(p1->szName, p2->szName); -} - -static OBJLIST *confirmSettings; - -static INT_PTR CALLBACK StatusMessageDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) -{ - static PROTOCOLSETTINGEX* protoSetting = NULL; - switch (msg) { - case WM_INITDIALOG: - TranslateDialogDefault(hwndDlg); - - protoSetting = (PROTOCOLSETTINGEX *)lParam; - if (protoSetting->szMsg == NULL) { - wchar_t* smsg = GetDefaultStatusMessage(protoSetting, GetActualStatus(protoSetting)); - if (smsg != NULL) { - SetDlgItemText(hwndDlg, IDC_STSMSG, smsg); - mir_free(smsg); - } - } - else SetDlgItemText(hwndDlg, IDC_STSMSG, protoSetting->szMsg); - - { - wchar_t desc[512]; - mir_snwprintf(desc, TranslateT("Set %s message for %s."), - pcli->pfnGetStatusModeDescription(GetActualStatus(protoSetting), 0), protoSetting->tszAccName); - SetDlgItemText(hwndDlg, IDC_DESCRIPTION, desc); - } - break; - - case WM_COMMAND: - switch (LOWORD(wParam)) { - case IDC_OK: - { - int len = SendDlgItemMessage(hwndDlg, IDC_STSMSG, WM_GETTEXTLENGTH, 0, 0); - if (len > 0) { - protoSetting->szMsg = (wchar_t*)realloc(protoSetting->szMsg, sizeof(wchar_t)*(len + 1)); - if (protoSetting->szMsg != NULL) - GetDlgItemText(hwndDlg, IDC_STSMSG, protoSetting->szMsg, len + 1); - } - SendMessage(GetParent(hwndDlg), UM_STSMSGDLGCLOSED, TRUE, 0); - EndDialog(hwndDlg, IDC_OK); - } - break; - - case IDC_CANCEL: - SendMessage(GetParent(hwndDlg), UM_STSMSGDLGCLOSED, 0, 0); - EndDialog(hwndDlg, IDC_CANCEL); - break; - } - break; - } - - return FALSE; -} - -static int SetStatusList(HWND hwndDlg) -{ - if (confirmSettings->getCount() == 0) - return -1; - - HWND hList = GetDlgItem(hwndDlg, IDC_STARTUPLIST); - wchar_t buf[100]; - - // create items - LVITEM lvItem = { 0 }; - lvItem.mask = LVIF_TEXT | LVIF_PARAM; - - for (int i = 0; i < confirmSettings->getCount(); i++) { - lvItem.pszText = (*confirmSettings)[i].tszAccName; - if (ListView_GetItemCount(hList) < confirmSettings->getCount()) - ListView_InsertItem(hList, &lvItem); - - int actualStatus; - switch ((*confirmSettings)[i].status) { - case ID_STATUS_LAST: actualStatus = (*confirmSettings)[i].lastStatus; break; - case ID_STATUS_CURRENT: actualStatus = CallProtoService((*confirmSettings)[i].szName, PS_GETSTATUS, 0, 0); break; - default: actualStatus = (*confirmSettings)[i].status; - } - wchar_t* status = pcli->pfnGetStatusModeDescription(actualStatus, 0); - switch ((*confirmSettings)[i].status) { - case ID_STATUS_LAST: - mir_snwprintf(buf, L"%s (%s)", TranslateT(""), status); - ListView_SetItemText(hList, lvItem.iItem, 1, buf); - break; - case ID_STATUS_CURRENT: - mir_snwprintf(buf, L"%s (%s)", TranslateT(""), status); - ListView_SetItemText(hList, lvItem.iItem, 1, buf); - break; - default: - ListView_SetItemText(hList, lvItem.iItem, 1, status); - } - - // status message - if (!((!((CallProtoService((*confirmSettings)[i].szName, PS_GETCAPS, (WPARAM)PFLAGNUM_1, 0)&PF1_MODEMSGSEND)&~PF1_INDIVMODEMSG)) || (!(CallProtoService((*confirmSettings)[i].szName, PS_GETCAPS, (WPARAM)PFLAGNUM_3, 0)&Proto_Status2Flag(actualStatus))))) { - wchar_t *msg = GetDefaultStatusMessage(&(*confirmSettings)[i], actualStatus); - if (msg != NULL) { - wchar_t* fMsg = variables_parsedup(msg, (*confirmSettings)[i].tszAccName, NULL); - ListView_SetItemText(hList, lvItem.iItem, 2, fMsg); - mir_free(fMsg); - mir_free(msg); - } - else ListView_SetItemText(hList, lvItem.iItem, 2, TranslateT("")); - } - else ListView_SetItemText(hList, lvItem.iItem, 2, TranslateT("")); - - ListView_SetColumnWidth(hList, 0, LVSCW_AUTOSIZE); - ListView_SetColumnWidth(hList, 2, LVSCW_AUTOSIZE); - lvItem.lParam = (LPARAM)&(*confirmSettings)[i]; - ListView_SetItem(hList, &lvItem); - lvItem.iItem++; - } - - // grey out status box - EnableWindow(GetDlgItem(hwndDlg, IDC_STATUS), (ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_STARTUPLIST), -1, LVNI_SELECTED) >= 0)); - return 0; -} - -static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) -{ - switch (msg) { - case WM_INITDIALOG: - TranslateDialogDefault(hwndDlg); - { - HWND hList = GetDlgItem(hwndDlg, IDC_STARTUPLIST); - SendMessage(hList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT); - - // create columns - LVCOLUMN lvCol = { 0 }; - lvCol.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM; - lvCol.pszText = TranslateT("Protocol"); - ListView_InsertColumn(hList, 0, &lvCol); - - lvCol.cx = 100; - lvCol.pszText = TranslateT("Status"); - ListView_InsertColumn(hList, 1, &lvCol); - - lvCol.pszText = TranslateT("Message"); - ListView_InsertColumn(hList, 2, &lvCol); - } - - // create items - SetStatusList(hwndDlg); - - EnableWindow(GetDlgItem(hwndDlg, IDC_SETSTSMSG), FALSE); - // fill profile combo box - if (!ServiceExists(MS_SS_GETPROFILE)) - EnableWindow(GetDlgItem(hwndDlg, IDC_PROFILE), FALSE); - else { - int defaultProfile; - int profileCount = (int)CallService(MS_SS_GETPROFILECOUNT, (WPARAM)&defaultProfile, 0); - for (int i = 0; i < profileCount; i++) { - wchar_t profileName[128]; - CallService(MS_SS_GETPROFILENAME, i, (LPARAM)profileName); - int item = SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_ADDSTRING, 0, (LPARAM)profileName); - SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_SETITEMDATA, item, i); - } - if (profileCount == 0) - EnableWindow(GetDlgItem(hwndDlg, IDC_PROFILE), FALSE); - else - SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_SETCURSEL, defaultProfile, 0); - } - // start timer - if (timeOut > 0) { - wchar_t text[32]; - mir_snwprintf(text, TranslateT("Closing in %d"), timeOut); - SetDlgItemText(hwndDlg, IDC_CLOSE, text); - SetTimer(hwndDlg, TIMER_ID, 1000, NULL); - } - return TRUE; - - case WM_TIMER: - { - wchar_t text[32]; - mir_snwprintf(text, TranslateT("Closing in %d"), timeOut - 1); - SetDlgItemText(hwndDlg, IDC_CLOSE, text); - if (timeOut <= 0) { - KillTimer(hwndDlg, TIMER_ID); - SendMessage(hwndDlg, UM_CLOSECONFIRMDLG, 0, 0); - } - else timeOut--; - } - break; - - case WM_COMMAND: - // stop timer - KillTimer(hwndDlg, TIMER_ID); - SetDlgItemText(hwndDlg, IDC_CLOSE, TranslateT("Close")); - if ((HIWORD(wParam) == CBN_SELCHANGE) || (HIWORD(wParam) == BN_CLICKED) || (HIWORD(wParam) == NM_CLICK)) { // something clicked - switch (LOWORD(wParam)) { - case IDC_PROFILE: - { - int profile = (int)SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETCURSEL, 0, 0), 0); - for (int i = 0; i < confirmSettings->getCount(); i++) - if ((*confirmSettings)[i].szMsg != NULL) { - free((*confirmSettings)[i].szMsg); - (*confirmSettings)[i].szMsg = NULL; - } - - CallService(MS_SS_GETPROFILE, (WPARAM)profile, (LPARAM)confirmSettings); - for (int i = 0; i < confirmSettings->getCount(); i++) - if ((*confirmSettings)[i].szMsg != NULL) // we free this later, copy to our memory space - (*confirmSettings)[i].szMsg = wcsdup((*confirmSettings)[i].szMsg); - - SetStatusList(hwndDlg); - } - break; - - case IDC_STATUS: - { - LVITEM lvItem = { 0 }; - lvItem.mask = LVIF_TEXT | LVIF_PARAM; - lvItem.iSubItem = 0; - lvItem.iItem = ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_STARTUPLIST), -1, LVNI_SELECTED); - if (lvItem.iItem == -1) - break; - - ListView_GetItem(GetDlgItem(hwndDlg, IDC_STARTUPLIST), &lvItem); - PROTOCOLSETTINGEX* proto = (PROTOCOLSETTINGEX*)lvItem.lParam; - int actualStatus = proto->status = (int)SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_GETCURSEL, 0, 0), 0); - - // LAST STATUS - if (proto->status == ID_STATUS_LAST) { - wchar_t last[80]; - mir_snwprintf(last, L"%s (%s)", TranslateT(""), pcli->pfnGetStatusModeDescription(proto->lastStatus, 0)); - ListView_SetItemText(GetDlgItem(hwndDlg, IDC_STARTUPLIST), lvItem.iItem, 1, last); - actualStatus = proto->lastStatus; - } - - // CURRENT STATUS - else if (proto->status == ID_STATUS_CURRENT) { - int currentStatus = CallProtoService(proto->szName, PS_GETSTATUS, 0, 0); - wchar_t current[80]; - mir_snwprintf(current, L"%s (%s)", TranslateT(""), pcli->pfnGetStatusModeDescription(currentStatus, 0)); - ListView_SetItemText(GetDlgItem(hwndDlg, IDC_STARTUPLIST), lvItem.iItem, 1, current); - actualStatus = currentStatus; - } - else ListView_SetItemText(GetDlgItem(hwndDlg, IDC_STARTUPLIST), lvItem.iItem, 1, pcli->pfnGetStatusModeDescription(proto->status, 0)); - - if ((!((CallProtoService(proto->szName, PS_GETCAPS, (WPARAM)PFLAGNUM_1, 0)&PF1_MODEMSGSEND)&~PF1_INDIVMODEMSG)) || (!(CallProtoService(proto->szName, PS_GETCAPS, (WPARAM)PFLAGNUM_3, 0)&Proto_Status2Flag(actualStatus)))) - EnableWindow(GetDlgItem(hwndDlg, IDC_SETSTSMSG), FALSE); - else if ((proto->status == ID_STATUS_LAST) || (proto->status == ID_STATUS_CURRENT)) - EnableWindow(GetDlgItem(hwndDlg, IDC_SETSTSMSG), TRUE); - else - EnableWindow(GetDlgItem(hwndDlg, IDC_SETSTSMSG), (CallProtoService(proto->szName, PS_GETCAPS, (WPARAM)PFLAGNUM_3, 0)&Proto_Status2Flag(actualStatus)) ? TRUE : FALSE); - SetStatusList(hwndDlg); - } - break; - - case IDC_SETSTSMSG: - { - LVITEM lvItem = { 0 }; - lvItem.mask = LVIF_TEXT | LVIF_PARAM; - lvItem.iSubItem = 0; - lvItem.iItem = ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_STARTUPLIST), -1, LVNI_SELECTED); - if (lvItem.iItem == -1) - break; - - ListView_GetItem(GetDlgItem(hwndDlg, IDC_STARTUPLIST), &lvItem); - DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SETSTSMSGDIALOG), hwndDlg, StatusMessageDlgProc, lvItem.lParam); - } - break; - - case IDC_CLOSE: - SendMessage(hwndDlg, UM_CLOSECONFIRMDLG, 0, 0); - break; - - case IDC_CANCEL: - DestroyWindow(hwndDlg); - break; - } - } - break; - - case WM_NOTIFY: - switch (((NMHDR*)lParam)->idFrom) { - case IDC_STARTUPLIST: - if (((NMHDR*)lParam)->code == NM_CLICK) { - KillTimer(hwndDlg, TIMER_ID); - SetDlgItemText(hwndDlg, IDC_CLOSE, TranslateT("Close")); - - LVITEM lvItem = { 0 }; - lvItem.mask = LVIF_TEXT | LVIF_PARAM; - lvItem.iSubItem = 0; - lvItem.iItem = ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_STARTUPLIST), -1, LVNI_SELECTED); - - if (ListView_GetItem(GetDlgItem(hwndDlg, IDC_STARTUPLIST), &lvItem) == FALSE) { - SetStatusList(hwndDlg); - break; - } - - PROTOCOLSETTINGEX *proto = (PROTOCOLSETTINGEX*)lvItem.lParam; - int flags = CallProtoService(proto->szName, PS_GETCAPS, PFLAGNUM_2, 0) & ~CallProtoService(proto->szName, PS_GETCAPS, (WPARAM)PFLAGNUM_5, 0); - // clear box and add new status, loop status and check if compatible with proto - SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_RESETCONTENT, 0, 0); - int actualStatus = proto->status; - - // last - wchar_t buf[100]; - mir_snwprintf(buf, L"%s (%s)", TranslateT(""), pcli->pfnGetStatusModeDescription(proto->lastStatus, 0)); - int item = SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_ADDSTRING, 0, (LPARAM)buf); - SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_SETITEMDATA, item, ID_STATUS_LAST); - if (proto->status == ID_STATUS_LAST) { - SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_SETCURSEL, item, 0); - actualStatus = proto->lastStatus; - } - - // current - int currentStatus = CallProtoService(proto->szName, PS_GETSTATUS, 0, 0); - mir_snwprintf(buf, L"%s (%s)", TranslateT(""), pcli->pfnGetStatusModeDescription(currentStatus, 0)); - item = SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_ADDSTRING, 0, (LPARAM)buf); - SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_SETITEMDATA, item, ID_STATUS_CURRENT); - if (proto->status == ID_STATUS_CURRENT) { - SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_SETCURSEL, item, 0); - actualStatus = currentStatus; - } - - for (int i = 0; i < _countof(statusModeList); i++) { - if (((flags & statusModePf2List[i]) || (statusModePf2List[i] == PF2_OFFLINE)) && (!((!(flags)& Proto_Status2Flag(statusModePf2List[i]))) || ((CallProtoService(proto->szName, PS_GETCAPS, (WPARAM)PFLAGNUM_5, 0)&Proto_Status2Flag(statusModePf2List[i]))))) { - wchar_t *statusMode = pcli->pfnGetStatusModeDescription(statusModeList[i], 0); - item = SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_ADDSTRING, 0, (LPARAM)statusMode); - SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_SETITEMDATA, item, statusModeList[i]); - if (statusModeList[i] == proto->status) - SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_SETCURSEL, item, 0); - } - } - - // enable status box - EnableWindow(GetDlgItem(hwndDlg, IDC_STATUS), (ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_STARTUPLIST), -1, LVNI_SELECTED) >= 0)); - if ((!((CallProtoService(proto->szName, PS_GETCAPS, PFLAGNUM_1, 0)&PF1_MODEMSGSEND)&~PF1_INDIVMODEMSG)) || (!(CallProtoService(proto->szName, PS_GETCAPS, PFLAGNUM_3, 0)&Proto_Status2Flag(actualStatus)))) - EnableWindow(GetDlgItem(hwndDlg, IDC_SETSTSMSG), FALSE); - else if (proto->status == ID_STATUS_LAST || proto->status == ID_STATUS_CURRENT) - EnableWindow(GetDlgItem(hwndDlg, IDC_SETSTSMSG), TRUE); - else - EnableWindow(GetDlgItem(hwndDlg, IDC_SETSTSMSG), (CallProtoService(proto->szName, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(actualStatus)) ? TRUE : FALSE); - } - } - break; - - case UM_STSMSGDLGCLOSED: - SetStatusList(hwndDlg); - break; - - case UM_CLOSECONFIRMDLG: - CallService(MS_CS_SETSTATUSEX, (WPARAM)confirmSettings, 0); - DestroyWindow(hwndDlg); - break; - - case WM_DESTROY: - delete confirmSettings; confirmSettings = 0; - break; - } - - return 0; -} - -INT_PTR ShowConfirmDialogEx(WPARAM wParam, LPARAM lParam) -{ - if (wParam == 0) - return -1; - - delete confirmSettings; - confirmSettings = new OBJLIST(10, CompareSettings); - - OBJLIST& param = *(OBJLIST*)wParam; - for (int i = 0; i < param.getCount(); i++) - confirmSettings->insert(new TConfirmSetting(param[i])); - - timeOut = lParam; - if (timeOut < 0) - timeOut = DEF_CLOSE_TIME; - - if (GetWindow(win, 0) == NULL) { - win = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_CONFIRMDIALOG), NULL, ConfirmDlgProc, NULL); - EnableWindow(win, TRUE); - } - - return (INT_PTR)win; -} diff --git a/plugins/StatusPlugins/copying.txt b/plugins/StatusPlugins/copying.txt deleted file mode 100644 index cff645bda5..0000000000 --- a/plugins/StatusPlugins/copying.txt +++ /dev/null @@ -1,346 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. - diff --git a/plugins/StatusPlugins/notick.ico b/plugins/StatusPlugins/notick.ico deleted file mode 100644 index 7f93490642..0000000000 Binary files a/plugins/StatusPlugins/notick.ico and /dev/null differ diff --git a/plugins/StatusPlugins/notick1.ico b/plugins/StatusPlugins/notick1.ico deleted file mode 100644 index 609504d614..0000000000 Binary files a/plugins/StatusPlugins/notick1.ico and /dev/null differ diff --git a/plugins/StatusPlugins/resource.h b/plugins/StatusPlugins/resource.h deleted file mode 100644 index e64104da80..0000000000 --- a/plugins/StatusPlugins/resource.h +++ /dev/null @@ -1,168 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by resource.rc -// -#define IDD_OPT_KEEPSTATUS 101 -#define IDD_OPT_KS_BASIC 101 -#define IDD_CONFIRMDIALOG 102 -#define IDD_OPT_AUTOAWAY 104 -#define IDD_CMDLOPTIONS 106 -#define IDD_ADDPROFILE 109 -#define IDD_OPT_STARTUPSTATUS 110 -#define IDD_PUOPT_KEEPSTATUS 113 -#define IDD_OPT_AUTOAWAYMSG 114 -#define IDI_TICK 117 -#define IDI_NOTICK 118 -#define IDD_OPT_GENAUTOAWAY 119 -#define IDD_OPT_KS_ACTION 120 -#define IDD_SETSTSMSGDIALOG 121 -#define IDD_OPT_STATUSPROFILES 123 -#define IDD_OPT_AAATABS 126 -#define IDD_OPT_TABS 126 -#define IDD_OPT_KS_ADV 127 -#define IDD_TRG_AAASTATECHANGE 128 -#define IDI_TTBDOWN 129 -#define IDI_TTBUP 130 -#define IDC_PROTOCOL 1000 -#define IDC_STATUS 1001 -#define IDC_PROFILE 1002 -#define IDC_STARTUPLIST 1008 -#define IDC_STATUSMSG 1008 -#define IDC_SETSTATUSONSTARTUP 1010 -#define IDC_SETPROFILE 1010 -#define IDC_SETWINDOW 1011 -#define IDC_SETWINSTATE 1011 -#define IDC_WINDOW 1012 -#define IDC_WINSTATE 1012 -#define IDC_CLOSE 1013 -#define IDC_SHOWDIALOG 1014 -#define IDC_OFFLINECLOSE 1016 -#define IDC_CONFIRM 1017 -#define IDC_SHOWCMDL 1018 -#define IDC_COPY 1019 -#define IDC_CMDL 1020 -#define IDC_OK 1021 -#define IDC_SHORTCUT 1022 -#define IDC_CHECKCONNECTION 1025 -#define IDC_MAXRETRIES 1026 -#define IDC_INITDELAY 1027 -#define IDC_SETSTATUSDELAY 1027 -#define IDC_SETPROFILEDELAY 1027 -#define IDC_DOCKED 1028 -#define IDC_SETDOCKED 1029 -#define IDC_MAXDELAY 1031 -#define IDC_INCREASEEXPONENTIAL 1032 -#define IDC_LNOTHING 1032 -#define IDC_LCLOSE 1033 -#define IDC_LV1STATUS 1035 -#define IDC_LV2STATUS 1036 -#define IDC_STATUSLIST 1037 -#define IDC_LV1AFTERSTR 1038 -#define IDC_SHOWCONNECTIONPOPUPS 1040 -#define IDC_ADDPROFILE 1041 -#define IDC_DELPROFILE 1042 -#define IDC_PROFILENAME 1043 -#define IDC_CANCEL 1044 -#define IDC_DEFAULTPROFILE 1045 -#define IDC_MONITORMIRANDA 1045 -#define IDC_WINCOLORS 1045 -#define IDC_CHKINET 1045 -#define IDC_IGNLOCK 1045 -#define IDC_CREATETTBBUTTONS 1046 -#define IDC_CREATETTB 1046 -#define IDC_PERPROTOCOLSETTINGS 1050 -#define IDC_SAMESETTINGS 1051 -#define IDC_RESETSTATUS 1052 -#define IDC_SETSTSMSG 1053 -#define IDC_DEFAULTCOLORS 1057 -#define IDC_ONLOCK 1057 -#define IDC_LOGINERR 1057 -#define IDC_LV2ONINACTIVE 1062 -#define IDC_CNCOTHERLOC 1062 -#define IDC_PUCONNLOST 1062 -#define IDC_DLGTIMEOUT 1063 -#define IDC_AWAYCHECKTIMEINSECS 1063 -#define IDC_STSMSG 1063 -#define IDC_PINGHOST 1063 -#define IDC_CONFIRMDELAY 1064 -#define IDC_PROTOCOLLIST 1066 -#define IDC_LCANCEL 1068 -#define IDC_RNOTHING 1069 -#define IDC_RCLOSE 1070 -#define IDC_RCANCEL 1071 -#define IDC_DELAY 1072 -#define IDC_BGCOLOR 1074 -#define IDC_TEXTCOLOR 1075 -#define IDC_PREV 1076 -#define IDC_LOGINERR_DELAY 1077 -#define IDC_PROTOLIST 1079 -#define IDC_ENABLECHECKING 1080 -#define IDC_DISABLECHECKING 1081 -#define IDC_IDLEWARNING 1084 -#define IDC_DESCRIPTION 1085 -#define IDC_CONTCHECK 1087 -#define IDC_BYPING 1088 -#define IDC_CHECKAPMRESUME 1089 -#define IDC_PUCONNRETRY 1090 -#define IDC_PURESULT 1091 -#define IDC_PUOTHER 1092 -#define IDC_DELAYFROMPU 1093 -#define IDC_DELAYCUSTOM 1094 -#define IDC_DELAYPERMANENT 1095 -#define IDC_LOGINERR_CANCEL 1096 -#define IDC_LOGINERR_SETDELAY 1097 -#define IDC_PUSHOWEXTRA 1098 -#define IDC_CREATEMMI 1100 -#define IDC_SETWINLOCATION 1104 -#define IDC_XPOS 1105 -#define IDC_YPOS 1106 -#define IDC_SETWINSIZE 1107 -#define IDC_WIDTH 1108 -#define IDC_HEIGHT 1109 -#define IDC_OVERRIDE 1111 -#define IDC_MIRANDAMSG 1112 -#define IDC_CUSTOMMSG 1113 -#define IDC_CURWINLOC 1114 -#define IDC_CURWINSIZE 1115 -#define IDC_HOTKEY 1116 -#define IDC_REGHOTKEY 1117 -#define IDC_VARIABLESHELP 1118 -#define IDC_AUTODIAL 1120 -#define IDC_AUTOHANGUP 1121 -#define IDC_MONITORKEYBOARD 1122 -#define IDC_MONITORMOUSE 1123 -#define IDC_IGNSYSKEYS 1124 -#define IDC_IGNALTCOMBO 1125 -#define IDC_FIRSTOFFLINE 1126 -#define IDC_INSUBMENU 1127 -#define IDC_MAXCONNECTINGTIME 1128 -#define IDC_TABS 1130 -#define IDC_NOLOCKED 1131 -#define IDC_PINGCOUNT 1132 -#define IDC_CNTDELAY 1133 -#define IDC_ENTERFIRST 1134 -#define IDC_ENTERSECOND 1135 -#define IDC_LEAVEFIRST 1136 -#define IDC_LEAVESECOND 1137 -#define IDC_BECOMEACTIVE 1138 -#define IDC_SCREENSAVE 1145 -#define IDC_TIMED 1146 -#define IDC_AWAYTIME 1147 -#define IDC_SETNA 1148 -#define IDC_NATIME 1149 -#define IDC_SCREENSAVE2 1150 -#define IDC_FULLSCREEN 1150 -#define IDC_RADUSEMIRANDA 1210 -#define IDC_RADUSECUSTOM 1212 -#define IDC_SETNASTR 1568 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 129 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1141 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/plugins/StatusPlugins/resource.rc b/plugins/StatusPlugins/resource.rc deleted file mode 100644 index 5553c4dbf6..0000000000 --- a/plugins/StatusPlugins/resource.rc +++ /dev/null @@ -1,409 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// German (Germany) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) -LANGUAGE LANG_GERMAN, SUBLANG_GERMAN -#pragma code_page(1252) - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_OPT_KS_BASIC DIALOGEX 0, 0, 292, 224 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - CONTROL "Check connection",IDC_CHECKCONNECTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,51,162,10 - EDITTEXT IDC_MAXRETRIES,21,70,22,14,ES_AUTOHSCROLL | ES_NUMBER - LTEXT "Maximum retries (0 - infinite)",IDC_STATIC,47,73,129,14 - GROUPBOX "Account connection",IDC_STATIC,3,32,286,116 - EDITTEXT IDC_INITDELAY,21,92,22,14,ES_AUTOHSCROLL | ES_NUMBER - LTEXT "Delay between retries (secs)",IDC_STATIC,47,95,130,17 - CONTROL "Show popups",IDC_SHOWCONNECTIONPOPUPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,12,269,10 - GROUPBOX "General",IDC_STATIC,3,0,286,30 - CONTROL "",IDC_PROTOCOLLIST,"SysListView32",LVS_REPORT | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,180,52,101,92 - CTEXT "Accounts to check",IDC_STATIC,180,41,96,8 - GROUPBOX "Dial-Up",IDC_STATIC,4,149,285,69 - CONTROL "Don't reconnect if no internet connection seems available",IDC_CHKINET, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,161,265,8 - CONTROL "Continuously check for internet connection",IDC_CONTCHECK, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,175,265,8 - CONTROL "Do so by pinging host",IDC_BYPING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,21,188,256,8 - EDITTEXT IDC_PINGHOST,36,198,237,14,ES_AUTOHSCROLL -END - -IDD_CONFIRMDIALOG DIALOGEX 0, 0, 257, 121 -STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "Confirm status" -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - PUSHBUTTON "Close",IDC_CLOSE,7,100,59,14 - COMBOBOX IDC_STATUS,185,100,65,101,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "List1",IDC_STARTUPLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,7,23,243,74 - PUSHBUTTON "Cancel",IDC_CANCEL,69,100,59,14 - LTEXT "Profile",IDC_STATIC,7,9,116,8 - COMBOBOX IDC_PROFILE,185,7,65,89,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Message",IDC_SETSTSMSG,131,100,50,14 -END - -IDD_OPT_AUTOAWAY DIALOGEX 0, 0, 284, 198 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - RTEXT "Account",IDC_STATIC,93,11,78,8 - COMBOBOX IDC_PROTOCOL,177,9,100,138,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP - RTEXT "Set",IDC_STATIC,5,41,33,8 - COMBOBOX IDC_LV1STATUS,41,39,65,101,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "when full-screen mode is active",IDC_FULLSCREEN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,60,152,10 - CONTROL "when screen saver engages",IDC_SCREENSAVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,73,152,10 - CONTROL "when workstation is locked",IDC_ONLOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,86,153,10 - CONTROL "after",IDC_TIMED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,100,32,8 - EDITTEXT IDC_AWAYTIME,51,98,26,12,ES_AUTOHSCROLL - LTEXT "minutes of inactivity",IDC_LV1AFTERSTR,82,100,87,8 - RTEXT "Set",IDC_STATIC,5,115,33,8 - COMBOBOX IDC_LV2STATUS,41,113,65,101,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "after",IDC_SETNA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,131,32,8 - EDITTEXT IDC_NATIME,51,129,26,12,ES_AUTOHSCROLL - LTEXT "minutes of level 1 mode",IDC_SETNASTR,82,131,86,8 - CONTROL "only set when inactive",IDC_LV2ONINACTIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,143,151,10 - CONTROL "Monitor Miranda's activity only",IDC_MONITORMIRANDA, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,9,155,168,12 - CONTROL "Reset status on return",IDC_RESETSTATUS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,9,168,168,11 - CONTROL "Confirm resetting status",IDC_CONFIRM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,9,181,168,10 - LTEXT "Only set if current status is",IDC_STATIC,180,42,95,8 - CONTROL "",IDC_STATUSLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,177,55,100,84 -END - -IDD_CMDLOPTIONS DIALOGEX 0, 0, 315, 82 -STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "Command line" -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - DEFPUSHBUTTON "OK",IDC_OK,257,61,51,14 - PUSHBUTTON "Copy to clipboard",IDC_COPY,132,61,120,14 - EDITTEXT IDC_CMDL,7,19,301,35,ES_MULTILINE | ES_READONLY - LTEXT "Command line:",IDC_STATIC,7,7,301,8 - PUSHBUTTON "Create shortcut",IDC_SHORTCUT,7,61,120,14 -END - -IDD_ADDPROFILE DIALOGEX 0, 0, 131, 60 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Add new profile" -FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN - DEFPUSHBUTTON "OK",IDC_OK,68,39,50,14 - PUSHBUTTON "Cancel",IDC_CANCEL,14,39,50,14 - EDITTEXT IDC_PROFILENAME,14,21,104,14,ES_AUTOHSCROLL - LTEXT "Profile name",IDC_STATIC,11,11,55,8 -END - -IDD_OPT_STARTUPSTATUS DIALOGEX 0, 0, 305, 223 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - COMBOBOX IDC_WINSTATE,209,34,80,60,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Set window state",IDC_SETWINSTATE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,209,22,80,10 - CONTROL "Show dialog",IDC_SHOWDIALOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,71,127,10 - CONTROL "Set status to offline before exit",IDC_OFFLINECLOSE, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,180,174,10 - PUSHBUTTON "Show CMDL",IDC_SHOWCMDL,14,194,53,14 - CONTROL "Activate status profile",IDC_SETPROFILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,20,89,10 - COMBOBOX IDC_DOCKED,209,64,80,60,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Set docked",IDC_SETDOCKED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,209,52,80,10 - GROUPBOX "Other",IDC_STATIC,7,166,182,50 - GROUPBOX "Status on startup",IDC_STATIC,7,7,182,102 - EDITTEXT IDC_SETPROFILEDELAY,57,35,28,14,ES_AUTOHSCROLL | ES_NUMBER - LTEXT "ms",IDC_STATIC,88,37,13,8 - LTEXT "Set after",IDC_STATIC,26,37,28,8 - EDITTEXT IDC_DLGTIMEOUT,57,86,28,14,ES_AUTOHSCROLL | ES_NUMBER - LTEXT "Timeout",IDC_STATIC,26,89,30,8 - LTEXT "s",IDC_STATIC,88,89,12,8 - CONTROL "Set window location",IDC_SETWINLOCATION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,209,82,80,10 - LTEXT "Left",IDC_STATIC,214,97,35,8 - EDITTEXT IDC_XPOS,259,94,30,14,ES_AUTOHSCROLL | ES_NUMBER - LTEXT "Top",IDC_STATIC,214,113,35,8 - EDITTEXT IDC_YPOS,259,110,30,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "Set window size",IDC_SETWINSIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,209,140,80,10 - LTEXT "Width",IDC_STATIC,214,155,35,8 - EDITTEXT IDC_WIDTH,259,152,30,14,ES_AUTOHSCROLL | ES_NUMBER - LTEXT "Height",IDC_STATIC,214,171,35,8 - EDITTEXT IDC_HEIGHT,259,168,30,14,ES_AUTOHSCROLL | ES_NUMBER - COMBOBOX IDC_PROFILE,105,19,78,92,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Allow override",IDC_OVERRIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,53,76,10 - LTEXT "Note: status profiles can be created in the 'Status profiles' options screen",IDC_STATIC,105,37,77,34 - LTEXT "",IDC_CURWINLOC,209,128,80,8 - LTEXT "",IDC_CURWINSIZE,209,186,80,8 - GROUPBOX "Window on startup",IDC_STATIC,194,7,104,209 - CONTROL "Automatically dial on startup",IDC_AUTODIAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,129,168,10 - CONTROL "Automatically hang up on exit",IDC_AUTOHANGUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,144,168,10 - GROUPBOX "Dial-up (experimental)",IDC_STATIC,7,113,182,49 -END - -IDD_PUOPT_KEEPSTATUS DIALOGEX 0, 0, 254, 223 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - CONTROL "",IDC_BGCOLOR,"ColourPicker",WS_TABSTOP,15,19,35,14 - LTEXT "Background color",IDC_STATIC,59,23,66,8 - CONTROL "",IDC_TEXTCOLOR,"ColourPicker",WS_TABSTOP,15,37,35,14 - LTEXT "Text color",IDC_STATIC,59,41,66,8 - CONTROL "Use Windows colors",IDC_WINCOLORS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,56,108,10 - CONTROL "Use default colors",IDC_DEFAULTCOLORS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,66,107,10 - GROUPBOX "Delay",IDC_STATIC,137,7,110,52 - EDITTEXT IDC_DELAY,221,30,20,14,ES_AUTOHSCROLL | ES_NUMBER - GROUPBOX "On left click",IDC_STATIC,7,84,103,51 - GROUPBOX "On right click",IDC_STATIC,137,84,101,51,WS_GROUP - CONTROL "Do nothing",IDC_LNOTHING,"Button",BS_AUTORADIOBUTTON | WS_GROUP,15,96,80,10 - CONTROL "Close popup",IDC_LCLOSE,"Button",BS_AUTORADIOBUTTON,15,108,79,10 - CONTROL "Cancel reconnecting",IDC_LCANCEL,"Button",BS_AUTORADIOBUTTON,15,120,94,10 - CONTROL "Do nothing",IDC_RNOTHING,"Button",BS_AUTORADIOBUTTON | WS_GROUP,143,96,78,10 - CONTROL "Close popup",IDC_RCLOSE,"Button",BS_AUTORADIOBUTTON,143,108,78,10 - CONTROL "Cancel reconnecting",IDC_RCANCEL,"Button",BS_AUTORADIOBUTTON,143,120,94,10 - GROUPBOX "Colors",IDC_STATIC,7,7,126,73 - PUSHBUTTON "Preview",IDC_PREV,137,63,50,14 - GROUPBOX "Events",IDC_STATIC,7,140,240,76 - CONTROL "Show when connection is lost",IDC_PUCONNLOST,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,153,226,10 - CONTROL "Show when a connection attempt is made",IDC_PUCONNRETRY, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,165,226,10 - CONTROL "Show when reconnection has finished",IDC_PURESULT, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,177,226,10 - CONTROL "Show other messages",IDC_PUOTHER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,189,226,10 - CONTROL "From popup plugin",IDC_DELAYFROMPU,"Button",BS_AUTORADIOBUTTON | WS_GROUP,143,19,94,10 - CONTROL "Custom",IDC_DELAYCUSTOM,"Button",BS_AUTORADIOBUTTON,143,32,47,10 - CONTROL "Permanent",IDC_DELAYPERMANENT,"Button",BS_AUTORADIOBUTTON,143,45,50,10 - CONTROL "Show additional information in popups",IDC_PUSHOWEXTRA, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,201,226,10 -END - -IDD_OPT_AUTOAWAYMSG DIALOGEX 0, 0, 263, 153 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - COMBOBOX IDC_STATUS,12,19,240,97,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Use Miranda's message setting",IDC_RADUSEMIRANDA,"Button",BS_AUTORADIOBUTTON,23,56,165,10 - CONTROL "Use this message:",IDC_RADUSECUSTOM,"Button",BS_AUTORADIOBUTTON,23,69,165,10 - EDITTEXT IDC_STATUSMSG,33,82,219,50,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL - LTEXT "Use %time% for the current time, %date% for the current date",IDC_STATIC,33,135,220,8 - PUSHBUTTON "Variables...",IDC_VARIABLESHELP,198,65,54,14,NOT WS_VISIBLE -END - -IDD_OPT_GENAUTOAWAY DIALOGEX 0, 0, 258, 191 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - CONTROL "Specify settings for each account",IDC_PERPROTOCOLSETTINGS, - "Button",BS_AUTORADIOBUTTON,20,20,220,10 - CONTROL "Use same settings for all accounts",IDC_SAMESETTINGS, - "Button",BS_AUTORADIOBUTTON,20,31,220,10 - CONTROL "Ignore Caps Lock, Num Lock and Scroll Lock keys",IDC_IGNLOCK, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,44,220,10 - LTEXT "Check interval (secs)",IDC_STATIC,21,125,133,8 - EDITTEXT IDC_AWAYCHECKTIMEINSECS,159,122,22,14,ES_AUTOHSCROLL - LTEXT "Confirm dialog timeout (secs)",IDC_STATIC,21,142,133,8 - EDITTEXT IDC_CONFIRMDELAY,159,138,22,14,ES_AUTOHSCROLL - CTEXT "You enabled ""Change my status mode to"" in the ""Idle"" options dialog, AdvancedAutoAway's options are ignored.",IDC_IDLEWARNING,7,164,244,20,NOT WS_VISIBLE - CONTROL "Monitor keyboard activity",IDC_MONITORKEYBOARD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,77,220,10 - CONTROL "Monitor mouse activity",IDC_MONITORMOUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,88,220,10 - CONTROL "Ignore CTRL, ALT, SHIFT, TAB, ESC and Windows keys",IDC_IGNSYSKEYS, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,55,220,10 - CONTROL "Ignore any key combination with above keys",IDC_IGNALTCOMBO, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,66,220,10 -END - -IDD_OPT_KS_ACTION DIALOGEX 0, 0, 140, 162 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - CONTROL "",IDC_PROTOLIST,"SysListView32",LVS_REPORT | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,16,63,100,72 - LTEXT "Accounts",IDC_STATIC,19,51,30,8 - CONTROL "Enable checking",IDC_ENABLECHECKING,"Button",BS_AUTORADIOBUTTON,16,17,69,10 - CONTROL "Disable checking",IDC_DISABLECHECKING,"Button",BS_AUTORADIOBUTTON,16,33,71,10 -END - -IDD_SETSTSMSGDIALOG DIALOG 0, 0, 240, 126 -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Set status message" -FONT 8, "MS Shell Dlg" -BEGIN - DEFPUSHBUTTON "OK",IDC_OK,183,105,50,14 - PUSHBUTTON "Cancel",IDC_CANCEL,127,105,50,14 - EDITTEXT IDC_STSMSG,7,19,226,79,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN - LTEXT "Set status message",IDC_DESCRIPTION,7,7,226,8 -END - -IDD_OPT_STATUSPROFILES DIALOGEX 0, 0, 305, 234 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - LTEXT "Account",IDC_STATIC,16,78,77,8 - LTEXT "Status",IDC_STATIC,156,78,77,8 - LISTBOX IDC_PROTOCOL,16,88,133,58,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - LISTBOX IDC_STATUS,156,88,133,58,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - LTEXT "Profile",IDC_STATIC,16,18,78,8 - PUSHBUTTON "Add...",IDC_ADDPROFILE,16,44,64,14 - PUSHBUTTON "Delete",IDC_DELPROFILE,81,44,67,14 - CONTROL "Create a TopToolBar button",IDC_CREATETTB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,156,27,135,10 - CONTROL "Show confirm dialog when loading",IDC_SHOWDIALOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,156,17,135,10 - COMBOBOX IDC_PROFILE,16,27,133,106,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Create a main menu item",IDC_CREATEMMI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,156,37,135,10 - EDITTEXT IDC_STATUSMSG,16,174,273,46,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN - GROUPBOX "Status profiles",IDC_STATIC,7,7,291,220 - CONTROL "Use Miranda's message setting",IDC_MIRANDAMSG,"Button",BS_AUTORADIOBUTTON,16,150,195,10 - CONTROL "Use this message:",IDC_CUSTOMMSG,"Button",BS_AUTORADIOBUTTON,16,161,192,10 - CONTROL "HotKey1",IDC_HOTKEY,"msctls_hotkey32",WS_BORDER | WS_TABSTOP,105,63,111,14 - CONTROL "Hotkey",IDC_REGHOTKEY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,64,88,10 - PUSHBUTTON "Variables...",IDC_VARIABLESHELP,215,157,74,14,NOT WS_VISIBLE - CONTROL "In submenu",IDC_INSUBMENU,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,169,47,119,10 -END - -IDD_OPT_TABS DIALOGEX 0, 0, 314, 250 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - CONTROL "Tab1",IDC_TABS,"SysTabControl32",0x0,3,4,306,242 -END - -IDD_OPT_KS_ADV DIALOGEX 0, 0, 292, 224 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - EDITTEXT IDC_MAXDELAY,11,32,22,14,ES_AUTOHSCROLL | ES_NUMBER - LTEXT "Max. delay (secs)",IDC_STATIC,39,35,84,8 - CONTROL "Increase delay exponential",IDC_INCREASEEXPONENTIAL, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,14,263,10 - CONTROL "Cancel all if an account connects from another location",IDC_CNCOTHERLOC, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,96,234,10 - CONTROL "Reconnect on APM resume",IDC_CHECKAPMRESUME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,108,234,10 - CONTROL "Stop trying to reconnect",IDC_LOGINERR_CANCEL,"Button",BS_AUTORADIOBUTTON,22,132,169,10 - CONTROL "Set delay to",IDC_LOGINERR_SETDELAY,"Button",BS_AUTORADIOBUTTON,22,143,110,12 - CONTROL "React on login errors",IDC_LOGINERR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,120,234,10 - EDITTEXT IDC_LOGINERR_DELAY,136,142,22,14,ES_AUTOHSCROLL | ES_NUMBER - LTEXT "seconds",IDC_STATIC,164,145,77,8 - CONTROL "Set account offline before a connection attempt",IDC_FIRSTOFFLINE, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,84,234,10 - EDITTEXT IDC_MAXCONNECTINGTIME,127,32,22,14,ES_AUTOHSCROLL | ES_NUMBER - LTEXT "Max. account connecting time (secs)",IDC_STATIC,154,35,121,19 - GROUPBOX "Timers",IDC_STATIC,3,2,284,54 - GROUPBOX "Reconnecting",IDC_STATIC,4,58,283,106 - CONTROL "Ignore locked status of accounts",IDC_NOLOCKED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,72,234,10 - GROUPBOX "Dial-Up",IDC_STATIC,5,166,282,51 - LTEXT "Consider connection lost after",IDC_STATIC,12,180,122,8 - EDITTEXT IDC_PINGCOUNT,135,177,22,14,ES_AUTOHSCROLL | ES_NUMBER - LTEXT "failed pings",IDC_STATIC,160,180,101,8 - EDITTEXT IDC_CNTDELAY,11,193,22,14,ES_AUTOHSCROLL | ES_NUMBER - LTEXT "Continuously check interval (secs)",IDC_STATIC,36,196,160,8 -END - -IDD_TRG_AAASTATECHANGE DIALOGEX 0, 0, 212, 144 -STYLE DS_SETFONT | DS_3DLOOK | WS_CHILD -EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - CONTROL "Entering first auto-away status",IDC_ENTERFIRST,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,24,110,10 - CONTROL "Entering second auto-away status",IDC_ENTERSECOND, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,37,123,10 - CONTROL "Leaving first auto-away status",IDC_LEAVEFIRST,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,50,109,10 - CONTROL "Leaving second auto-away status",IDC_LEAVESECOND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,63,122,10 - CONTROL "Becoming active without status change",IDC_BECOMEACTIVE, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,76,140,10 - GROUPBOX "Pre-conditions",IDC_STATIC,7,7,198,89 - GROUPBOX "TriggerData",IDC_STATIC,7,97,198,40 - LTEXT "Status: The status the account will change to\r\nAccount: The account changing state",IDC_STATIC,19,111,177,18 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_OPT_KS_BASIC, DIALOG - BEGIN - END - - IDD_OPT_AUTOAWAY, DIALOG - BEGIN - END - - IDD_OPT_TABS, DIALOG - BEGIN - BOTTOMMARGIN, 248 - END - - IDD_OPT_KS_ADV, DIALOG - BEGIN - END -END -#endif // APSTUDIO_INVOKED - -#endif // German (Germany) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/plugins/StatusPlugins/stdafx.cpp b/plugins/StatusPlugins/stdafx.cpp deleted file mode 100644 index 8adbd4ce11..0000000000 --- a/plugins/StatusPlugins/stdafx.cpp +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright (C) 2012-16 Miranda NG project (http://miranda-ng.org) - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation version 2 -of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#include "commonstatus.h" \ No newline at end of file diff --git a/plugins/StatusPlugins/useronli.ico b/plugins/StatusPlugins/useronli.ico deleted file mode 100644 index 2760c47d5c..0000000000 Binary files a/plugins/StatusPlugins/useronli.ico and /dev/null differ diff --git a/plugins/StatusPlugins/version.rc b/plugins/StatusPlugins/version.rc deleted file mode 100644 index 312430aa29..0000000000 --- a/plugins/StatusPlugins/version.rc +++ /dev/null @@ -1,43 +0,0 @@ -#ifdef APSTUDIO_INVOKED -#error this file is not editable by Microsoft Visual C++ -#endif //APSTUDIO_INVOKED - -#include "version.h" -#include "winres.h" - -#ifdef _WIN32 -LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL -#endif //_WIN32 - -VS_VERSION_INFO VERSIONINFO - FILEVERSION __FILEVERSION_STRING - PRODUCTVERSION __FILEVERSION_STRING - FILEFLAGSMASK VS_FFI_FILEFLAGSMASK -#ifdef _DEBUG - FILEFLAGS VS_FF_DEBUG -//#else -// FILEFLAGS 0x0L -#endif - - FILEOS VOS__WINDOWS32 - FILETYPE VFT_DLL - FILESUBTYPE VFT2_UNKNOWN -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "000004b0" // LOCALE_NEUTRAL<<16 + 1200 (ANSI - Unicode) - BEGIN - VALUE "Author", __AUTHOR - VALUE "FileDescription", __DESC - VALUE "InternalName", __PLUGIN_NAME - VALUE "LegalCopyright", __COPYRIGHT - VALUE "OriginalFilename", __FILENAME - VALUE "FileVersion", __VERSION_STRING - VALUE "ProductName", "Miranda NG" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", /*LOCALE_NEUTRAL from WinNT.h */ 0x0, 1200 - END -END diff --git a/tools/_deprecated/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj b/tools/_deprecated/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj new file mode 100644 index 0000000000..98d9991c15 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj @@ -0,0 +1,248 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + AdvancedAutoAway + {66503A70-B1E8-4545-B4FF-2108DFB40C72} + + + + DynamicLibrary + Unicode + true + + + DynamicLibrary + Unicode + + + DynamicLibrary + true + Unicode + + + DynamicLibrary + Unicode + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)\Plugins\ + $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)\Plugins\ + $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)64\Plugins\ + $(SolutionDir)$(Configuration)64\Plugins\ + $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ + true + + + + Disabled + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + _DEBUG;_WINDOWS;_USRDLL;ADVANCEDAUTOAWAY_EXPORTS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + Use + ..\commonstatus.h + Level3 + EditAndContinue + 4996;%(DisableSpecificWarnings) + false + + + _DEBUG;%(PreprocessorDefinitions) + ..\..\..\include\msapi + + + true + $(IntDir)$(TargetName).lib + Windows + 0x11bd0000 + false + $(ProfileDir)..\..\..\bin10\lib + UxTheme.lib;%(AdditionalDependencies) + + + + + Full + OnlyExplicitInline + Size + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + NDEBUG;_WINDOWS;_USRDLL;ADVANCEDAUTOAWAY_EXPORTS;%(PreprocessorDefinitions) + true + true + Use + ..\commonstatus.h + Level3 + 4996;%(DisableSpecificWarnings) + false + false + Fast + + + NDEBUG;%(PreprocessorDefinitions) + ..\..\..\include\msapi + + + true + true + true + 0x11bd0000 + $(IntDir)$(TargetName).lib + Windows + false + $(ProfileDir)..\..\..\bin10\lib + /PDBALTPATH:%_PDB% + UxTheme.lib;%(AdditionalDependencies) + + + + + Full + + + + + OnlyExplicitInline + + + + + + + + + Size + + + + + true + false + false + Fast + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + Use + ..\commonstatus.h + Level3 + NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + 4996;%(DisableSpecificWarnings) + AssemblyAndSourceCode + + + true + $(SolutionDir)\lib + + + true + true + $(IntDir)$(TargetName).lib + Windows + false + 0x11bd0000 + $(ProfileDir)..\..\..\bin10\lib + /PDBALTPATH:%_PDB% + UxTheme.lib;%(AdditionalDependencies) + + + ..\..\..\include\msapi + NDEBUG;%(PreprocessorDefinitions) + + + + + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + Use + ..\commonstatus.h + Level3 + Disabled + _DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + EnableFastChecks + 4996;%(DisableSpecificWarnings) + false + + + true + $(IntDir)$(TargetName).lib + Windows + false + 0x11bd0000 + $(ProfileDir)..\..\..\bin10\lib + UxTheme.lib;%(AdditionalDependencies) + + + ..\..\..\include\msapi + + + + + Create + commonstatus.h + + + + commonstatus.h + Use + + + commonstatus.h + + + NotUsing + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/_deprecated/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj.filters b/tools/_deprecated/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj.filters new file mode 100644 index 0000000000..fc5daed232 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj.filters @@ -0,0 +1,67 @@ + + + + + {6b60d98e-019d-49ff-a906-9090232d9213} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {b2e98f78-44f0-4095-880b-46a0ede02428} + h;hpp;hxx;hm;inl + + + {2d794d19-0987-4aa7-940d-2378ba7e4fdb} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + + + Resource Files + + + Resource Files + + + \ No newline at end of file diff --git a/tools/_deprecated/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_12.vcxproj b/tools/_deprecated/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_12.vcxproj new file mode 100644 index 0000000000..c1b9ee6adb --- /dev/null +++ b/tools/_deprecated/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_12.vcxproj @@ -0,0 +1,251 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + AdvancedAutoAway + {66503A70-B1E8-4545-B4FF-2108DFB40C72} + + + + DynamicLibrary + Unicode + true + v120_xp + + + DynamicLibrary + Unicode + v120_xp + + + DynamicLibrary + true + Unicode + v120_xp + + + DynamicLibrary + Unicode + v120_xp + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)\Plugins\ + $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)\Plugins\ + $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)64\Plugins\ + $(SolutionDir)$(Configuration)64\Plugins\ + $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ + true + + + + Disabled + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + _DEBUG;_WINDOWS;_USRDLL;ADVANCEDAUTOAWAY_EXPORTS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + Use + ..\commonstatus.h + Level3 + EditAndContinue + 4996;%(DisableSpecificWarnings) + false + + + _DEBUG;%(PreprocessorDefinitions) + ..\..\..\include\msapi + + + true + $(IntDir)$(TargetName).lib + Windows + 0x11bd0000 + false + $(ProfileDir)..\..\..\bin12\lib + false + UxTheme.lib;%(AdditionalDependencies) + + + + + Full + OnlyExplicitInline + Size + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + NDEBUG;_WINDOWS;_USRDLL;ADVANCEDAUTOAWAY_EXPORTS;%(PreprocessorDefinitions) + true + true + Use + ..\commonstatus.h + Level3 + 4996;%(DisableSpecificWarnings) + false + false + Fast + + + NDEBUG;%(PreprocessorDefinitions) + ..\..\..\include\msapi + + + true + true + true + 0x11bd0000 + $(IntDir)$(TargetName).lib + Windows + false + $(ProfileDir)..\..\..\bin12\lib + UxTheme.lib;%(AdditionalDependencies) + + + + + Full + + + + + OnlyExplicitInline + + + + + + + + + Size + + + + + true + false + false + Fast + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + Use + ..\commonstatus.h + Level3 + NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + 4996;%(DisableSpecificWarnings) + AssemblyAndSourceCode + + + true + $(SolutionDir)\lib + + + true + true + $(IntDir)$(TargetName).lib + Windows + false + 0x11bd0000 + $(ProfileDir)..\..\..\bin12\lib + UxTheme.lib;%(AdditionalDependencies) + + + ..\..\..\include\msapi + NDEBUG;%(PreprocessorDefinitions) + + + + + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + Use + ..\commonstatus.h + Level3 + Disabled + _DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + EnableFastChecks + 4996;%(DisableSpecificWarnings) + false + + + true + $(IntDir)$(TargetName).lib + Windows + false + 0x11bd0000 + $(ProfileDir)..\..\..\bin12\lib + UxTheme.lib;%(AdditionalDependencies) + + + ..\..\..\include\msapi + + + + + Create + commonstatus.h + + + + commonstatus.h + Use + + + commonstatus.h + + + NotUsing + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/_deprecated/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_12.vcxproj.filters b/tools/_deprecated/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_12.vcxproj.filters new file mode 100644 index 0000000000..fc5daed232 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_12.vcxproj.filters @@ -0,0 +1,67 @@ + + + + + {6b60d98e-019d-49ff-a906-9090232d9213} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {b2e98f78-44f0-4095-880b-46a0ede02428} + h;hpp;hxx;hm;inl + + + {2d794d19-0987-4aa7-940d-2378ba7e4fdb} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + + + Resource Files + + + Resource Files + + + \ No newline at end of file diff --git a/tools/_deprecated/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_14.vcxproj b/tools/_deprecated/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_14.vcxproj new file mode 100644 index 0000000000..e8467e23d8 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_14.vcxproj @@ -0,0 +1,251 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + AdvancedAutoAway + {66503A70-B1E8-4545-B4FF-2108DFB40C72} + + + + DynamicLibrary + Unicode + true + v140_xp + + + DynamicLibrary + Unicode + v140_xp + + + DynamicLibrary + true + Unicode + v140_xp + + + DynamicLibrary + Unicode + v140_xp + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)\Plugins\ + $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)\Plugins\ + $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)64\Plugins\ + $(SolutionDir)$(Configuration)64\Plugins\ + $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ + true + + + + Disabled + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + _DEBUG;_WINDOWS;_USRDLL;ADVANCEDAUTOAWAY_EXPORTS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + Use + ..\commonstatus.h + Level3 + EditAndContinue + 4996;%(DisableSpecificWarnings) + false + + + _DEBUG;%(PreprocessorDefinitions) + ..\..\..\include\msapi + + + true + $(IntDir)$(TargetName).lib + Windows + 0x11bd0000 + false + $(ProfileDir)..\..\..\bin14\lib + false + UxTheme.lib;%(AdditionalDependencies) + + + + + Full + OnlyExplicitInline + Size + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + NDEBUG;_WINDOWS;_USRDLL;ADVANCEDAUTOAWAY_EXPORTS;%(PreprocessorDefinitions) + true + true + Use + ..\commonstatus.h + Level3 + 4996;%(DisableSpecificWarnings) + false + false + Fast + + + NDEBUG;%(PreprocessorDefinitions) + ..\..\..\include\msapi + + + true + true + true + 0x11bd0000 + $(IntDir)$(TargetName).lib + Windows + false + $(ProfileDir)..\..\..\bin14\lib + UxTheme.lib;%(AdditionalDependencies) + + + + + Full + + + + + OnlyExplicitInline + + + + + + + + + Size + + + + + true + false + false + Fast + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + Use + ..\commonstatus.h + Level3 + NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + 4996;%(DisableSpecificWarnings) + AssemblyAndSourceCode + + + true + $(SolutionDir)\lib + + + true + true + $(IntDir)$(TargetName).lib + Windows + false + 0x11bd0000 + $(ProfileDir)..\..\..\bin14\lib + UxTheme.lib;%(AdditionalDependencies) + + + ..\..\..\include\msapi + NDEBUG;%(PreprocessorDefinitions) + + + + + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + Use + ..\commonstatus.h + Level3 + Disabled + _DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + EnableFastChecks + 4996;%(DisableSpecificWarnings) + false + + + true + $(IntDir)$(TargetName).lib + Windows + false + 0x11bd0000 + $(ProfileDir)..\..\..\bin14\lib + UxTheme.lib;%(AdditionalDependencies) + + + ..\..\..\include\msapi + + + + + Create + commonstatus.h + + + + commonstatus.h + Use + + + commonstatus.h + + + NotUsing + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/_deprecated/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_14.vcxproj.filters b/tools/_deprecated/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_14.vcxproj.filters new file mode 100644 index 0000000000..fc5daed232 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_14.vcxproj.filters @@ -0,0 +1,67 @@ + + + + + {6b60d98e-019d-49ff-a906-9090232d9213} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {b2e98f78-44f0-4095-880b-46a0ede02428} + h;hpp;hxx;hm;inl + + + {2d794d19-0987-4aa7-940d-2378ba7e4fdb} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + + + Resource Files + + + Resource Files + + + \ No newline at end of file diff --git a/tools/_deprecated/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp b/tools/_deprecated/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp new file mode 100644 index 0000000000..021674ab22 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp @@ -0,0 +1,593 @@ +/* + AdvancedAutoAway Plugin for Miranda-IM (www.miranda-im.org) + Copyright 2003-2006 P. Boon + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + + Some code is copied from Miranda's AutoAway module +*/ +#include "../commonstatus.h" +#include "advancedautoaway.h" +#include "../resource.h" +#include + +#ifdef _DEBUG + #define SECS_PER_MINUTE 20 /* speedup */ +#else + #define SECS_PER_MINUTE 60 /* default I believe */ +#endif + +///////////////////////////////////////////////////////////////////////////////////////// + +int CompareSettings(const TAAAProtoSetting *p1, const TAAAProtoSetting *p2) +{ + return mir_strcmp(p1->szName, p2->szName); +} + +TAAAProtoSettingList autoAwaySettings(10, CompareSettings); + +TAAAProtoSetting::TAAAProtoSetting(PROTOACCOUNT *pa) +{ + cbSize = sizeof(PROTOCOLSETTINGEX); + szName = pa->szModuleName; + tszAccName = pa->tszAccountName; + lastStatus = status = originalStatusMode = ID_STATUS_CURRENT; + szMsg = NULL; + curState = ACTIVE; + mStatus = FALSE; +} + +TAAAProtoSetting::~TAAAProtoSetting() +{ + free(szMsg); +} + +///////////////////////////////////////////////////////////////////////////////////////// + +extern HANDLE hStateChangedEvent; + +static BOOL ignoreLockKeys = FALSE; +static BOOL ignoreSysKeys = FALSE; +static BOOL ignoreAltCombo = FALSE; +static BOOL monitorMouse = TRUE; +static BOOL monitorKeyboard = TRUE; +static HWND confirmDialog; +static int mouseStationaryTimer; +HHOOK hMirandaMouseHook = NULL; +HHOOK hMirandaKeyBoardHook = NULL; +#pragma data_seg("Shared") +DWORD lastInput = 0; +POINT lastMousePos = {0}; +HHOOK hMouseHook = NULL; +HHOOK hKeyBoardHook = NULL; +#pragma data_seg() +#pragma comment(linker, "/section:Shared,rws") +DWORD lastMirandaInput = 0; +static UINT_PTR hAutoAwayTimer; +// prototypes +extern DWORD StatusModeToProtoFlag(int status); +extern int InitCommonStatus(); +static int HookWindowsHooks(int hookMiranda, int hookAll); +static int UnhookWindowsHooks(); +static LRESULT CALLBACK MouseHookFunction(int code, WPARAM wParam, LPARAM lParam); +static LRESULT CALLBACK KeyBoardHookFunction(int code, WPARAM wParam, LPARAM lParam); +static LRESULT CALLBACK MirandaMouseHookFunction(int code, WPARAM wParam, LPARAM lParam); +static LRESULT CALLBACK MirandaKeyBoardHookFunction(int code, WPARAM wParam, LPARAM lParam); +BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved); + +static VOID CALLBACK AutoAwayTimer(HWND hwnd,UINT message,UINT_PTR idEvent,DWORD dwTime); +extern int AutoAwayOptInitialise(WPARAM wParam,LPARAM lParam); +extern int AutoAwayMsgOptInitialise(WPARAM wParam,LPARAM lParam); +extern int SetStatus(WPARAM wParam, LPARAM lParam); +extern int ShowConfirmDialog(WPARAM wParam, LPARAM lParam); +extern char *StatusModeToDbSetting(int status,const char *suffix); + +///////////////////////////////////////////////////////////////////////////////////////// +// Load from DB + +void LoadOptions(TAAAProtoSettingList &loadSettings, BOOL override) +{ + // if override is enabled, samesettings will be ignored (for options loading) + int monitorMiranda = FALSE; // use windows hooks? + int monitorAll = FALSE; // use windows hooks? + + if (!override) + UnhookWindowsHooks(); + if (hAutoAwayTimer != 0) + KillTimer(NULL, hAutoAwayTimer); + + ignoreLockKeys = db_get_b(NULL, MODULENAME, SETTING_IGNLOCK, FALSE); + ignoreSysKeys = db_get_b(NULL, MODULENAME, SETTING_IGNSYSKEYS, FALSE); + ignoreAltCombo = db_get_b(NULL, MODULENAME, SETTING_IGNALTCOMBO, FALSE); + monitorMouse = db_get_b(NULL, MODULENAME, SETTING_MONITORMOUSE, TRUE); + monitorKeyboard = db_get_b(NULL, MODULENAME, SETTING_MONITORKEYBOARD, TRUE); + lastInput = lastMirandaInput = GetTickCount(); + + for (int i = 0; i < loadSettings.getCount(); i++) { + char* protoName; + if ((db_get_b(NULL, MODULENAME, SETTING_SAMESETTINGS, 0)) && !override) + protoName = SETTING_ALL; + else + protoName = loadSettings[i].szName; + LoadAutoAwaySetting(loadSettings[i], protoName); + if (!override) { + if (loadSettings[i].optionFlags & FLAG_MONITORMIRANDA) + monitorMiranda = TRUE; + else if (ignoreLockKeys || ignoreSysKeys || ignoreAltCombo || (monitorMouse != monitorKeyboard)) + monitorAll = TRUE; + } + } + + if (db_get_b(NULL, "Idle", "AAEnable", 0)) + return; + + HookWindowsHooks(monitorMiranda, monitorAll); + hAutoAwayTimer = SetTimer(NULL, 0, db_get_w(NULL, MODULENAME, SETTING_AWAYCHECKTIMEINSECS, 5) * 1000, AutoAwayTimer); +} + +int LoadAutoAwaySetting(TAAAProtoSetting &autoAwaySetting, char* protoName) +{ + char setting[128]; + mir_snprintf(setting, "%s_OptionFlags", protoName); + autoAwaySetting.optionFlags = db_get_w(NULL, MODULENAME, setting, FLAG_LV2ONINACTIVE | FLAG_RESET); + mir_snprintf(setting, "%s_AwayTime", protoName); + autoAwaySetting.awayTime = db_get_w(NULL, MODULENAME, setting, SETTING_AWAYTIME_DEFAULT); + mir_snprintf(setting, "%s_NATime", protoName); + autoAwaySetting.naTime = db_get_w(NULL, MODULENAME, setting, SETTING_NATIME_DEFAULT); + mir_snprintf(setting, "%s_StatusFlags", protoName); + autoAwaySetting.statusFlags = db_get_w(NULL, MODULENAME, setting, StatusModeToProtoFlag(ID_STATUS_ONLINE) | StatusModeToProtoFlag(ID_STATUS_FREECHAT)); + + int flags; + if (db_get_b(NULL, MODULENAME, SETTING_SAMESETTINGS, 0)) + flags = 0xFFFFFF; + else + flags = CallProtoService(protoName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(protoName, PS_GETCAPS, (WPARAM)PFLAGNUM_5, 0); + mir_snprintf(setting, "%s_Lv1Status", protoName); + autoAwaySetting.lv1Status = db_get_w(NULL, MODULENAME, setting, (flags&StatusModeToProtoFlag(ID_STATUS_AWAY)) ? ID_STATUS_AWAY : ID_STATUS_OFFLINE); + mir_snprintf(setting, "%s_Lv2Status", protoName); + autoAwaySetting.lv2Status = db_get_w(NULL, MODULENAME, setting, (flags&StatusModeToProtoFlag(ID_STATUS_NA)) ? ID_STATUS_NA : ID_STATUS_OFFLINE); + + return 0; +} + +static int ProcessProtoAck(WPARAM wParam, LPARAM lParam) +{ + ACKDATA *ack = (ACKDATA*)lParam; + if (ack->type != ACKTYPE_STATUS || ack->result != ACKRESULT_SUCCESS) + return 0; + + log_debugA("ProcessProtoAck: ack->szModule: %s", ack->szModule); + for (int i = 0; i < autoAwaySettings.getCount(); i++) { + TAAAProtoSetting &p = autoAwaySettings[i]; + log_debugA("chk: %s", p.szName); + if (!mir_strcmp(p.szName, ack->szModule)) { + log_debugA("ack->szModule: %s p.statusChanged: %d", ack->szModule, p.statusChanged); + if (!p.statusChanged) + p.mStatus = TRUE; + + p.statusChanged = FALSE; + } + } + + return 0; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// Account control event + +int OnAccChanged(WPARAM wParam, LPARAM lParam) +{ + PROTOACCOUNT *pa = (PROTOACCOUNT*)lParam; + switch (wParam) { + case PRAC_ADDED: + autoAwaySettings.insert(new TAAAProtoSetting(pa)); + break; + + case PRAC_REMOVED: + for (int i = 0; i < autoAwaySettings.getCount(); i++) { + if (!mir_strcmp(autoAwaySettings[i].szName, pa->szModuleName)) { + autoAwaySettings.remove(i); + break; + } + } + break; + } + + return 0; +} + +static char* status2descr(int status) +{ + switch (status) { + case ACTIVE: return "ACTIVE"; + case STATUS1_SET: return "STATUS1_SET"; + case STATUS2_SET: return "STATUS2_SET"; + case SET_ORGSTATUS: return "SET_ORGSTATUS"; + case HIDDEN_ACTIVE: return "HIDDEN_ACTIVE"; + } + return "ERROR"; +} + +static int changeState(TAAAProtoSetting &setting, STATES newState) +{ + if (setting.curState == newState) + return 0; + + setting.oldState = setting.curState; + setting.curState = newState; + + log_debugA("%s state change: %s -> %s", setting.szName, status2descr(setting.oldState), status2descr(setting.curState)); + + NotifyEventHooks(hStateChangedEvent, 0, (LPARAM)&setting); + if (setting.curState != SET_ORGSTATUS && setting.curState != ACTIVE && setting.statusChanged) { + /* change the awaymessage */ + if (setting.szMsg != NULL) { + free(setting.szMsg); + setting.szMsg = NULL; + } + + if (db_get_b(NULL, MODULENAME, StatusModeToDbSetting(setting.status, SETTING_MSGCUSTOM), FALSE)) { + DBVARIANT dbv; + if (!db_get_ws(NULL, MODULENAME, StatusModeToDbSetting(setting.status, SETTING_STATUSMSG), &dbv)) { + setting.szMsg = wcsdup(dbv.ptszVal); + db_free(&dbv); + } + } + } + else if (setting.szMsg != NULL) { + free(setting.szMsg); + setting.szMsg = NULL; + } + + return 0; +} + +static VOID CALLBACK AutoAwayTimer(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime) +{ + int statusChanged = FALSE; + int confirm = FALSE; + + for (int i = 0; i < autoAwaySettings.getCount(); i++) { + TAAAProtoSetting& aas = autoAwaySettings[i]; + aas.status = ID_STATUS_DISABLED; + + BOOL bTrigger = false; + + if (aas.optionFlags & FLAG_MONITORMIRANDA) + mouseStationaryTimer = (GetTickCount() - lastMirandaInput) / 1000; + else { + LASTINPUTINFO ii = { sizeof(ii) }; + GetLastInputInfo(&ii); + mouseStationaryTimer = (GetTickCount() - ii.dwTime) / 1000; + } + + int sts1Time = aas.awayTime * SECS_PER_MINUTE; + int sts2Time = aas.naTime * SECS_PER_MINUTE; + int sts1setTime = aas.sts1setTimer == 0 ? 0 : (GetTickCount() - aas.sts1setTimer) / 1000; + int currentMode = CallProtoService(aas.szName, PS_GETSTATUS, 0, 0); + + if (aas.optionFlags & FLAG_ONSAVER) + bTrigger |= IsScreenSaverRunning(); + if (aas.optionFlags & FLAG_ONLOCK) + bTrigger |= IsWorkstationLocked(); + if (aas.optionFlags & FLAG_FULLSCREEN) + bTrigger |= IsFullScreen(); + + /* check states */ + if (aas.curState == ACTIVE) { + if (((mouseStationaryTimer >= sts1Time && (aas.optionFlags & FLAG_ONMOUSE)) || bTrigger) && currentMode != aas.lv1Status && aas.statusFlags&StatusModeToProtoFlag(currentMode)) { + /* from ACTIVE to STATUS1_SET */ + aas.lastStatus = aas.originalStatusMode = CallProtoService(aas.szName, PS_GETSTATUS, 0, 0); + aas.status = aas.lv1Status; + aas.sts1setTimer = GetTickCount(); + sts1setTime = 0; + aas.statusChanged = statusChanged = TRUE; + changeState(aas, STATUS1_SET); + } + else if (mouseStationaryTimer >= sts2Time && currentMode == aas.lv1Status && currentMode != aas.lv2Status && (aas.optionFlags & FLAG_SETNA) && (aas.statusFlags & StatusModeToProtoFlag(currentMode))) { + /* from ACTIVE to STATUS2_SET */ + aas.lastStatus = aas.originalStatusMode = CallProtoService(aas.szName, PS_GETSTATUS, 0, 0); + aas.status = aas.lv2Status; + aas.statusChanged = statusChanged = TRUE; + changeState(aas, STATUS2_SET); + } + } + + if (aas.curState == STATUS1_SET) { + if ((mouseStationaryTimer < sts1Time && !bTrigger) && !(aas.optionFlags & FLAG_RESET)) { + /* from STATUS1_SET to HIDDEN_ACTIVE */ + changeState(aas, HIDDEN_ACTIVE); + aas.lastStatus = CallProtoService(aas.szName, PS_GETSTATUS, 0, 0); + } + else if (((mouseStationaryTimer < sts1Time) && !bTrigger) && + ((aas.optionFlags & FLAG_LV2ONINACTIVE) || (!(aas.optionFlags&FLAG_SETNA))) && + (aas.optionFlags & FLAG_RESET)) { + /* from STATUS1_SET to SET_ORGSTATUS */ + changeState(aas, SET_ORGSTATUS); + } + else if ((aas.optionFlags & FLAG_SETNA) && sts1setTime >= sts2Time) { + /* when set STATUS2, currentMode doesn't have to be in the selected status list (statusFlags) */ + /* from STATUS1_SET to STATUS2_SET */ + aas.lastStatus = CallProtoService(aas.szName, PS_GETSTATUS, 0, 0); + aas.status = aas.lv2Status; + aas.statusChanged = statusChanged = TRUE; + changeState(aas, STATUS2_SET); + } + } + + if (aas.curState == STATUS2_SET) { + if (mouseStationaryTimer < sts2Time && !bTrigger && (aas.optionFlags & FLAG_RESET)) { + /* from STATUS2_SET to SET_ORGSTATUS */ + changeState(aas, SET_ORGSTATUS); + } + else if (mouseStationaryTimer < sts2Time && !bTrigger && !(aas.optionFlags & FLAG_RESET)) { + /* from STATUS2_SET to HIDDEN_ACTIVE */ + /* Remember: after status1 is set, and "only on inactive" is NOT set, it implies !reset. */ + changeState(aas, HIDDEN_ACTIVE); + aas.lastStatus = CallProtoService(aas.szName, PS_GETSTATUS, 0, 0); + } + } + + if (aas.curState == HIDDEN_ACTIVE) { + if (aas.mStatus) { + /* HIDDEN_ACTIVE to ACTIVE */ + //aas.statusChanged = FALSE; + changeState(aas, ACTIVE); + aas.sts1setTimer = 0; + aas.mStatus = FALSE; + } + else if ((aas.optionFlags & FLAG_SETNA) && currentMode == aas.lv1Status && + currentMode != aas.lv2Status && (aas.statusFlags & StatusModeToProtoFlag(currentMode)) && + (mouseStationaryTimer >= sts2Time || (sts1setTime >= sts2Time && !(aas.optionFlags & FLAG_LV2ONINACTIVE)))) { + /* HIDDEN_ACTIVE to STATUS2_SET */ + aas.lastStatus = aas.originalStatusMode = CallProtoService(aas.szName, PS_GETSTATUS, 0, 0); + aas.status = aas.lv2Status; + aas.statusChanged = statusChanged = TRUE; + changeState(aas, STATUS2_SET); + } + } + if (aas.curState == SET_ORGSTATUS) { + /* SET_ORGSTATUS to ACTIVE */ + aas.lastStatus = CallProtoService(aas.szName, PS_GETSTATUS, 0, 0); + aas.status = aas.originalStatusMode; + confirm = (aas.optionFlags&FLAG_CONFIRM) ? TRUE : confirm; + aas.statusChanged = statusChanged = TRUE; + changeState(aas, ACTIVE); + aas.sts1setTimer = 0; + } + autoAwaySettings[i].mStatus = FALSE; + } + + if (confirm || statusChanged) { + TAAAProtoSettingList ps = autoAwaySettings; + for (int i = 0; i < ps.getCount(); i++) { + if (ps[i].szMsg) + ps[i].szMsg = wcsdup(ps[i].szMsg); + + if (ps[i].status == ID_STATUS_DISABLED) + ps[i].szName = ""; + } + + if (confirm) + confirmDialog = (HWND)CallService(MS_CS_SHOWCONFIRMDLGEX, (WPARAM)&ps, db_get_w(NULL, MODULENAME, SETTING_CONFIRMDELAY, 5)); + else if (statusChanged) + CallService(MS_CS_SETSTATUSEX, (WPARAM)&ps, 0); + } +} + +///////////////////////////////////////////////////////////////////////////////////////// +// Windows hooks + +static int HookWindowsHooks(int hookMiranda, int hookAll) +{ + if (hookMiranda) { + if (monitorKeyboard && hMirandaKeyBoardHook == NULL) + hMirandaKeyBoardHook = SetWindowsHookEx(WH_KEYBOARD, MirandaKeyBoardHookFunction, NULL, GetCurrentThreadId()); + if (monitorMouse && hMirandaMouseHook == NULL) + hMirandaMouseHook = SetWindowsHookEx(WH_MOUSE, MirandaMouseHookFunction, NULL, GetCurrentThreadId()); + } + if (hookAll) { + if (monitorKeyboard && hKeyBoardHook == NULL) + hKeyBoardHook = SetWindowsHookEx(WH_KEYBOARD, KeyBoardHookFunction, 0, GetCurrentThreadId()); + if (monitorMouse && hMouseHook == NULL) + hMouseHook = SetWindowsHookEx(WH_MOUSE, MouseHookFunction, 0, GetCurrentThreadId()); + } + + return 0; +} + +static int UnhookWindowsHooks() +{ + UnhookWindowsHookEx(hMouseHook); + UnhookWindowsHookEx(hKeyBoardHook); + UnhookWindowsHookEx(hMirandaMouseHook); + UnhookWindowsHookEx(hMirandaKeyBoardHook); + + hMouseHook = hKeyBoardHook = hMirandaMouseHook = hMirandaKeyBoardHook = NULL; + return 0; +} + +static LRESULT CALLBACK MirandaMouseHookFunction(int code, WPARAM wParam, LPARAM lParam) +{ + if (code >= 0) { + PMOUSEHOOKSTRUCT mouseInfo = (PMOUSEHOOKSTRUCT)lParam; + POINT pt = mouseInfo->pt; + + /* TioDuke's KeyBoardNotifyExt: only update if a Miranda window is focused */ + DWORD pid; + GetWindowThreadProcessId(GetForegroundWindow(), &pid); + if (pid != GetCurrentProcessId()) + return CallNextHookEx(hMirandaMouseHook, code, wParam, lParam); + + if (pt.x != lastMousePos.x || pt.y != lastMousePos.y) { + lastMousePos = pt; + lastMirandaInput = GetTickCount(); + } + } + + return CallNextHookEx(hMirandaMouseHook, code, wParam, lParam); +} + +static LRESULT CALLBACK MirandaKeyBoardHookFunction(int code, WPARAM wParam, LPARAM lParam) +{ + if (code >= 0) { + if (ignoreAltCombo) { + if (((GetKeyState(VK_MENU) < 0) || (wParam == VK_MENU)) || + ((GetKeyState(VK_TAB) < 0) || (wParam == VK_TAB)) || + ((GetKeyState(VK_SHIFT) < 0) || (wParam == VK_SHIFT)) || + ((GetKeyState(VK_CONTROL) < 0) || (wParam == VK_CONTROL)) || + ((GetKeyState(VK_ESCAPE) < 0) || (wParam == VK_ESCAPE)) || + ((GetKeyState(VK_LWIN) < 0) || (wParam == VK_LWIN)) || + ((GetKeyState(VK_RWIN) < 0) || (wParam == VK_RWIN))) + { + return CallNextHookEx(hMirandaKeyBoardHook, code, wParam, lParam); + } + } + + switch (wParam) { + case VK_NUMLOCK: + case VK_CAPITAL: + case VK_SCROLL: + if (!ignoreLockKeys) + lastMirandaInput = GetTickCount(); + break; + + case VK_TAB: + case VK_SHIFT: + case VK_CONTROL: + case VK_MENU: + case VK_ESCAPE: + case VK_LWIN: + case VK_RWIN: + if (!ignoreSysKeys) + lastMirandaInput = GetTickCount(); + break; + + default: + lastMirandaInput = GetTickCount(); + break; + } + } + + return CallNextHookEx(hMirandaKeyBoardHook, code, wParam, lParam); +} + +static LRESULT CALLBACK MouseHookFunction(int code, WPARAM wParam, LPARAM lParam) +{ + if (code >= 0) { + PMOUSEHOOKSTRUCT mouseInfo = (PMOUSEHOOKSTRUCT)lParam; + POINT pt = mouseInfo->pt; + + /* TioDuke's KeyBoardNotifyExt: also grab clicks */ + if ((wParam >= WM_NCLBUTTONDOWN && wParam <= WM_NCXBUTTONDBLCLK && wParam != 0x00AA) || (wParam >= WM_LBUTTONDOWN && wParam <= WM_XBUTTONDBLCLK)) + lastInput = GetTickCount(); + + if (pt.x != lastMousePos.x || pt.y != lastMousePos.y) { + lastMousePos = pt; + lastInput = GetTickCount(); + } + } + + return CallNextHookEx(hMouseHook, code, wParam, lParam); +} + +static LRESULT CALLBACK KeyBoardHookFunction(int code, WPARAM wParam, LPARAM lParam) +{ + if (code >= 0) { + if (ignoreAltCombo) { + if (((GetKeyState(VK_MENU) < 0) || (wParam == VK_MENU)) || + ((GetKeyState(VK_TAB) < 0) || (wParam == VK_TAB)) || + ((GetKeyState(VK_SHIFT) < 0) || (wParam == VK_SHIFT)) || + ((GetKeyState(VK_CONTROL) < 0) || (wParam == VK_CONTROL)) || + ((GetKeyState(VK_ESCAPE) < 0) || (wParam == VK_ESCAPE)) || + ((GetKeyState(VK_LWIN) < 0) || (wParam == VK_LWIN)) || + ((GetKeyState(VK_RWIN) < 0) || (wParam == VK_RWIN))) + { + return CallNextHookEx(hKeyBoardHook, code, wParam, lParam); + } + } + + switch (wParam) { + case VK_NUMLOCK: + case VK_CAPITAL: + case VK_SCROLL: + if (!ignoreLockKeys) + lastInput = GetTickCount(); + break; + + case VK_TAB: + case VK_SHIFT: + case VK_CONTROL: + case VK_MENU: + case VK_ESCAPE: + case VK_LWIN: + case VK_RWIN: + if (!ignoreSysKeys) + lastInput = GetTickCount(); + break; + + default: + lastInput = GetTickCount(); + break; + } + } + + return CallNextHookEx(hKeyBoardHook, code, wParam, lParam); +} + +///////////////////////////////////////////////////////////////////////////////////////// +// Inits & stuff + +static int AutoAwayShutdown(WPARAM wParam, LPARAM lParam) +{ + KillTimer(NULL, hAutoAwayTimer); + +#ifdef TRIGGERPLUGIN + DeInitTrigger(); +#endif + UnhookWindowsHooks(); + DestroyHookableEvent(hStateChangedEvent); + + autoAwaySettings.destroy(); + return 0; +} + +int CSModuleLoaded(WPARAM wParam, LPARAM lParam) +{ + HookEvent(ME_PROTO_ACCLISTCHANGED, OnAccChanged); + HookEvent(ME_OPT_INITIALISE, AutoAwayOptInitialise); + HookEvent(ME_SYSTEM_PRESHUTDOWN, AutoAwayShutdown); + HookEvent(ME_PROTO_ACK, ProcessProtoAck); + mouseStationaryTimer = 0; + lastInput = lastMirandaInput = GetTickCount(); + + //////////////////////////////////////////////////////////////////////////////////////// + + protoList = (OBJLIST*)&autoAwaySettings; + + int count; + PROTOACCOUNT** protos; + Proto_EnumAccounts(&count, &protos); + + for (int i = 0; i < count; i++) + if (IsSuitableProto(protos[i])) + autoAwaySettings.insert(new TAAAProtoSetting(protos[i])); + + //////////////////////////////////////////////////////////////////////////////////////// + + LoadOptions(autoAwaySettings, FALSE); + return 0; +} diff --git a/tools/_deprecated/StatusPlugins/AdvancedAutoAway/advancedautoaway.h b/tools/_deprecated/StatusPlugins/AdvancedAutoAway/advancedautoaway.h new file mode 100644 index 0000000000..4a96da2544 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/AdvancedAutoAway/advancedautoaway.h @@ -0,0 +1,93 @@ +/* + AdvancedAutoAway Plugin for Miranda-IM (www.miranda-im.org) + Copyright 2003-2006 P. Boon + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +#ifndef __ADVANCED_AUTOAWAY_HEADER +#define __ADVANCED_AUTOAWAY_HEADER + +#include +#include "version.h" + +#define SETTING_IGNLOCK "IgnoreLockKeys" +#define SETTING_IGNSYSKEYS "IgnoreSysKeys" +#define SETTING_IGNALTCOMBO "IgnoreAltCombo" +#define SETTING_SAMESETTINGS "SameAutoAwaySettings" +#define SETTING_ALL "ALLPROTOS" +#define SETTING_MSGCUSTOM "Custom" +#define SETTING_STATUSMSG "Msg" +#define SETTING_CONFIRMDELAY "ConfirmTimeout" +#define MODULENAME "AdvancedAutoAway" + +#define SETTING_AWAYTIME_DEFAULT 5 +#define SETTING_NATIME_DEFAULT 20 +#define SETTING_AWAYCHECKTIMEINSECS "CheckInterval" + +#define STATUS_RESET 1 +#define STATUS_AUTOAWAY 2 +#define STATUS_AUTONA 3 + +#define SETTING_MONITORMOUSE "MonitorMouse" +#define SETTING_MONITORKEYBOARD "MonitorKeyboard" + +#define FLAG_ONSAVER 0x0001 // db: set lv1 status on screensaver ? +#define FLAG_ONMOUSE 0x0002 // db: set after inactivity ? +#define FLAG_SETNA 0x0004 // db: set NA after xx of away time ? +#define FLAG_CONFIRM 0x0008 // db: show confirm dialog ? +#define FLAG_RESET 0x0010 // db: restore status ? +#define FLAG_LV2ONINACTIVE 0x0020 // db: set lv2 only on inactivity +#define FLAG_MONITORMIRANDA 0x0040 // db: monitor miranda activity only +#define FLAG_ONLOCK 0x0080 // db: on work station lock +#define FLAG_FULLSCREEN 0x0100 // db: on full screen + +struct TAAAProtoSetting : public PROTOCOLSETTINGEX, public MZeroedObject +{ + TAAAProtoSetting(PROTOACCOUNT *pa); + ~TAAAProtoSetting(); + + int originalStatusMode; + STATES + oldState, + curState; + BOOL statusChanged; // AAA changed the status, don't update mStatus + BOOL mStatus; // status changed manually or not ? + int optionFlags, // db: see above + awayTime, // db: time to wait for inactivity + naTime, // db: time to wait after away is set + statusFlags; // db: set lv1 status if this is original status + WORD lv1Status, // db + lv2Status; // db + unsigned int sts1setTimer; +}; + +struct AAMSGSETTING +{ + short useCustom; + int status; + char* msg; +}; + +extern HINSTANCE hInst; + +int CompareSettings( const TAAAProtoSetting *p1, const TAAAProtoSetting *p2 ); + +typedef OBJLIST TAAAProtoSettingList; +extern TAAAProtoSettingList autoAwaySettings; + +int LoadAutoAwaySetting(TAAAProtoSetting &autoAwaySetting, char *protoName); +void LoadOptions(TAAAProtoSettingList &settings, BOOL override); + +#endif diff --git a/tools/_deprecated/StatusPlugins/AdvancedAutoAway/fsm.jpg b/tools/_deprecated/StatusPlugins/AdvancedAutoAway/fsm.jpg new file mode 100644 index 0000000000..21066a3939 Binary files /dev/null and b/tools/_deprecated/StatusPlugins/AdvancedAutoAway/fsm.jpg differ diff --git a/tools/_deprecated/StatusPlugins/AdvancedAutoAway/main.cpp b/tools/_deprecated/StatusPlugins/AdvancedAutoAway/main.cpp new file mode 100644 index 0000000000..e271378c20 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/AdvancedAutoAway/main.cpp @@ -0,0 +1,93 @@ +/* + AdvancedAutoAway Plugin for Miranda-IM (www.miranda-im.org) + Copyright 2003-2006 P. Boon + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + + Some code is copied from Miranda's AutoAway module +*/ + +#include "../commonstatus.h" +#include "advancedautoaway.h" +#include "../resource.h" + +HINSTANCE hInst; +CLIST_INTERFACE *pcli; + +HANDLE hCSModuleLoadedHook; +HANDLE hStateChangedEvent; +int hLangpack = 0; + +int CSModuleLoaded(WPARAM wParam, LPARAM lParam); + +///////////////////////////////////////////////////////////////////////////////////////// +// dll entry point + +BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved) +{ + if (fdwReason == DLL_PROCESS_ATTACH) + hInst = hinstDLL; + + return TRUE; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// returns plugin's extended information + +PLUGININFOEX pluginInfoEx={ + sizeof(PLUGININFOEX), + __PLUGIN_NAME, + PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), + __DESC, + __AUTHOR, + __AUTHOREMAIL, + __COPYRIGHT, + __AUTHORWEB, + UNICODE_AWARE, + { 0xf0fdf73a, 0x753d, 0x499d, { 0x8d, 0xba, 0x33, 0x6d, 0xb7, 0x9c, 0xdd, 0x41 } } // {F0FDF73A-753D-499d-8DBA-336DB79CDD41} +}; + +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) +{ + return &pluginInfoEx; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// interfaces + +extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_AUTOAWAY, MIID_LAST }; + +///////////////////////////////////////////////////////////////////////////////////////// +// plugin's entry point + +extern "C" __declspec(dllexport) int Load(void) +{ + mir_getLP(&pluginInfoEx); + pcli = Clist_GetInterface(); + + InitCommonStatus(); + hCSModuleLoadedHook = HookEvent(ME_SYSTEM_MODULESLOADED, CSModuleLoaded); + hStateChangedEvent = CreateHookableEvent(ME_AAA_STATECHANGED); + return 0; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// plugin's exit point + +extern "C" __declspec(dllexport) int Unload(void) +{ + return 0; +} diff --git a/tools/_deprecated/StatusPlugins/AdvancedAutoAway/msgoptions.cpp b/tools/_deprecated/StatusPlugins/AdvancedAutoAway/msgoptions.cpp new file mode 100644 index 0000000000..9435d0db54 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/AdvancedAutoAway/msgoptions.cpp @@ -0,0 +1,180 @@ +/* + AdvancedAutoAway Plugin for Miranda-IM (www.miranda-im.org) + Copyright 2003-2006 P. Boon + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +#include "../commonstatus.h" +#include "advancedautoaway.h" +#include "../resource.h" + +extern char *StatusModeToDbSetting(int status,const char *suffix); + +void DisableDialog(HWND hwndDlg) +{ + EnableWindow(GetDlgItem(hwndDlg, IDC_STATUS), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_STATUSMSG), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_VARIABLESHELP), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_RADUSECUSTOM), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_RADUSEMIRANDA), FALSE); +} + +INT_PTR CALLBACK DlgProcAutoAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static AAMSGSETTING** settings; + static int last, count; + + switch( msg ) { + case WM_INITDIALOG: + TranslateDialogDefault( hwndDlg ); + { + ShowWindow(GetDlgItem(hwndDlg, IDC_VARIABLESHELP), ServiceExists(MS_VARS_SHOWHELP)?SW_SHOW:SW_HIDE); + count = 0; + last = -1; + + PROTOACCOUNT** proto; + int protoCount = 0; + Proto_EnumAccounts(&protoCount, &proto); + if (protoCount <= 0) + { + DisableDialog(hwndDlg); + break; + } + + DWORD protoModeMsgFlags = 0; + for (int i=0; i < protoCount; i++) + if (CallProtoService(proto[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND & ~PF1_INDIVMODEMSG) + protoModeMsgFlags |= CallProtoService( proto[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0 ); + + if (protoModeMsgFlags == 0) + { + DisableDialog(hwndDlg); + break; + } + + settings = ( AAMSGSETTING** )malloc(sizeof(AAMSGSETTING*)); + count = 0; + for (int i=0; i < _countof(statusModeList); i++ ) { + if ( !( protoModeMsgFlags & Proto_Status2Flag( statusModeList[i] ))) + continue; + + int j = SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_ADDSTRING, 0, (LPARAM)pcli->pfnGetStatusModeDescription(statusModeList[i], 0)); + SendDlgItemMessage( hwndDlg, IDC_STATUS, CB_SETITEMDATA, j, statusModeList[i] ); + settings = ( AAMSGSETTING** )realloc(settings, (count+1)*sizeof(AAMSGSETTING*)); + settings[count] = ( AAMSGSETTING* )malloc(sizeof(AAMSGSETTING)); + settings[count]->status = statusModeList[i]; + + DBVARIANT dbv; + if ( !db_get(NULL, MODULENAME, StatusModeToDbSetting(statusModeList[i],SETTING_STATUSMSG), &dbv)) { + settings[count]->msg = ( char* )malloc(mir_strlen(dbv.pszVal) + 1); + mir_strcpy(settings[count]->msg, dbv.pszVal); + db_free(&dbv); + } + else settings[count]->msg = NULL; + + settings[count]->useCustom = db_get_b(NULL, MODULENAME, StatusModeToDbSetting(statusModeList[i], SETTING_MSGCUSTOM), FALSE); + count += 1; + } + SendDlgItemMessage(hwndDlg,IDC_STATUS,CB_SETCURSEL,0,0); + SendMessage(hwndDlg,WM_COMMAND,MAKEWPARAM(IDC_STATUS,CBN_SELCHANGE),0); + } + break; + + case WM_COMMAND: + if ( ((HIWORD(wParam) == EN_CHANGE) || (HIWORD(wParam) == BN_CLICKED)) && ((HWND)lParam == GetFocus())) + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + + switch(LOWORD(wParam)) { + case IDC_RADUSEMIRANDA: + CheckDlgButton(hwndDlg, IDC_RADUSECUSTOM, BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_RADUSEMIRANDA) ? BST_CHECKED : BST_UNCHECKED); + EnableWindow(GetDlgItem(hwndDlg, IDC_STATUSMSG), IsDlgButtonChecked(hwndDlg, IDC_RADUSECUSTOM)); + EnableWindow(GetDlgItem(hwndDlg, IDC_VARIABLESHELP), IsDlgButtonChecked(hwndDlg, IDC_RADUSECUSTOM)); + settings[SendDlgItemMessage(hwndDlg,IDC_STATUS,CB_GETCURSEL,0,0)]->useCustom = IsDlgButtonChecked(hwndDlg, IDC_RADUSECUSTOM); + break; + + case IDC_RADUSECUSTOM: + CheckDlgButton(hwndDlg, IDC_RADUSEMIRANDA, BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_RADUSECUSTOM) ? BST_CHECKED : BST_UNCHECKED); + EnableWindow(GetDlgItem(hwndDlg, IDC_STATUSMSG), IsDlgButtonChecked(hwndDlg, IDC_RADUSECUSTOM)); + EnableWindow(GetDlgItem(hwndDlg, IDC_VARIABLESHELP), IsDlgButtonChecked(hwndDlg, IDC_RADUSECUSTOM)); + settings[SendDlgItemMessage(hwndDlg,IDC_STATUS,CB_GETCURSEL,0,0)]->useCustom = IsDlgButtonChecked(hwndDlg, IDC_RADUSECUSTOM); + break; + + case IDC_STATUS: + if ( HIWORD( wParam ) == CBN_SELCHANGE ) { + int i = SendDlgItemMessage(hwndDlg,IDC_STATUS,CB_GETCURSEL,0,0); + int len = SendDlgItemMessage(hwndDlg, IDC_STATUSMSG, WM_GETTEXTLENGTH, 0, 0); + if ( last != -1 ) { + if (settings[last]->msg == NULL) + settings[last]->msg = ( char* )malloc(len+1); + else + settings[last]->msg = (char*)realloc(settings[last]->msg, len+1); + GetDlgItemTextA(hwndDlg, IDC_STATUSMSG, settings[last]->msg, (len+1)); + } + + if (i != -1) { + if (settings[i]->msg != NULL) + SetDlgItemTextA(hwndDlg, IDC_STATUSMSG, settings[i]->msg); + else { + ptrW msg((wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGW, settings[i]->status, 0)); + SetDlgItemText(hwndDlg, IDC_STATUSMSG, (msg != NULL) ? msg : L""); + } + + if (settings[i]->useCustom) { + EnableWindow(GetDlgItem(hwndDlg, IDC_STATUSMSG), TRUE); + EnableWindow(GetDlgItem(hwndDlg, IDC_VARIABLESHELP), TRUE); + CheckDlgButton(hwndDlg, IDC_RADUSECUSTOM, BST_CHECKED); + CheckDlgButton(hwndDlg, IDC_RADUSEMIRANDA, BST_UNCHECKED); + } + else { + EnableWindow(GetDlgItem(hwndDlg, IDC_STATUSMSG), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_VARIABLESHELP), FALSE); + CheckDlgButton(hwndDlg, IDC_RADUSEMIRANDA, BST_CHECKED); + CheckDlgButton(hwndDlg, IDC_RADUSECUSTOM, BST_UNCHECKED); + } + } + last = i; + } + break; + + case IDC_VARIABLESHELP: + CallService(MS_VARS_SHOWHELP, (WPARAM)GetDlgItem(hwndDlg, IDC_STATUSMSG), 0); + break; + } + break; + + case WM_NOTIFY: + switch (((LPNMHDR)lParam)->code) { + case PSN_APPLY: + SendMessage(hwndDlg,WM_COMMAND,MAKEWPARAM(IDC_STATUS,CBN_SELCHANGE),0); + for (int i=0; i < count; i++ ) { + db_set_b(NULL, MODULENAME, StatusModeToDbSetting(settings[i]->status,SETTING_MSGCUSTOM), (BYTE)settings[i]->useCustom); + if ( (settings[i]->useCustom) && (settings[i]->msg != NULL) && (settings[i]->msg[0] != '\0')) + db_set_s(NULL, MODULENAME, StatusModeToDbSetting(settings[i]->status,SETTING_STATUSMSG), settings[i]->msg); + } + break; + } + break; + + case WM_DESTROY: + for (int i=0; i < count; i++ ) { + free(settings[i]->msg); + free(settings[i]); + } + free(settings); + break; + } + + return FALSE; +} diff --git a/tools/_deprecated/StatusPlugins/AdvancedAutoAway/options.cpp b/tools/_deprecated/StatusPlugins/AdvancedAutoAway/options.cpp new file mode 100644 index 0000000000..02516f3e9e --- /dev/null +++ b/tools/_deprecated/StatusPlugins/AdvancedAutoAway/options.cpp @@ -0,0 +1,526 @@ +/* +AdvancedAutoAway Plugin for Miranda-IM (www.miranda-im.org) +Copyright 2003-2006 P. Boon + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "../commonstatus.h" +#include "advancedautoaway.h" +#include "../resource.h" +#include + +int LoadAutoAwaySetting(TAAAProtoSetting &autoAwaySetting, char* protoName); + +INT_PTR CALLBACK DlgProcAutoAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); + +static BOOL bSettingSame = FALSE; + +///////////////////////////////////////////////////////////////////////////////////////// +// Dialog service functions + +static int WriteAutoAwaySetting(TAAAProtoSetting &autoAwaySetting, char *protoName) +{ + char setting[128]; + mir_snprintf(setting, "%s_OptionFlags", protoName); + db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.optionFlags); + mir_snprintf(setting, "%s_AwayTime", protoName); + db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.awayTime); + mir_snprintf(setting, "%s_NATime", protoName); + db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.naTime); + mir_snprintf(setting, "%s_StatusFlags", protoName); + db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.statusFlags); + mir_snprintf(setting, "%s_Lv1Status", protoName); + db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.lv1Status); + mir_snprintf(setting, "%s_Lv2Status", protoName); + db_set_w(NULL, MODULENAME, setting, (WORD)autoAwaySetting.lv2Status); + + return 0; +} + +static void SetDialogItems(HWND hwndDlg, TAAAProtoSetting *setting) +{ + bool bIsTimed = (setting->optionFlags & FLAG_ONMOUSE) != 0; + bool bSetNA = (setting->optionFlags & FLAG_SETNA) != 0; + bool bSaver = (setting->optionFlags & FLAG_ONSAVER) != 0; + bool bFullScr = (setting->optionFlags & FLAG_FULLSCREEN) != 0; + + CheckDlgButton(hwndDlg, IDC_FULLSCREEN, bFullScr ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_SCREENSAVE, bSaver ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_ONLOCK, (setting->optionFlags & FLAG_ONLOCK) != 0 ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_TIMED, bIsTimed ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_SETNA, bSetNA ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_CONFIRM, (setting->optionFlags & FLAG_CONFIRM) != 0 ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_RESETSTATUS, (setting->optionFlags & FLAG_RESET) != 0 ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_MONITORMIRANDA, (setting->optionFlags & FLAG_MONITORMIRANDA) != 0 ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_LV2ONINACTIVE, (setting->optionFlags & FLAG_LV2ONINACTIVE) != 0 ? BST_CHECKED : BST_UNCHECKED); + + SetDlgItemInt(hwndDlg, IDC_AWAYTIME, setting->awayTime, FALSE); + SetDlgItemInt(hwndDlg, IDC_NATIME, setting->naTime, FALSE); + + EnableWindow(GetDlgItem(hwndDlg, IDC_SETNA), bIsTimed); + EnableWindow(GetDlgItem(hwndDlg, IDC_LV2ONINACTIVE), bIsTimed && bSetNA); + EnableWindow(GetDlgItem(hwndDlg, IDC_MONITORMIRANDA), bIsTimed); + EnableWindow(GetDlgItem(hwndDlg, IDC_AWAYTIME), bIsTimed); + EnableWindow(GetDlgItem(hwndDlg, IDC_LV1AFTERSTR), bIsTimed); + EnableWindow(GetDlgItem(hwndDlg, IDC_LV1STATUS), bIsTimed || bSaver || bFullScr); + EnableWindow(GetDlgItem(hwndDlg, IDC_STATUSLIST), bIsTimed || bSaver || bFullScr); + EnableWindow(GetDlgItem(hwndDlg, IDC_RESETSTATUS), (bIsTimed || bSaver || bFullScr) && IsDlgButtonChecked(hwndDlg, IDC_LV2ONINACTIVE)); + EnableWindow(GetDlgItem(hwndDlg, IDC_CONFIRM), (bIsTimed || bSaver || bFullScr) && IsDlgButtonChecked(hwndDlg, IDC_LV2ONINACTIVE) && IsDlgButtonChecked(hwndDlg, IDC_RESETSTATUS)); + EnableWindow(GetDlgItem(hwndDlg, IDC_NATIME), bSetNA && bIsTimed); + EnableWindow(GetDlgItem(hwndDlg, IDC_SETNASTR), bSetNA && bIsTimed); + EnableWindow(GetDlgItem(hwndDlg, IDC_SETNASTR), bSetNA && bIsTimed); + EnableWindow(GetDlgItem(hwndDlg, IDC_LV2STATUS), bSetNA && bIsTimed); + EnableWindow(GetDlgItem(hwndDlg, IDC_PROTOCOL), !bSettingSame); +} + +static TAAAProtoSetting* GetSetting(HWND hwndDlg, TAAAProtoSetting *sameSetting) +{ + if (bSettingSame) + return sameSetting; + + int iItem = SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, CB_GETCURSEL, 0, 0); + if (iItem == -1) + return NULL; + + INT_PTR iData = (INT_PTR)SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, CB_GETITEMDATA, iItem, 0); + return (iData == -1) ? NULL : (TAAAProtoSetting*)iData; +} + +static void SetDialogStatus(HWND hwndDlg, TAAAProtoSetting *sameSetting) +{ + TAAAProtoSetting *setting = GetSetting(hwndDlg, sameSetting); + if (setting == NULL) + return; + + // create columns + HWND hList = GetDlgItem(hwndDlg, IDC_STATUSLIST); + ListView_SetExtendedListViewStyleEx(hList, LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES, LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES); + + LVCOLUMN lvCol = { 0 }; + lvCol.mask = LVCF_WIDTH | LVCF_TEXT; + lvCol.pszText = TranslateT("Status"); + lvCol.cx = 118; + ListView_InsertColumn(hList, 0, &lvCol); + + // get pointer to settings + SetDialogItems(hwndDlg, setting); +} + +///////////////////////////////////////////////////////////////////////////////////////// +// Rules dialog window procedure + +static TAAAProtoSettingList optionSettings(10, CompareSettings); + +static INT_PTR CALLBACK DlgProcAutoAwayRulesOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static TAAAProtoSetting* sameSetting; + TAAAProtoSetting *setting; + static int init; + + switch (msg) { + case WM_INITDIALOG: + init = TRUE; + TranslateDialogDefault(hwndDlg); + + // copy the settings + optionSettings = autoAwaySettings; + + sameSetting = (TAAAProtoSetting*)malloc(sizeof(TAAAProtoSetting)); + LoadAutoAwaySetting(*sameSetting, SETTING_ALL); + + // fill list from currentProtoSettings + { + for (int i = 0; i < optionSettings.getCount(); i++) { + TAAAProtoSetting &p = optionSettings[i]; + int item = SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, CB_ADDSTRING, 0, (LPARAM)p.tszAccName); + SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, CB_SETITEMDATA, item, (LPARAM)&p); + } + } + // set cursor to first protocol + SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, CB_SETCURSEL, 0, 0); + + // status list + SetDialogStatus(hwndDlg, sameSetting); + + SendMessage(hwndDlg, WM_COMMAND, (WPARAM)IDC_PROTOCOL, (LPARAM)0x11111111); + init = FALSE; + break; + + case WM_COMMAND: + if ((HIWORD(wParam) == EN_CHANGE || HIWORD(wParam) == BN_CLICKED) && (HWND)lParam == GetFocus()) + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + + setting = GetSetting(hwndDlg, sameSetting); + if (!setting) + break; + + switch (LOWORD(wParam)) { + case IDC_PROTOCOL: + // status listview + init = TRUE; + { + HWND hList = GetDlgItem(hwndDlg, IDC_STATUSLIST); + ListView_DeleteAllItems(hList); + + int flags = 0; + if (!bSettingSame) + flags = CallProtoService(setting->szName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(setting->szName, PS_GETCAPS, (WPARAM)PFLAGNUM_5, 0); + + LVITEM lvItem = { 0 }; + lvItem.mask = LVIF_TEXT | LVIF_PARAM; + lvItem.iItem = 0; + lvItem.iSubItem = 0; + for (int i = 0; i < _countof(statusModeList); i++) { + if ((flags & statusModePf2List[i]) || (statusModePf2List[i] == PF2_OFFLINE) || (bSettingSame)) { + lvItem.pszText = pcli->pfnGetStatusModeDescription(statusModeList[i], 0); + lvItem.lParam = (LPARAM)statusModePf2List[i]; + ListView_InsertItem(hList, &lvItem); + ListView_SetCheckState(hList, lvItem.iItem, setting->statusFlags & statusModePf2List[i] ? TRUE : FALSE); + lvItem.iItem++; + } + } + } + init = FALSE; + // status dropdown boxes + { + int flags = 0; + if (!bSettingSame) + flags = CallProtoService(setting->szName, PS_GETCAPS, PFLAGNUM_2, 0)&~CallProtoService(setting->szName, PS_GETCAPS, (WPARAM)PFLAGNUM_5, 0); + + // clear box and add new status, loop status and check if compatible with proto + SendDlgItemMessage(hwndDlg, IDC_LV1STATUS, CB_RESETCONTENT, 0, 0); + SendDlgItemMessage(hwndDlg, IDC_LV2STATUS, CB_RESETCONTENT, 0, 0); + for (int i=0; i < _countof(statusModeList); i++) { + if ((flags & statusModePf2List[i]) || statusModePf2List[i] == PF2_OFFLINE || bSettingSame) { + wchar_t *statusMode = pcli->pfnGetStatusModeDescription(statusModeList[i], 0); + int item = SendDlgItemMessage(hwndDlg, IDC_LV1STATUS, CB_ADDSTRING, 0, (LPARAM)statusMode); + SendDlgItemMessage(hwndDlg, IDC_LV1STATUS, CB_SETITEMDATA, item, (LPARAM)statusModeList[i]); + item = SendDlgItemMessage(hwndDlg, IDC_LV2STATUS, CB_ADDSTRING, 0, (LPARAM)statusMode); + SendDlgItemMessage(hwndDlg, IDC_LV2STATUS, CB_SETITEMDATA, item, (LPARAM)statusModeList[i]); + if (statusModeList[i] == setting->lv1Status) { + SendDlgItemMessage(hwndDlg, IDC_LV1STATUS, CB_SETCURSEL, (WPARAM)item, 0); + SetDlgItemText(hwndDlg, IDC_SETNASTR, CMStringW(FORMAT, TranslateT("minutes of %s mode"), statusMode)); + } + if (statusModeList[i] == setting->lv2Status) + SendDlgItemMessage(hwndDlg, IDC_LV2STATUS, CB_SETCURSEL, (WPARAM)item, 0); + } + } + } + SetDialogItems(hwndDlg, setting); + break; + + case IDC_LV1STATUS: + if (HIWORD(wParam) == CBN_SELCHANGE) + SendMessage(GetParent(hwndDlg),PSM_CHANGED,0,0); + + setting->lv1Status = (int)SendDlgItemMessage(hwndDlg, IDC_LV1STATUS, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_LV1STATUS, CB_GETCURSEL, 0, 0), 0); + SetDlgItemText(hwndDlg, IDC_SETNASTR, CMStringW(FORMAT, TranslateT("minutes of %s mode"), pcli->pfnGetStatusModeDescription(setting->lv1Status, 0))); + break; + + case IDC_LV2STATUS: + if (HIWORD(wParam) == CBN_SELCHANGE) + SendMessage(GetParent(hwndDlg),PSM_CHANGED,0,0); + + setting->lv2Status = (int)SendDlgItemMessage(hwndDlg, IDC_LV2STATUS, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_LV2STATUS, CB_GETCURSEL, 0, 0), 0); + break; + + case IDC_FULLSCREEN: + setting->optionFlags ^= FLAG_FULLSCREEN; + SetDialogItems(hwndDlg, setting); + break; + + case IDC_SCREENSAVE: + setting->optionFlags ^= FLAG_ONSAVER; + SetDialogItems(hwndDlg, setting); + break; + + case IDC_ONLOCK: + setting->optionFlags ^= FLAG_ONLOCK; + SetDialogItems(hwndDlg, setting); + break; + + case IDC_TIMED: + setting->optionFlags ^= FLAG_ONMOUSE; + SetDialogItems(hwndDlg, setting); + break; + + case IDC_SETNA: + setting->optionFlags ^= FLAG_SETNA; + SetDialogItems(hwndDlg, setting); + break; + + case IDC_AWAYTIME: + setting->awayTime = GetDlgItemInt(hwndDlg,IDC_AWAYTIME, NULL, FALSE); + break; + + case IDC_NATIME: + setting->naTime = GetDlgItemInt(hwndDlg,IDC_NATIME, NULL, FALSE); + break; + + case IDC_LV2ONINACTIVE: + setting->optionFlags^=FLAG_LV2ONINACTIVE; + SetDialogItems(hwndDlg, setting); + break; + + case IDC_CONFIRM: + setting->optionFlags^=FLAG_CONFIRM; + SetDialogItems(hwndDlg, setting); + break; + + case IDC_RESETSTATUS: + setting->optionFlags^=FLAG_RESET; + SetDialogItems(hwndDlg, setting); + break; + + case IDC_MONITORMIRANDA: + setting->optionFlags^=FLAG_MONITORMIRANDA; + SetDialogItems(hwndDlg, setting); + break; + } + break; + + case WM_SHOWWINDOW: + init = TRUE; + + if (setting = GetSetting(hwndDlg, sameSetting)) + SetDialogItems(hwndDlg, setting); + + SendMessage(hwndDlg, WM_COMMAND, (WPARAM)IDC_PROTOCOL, (LPARAM)0x11111111); + init = FALSE; + break; + + case WM_NOTIFY: + switch(((NMHDR*)lParam)->idFrom) { + case IDC_STATUSLIST: + if (init) + break; + + switch(((NMHDR*)lParam)->code) { + case LVN_ITEMCHANGED: + NMLISTVIEW *nmlv = (NMLISTVIEW*)lParam; + if (IsWindowVisible(GetDlgItem(hwndDlg, IDC_STATUSLIST)) && ((nmlv->uNewState ^ nmlv->uOldState) & LVIS_STATEIMAGEMASK)) { + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + + if (setting = GetSetting(hwndDlg, sameSetting)) { + HWND hList = GetDlgItem(hwndDlg, IDC_STATUSLIST); + LVITEM lvItem = { 0 }; + lvItem.mask = LVIF_PARAM; + lvItem.iItem = nmlv->iItem; + ListView_GetItem(hList, &lvItem); + int pf2Status = lvItem.lParam; + if (ListView_GetCheckState(hList, lvItem.iItem)) + setting->statusFlags |= pf2Status; + else + setting->statusFlags &= ~pf2Status; + } + } + break; + } + break; + } + + switch (((LPNMHDR)lParam)->code) { + case PSN_APPLY: + if (bSettingSame) + WriteAutoAwaySetting(*sameSetting, SETTING_ALL); + else { + for (int i=0; i < optionSettings.getCount(); i++ ) + WriteAutoAwaySetting(optionSettings[i], optionSettings[i].szName); + } + LoadOptions(autoAwaySettings, FALSE); + } + break; + + case WM_DESTROY: + optionSettings.destroy(); + free(sameSetting); + break; + } + return FALSE; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// General options window procedure + +static INT_PTR CALLBACK DlgProcAutoAwayGeneralOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch (msg) { + case WM_INITDIALOG: + TranslateDialogDefault(hwndDlg); + CheckDlgButton(hwndDlg, IDC_IGNLOCK, db_get_b(NULL, MODULENAME, SETTING_IGNLOCK, FALSE) != 0 ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_IGNSYSKEYS, db_get_b(NULL, MODULENAME, SETTING_IGNSYSKEYS, FALSE) != 0 ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_IGNALTCOMBO, db_get_b(NULL, MODULENAME, SETTING_IGNALTCOMBO, FALSE) != 0 ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_MONITORMOUSE, db_get_b(NULL, MODULENAME, SETTING_MONITORMOUSE, BST_CHECKED) != 0 ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_MONITORKEYBOARD, db_get_b(NULL, MODULENAME, SETTING_MONITORKEYBOARD, BST_CHECKED) != 0 ? BST_CHECKED : BST_UNCHECKED); + SetDlgItemInt(hwndDlg, IDC_AWAYCHECKTIMEINSECS, db_get_w(NULL, MODULENAME, SETTING_AWAYCHECKTIMEINSECS, 5), FALSE); + SetDlgItemInt(hwndDlg, IDC_CONFIRMDELAY, db_get_w(NULL, MODULENAME, SETTING_CONFIRMDELAY, 5), FALSE); + CheckDlgButton(hwndDlg, bSettingSame ? IDC_SAMESETTINGS : IDC_PERPROTOCOLSETTINGS, BST_CHECKED); + ShowWindow(GetDlgItem(hwndDlg, IDC_IDLEWARNING), db_get_b(NULL, "Idle", "AAEnable", 0)); + break; + + case WM_SHOWWINDOW: + ShowWindow(GetDlgItem(hwndDlg, IDC_IDLEWARNING), (db_get_b(NULL, "Idle", "AAEnable", 0))); + break; + + case WM_COMMAND: + if (( HIWORD(wParam) == EN_CHANGE || HIWORD(wParam) == BN_CLICKED ) && (HWND)lParam == GetFocus()) + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + + switch(LOWORD(wParam)) { + case IDC_MONITORMOUSE: + CheckDlgButton(hwndDlg, IDC_MONITORMOUSE, (((BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_MONITORMOUSE))&&(BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_MONITORKEYBOARD)))||(IsDlgButtonChecked(hwndDlg, IDC_MONITORMOUSE)) ? BST_CHECKED : BST_UNCHECKED)); + break; + + case IDC_MONITORKEYBOARD: + CheckDlgButton(hwndDlg, IDC_MONITORKEYBOARD, (((BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_MONITORMOUSE))&&(BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_MONITORKEYBOARD)))||(IsDlgButtonChecked(hwndDlg, IDC_MONITORKEYBOARD)) ? BST_CHECKED : BST_UNCHECKED)); + break; + + case IDC_SAMESETTINGS: + case IDC_PERPROTOCOLSETTINGS: + bSettingSame = IsDlgButtonChecked(hwndDlg, IDC_SAMESETTINGS); + break; + } + break; + + case WM_NOTIFY: + if (((LPNMHDR)lParam)->code == PSN_APPLY ) { + db_set_b(NULL, MODULENAME, SETTING_IGNLOCK, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNLOCK)); + db_set_b(NULL, MODULENAME, SETTING_IGNSYSKEYS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNSYSKEYS)); + db_set_b(NULL, MODULENAME, SETTING_IGNALTCOMBO, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNALTCOMBO)); + db_set_b(NULL, MODULENAME, SETTING_SAMESETTINGS, (BYTE)bSettingSame); + db_set_w(NULL, MODULENAME, SETTING_AWAYCHECKTIMEINSECS, (WORD)GetDlgItemInt(hwndDlg, IDC_AWAYCHECKTIMEINSECS, NULL, FALSE)); + db_set_w(NULL, MODULENAME, SETTING_CONFIRMDELAY, (WORD)GetDlgItemInt(hwndDlg, IDC_CONFIRMDELAY, NULL, FALSE)); + db_set_b(NULL, MODULENAME, SETTING_MONITORMOUSE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MONITORMOUSE)); + db_set_b(NULL, MODULENAME, SETTING_MONITORKEYBOARD, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MONITORKEYBOARD)); + LoadOptions(autoAwaySettings, FALSE); + } + break; + } + return FALSE; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// Tab window procedure + +static INT_PTR CALLBACK DlgProcAutoAwayTabs(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch(msg) { + case WM_INITDIALOG: + TranslateDialogDefault(hwndDlg); + { + RECT rcTabs, rcOptions, rcPage; + bSettingSame = db_get_b(NULL, MODULENAME, SETTING_SAMESETTINGS, FALSE); + + // set tabs + int tabCount = 0; + HWND hTab = GetDlgItem(hwndDlg, IDC_TABS); + GetWindowRect(hTab, &rcTabs); + GetWindowRect(hwndDlg, &rcOptions); + + // general tab + TCITEM tci = { 0 }; + tci.mask = TCIF_TEXT | TCIF_PARAM; + tci.pszText = TranslateT("General"); + HWND hPage = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_OPT_GENAUTOAWAY), hwndDlg, DlgProcAutoAwayGeneralOpts, (LPARAM)GetParent(hwndDlg)); + EnableThemeDialogTexture(hPage, ETDT_ENABLETAB); + + tci.lParam = (LPARAM)hPage; + GetClientRect(hPage, &rcPage); + MoveWindow(hPage, (rcTabs.left - rcOptions.left) + ((rcTabs.right-rcTabs.left)-(rcPage.right-rcPage.left))/2, 10 + (rcTabs.top - rcOptions.top) + ((rcTabs.bottom-rcTabs.top)-(rcPage.bottom-rcPage.top))/2, rcPage.right-rcPage.left, rcPage.bottom-rcPage.top, TRUE); + ShowWindow(hPage, SW_HIDE); + TabCtrl_InsertItem(hTab, tabCount++, &tci); + HWND hShow = hPage; + + // rules tab + tci.mask = TCIF_TEXT|TCIF_PARAM; + tci.pszText = TranslateT("Rules"); + hPage = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_OPT_AUTOAWAY), hwndDlg, DlgProcAutoAwayRulesOpts, (LPARAM)GetParent(hwndDlg)); + EnableThemeDialogTexture(hPage, ETDT_ENABLETAB); + + tci.lParam = (LPARAM)hPage; + GetClientRect(hPage, &rcPage); + MoveWindow(hPage, (rcTabs.left - rcOptions.left) + ((rcTabs.right-rcTabs.left)-(rcPage.right-rcPage.left))/2, 10 + (rcTabs.top - rcOptions.top) + ((rcTabs.bottom-rcTabs.top)-(rcPage.bottom-rcPage.top))/2, rcPage.right-rcPage.left, rcPage.bottom-rcPage.top, TRUE); + ShowWindow(hPage, SW_HIDE); + TabCtrl_InsertItem(hTab, tabCount++, &tci); + + // messages tab + tci.mask = TCIF_TEXT|TCIF_PARAM; + tci.pszText = TranslateT("Status messages"); + hPage = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_OPT_AUTOAWAYMSG), hwndDlg, DlgProcAutoAwayMsgOpts, (LPARAM)GetParent(hwndDlg)); + EnableThemeDialogTexture(hPage, ETDT_ENABLETAB); + + tci.lParam = (LPARAM)hPage; + GetClientRect(hPage, &rcPage); + MoveWindow(hPage, (rcTabs.left - rcOptions.left) + ((rcTabs.right-rcTabs.left)-(rcPage.right-rcPage.left))/2, 10 + (rcTabs.top - rcOptions.top) + ((rcTabs.bottom-rcTabs.top)-(rcPage.bottom-rcPage.top))/2, rcPage.right-rcPage.left, rcPage.bottom-rcPage.top, TRUE); + ShowWindow(hPage, SW_HIDE); + TabCtrl_InsertItem(hTab, tabCount++, &tci); + + ShowWindow(hShow, SW_SHOW); + } + break; + + case PSM_CHANGED: + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + break; + + case WM_NOTIFY: + if ((((NMHDR*)lParam)->idFrom == IDC_TABS)) { + if (((NMHDR*)lParam)->code == TCN_SELCHANGING) { + TCITEM tci; + + tci.mask = TCIF_PARAM; + TabCtrl_GetItem(GetDlgItem(hwndDlg, IDC_TABS), TabCtrl_GetCurSel(GetDlgItem(hwndDlg, IDC_TABS)), &tci); + ShowWindow((HWND)tci.lParam, SW_HIDE); + } + else if (((NMHDR*)lParam)->code == TCN_SELCHANGE) { + TCITEM tci; + + tci.mask = TCIF_PARAM; + TabCtrl_GetItem(GetDlgItem(hwndDlg, IDC_TABS), TabCtrl_GetCurSel(GetDlgItem(hwndDlg, IDC_TABS)), &tci); + ShowWindow((HWND)tci.lParam, SW_SHOW); + } + } + if (((LPNMHDR)lParam)->code == PSN_APPLY) { + TCITEM tci; + tci.mask = TCIF_PARAM; + int count = TabCtrl_GetItemCount(GetDlgItem(hwndDlg, IDC_TABS)); + for (int i = 0; i < count; i++) { + TabCtrl_GetItem(GetDlgItem(hwndDlg, IDC_TABS), i, &tci); + SendMessage((HWND)tci.lParam, WM_NOTIFY, 0, lParam); + } + } + break; + } + + return FALSE; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// Options initialization procedure + +int AutoAwayOptInitialise(WPARAM wParam,LPARAM lParam) +{ + OPTIONSDIALOGPAGE odp = { 0 }; + odp.position = 1000000000; + odp.hInstance = hInst; + odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_TABS); + odp.pszTitle = LPGEN("Auto Away"); + odp.pszGroup = LPGEN("Status"); + odp.pfnDlgProc = DlgProcAutoAwayTabs; + odp.flags = ODPF_BOLDGROUPS; + Options_AddPage(wParam, &odp); + return 0; +} diff --git a/tools/_deprecated/StatusPlugins/AdvancedAutoAway/version.h b/tools/_deprecated/StatusPlugins/AdvancedAutoAway/version.h new file mode 100644 index 0000000000..bda6bff95c --- /dev/null +++ b/tools/_deprecated/StatusPlugins/AdvancedAutoAway/version.h @@ -0,0 +1,17 @@ +// plugin version part +#define __MAJOR_VERSION 0 +#define __MINOR_VERSION 8 +#define __RELEASE_NUM 1 +#define __BUILD_NUM 1 + +// other stuff for Version resource +#include + +// stuff that will be used in PluginInfo section and in Version resource +#define __PLUGIN_NAME "Advanced Auto Away" +#define __FILENAME "AdvancedAutoAway.dll" +#define __DESC "An Auto Away module with some more options than the original." +#define __AUTHOR "P Boon" +#define __AUTHOREMAIL "unregistered@users.sourceforge.net" +#define __AUTHORWEB "http://miranda-ng.org/p/AdvancedAutoAway/" +#define __COPYRIGHT "© 2003-08 P. Boon, 2008-16 George Hazan" diff --git a/tools/_deprecated/StatusPlugins/KeepStatus/KeepStatus.txt b/tools/_deprecated/StatusPlugins/KeepStatus/KeepStatus.txt new file mode 100644 index 0000000000..55b3992487 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/KeepStatus/KeepStatus.txt @@ -0,0 +1,145 @@ +KeepStatus plugin for Miranda IM v0.0.2.x +unregistered@users.sourceforge.net + +--- About --- + +KeepStatus, a connection checker, for use with (or without) +StartupStatus and/or AdvancedAutoAway. + +--- Usage --- + +There are two tabs in the options screen, one with basic options, and +one with advanced options. + +The Basic Tab: + +[] Show popups, this will make use of the popup plugin to notify you +in case of a connection loss or reconnect attempt. + +[] Check connection, with this option you can enable or disable the +plugin. + +[count] Max. retries, in case connection is lost, this number of +reconnect attempts will be made to restore the connection. + +[secs] Delay between retries, the number of seconds to wait before a +new attempt is made. + +[] Don't reconnect if no internet connection seems available, if +enabled, KS will not reconnect if Windows reports that no internet +connection is available. + +[] Continuesly check for internet connection, if enables, KS will keep +looking for a connection, either by asking Windows, or by pinging a +host. You can specify multiple hosts by seperating them with +spaces. If one host replies, a connection is assumed to be available. + +Note: All dial-up options are experimental. I cannot test these +myself. Please let me know if you encounter problems with it (and you +are willing to run some tests ;) ) + +The Advanced Tab: + +[] Increase delay exponential, if enabled, the delay is multiplied by +2 after each check. So checks are made at t=10, t=20, t=40, t=40, +t=40, etc. if "Max. delay" = 40, "Initial delay" = 10, and connection +was lost at t=0. + +[secs] Max. delay, the maximum delay allowed in case "increase delay +exponential" is enabled. + +[secs] Max. protocol connecting time, -experimental-, this is the +maximum number of seconds a protocol is allowed to be in the +"connecting state" during a reconnect attempt. After this time, KS +will force the protocol offline and make a new connection attempt. + +[] Ignore locked status of protocols, if enabled, KS will reconnect +protocols in case of a global status change, even if they are locked +by the clist (nicer/modern). You can enable this if protocols don't +reconnect properly after a global status change using a clist that +doesn't support locking. + +[] Set protocol offline before a connection attempt, this will force a +protocol offline, before KS tries to restore its connection. + +[] Cancel all if a protocol connects from another location, this will +not reconnect any of the protocols if one of them is connected from +another location. The reason for this option is because not all +protocols can detect a second login. + +[] Reconnect on APM resume, will reconnect you when you come back from +standby or hibernation. If it for some reason fails, please try +another clist. + +[] React on login errors, influences the way KS deals with login +errors (default is to keep retrying). A login error can be "wrong +password" or "server busy" for example. + +() Stop trying to reconnect, cancels reconnecting for the protocol. + +() Set delay to [secs], this will (possibly) increase the delay before +a new attempt is made to restore the connection. + +Consider connection lost after [count] failed pings, tells KS how many +ping attempts must fail before the connection should be considered +"lost" and need to be restored. + +[secs] Continuously check interval, the delay between two pings. + +--- Notes --- + +All options regarding dial-up connections are experimental. + +--- Changelog --- + +0.0.2.92: - fixes for Miranda 0.8 (added MUID) + - some minor fixes. + +0.0.2.85: - Different handling of timers + - Partitial locked status support (full support requires changes in core) + - Fix 'random' crash + +0.0.2.74: - A few more fixes + +0.0.2.73: - Fix when setting no status message + +0.0.2.72: - Fix options dialog glitch + +0.0.2.71: - Several bug fixes + - Added options for continuously checking + - Support for "protocol locking" by clist + - Better NAS support (requires NAS v0.3.7.2 (build 2338; April 30, 2006)) + - Added more convenient service for developers MS_KS_ANNOUNCESTATUSCHANGE + - Popups stay until next retry if delay is set to 0 + - Added option "Max. connecting time", see documentation + - Added option to set protocol offline before reconnecting + - Set global status when possible + - Ping using ICMP instead of using InternetCheckConnection. + +0.0.2.4: - popups now show the icon of the first protocol that is about to be reconnected + - added popup option to show additional info in popup + +0.0.2.3: - you can now change the delay when a login error occurs + +0.0.2.2: - many bugfixes (with great help of weinstock and ghazan) + - added option to check internet connection by pinging + - added more options for popups + - added option to reconnect on APM resume (standby, hibernate) + +0.0.1.0: - doesn't reconnect when logged in from another location + - Added: option reconnect on login failures + +0.0.0.4: - fixed: now also works with popups disabled. (thanks to Stefan Waldmann) + +0.0.0.3: - Added support for PluginUninstaller + - bug fixes + +0.0.0.2: - Several bug fixes + - Better menu handling + - Fixed: Jabber/Tlen support (not in combination with (current) awaysys!) + +0.0.0.1: - First release without StartupStatus + +--- Disclaimer --- + +If something terrible happens, don't blame me. \ No newline at end of file diff --git a/tools/_deprecated/StatusPlugins/KeepStatus/KeepStatus_10.vcxproj b/tools/_deprecated/StatusPlugins/KeepStatus/KeepStatus_10.vcxproj new file mode 100644 index 0000000000..ac91443e1c --- /dev/null +++ b/tools/_deprecated/StatusPlugins/KeepStatus/KeepStatus_10.vcxproj @@ -0,0 +1,226 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + KeepStatus + {D548A54E-310B-4A86-A545-64BDD5748745} + + + + DynamicLibrary + Unicode + true + + + DynamicLibrary + Unicode + + + DynamicLibrary + Unicode + true + + + DynamicLibrary + Unicode + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)\Plugins\ + $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)\Plugins\ + $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)64\Plugins\ + $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)64\Plugins\ + $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ + true + + + + Disabled + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + _DEBUG;_WINDOWS;_USRDLL;KEEPSTATUS_EXPORTS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + Use + ..\commonstatus.h + Level3 + EditAndContinue + 4996;%(DisableSpecificWarnings) + false + + + _DEBUG;%(PreprocessorDefinitions) + ..\..\..\include\msapi + + + ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies) + true + false + $(IntDir)$(TargetName).lib + Windows + 0x11cd0000 + $(ProfileDir)..\..\..\bin10\lib + + + + + Full + OnlyExplicitInline + Size + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + NDEBUG;_WINDOWS;_USRDLL;KEEPSTATUS_EXPORTS;%(PreprocessorDefinitions) + true + false + false + true + Fast + Use + ..\commonstatus.h + Level3 + 4996;%(DisableSpecificWarnings) + + + NDEBUG;%(PreprocessorDefinitions) + ..\..\..\include\msapi + + + ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies) + true + true + true + 0x11cd0000 + false + $(IntDir)$(TargetName).lib + Windows + $(ProfileDir)..\..\..\bin10\lib + /PDBALTPATH:%_PDB% + + + + + Full + false + false + Fast + OnlyExplicitInline + Size + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + true + Use + ..\commonstatus.h + NDEBUG;_WINDOWS;_USRDLL;KEEPSTATUS_EXPORTS;%(PreprocessorDefinitions) + Level3 + 4996;%(DisableSpecificWarnings) + + + true + $(SolutionDir)\lib + + + true + ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies) + true + $(IntDir)$(TargetName).lib + Windows + false + 0x11cd0000 + $(ProfileDir)..\..\..\bin10\lib + /PDBALTPATH:%_PDB% + + + ..\..\..\include\msapi + NDEBUG;%(PreprocessorDefinitions) + + + + + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + Use + ..\commonstatus.h + _DEBUG;_WINDOWS;_USRDLL;KEEPSTATUS_EXPORTS;%(PreprocessorDefinitions) + Level3 + 4996;%(DisableSpecificWarnings) + Disabled + MultiThreadedDebugDLL + false + + + ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies) + true + $(IntDir)$(TargetName).lib + Windows + false + 0x11cd0000 + $(ProfileDir)..\..\..\bin10\lib + + + ..\..\..\include\msapi + _DEBUG;%(PreprocessorDefinitions) + + + + + Create + commonstatus.h + + + commonstatus.h + + + commonstatus.h + + + NotUsing + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/_deprecated/StatusPlugins/KeepStatus/KeepStatus_10.vcxproj.filters b/tools/_deprecated/StatusPlugins/KeepStatus/KeepStatus_10.vcxproj.filters new file mode 100644 index 0000000000..9d4b6dcc2d --- /dev/null +++ b/tools/_deprecated/StatusPlugins/KeepStatus/KeepStatus_10.vcxproj.filters @@ -0,0 +1,59 @@ + + + + + {6fb49235-e0f0-4889-b5d7-c5f7a5b3a95f} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {be845fa0-70f3-4168-9620-2f231e2702af} + h;hpp;hxx;hm;inl + + + {3795d706-cfb9-43c3-a967-b0759da5b8af} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + Resource Files + + + \ No newline at end of file diff --git a/tools/_deprecated/StatusPlugins/KeepStatus/KeepStatus_12.vcxproj b/tools/_deprecated/StatusPlugins/KeepStatus/KeepStatus_12.vcxproj new file mode 100644 index 0000000000..f79e8063b6 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/KeepStatus/KeepStatus_12.vcxproj @@ -0,0 +1,229 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + KeepStatus + {D548A54E-310B-4A86-A545-64BDD5748745} + + + + DynamicLibrary + Unicode + true + v120_xp + + + DynamicLibrary + Unicode + v120_xp + + + DynamicLibrary + Unicode + true + v120_xp + + + DynamicLibrary + Unicode + v120_xp + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)\Plugins\ + $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)\Plugins\ + $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)64\Plugins\ + $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)64\Plugins\ + $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ + true + + + + Disabled + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + _DEBUG;_WINDOWS;_USRDLL;KEEPSTATUS_EXPORTS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + Use + ..\commonstatus.h + Level4 + EditAndContinue + 4996;%(DisableSpecificWarnings) + false + + + _DEBUG;%(PreprocessorDefinitions) + ..\..\..\include\msapi + + + ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies) + true + false + $(IntDir)$(TargetName).lib + Windows + 0x11cd0000 + $(ProfileDir)..\..\..\bin12\lib + false + + + + + Full + OnlyExplicitInline + Size + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + NDEBUG;_WINDOWS;_USRDLL;KEEPSTATUS_EXPORTS;%(PreprocessorDefinitions) + true + false + false + true + Fast + Use + ..\commonstatus.h + Level4 + 4996;%(DisableSpecificWarnings) + + + NDEBUG;%(PreprocessorDefinitions) + ..\..\..\include\msapi + + + ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies) + true + true + true + 0x11cd0000 + false + $(IntDir)$(TargetName).lib + Windows + $(ProfileDir)..\..\..\bin12\lib + + + + + Full + false + false + Fast + OnlyExplicitInline + Size + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + true + Use + ..\commonstatus.h + NDEBUG;_WINDOWS;_USRDLL;KEEPSTATUS_EXPORTS;%(PreprocessorDefinitions) + Level4 + 4996;%(DisableSpecificWarnings) + + + true + $(SolutionDir)\lib + + + true + ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies) + true + $(IntDir)$(TargetName).lib + Windows + false + 0x11cd0000 + $(ProfileDir)..\..\..\bin12\lib + + + ..\..\..\include\msapi + NDEBUG;%(PreprocessorDefinitions) + + + + + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + Use + ..\commonstatus.h + _DEBUG;_WINDOWS;_USRDLL;KEEPSTATUS_EXPORTS;%(PreprocessorDefinitions) + Level4 + 4996;%(DisableSpecificWarnings) + Disabled + MultiThreadedDebugDLL + false + + + ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies) + true + $(IntDir)$(TargetName).lib + Windows + false + 0x11cd0000 + $(ProfileDir)..\..\..\bin12\lib + + + ..\..\..\include\msapi + _DEBUG;%(PreprocessorDefinitions) + + + + + Create + commonstatus.h + + + commonstatus.h + + + commonstatus.h + + + NotUsing + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/_deprecated/StatusPlugins/KeepStatus/KeepStatus_12.vcxproj.filters b/tools/_deprecated/StatusPlugins/KeepStatus/KeepStatus_12.vcxproj.filters new file mode 100644 index 0000000000..9d4b6dcc2d --- /dev/null +++ b/tools/_deprecated/StatusPlugins/KeepStatus/KeepStatus_12.vcxproj.filters @@ -0,0 +1,59 @@ + + + + + {6fb49235-e0f0-4889-b5d7-c5f7a5b3a95f} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {be845fa0-70f3-4168-9620-2f231e2702af} + h;hpp;hxx;hm;inl + + + {3795d706-cfb9-43c3-a967-b0759da5b8af} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + Resource Files + + + \ No newline at end of file diff --git a/tools/_deprecated/StatusPlugins/KeepStatus/KeepStatus_14.vcxproj b/tools/_deprecated/StatusPlugins/KeepStatus/KeepStatus_14.vcxproj new file mode 100644 index 0000000000..52ab7ac406 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/KeepStatus/KeepStatus_14.vcxproj @@ -0,0 +1,229 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + KeepStatus + {D548A54E-310B-4A86-A545-64BDD5748745} + + + + DynamicLibrary + Unicode + true + v140_xp + + + DynamicLibrary + Unicode + v140_xp + + + DynamicLibrary + Unicode + true + v140_xp + + + DynamicLibrary + Unicode + v140_xp + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)\Plugins\ + $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)\Plugins\ + $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)64\Plugins\ + $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)64\Plugins\ + $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ + true + + + + Disabled + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + _DEBUG;_WINDOWS;_USRDLL;KEEPSTATUS_EXPORTS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + Use + ..\commonstatus.h + Level4 + EditAndContinue + 4996;%(DisableSpecificWarnings) + false + + + _DEBUG;%(PreprocessorDefinitions) + ..\..\..\include\msapi + + + ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies) + true + false + $(IntDir)$(TargetName).lib + Windows + 0x11cd0000 + $(ProfileDir)..\..\..\bin14\lib + false + + + + + Full + OnlyExplicitInline + Size + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + NDEBUG;_WINDOWS;_USRDLL;KEEPSTATUS_EXPORTS;%(PreprocessorDefinitions) + true + false + false + true + Fast + Use + ..\commonstatus.h + Level4 + 4996;%(DisableSpecificWarnings) + + + NDEBUG;%(PreprocessorDefinitions) + ..\..\..\include\msapi + + + ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies) + true + true + true + 0x11cd0000 + false + $(IntDir)$(TargetName).lib + Windows + $(ProfileDir)..\..\..\bin14\lib + + + + + Full + false + false + Fast + OnlyExplicitInline + Size + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + true + Use + ..\commonstatus.h + NDEBUG;_WINDOWS;_USRDLL;KEEPSTATUS_EXPORTS;%(PreprocessorDefinitions) + Level4 + 4996;%(DisableSpecificWarnings) + + + true + $(SolutionDir)\lib + + + true + ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies) + true + $(IntDir)$(TargetName).lib + Windows + false + 0x11cd0000 + $(ProfileDir)..\..\..\bin14\lib + + + ..\..\..\include\msapi + NDEBUG;%(PreprocessorDefinitions) + + + + + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + Use + ..\commonstatus.h + _DEBUG;_WINDOWS;_USRDLL;KEEPSTATUS_EXPORTS;%(PreprocessorDefinitions) + Level4 + 4996;%(DisableSpecificWarnings) + Disabled + MultiThreadedDebugDLL + false + + + ws2_32.lib;wininet.lib;UxTheme.lib;Iphlpapi.lib;%(AdditionalDependencies) + true + $(IntDir)$(TargetName).lib + Windows + false + 0x11cd0000 + $(ProfileDir)..\..\..\bin14\lib + + + ..\..\..\include\msapi + _DEBUG;%(PreprocessorDefinitions) + + + + + Create + commonstatus.h + + + commonstatus.h + + + commonstatus.h + + + NotUsing + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/_deprecated/StatusPlugins/KeepStatus/KeepStatus_14.vcxproj.filters b/tools/_deprecated/StatusPlugins/KeepStatus/KeepStatus_14.vcxproj.filters new file mode 100644 index 0000000000..9d4b6dcc2d --- /dev/null +++ b/tools/_deprecated/StatusPlugins/KeepStatus/KeepStatus_14.vcxproj.filters @@ -0,0 +1,59 @@ + + + + + {6fb49235-e0f0-4889-b5d7-c5f7a5b3a95f} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {be845fa0-70f3-4168-9620-2f231e2702af} + h;hpp;hxx;hm;inl + + + {3795d706-cfb9-43c3-a967-b0759da5b8af} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + Resource Files + + + \ No newline at end of file diff --git a/tools/_deprecated/StatusPlugins/KeepStatus/keepstatus.cpp b/tools/_deprecated/StatusPlugins/KeepStatus/keepstatus.cpp new file mode 100644 index 0000000000..54cb3028d4 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/KeepStatus/keepstatus.cpp @@ -0,0 +1,1209 @@ +/* + KeepStatus Plugin for Miranda-IM (www.miranda-im.org) + Copyright 2003-2006 P. Boon + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include "../commonstatus.h" +#include "keepstatus.h" +#include "../resource.h" + +struct TimerInfo { + int timer; + int timeout; + BOOL restart; + int result; + HANDLE hEvent; +}; + +static mir_cs GenTimerCS, GenStatusCS, CheckContinueslyCS; + +static HANDLE hProtoAckHook = NULL; +static HANDLE hStatusChangeHook = NULL; +static HANDLE hCSStatusChangeHook = NULL; +static HANDLE hCSStatusChangeExHook = NULL; + +extern HANDLE hConnectionEvent; +extern PLUGININFOEX pluginInfoEx; + +static HWND hMessageWindow = NULL; + +static int CompareConnections(const TConnectionSettings *p1, const TConnectionSettings *p2) +{ + return mir_strcmp(p1->szName, p2->szName); +} + +static OBJLIST connectionSettings(10, CompareConnections); + +static UINT_PTR checkConnectionTimerId = 0; +static UINT_PTR afterCheckTimerId = 0; +static UINT_PTR processAckTimerId = 0; +static UINT_PTR checkContinTimerId = 0; +static UINT_PTR checkConnectingTimerId = 0; +static int retryCount = 0; +static BOOL bLastPingResult = TRUE; +// variables (options) +static int maxRetries = 0; +static int initDelay = 0; +static int currentDelay = 0; +static int maxDelay = 0; +static int ackDelay = 500; +static int increaseExponential = 0; +static int showConnectionPopups = 0; +// prototypes +static int StartTimer(int timer, int timeout, BOOL restart); +static int StopTimer(int timer); +int LoadMainOptions(); +static void GetCurrentConnectionSettings(); +static int AssignStatus(TConnectionSettings* connSetting, int status, int lastStatus, wchar_t *szMsg); +static int ProcessProtoAck(WPARAM wParam, LPARAM lParam); +static VOID CALLBACK CheckConnectingTimer(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime); +static VOID CALLBACK CheckAckStatusTimer(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime); +static int StatusChange(WPARAM wParam, LPARAM lParam); +static int CSStatusChange(WPARAM wParam, LPARAM lParam); +static int CSStatusChangeEx(WPARAM wParam, LPARAM lParam); +static VOID CALLBACK StatusChangeTimer(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime); +static VOID CALLBACK CheckConnectionTimer(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime); +static int StopChecking(); +static VOID CALLBACK AfterCheckTimer(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime); +static void ContinueslyCheckFunction(void *arg); +static VOID CALLBACK CheckContinueslyTimer(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime); +INT_PTR IsProtocolEnabledService(WPARAM wParam, LPARAM lParam); + +static int ProcessPopup(int reason, LPARAM lParam); +static INT_PTR ShowPopup(wchar_t *msg, HICON hIcon); +LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); +static DWORD CALLBACK MessageWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); + +// options.c +extern int OptionsInit(WPARAM wparam, LPARAM); +extern int InitCommonStatus(); + +TConnectionSettings::TConnectionSettings(PROTOACCOUNT *pa) +{ + cbSize = sizeof(PROTOCOLSETTINGEX); + szName = pa->szModuleName; + tszAccName = pa->tszAccountName; + szMsg = NULL; + + int iStatus = CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0); + AssignStatus(this, iStatus, iStatus, NULL); +} + +TConnectionSettings::~TConnectionSettings() +{ + if (szMsg != NULL) + free(szMsg); +} + +int LoadMainOptions() +{ + UnhookEvent(hProtoAckHook); + UnhookEvent(hStatusChangeHook); + UnhookEvent(hCSStatusChangeHook); + UnhookEvent(hCSStatusChangeExHook); + hProtoAckHook = hStatusChangeHook = hCSStatusChangeHook = hCSStatusChangeExHook = 0; + + if (IsWindow(hMessageWindow)) + DestroyWindow(hMessageWindow); + if (StartTimer(IDT_CHECKCONTIN, -1, FALSE)) { + WSACleanup(); + } + StopTimer(IDT_CHECKCONN | IDT_PROCESSACK | IDT_AFTERCHECK | IDT_CHECKCONTIN | IDT_CHECKCONNECTING); + + GetCurrentConnectionSettings(); + + if (db_get_b(NULL, MODULENAME, SETTING_CHECKCONNECTION, FALSE)) { + if (db_get_b(NULL, MODULENAME, SETTING_CONTCHECK, FALSE)) { + if (db_get_b(NULL, MODULENAME, SETTING_BYPING, FALSE)) { + WSADATA wsaData; + WSAStartup(MAKEWORD(2, 2), &wsaData); + } + StartTimer(IDT_CHECKCONTIN, 0, FALSE); + } + increaseExponential = db_get_b(NULL, MODULENAME, SETTING_INCREASEEXPONENTIAL, FALSE); + currentDelay = initDelay = 1000 * db_get_dw(NULL, MODULENAME, SETTING_INITDELAY, DEFAULT_INITDELAY); + maxDelay = 1000 * db_get_dw(NULL, MODULENAME, SETTING_MAXDELAY, DEFAULT_MAXDELAY); + maxRetries = db_get_b(NULL, MODULENAME, SETTING_MAXRETRIES, 0); + if (maxRetries == 0) + maxRetries = -1; + hProtoAckHook = HookEvent(ME_PROTO_ACK, ProcessProtoAck); + hStatusChangeHook = HookEvent(ME_CLIST_STATUSMODECHANGE, StatusChange); + if (ServiceExists(ME_CS_STATUSCHANGE)) + hCSStatusChangeHook = HookEvent(ME_CS_STATUSCHANGE, CSStatusChange); + hCSStatusChangeExHook = HookEvent(ME_CS_STATUSCHANGEEX, CSStatusChangeEx); + if (db_get_b(NULL, MODULENAME, SETTING_CHECKAPMRESUME, 0) && (CallService(MS_SYSTEM_GETVERSION, 0, 0) >= 0x00040000)) { + if (!IsWindow(hMessageWindow)) { + hMessageWindow = CreateWindowEx(0, L"STATIC", NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL); + SetWindowLongPtr(hMessageWindow, GWLP_WNDPROC, (LONG_PTR)MessageWndProc); + } + } + retryCount = 0; + } + + return 0; +} + +static void GetCurrentConnectionSettings() +{ + connectionSettings.destroy(); + + int count; + PROTOACCOUNT** protos; + Proto_EnumAccounts(&count, &protos); + + for (int i = 0; i < count; i++) + if (IsSuitableProto(protos[i])) + connectionSettings.insert(new TConnectionSettings(protos[i])); +} + +static PROTOCOLSETTINGEX** GetCurrentProtoSettingsCopy() +{ + mir_cslock lck(GenStatusCS); + PROTOCOLSETTINGEX **ps = (PROTOCOLSETTINGEX**)malloc(connectionSettings.getCount()*sizeof(PROTOCOLSETTINGEX *)); + if (ps == NULL) { + return NULL; + } + for (int i = 0; i < connectionSettings.getCount(); i++) { + ps[i] = (PROTOCOLSETTINGEX*)calloc(1, sizeof(PROTOCOLSETTINGEX)); + if (ps[i] == NULL) { + free(ps); + return NULL; + } + + TConnectionSettings& cs = connectionSettings[i]; + ps[i]->cbSize = sizeof(PROTOCOLSETTINGEX); + ps[i]->lastStatus = cs.lastStatus; + ps[i]->status = cs.status; + ps[i]->szMsg = NULL; + ps[i]->szName = cs.szName; + ps[i]->tszAccName = cs.tszAccName; + } + + return ps; +} + +static void FreeProtoSettings(PROTOCOLSETTINGEX** ps) +{ + for (int i = 0; i < connectionSettings.getCount(); i++) { + if (ps[i]->szMsg != NULL) + free(ps[i]->szMsg); + free(ps[i]); + } + free(ps); +} + +static int AssignStatus(TConnectionSettings* cs, int status, int lastStatus, wchar_t *szMsg) +{ + if (status < MIN_STATUS || status > MAX_STATUS) + return -1; + + mir_cslock lck(GenStatusCS); + + char dbSetting[128]; + mir_snprintf(dbSetting, "%s_enabled", cs->szName); + cs->lastStatus = lastStatus == 0 ? cs->status : lastStatus; + if (!db_get_b(NULL, MODULENAME, dbSetting, 1)) + cs->status = ID_STATUS_DISABLED; + else if (status == ID_STATUS_LAST) + cs->status = cs->lastStatus; + else + cs->status = status; + + log_infoA("KeepStatus: assigning status %d to %s", cs->status, cs->szName); + + if (szMsg != NULL && mir_wstrcmp(szMsg, cs->szMsg)) { + if (cs->szMsg != NULL) + free(cs->szMsg); + + cs->szMsg = wcsdup(szMsg); + } + else if (szMsg != cs->szMsg) { + if (cs->szMsg != NULL) + free(cs->szMsg); + + cs->szMsg = NULL; + } + return 0; +} + +static int GetStatus(const TConnectionSettings& cs) +{ + if (cs.status == ID_STATUS_CURRENT) + return CallProtoService(cs.szName, PS_GETSTATUS, 0, 0); + + return cs.status; +} + +static int SetCurrentStatus() +{ + PROTOCOLSETTINGEX **ps = GetCurrentProtoSettingsCopy(); + for (int i = 0; i < connectionSettings.getCount(); i++) { + int realStatus = CallProtoService(ps[i]->szName, PS_GETSTATUS, 0, 0); + if (ps[i]->status == ID_STATUS_DISABLED || ps[i]->status == realStatus) { // ignore this proto by removing it's name (not so nice) + ps[i]->szName = ""; + } + else if ((ps[i]->status != ID_STATUS_DISABLED) && (ps[i]->status != realStatus) && (realStatus != ID_STATUS_OFFLINE) && (db_get_b(NULL, MODULENAME, SETTING_FIRSTOFFLINE, FALSE))) { + // force offline before reconnecting + log_infoA("KeepStatus: Setting %s offline before making a new connection attempt", ps[i]->szName); + CallProtoService(ps[i]->szName, PS_SETSTATUS, (WPARAM)ID_STATUS_OFFLINE, 0); + } + } + ProcessPopup(KS_CONN_STATE_RETRY, (LPARAM)ps); + INT_PTR ret = CallService(MS_CS_SETSTATUSEX, (WPARAM)&ps, 0); + FreeProtoSettings(ps); + + return ret; +} + +static int StatusChange(WPARAM wParam, LPARAM lParam) +{ + char* szProto = (char *)lParam; + if (szProto == NULL) { // global status change + for (int i = 0; i < connectionSettings.getCount(); i++) { + TConnectionSettings& cs = connectionSettings[i]; + if (GetStatus(cs) != ID_STATUS_DISABLED) + if (db_get_b(NULL, MODULENAME, SETTING_NOLOCKED, 0) || + !db_get_b(NULL, cs.szName, "LockMainStatus", 0)) + AssignStatus(&cs, wParam, 0, cs.szMsg); + } + } + else { + for (int i = 0; i < connectionSettings.getCount(); i++) { + TConnectionSettings& cs = connectionSettings[i]; + if (GetStatus(cs) != ID_STATUS_DISABLED && !mir_strcmp(cs.szName, szProto)) + AssignStatus(&cs, wParam, 0, cs.szMsg); + } + } + + return 0; +} + +static int CSStatusChange(WPARAM wParam, LPARAM) +{ + // the status was changed by commonstatus (old) + if (wParam != 0) { + PROTOCOLSETTING** protoSettings = *(PROTOCOLSETTING***)wParam; + + if (protoSettings == NULL) + return -1; + + for (int i = 0; i < connectionSettings.getCount(); i++) { + for (int j = 0; j < connectionSettings.getCount(); j++) { + if ((protoSettings[i]->szName == NULL) || (connectionSettings[j].szName == NULL)) + continue; + + if (!mir_strcmp(protoSettings[i]->szName, connectionSettings[j].szName)) + if (GetStatus(connectionSettings[j]) != ID_STATUS_DISABLED) + AssignStatus(&connectionSettings[j], protoSettings[i]->status, protoSettings[i]->lastStatus, connectionSettings[j].szMsg); + } + } + } + + return 0; +} + +static int CSStatusChangeEx(WPARAM wParam, LPARAM) +{ + // the status was changed by commonstatus (new) + if (wParam != 0) { + PROTOCOLSETTINGEX** protoSettings = *(PROTOCOLSETTINGEX***)wParam; + + if (protoSettings == NULL) + return -1; + + for (int i = 0; i < connectionSettings.getCount(); i++) { + for (int j = 0; j < connectionSettings.getCount(); j++) { + if ((protoSettings[i]->szName == NULL) || (connectionSettings[j].szName == NULL)) + continue; + if (!mir_strcmp(protoSettings[i]->szName, connectionSettings[j].szName)) { + if (GetStatus(connectionSettings[j]) != ID_STATUS_DISABLED) + AssignStatus(&connectionSettings[j], protoSettings[i]->status, protoSettings[i]->lastStatus, protoSettings[i]->szMsg); + } + } + } + } + + return 0; +} + +static int StartTimerFunction(int timer, int timeout, BOOL restart) +{ + int res = 0; + + mir_cslock lck(GenTimerCS); + log_debugA("StartTimer: %d, %d, %d", timer, timeout, restart); + log_debugA("ack: %u, chk: %u, aft: %u, cnt: %u, con: %u", processAckTimerId, checkConnectionTimerId, afterCheckTimerId, checkContinTimerId, checkConnectingTimerId); + if (timer & IDT_PROCESSACK) { + res = (processAckTimerId == 0) ? 0 : 1; + if (((processAckTimerId == 0) && (checkConnectionTimerId == 0)) || (restart)) { + if (timeout != -1) { + if (restart) + KillTimer(NULL, processAckTimerId); + if (timeout == 0) + processAckTimerId = SetTimer(NULL, 0, ackDelay, CheckAckStatusTimer); + else + processAckTimerId = SetTimer(NULL, 0, timeout, CheckAckStatusTimer); + } + } + } + + if (timer & IDT_CHECKCONN) { + res = (checkConnectionTimerId == 0 ? 0 : 1) || res; + if ((checkConnectionTimerId == 0) || (restart)) { + if (timeout != -1) { + if (restart) + KillTimer(NULL, checkConnectionTimerId); + if (timeout == 0) + checkConnectionTimerId = SetTimer(NULL, 0, initDelay, CheckConnectionTimer); + else + checkConnectionTimerId = SetTimer(NULL, 0, timeout, CheckConnectionTimer); + } + } + } + + if (timer & IDT_AFTERCHECK) { + res = (afterCheckTimerId == 0 ? 0 : 1) || res; + if ((afterCheckTimerId == 0) || (restart)) { + if (timeout != -1) { + if (restart) + KillTimer(NULL, afterCheckTimerId); + if (timeout == 0) + afterCheckTimerId = SetTimer(NULL, 0, initDelay / 2, AfterCheckTimer); + else + afterCheckTimerId = SetTimer(NULL, 0, timeout, AfterCheckTimer); + } + } + } + + if (timer & IDT_CHECKCONTIN) { + res = (checkContinTimerId == 0 ? 0 : 1) || res; + if ((checkContinTimerId == 0) || (restart)) { + if (timeout != -1) { + if (restart) + KillTimer(NULL, checkContinTimerId); + if (timeout == 0) { + checkContinTimerId = SetTimer(NULL, 0, 1000 * db_get_dw(NULL, MODULENAME, SETTING_CNTDELAY, CHECKCONTIN_DELAY), CheckContinueslyTimer); + } + else + checkContinTimerId = SetTimer(NULL, 0, timeout, CheckContinueslyTimer); + } + } + } + + if (timer & IDT_CHECKCONNECTING) { + res = (checkConnectingTimerId == 0 ? 0 : 1) || res; + if ((checkConnectingTimerId == 0) || (restart)) { + if (timeout != -1) { + if (restart) + KillTimer(NULL, checkConnectingTimerId); + if (timeout == 0) { + timeout = initDelay / 2; + } + checkConnectingTimerId = SetTimer(NULL, 0, timeout, CheckConnectingTimer); + } + } + } + + log_debugA("ack: %u, chk: %u, aft: %u, cnt: %u, con: %u", processAckTimerId, checkConnectionTimerId, afterCheckTimerId, checkContinTimerId, checkConnectingTimerId); + log_debugA("StartTimer done %d", res); + + return res; +} + +static VOID CALLBACK StartTimerApcProc(ULONG_PTR param) +{ + struct TimerInfo *ti = (struct TimerInfo *)param; + log_debugA("StartTimerApcProc %d %d %d", ti->timer, ti->timeout, ti->restart); + ti->result = StartTimerFunction(ti->timer, ti->timeout, ti->restart); + SetEvent(ti->hEvent); +} + +static int StartTimer(int timer, int timeout, BOOL restart) +{ + if (GetCurrentThreadId() == mainThreadId) + return StartTimerFunction(timer, timeout, restart); + + TimerInfo *ti = (TimerInfo*)calloc(1, sizeof(struct TimerInfo)); + ti->timer = timer; + ti->timeout = timeout; + ti->restart = restart; + ti->hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); + QueueUserAPC(StartTimerApcProc, hMainThread, (ULONG_PTR)ti); + WaitForSingleObject(ti->hEvent, INFINITE); + CloseHandle(ti->hEvent); + int res = ti->result; + free(ti); + return res; +} + +static int StopTimer(int timer) +{ + int res = 0; + + mir_cslock lck(GenTimerCS); + log_debugA("StopTimer %d", timer); + log_debugA("ack: %u, chk: %u, aft: %u, cnt: %u, con: %u", processAckTimerId, checkConnectionTimerId, afterCheckTimerId, checkContinTimerId, checkConnectingTimerId); + + if (timer & IDT_PROCESSACK) { + if (processAckTimerId == 0) + res = 0; + else { + KillTimer(NULL, processAckTimerId); + processAckTimerId = 0; + res = 1; + } + } + + if (timer & IDT_CHECKCONN) { + if (checkConnectionTimerId == 0) + res = 0 || res; + else { + KillTimer(NULL, checkConnectionTimerId); + checkConnectionTimerId = 0; + res = 1; + } + } + + if (timer & IDT_AFTERCHECK) { + if (afterCheckTimerId == 0) + res = 0 || res; + else { + KillTimer(NULL, afterCheckTimerId); + afterCheckTimerId = 0; + res = 1; + } + } + + if (timer & IDT_CHECKCONTIN) { + if (checkContinTimerId == 0) + res = 0 || res; + else { + KillTimer(NULL, checkContinTimerId); + checkContinTimerId = 0; + res = 1; + } + } + + if (timer & IDT_CHECKCONNECTING) { + if (checkConnectingTimerId == 0) + res = 0 || res; + else { + KillTimer(NULL, checkConnectingTimerId); + checkConnectingTimerId = 0; + res = 1; + } + } + + log_debugA("ack: %u, chk: %u, aft: %u, cnt: %u, con: %u", processAckTimerId, checkConnectionTimerId, afterCheckTimerId, checkContinTimerId, checkConnectingTimerId); + log_debugA("StopTimer done %d", res); + + return res; +} + +static int ProcessProtoAck(WPARAM, LPARAM lParam) +{ + ACKDATA *ack = (ACKDATA*)lParam; + + if (ack->type != ACKTYPE_STATUS && ack->type != ACKTYPE_LOGIN) + return 0; + + char dbSetting[128]; + mir_snprintf(dbSetting, "%s_enabled", ack->szModule); + if (!db_get_b(NULL, MODULENAME, dbSetting, 1)) + return 0; + + if (ack->type == ACKTYPE_STATUS && ack->result == ACKRESULT_SUCCESS) { + for (int i = 0; i < connectionSettings.getCount(); i++) { + TConnectionSettings& cs = connectionSettings[i]; + if (!mir_strcmp(cs.szName, ack->szModule)) + cs.lastStatusAckTime = GetTickCount(); + } + StartTimer(IDT_PROCESSACK, 0, FALSE); + return 0; + } + + if (ack->type == ACKTYPE_LOGIN) { + if (ack->lParam == LOGINERR_OTHERLOCATION) { + for (int i = 0; i < connectionSettings.getCount(); i++) { + TConnectionSettings& cs = connectionSettings[i]; + if (!mir_strcmp(ack->szModule, cs.szName)) { + AssignStatus(&cs, ID_STATUS_OFFLINE, 0, NULL); + if (db_get_b(NULL, MODULENAME, SETTING_CNCOTHERLOC, 0)) { + StopTimer(IDT_PROCESSACK); + for (int j = 0; j < connectionSettings.getCount(); j++) { + AssignStatus(&connectionSettings[j], ID_STATUS_OFFLINE, 0, NULL); + } + } + + NotifyEventHooks(hConnectionEvent, (WPARAM)KS_CONN_STATE_OTHERLOCATION, (LPARAM)cs.szName); + ProcessPopup(KS_CONN_STATE_OTHERLOCATION, (LPARAM)ack->szModule); + } + } + } + else if (ack->result == ACKRESULT_FAILED) { + // login failed + NotifyEventHooks(hConnectionEvent, (WPARAM)KS_CONN_STATE_LOGINERROR, (LPARAM)ack->szModule); + switch (db_get_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING)) { + case LOGINERR_CANCEL: + { + log_infoA("KeepStatus: cancel on login error (%s)", ack->szModule); + for (int i = 0; i < connectionSettings.getCount(); i++) { + TConnectionSettings& cs = connectionSettings[i]; + if (!mir_strcmp(ack->szModule, cs.szName)) + AssignStatus(&cs, ID_STATUS_OFFLINE, 0, NULL); + } + ProcessPopup(KS_CONN_STATE_LOGINERROR, (LPARAM)ack->szModule); + StopChecking(); + } + break; + + case LOGINERR_SETDELAY: + { + int newDelay = 1000 * db_get_dw(NULL, MODULENAME, SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY); + log_infoA("KeepStatus: set delay to %d on login error (%s)", newDelay / 1000, ack->szModule); + StartTimer(IDT_CHECKCONN, newDelay, TRUE); + } + ProcessPopup(KS_CONN_STATE_LOGINERROR, (LPARAM)ack->szModule); + break; + + default: + case LOGINERR_NOTHING: + StartTimer(IDT_PROCESSACK, 0, FALSE); + break; + } + } + } + + return 0; +} + +static VOID CALLBACK CheckConnectingTimer(HWND, UINT, UINT_PTR, DWORD) +{ + int maxConnectingTime; + + StopTimer(IDT_CHECKCONNECTING); + //log_debugA("KeepStatus: CheckConnectingTimer"); + for (int i = 0; i < connectionSettings.getCount(); i++) { + TConnectionSettings& cs = connectionSettings[i]; + + int curStatus = GetStatus(cs); + if (IsStatusConnecting(curStatus)) { // connecting + maxConnectingTime = db_get_dw(NULL, MODULENAME, SETTING_MAXCONNECTINGTIME, 0); + if (maxConnectingTime > 0) { + if ((unsigned int)maxConnectingTime <= ((GetTickCount() - cs.lastStatusAckTime) / 1000)) { + // set offline + log_infoA("KeepStatus: %s is too long connecting; setting offline", cs.szName); + CallProtoService(cs.szName, PS_SETSTATUS, (WPARAM)ID_STATUS_OFFLINE, 0); + } + } + } + } +} + +static VOID CALLBACK CheckAckStatusTimer(HWND, UINT, UINT_PTR, DWORD) +{ + int maxConnectingTime; + bool needChecking = false; + + StopTimer(IDT_PROCESSACK); + for (int i = 0; i < connectionSettings.getCount(); i++) { + TConnectionSettings& cs = connectionSettings[i]; + + int curStatus = GetStatus(cs); + int newStatus = CallProtoService(cs.szName, PS_GETSTATUS, 0, 0); + // ok, np + if (curStatus == ID_STATUS_CURRENT || curStatus == ID_STATUS_DISABLED || curStatus == newStatus || newStatus > MAX_STATUS) + continue; + + if (IsStatusConnecting(newStatus)) { // connecting + maxConnectingTime = db_get_dw(NULL, MODULENAME, SETTING_MAXCONNECTINGTIME, 0); + if (maxConnectingTime > 0) + StartTimer(IDT_CHECKCONNECTING, (maxConnectingTime * 1000 - (GetTickCount() - cs.lastStatusAckTime)), FALSE); + } + // keepstatus' administration was wrong! + else if (newStatus != ID_STATUS_OFFLINE) + AssignStatus(&cs, newStatus, 0, NULL); + + // connection lost + else if (newStatus == ID_STATUS_OFFLINE) {// start checking connection + if (!StartTimer(IDT_CHECKCONN, -1, FALSE)) { /* check if not already checking */ + needChecking = true; + log_infoA("KeepStatus: connection lost! (%s)", cs.szName); + NotifyEventHooks(hConnectionEvent, (WPARAM)KS_CONN_STATE_LOST, (LPARAM)cs.szName); + ProcessPopup(KS_CONN_STATE_LOST, (LPARAM)cs.szName); + } + } + } + + if (needChecking) + StartTimer(IDT_CHECKCONN, initDelay, FALSE); +} + +static VOID CALLBACK CheckConnectionTimer(HWND, UINT, UINT_PTR, DWORD) +{ + int shouldBeStatus, realStatus; + HICON hIcon; + + log_debugA("CheckConnectionTimer"); + bool setStatus = false; + if (showConnectionPopups) + hIcon = Skin_LoadIcon(SKINICON_STATUS_OFFLINE); + + for (int i = 0; i < connectionSettings.getCount() && !setStatus; i++) { + TConnectionSettings& cs = connectionSettings[i]; + realStatus = CallProtoService(cs.szName, PS_GETSTATUS, 0, 0); + shouldBeStatus = GetStatus(cs); + if (shouldBeStatus == ID_STATUS_LAST) + shouldBeStatus = cs.lastStatus; + if (shouldBeStatus == ID_STATUS_DISABLED) + continue; + if ((shouldBeStatus != realStatus) && (realStatus == ID_STATUS_OFFLINE) || (realStatus < MIN_STATUS)) { + setStatus = true; + if (showConnectionPopups) + hIcon = Skin_LoadProtoIcon(cs.szName, ID_STATUS_OFFLINE); + } + } + + // one of the status was wrong + if (setStatus && (maxRetries == -1 || retryCount < maxRetries)) { + if (increaseExponential) + currentDelay = min(2 * currentDelay, maxDelay); + + if (((db_get_b(NULL, MODULENAME, SETTING_CHKINET, 0)) && (!InternetGetConnectedState(NULL, 0))) || ((db_get_b(NULL, MODULENAME, SETTING_BYPING, FALSE)) && (!bLastPingResult))) { + // no network + NotifyEventHooks(hConnectionEvent, (WPARAM)KS_CONN_STATE_RETRYNOCONN, (LPARAM)retryCount + 1); + ProcessPopup(KS_CONN_STATE_RETRYNOCONN, 0); + } + else { + NotifyEventHooks(hConnectionEvent, (WPARAM)KS_CONN_STATE_RETRY, (LPARAM)retryCount + 1); + /* set the status */ + SetCurrentStatus(); + } + retryCount += 1; + StartTimer(IDT_AFTERCHECK, min(currentDelay, AFTERCHECK_DELAY) / 2, FALSE); + StartTimer(IDT_CHECKCONN, currentDelay, TRUE); // restart this timer + } + else // all status set ok already, or stop checking + StopChecking(); + + log_debugA("CheckConnectionTimer done"); +} + +static int StopChecking() +{ + StopTimer(IDT_CHECKCONN | IDT_PROCESSACK | IDT_AFTERCHECK | IDT_CHECKCONNECTING); + + BOOL isOk = TRUE; + for (int i = 0; i < connectionSettings.getCount() && isOk; i++) { + TConnectionSettings& cs = connectionSettings[i]; + int curStatus = GetStatus(cs); + int newStatus = CallProtoService(cs.szName, PS_GETSTATUS, 0, 0); + if (newStatus != curStatus && curStatus != ID_STATUS_DISABLED) { + AssignStatus(&cs, newStatus, 0, NULL); + isOk = FALSE; + } + } + + NotifyEventHooks(hConnectionEvent, (WPARAM)KS_CONN_STATE_STOPPEDCHECKING, (LPARAM)isOk); + ProcessPopup(KS_CONN_STATE_STOPPEDCHECKING, (LPARAM)isOk); + log_infoA("KeepStatus: stop checking (%s)", isOk ? "success" : "failure"); + retryCount = 0; + currentDelay = initDelay; + + return 0; +} + +static VOID CALLBACK AfterCheckTimer(HWND, UINT, UINT_PTR, DWORD) +{ + // after each connection check, this function is called to see if connection was recovered + StopTimer(IDT_AFTERCHECK); + + bool setStatus = false; + + for (int i = 0; i < connectionSettings.getCount(); i++) { + TConnectionSettings& cs = connectionSettings[i]; + int realStatus = CallProtoService(cs.szName, PS_GETSTATUS, 0, 0); + int shouldBeStatus = GetStatus(cs); + if (shouldBeStatus == ID_STATUS_LAST) // this should never happen + shouldBeStatus = cs.lastStatus; + if (shouldBeStatus == ID_STATUS_DISABLED) // (on ignoring proto) + continue; + if ((shouldBeStatus != realStatus) && (realStatus == ID_STATUS_OFFLINE) || (realStatus < MIN_STATUS)) + setStatus = true; + } + + if (!setStatus || retryCount == maxRetries) + StopChecking(); +} + +static void CheckContinueslyFunction(void *) +{ + Thread_SetName("KeepStatus: CheckContinueslyFunction"); + + static int pingFailures = 0; + + // one at the time is enough, do it the 'easy' way + mir_cslock lck(CheckContinueslyCS); + + // do a ping, even if reconnecting + bool doPing = false; + for (int i = 0; i < connectionSettings.getCount(); i++) { + TConnectionSettings& cs = connectionSettings[i]; + int shouldBeStatus = GetStatus(cs); + if (shouldBeStatus == ID_STATUS_LAST) + shouldBeStatus = cs.lastStatus; + + if (shouldBeStatus == ID_STATUS_DISABLED) + continue; + + if (shouldBeStatus != ID_STATUS_OFFLINE) { + log_debugA("CheckContinueslyFunction: %s should be %d", cs.szName, shouldBeStatus); + doPing = true; + } + } + + if (!doPing) { + log_debugA("CheckContinueslyFunction: All protocols should be offline, no need to check connection"); + return; + } + + BOOL ping = db_get_b(NULL, MODULENAME, SETTING_BYPING, FALSE); + if (ping) { + DBVARIANT dbv; + if (db_get(NULL, MODULENAME, SETTING_PINGHOST, &dbv)) + ping = FALSE; + else { + char *start, *end; + char host[MAX_PATH]; + DWORD *addr; + struct hostent *hostent; + char reply[sizeof(ICMP_ECHO_REPLY) + 8]; + + bLastPingResult = FALSE; + HANDLE hICMPFile = (HANDLE)IcmpCreateFile(); + if (hICMPFile == INVALID_HANDLE_VALUE) { + bLastPingResult = TRUE; + log_infoA("KeepStatus: icmp.dll error (2)"); + } + if (bLastPingResult == FALSE) { + start = dbv.pszVal; + while ((*start != '\0') && (!bLastPingResult)) { + end = start; + while ((*end != ' ') && (*end != '\0')) + end++; + memset(host, '\0', sizeof(host)); + strncpy(host, start, end - start); + hostent = gethostbyname(host); + if (hostent != NULL) { + addr = (DWORD *)(*hostent->h_addr_list); + bLastPingResult = (IcmpSendEcho(hICMPFile, *addr, 0, 0, NULL, reply, sizeof(ICMP_ECHO_REPLY) + 8, 5000) != 0); + + if (bLastPingResult) + pingFailures = 0; + else + pingFailures++; + + log_debugA("CheckContinueslyFunction: pinging %s (result: %d/%d)", host, bLastPingResult, pingFailures); + } + else log_debugA("CheckContinueslyFunction: unable to resolve %s", host); + + start = end; + while (*start == ' ') + start++; + } + } + IcmpCloseHandle(hICMPFile); + } + db_free(&dbv); + } + + if (StartTimer(IDT_CHECKCONN, -1, FALSE)) { + return; // already connecting, leave + } + + if (((!ping) && (!InternetGetConnectedState(NULL, 0))) || ((ping) && (!bLastPingResult) && (pingFailures >= db_get_w(NULL, MODULENAME, SETTING_PINGCOUNT, DEFAULT_PINGCOUNT)))) { + pingFailures = 0; + + int count; + PROTOACCOUNT** protos; + Proto_EnumAccounts(&count, &protos); + + for (int i = 0; i < count; i++) { + if (!IsSuitableProto(protos[i])) + continue; + + if (IsStatusConnecting(CallProtoService(protos[i]->szModuleName, PS_GETSTATUS, 0, 0))) { + log_debugA("CheckContinueslyFunction: %s is connecting", protos[i]->szModuleName); + continue; // connecting, leave alone + } + if (IsProtocolEnabledService(0, (LPARAM)protos[i]->szModuleName)) { + log_debugA("CheckContinueslyFunction: forcing %s offline", protos[i]->szModuleName); + CallProtoService(protos[i]->szModuleName, PS_SETSTATUS, (WPARAM)ID_STATUS_OFFLINE, 0); + } + } + if (StartTimer(IDT_CHECKCONN | IDT_PROCESSACK, -1, FALSE)) {// are our 'set offlines' noticed? + log_debugA("CheckContinueslyFunction: currently checking"); + return; + } + log_infoA("KeepStatus: connection lost! (continuesly check)"); + NotifyEventHooks(hConnectionEvent, (WPARAM)KS_CONN_STATE_LOST, 0); + ProcessPopup(KS_CONN_STATE_LOST, 0); + maxRetries = db_get_b(NULL, MODULENAME, SETTING_MAXRETRIES, 0); + if (maxRetries == 0) + maxRetries = -1; + StartTimer(IDT_CHECKCONN, initDelay, FALSE); + } +} + +static VOID CALLBACK CheckContinueslyTimer(HWND, UINT, UINT_PTR, DWORD) +{ + if (db_get_b(NULL, MODULENAME, SETTING_BYPING, FALSE)) + mir_forkthread(CheckContinueslyFunction, NULL); + else + CheckContinueslyFunction(NULL); +} + +// =============== popup ====================== +static wchar_t* GetHumanName(LPARAM lParam) +{ + PROTOACCOUNT *ProtoAccount = Proto_GetAccount((char*)lParam); + return (ProtoAccount != NULL) ? ProtoAccount->tszAccountName : TranslateT("Protocol"); +} + +static int ProcessPopup(int reason, LPARAM lParam) +{ + HICON hIcon = NULL; + wchar_t text[MAX_SECONDLINE]; + + if (!db_get_b(NULL, MODULENAME, SETTING_SHOWCONNECTIONPOPUPS, FALSE) || !ServiceExists(MS_POPUP_ADDPOPUPT)) + return -1; + + switch (reason) { + case KS_CONN_STATE_OTHERLOCATION: // lParam = 1 proto + if (!db_get_b(NULL, MODULENAME, SETTING_PUOTHER, TRUE)) + return -1; + + hIcon = Skin_LoadProtoIcon((char*)lParam, SKINICON_STATUS_OFFLINE); + mir_snwprintf(text, TranslateT("%s connected from another location"), GetHumanName(lParam)); + break; + + case KS_CONN_STATE_LOGINERROR: // lParam = 1 proto + if (!db_get_b(NULL, MODULENAME, SETTING_PUOTHER, TRUE)) + return -1; + + hIcon = Skin_LoadProtoIcon((char*)lParam, SKINICON_STATUS_OFFLINE); + if (db_get_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING) == LOGINERR_CANCEL) + mir_snwprintf(text, TranslateT("%s login error, cancel reconnecting"), GetHumanName(lParam)); + else if (db_get_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING) == LOGINERR_SETDELAY) + mir_snwprintf(text, TranslateT("%s login error (next retry (%d) in %d s)"), GetHumanName(lParam), retryCount + 1, db_get_dw(NULL, MODULENAME, SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY)); + else + return -1; + break; + + case KS_CONN_STATE_LOST: // lParam = 1 proto, or NULL + if (!db_get_b(NULL, MODULENAME, SETTING_PUCONNLOST, TRUE)) + return -1; + + if (lParam) { // Óêàçàòåëü íà èìÿ ìîäóëÿ. + hIcon = Skin_LoadProtoIcon((char*)lParam, SKINICON_STATUS_OFFLINE); + mir_snwprintf(text, TranslateT("%s status error (next retry (%d) in %d s)"), GetHumanName(lParam), retryCount + 1, currentDelay / 1000); + } + else mir_snwprintf(text, TranslateT("Status error (next retry (%d) in %d s)"), retryCount + 1, currentDelay / 1000); + break; + + case KS_CONN_STATE_RETRY: // lParam = PROTOCOLSETTINGEX** + if (!db_get_b(NULL, MODULENAME, SETTING_PUCONNRETRY, TRUE)) + return -1; + if (lParam) { + PROTOCOLSETTINGEX **ps = (PROTOCOLSETTINGEX **)lParam; + wchar_t protoInfoLine[512], protoInfo[MAX_SECONDLINE]; + memset(protoInfoLine, '\0', sizeof(protoInfoLine)); + memset(protoInfo, '\0', sizeof(protoInfo)); + mir_wstrcpy(protoInfo, L"\r\n"); + for (int i = 0; i < connectionSettings.getCount(); i++) { + if (mir_wstrlen(ps[i]->tszAccName) > 0 && mir_strlen(ps[i]->szName) > 0) { + if (db_get_b(NULL, MODULENAME, SETTING_PUSHOWEXTRA, TRUE)) { + mir_snwprintf(protoInfoLine, TranslateT("%s\t(will be set to %s)\r\n"), ps[i]->tszAccName, pcli->pfnGetStatusModeDescription(ps[i]->status, 0)); + mir_wstrncat(protoInfo, protoInfoLine, _countof(protoInfo) - mir_wstrlen(protoInfo) - 1); + } + } + } + hIcon = Skin_LoadProtoIcon(ps[0]->szName, SKINICON_STATUS_OFFLINE); + + rtrimw(protoInfo); + if (retryCount == (maxRetries - 1)) + mir_snwprintf(text, TranslateT("Resetting status... (last try (%d))%s"), retryCount + 1, protoInfo); + else + mir_snwprintf(text, TranslateT("Resetting status... (next retry (%d) in %d s)%s"), retryCount + 2, currentDelay / 1000, protoInfo); + } + break; + + case KS_CONN_STATE_RETRYNOCONN: // lParam = NULL + if (!db_get_b(NULL, MODULENAME, SETTING_PUOTHER, TRUE)) + return -1; + + if (retryCount == maxRetries - 1) + mir_snwprintf(text, TranslateT("No internet connection seems available... (last try (%d))"), retryCount + 1); + else + mir_snwprintf(text, TranslateT("No internet connection seems available... (next retry (%d) in %d s)"), retryCount + 2, currentDelay / 1000); + break; + + case KS_CONN_STATE_STOPPEDCHECKING: // lParam == BOOL succes + if (!db_get_b(NULL, MODULENAME, SETTING_PURESULT, TRUE)) + return -1; + + if (lParam) { + hIcon = Skin_LoadIcon(SKINICON_STATUS_ONLINE); + mir_snwprintf(text, TranslateT("Status was set ok")); + } + else mir_snwprintf(text, TranslateT("Giving up")); + break; + } + if (hIcon == NULL) + hIcon = Skin_LoadIcon(SKINICON_STATUS_OFFLINE); + + log_info(L"KeepStatus: %s", text); + return ShowPopup(text, hIcon); +} + +static INT_PTR ShowPopup(wchar_t *msg, HICON hIcon) +{ + POPUPDATAT ppd = { 0 }; + ppd.lchIcon = hIcon; + wcsncpy(ppd.lptzContactName, TranslateT("KeepStatus"), MAX_CONTACTNAME); + wcsncpy(ppd.lptzText, msg, MAX_SECONDLINE); + if (db_get_b(NULL, MODULENAME, SETTING_POPUP_USEWINCOLORS, 0)) { + ppd.colorBack = GetSysColor(COLOR_BTNFACE); + ppd.colorText = GetSysColor(COLOR_WINDOWTEXT); + } + else if (!db_get_b(NULL, MODULENAME, SETTING_POPUP_USEDEFCOLORS, 0)) { + ppd.colorBack = db_get_dw(NULL, MODULENAME, SETTING_POPUP_BACKCOLOR, 0xAAAAAA); + ppd.colorText = db_get_dw(NULL, MODULENAME, SETTING_POPUP_TEXTCOLOR, 0x0000CC); + } + ppd.PluginWindowProc = PopupDlgProc; + + switch (db_get_b(NULL, MODULENAME, SETTING_POPUP_DELAYTYPE, POPUP_DELAYFROMPU)) { + case POPUP_DELAYCUSTOM: + ppd.iSeconds = (int)db_get_dw(NULL, MODULENAME, SETTING_POPUP_TIMEOUT, 0); + if (ppd.iSeconds == 0) + ppd.iSeconds = currentDelay / 1000 - 1; + break; + + case POPUP_DELAYPERMANENT: + ppd.iSeconds = -1; + break; + + case POPUP_DELAYFROMPU: + default: + ppd.iSeconds = 0; + break; + } + return PUAddPopupT(&ppd); +} + +LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) { + case WM_CONTEXTMENU: // right + case WM_COMMAND: // left + switch (db_get_b(NULL, MODULENAME, + (message == WM_COMMAND) ? SETTING_POPUP_LEFTCLICK : SETTING_POPUP_RIGHTCLICK, + POPUP_ACT_CLOSEPOPUP)) { + case POPUP_ACT_CANCEL: + // cancel timer + StopChecking(); + PUDeletePopup(hWnd); + break; + + case POPUP_ACT_CLOSEPOPUP: + // close the popup + PUDeletePopup(hWnd); + break; + } + break; + } + + return DefWindowProc(hWnd, message, wParam, lParam); +} + +// =============== services =================== +INT_PTR StopReconnectingService(WPARAM, LPARAM) +{ + int ret = StartTimer(IDT_CHECKCONN | IDT_AFTERCHECK, -1, FALSE); + StopChecking(); + return ret; +} + +INT_PTR EnableProtocolService(WPARAM wParam, LPARAM lParam) +{ + char *szProto = (char *)lParam; + if (szProto == NULL) + return -1; + + char dbSetting[128]; + mir_snprintf(dbSetting, "%s_enabled", szProto); + if (!db_get_b(NULL, MODULENAME, dbSetting, 1)) // 'hard' disabled + return -1; + + int ret = -2; + for (int i = 0; i < connectionSettings.getCount(); i++) { + TConnectionSettings& cs = connectionSettings[i]; + if (!mir_strcmp(szProto, cs.szName)) { + if (wParam) { + if (GetStatus(cs) == ID_STATUS_DISABLED) + AssignStatus(&cs, CallProtoService(cs.szName, PS_GETSTATUS, 0, 0), 0, NULL); + } + else AssignStatus(&cs, ID_STATUS_DISABLED, 0, NULL); + + ret = 0; + break; + } + } + return ret; +} + +INT_PTR IsProtocolEnabledService(WPARAM, LPARAM lParam) +{ + char *szProto = (char *)lParam; + + char dbSetting[128]; + mir_snprintf(dbSetting, "%s_enabled", szProto); + if (!db_get_b(NULL, MODULENAME, dbSetting, 1)) + return FALSE; + + for (int i = 0; i < connectionSettings.getCount(); i++) { + TConnectionSettings& cs = connectionSettings[i]; + if (!mir_strcmp(szProto, cs.szName)) + return GetStatus(cs) != ID_STATUS_DISABLED; + } + + return FALSE; +} + +INT_PTR AnnounceStatusChangeService(WPARAM, LPARAM lParam) +{ + PROTOCOLSETTINGEX *newSituation = (PROTOCOLSETTINGEX *)lParam; + log_infoA("Another plugin announced a status change to %d for %s", newSituation->status, newSituation->szName == NULL ? "all" : newSituation->szName); + + for (int i = 0; i < connectionSettings.getCount(); i++) { + TConnectionSettings& cs = connectionSettings[i]; + if (!mir_strcmp(cs.szName, newSituation->szName)) + AssignStatus(&cs, newSituation->status, newSituation->lastStatus, newSituation->szMsg); + } + + return 0; +} + +// =============== window for suspend =============== + +static DWORD CALLBACK MessageWndProc(HWND, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static PROTOCOLSETTINGEX** ps = NULL; + + switch (msg) { + case WM_POWERBROADCAST: + switch (wParam) { + case PBT_APMSUSPEND: + log_infoA("KeepStatus: suspend state detected: %08X %08X", wParam, lParam); + if (ps == NULL) { + ps = GetCurrentProtoSettingsCopy(); + for (int i = 0; i < connectionSettings.getCount(); i++) + EnableProtocolService(0, (LPARAM)ps[i]->szName); + + // set proto's offline, the clist will not try to reconnect in that case + CallService(MS_CLIST_SETSTATUSMODE, (WPARAM)ID_STATUS_OFFLINE, 0); + } + break; + + //case PBT_APMRESUMEAUTOMATIC: ? + case PBT_APMRESUMESUSPEND: + case PBT_APMRESUMECRITICAL: + log_infoA("KeepStatus: resume from suspend state"); + if (ps != NULL) { + for (int i = 0; i < connectionSettings.getCount(); i++) + AssignStatus(&connectionSettings[i], ps[i]->status, ps[i]->lastStatus, ps[i]->szMsg); + FreeProtoSettings(ps); + ps = NULL; + } + StartTimer(IDT_PROCESSACK, 0, FALSE); + break; + } + break; + + case WM_DESTROY: + if (ps != NULL) { + FreeProtoSettings(ps); + ps = NULL; + } + break; + } + + return TRUE; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// Account control event + +int OnAccChanged(WPARAM wParam, LPARAM lParam) +{ + PROTOACCOUNT *pa = (PROTOACCOUNT*)lParam; + switch (wParam) { + case PRAC_ADDED: + connectionSettings.insert(new TConnectionSettings(pa)); + break; + + case PRAC_REMOVED: + for (int i = 0; i < connectionSettings.getCount(); i++) { + if (!mir_strcmp(connectionSettings[i].szName, pa->szModuleName)) { + connectionSettings.remove(i); + break; + } + } + break; + } + return 0; +} + +// =============== init stuff ================= + +static int onShutdown(WPARAM, LPARAM) +{ + UnhookEvent(hStatusChangeHook); + UnhookEvent(hProtoAckHook); + UnhookEvent(hCSStatusChangeHook); + UnhookEvent(hCSStatusChangeExHook); + + StopTimer(IDT_CHECKCONN | IDT_PROCESSACK | IDT_AFTERCHECK | IDT_CHECKCONTIN); + if (IsWindow(hMessageWindow)) + DestroyWindow(hMessageWindow); + + connectionSettings.destroy(); + + return 0; +} + +int CSModuleLoaded(WPARAM, LPARAM) +{ + protoList = (OBJLIST*)&connectionSettings; + + hMessageWindow = NULL; + LoadMainOptions(); + + HookEvent(ME_OPT_INITIALISE, OptionsInit); + HookEvent(ME_SYSTEM_PRESHUTDOWN, onShutdown); + HookEvent(ME_PROTO_ACCLISTCHANGED, OnAccChanged); + return 0; +} diff --git a/tools/_deprecated/StatusPlugins/KeepStatus/keepstatus.h b/tools/_deprecated/StatusPlugins/KeepStatus/keepstatus.h new file mode 100644 index 0000000000..bf9f3e48f8 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/KeepStatus/keepstatus.h @@ -0,0 +1,139 @@ +/* + KeepStatus Plugin for Miranda-IM (www.miranda-im.org) + Copyright 2003-2006 P. Boon + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef __KEEPSTATUS_HEADER +#define __KEEPSTATUS_HEADER + +#include +#include +#include +#include +#include + +#include +#include +#include +#include "version.h" + +#define __FILENAME "KeepStatus.dll" +#define MODULENAME "KeepStatus" +#define SETTING_CHECKCONNECTION "CheckConnection" +#define SETTING_MAXRETRIES "MaxRetries" +#define SETTING_INCREASEEXPONENTIAL "IncreaseExponential" +#define SETTING_INITDELAY "InitDelay" +#define SETTING_MAXDELAY "MaxDelay" +#define SETTING_SHOWCONNECTIONPOPUPS "ShowConnectionPopups" +#define SETTING_CHKINET "CheckInet" +#define SETTING_CNCOTHERLOC "CancelIfOtherLocation" +#define SETTING_LOGINERR "OnLoginErr" +#define SETTING_LOGINERR_DELAY "OnLoginErrDelay" +#define SETTING_CONTCHECK "ContinueslyCheck" +#define SETTING_BYPING "ByPingingHost" +#define SETTING_PINGHOST "HostToPing" +#define SETTING_CHECKAPMRESUME "CheckAPMResume" +#define SETTING_FIRSTOFFLINE "FirstOffline" +#define SETTING_NOLOCKED "NoLocked" +#define SETTING_MAXCONNECTINGTIME "MaxConnectingTime" +#define SETTING_PINGCOUNT "PingCount" +#define DEFAULT_PINGCOUNT 1 +#define SETTING_CNTDELAY "CntDelay" +#define STATUSCHANGEDELAY 500 // ms +#define DEFAULT_MAXRETRIES 0 +#define DEFAULT_INITDELAY 10 // s +#define DEFAULT_MAXDELAY 900 // s +#define AFTERCHECK_DELAY 10000 //ms (divided by 2) +#define CHECKCONTIN_DELAY 10 // s +#define SETTING_POPUP_DELAYTYPE "PopupDelayType" +#define SETTING_POPUP_USEWINCOLORS "PopupUseWinColors" +#define SETTING_POPUP_USEDEFCOLORS "PopupUseDefColors" +#define SETTING_POPUP_BACKCOLOR "PopupBackColor" +#define SETTING_POPUP_TEXTCOLOR "PopupTextColor" +#define SETTING_POPUP_TIMEOUT "PopupTimeout" +#define SETTING_POPUP_LEFTCLICK "PopupLeftClickAction" +#define SETTING_POPUP_RIGHTCLICK "PopupRightClickAction" +#define SETTING_PUOTHER "PopupShowOther" +#define SETTING_PUCONNLOST "PopupShowConnLost" +#define SETTING_PUCONNRETRY "PopupShowConnRetry" +#define SETTING_PURESULT "PopupShowResult" +#define SETTING_PUSHOWEXTRA "PopupShowExtra" +#define POPUP_ACT_NOTHING 0 +#define POPUP_ACT_CANCEL 1 +#define POPUP_ACT_CLOSEPOPUP 2 +#define POPUP_DELAYFROMPU 0 +#define POPUP_DELAYCUSTOM 1 +#define POPUP_DELAYPERMANENT 2 +#define LOGINERR_NOTHING 0 +#define LOGINERR_CANCEL 1 +#define LOGINERR_SETDELAY 2 + +#define IDT_PROCESSACK 0x01 +#define IDT_CHECKCONN 0x02 +#define IDT_AFTERCHECK 0x04 +#define IDT_CHECKCONTIN 0x08 +#define IDT_CHECKCONNECTING 0x10 + +#define KS_ISENABLED WM_APP + 10 +#define KS_ENABLEITEMS WM_APP + 11 + +// action +#define SETTING_ENABLECHECKING "EnableChecking" +// trigger +#define TRIGGERNAME "KeepStatus: Connection state change" +#define TRIGGER_CONNLOST 0x01 +#define TRIGGER_LOGINERROR 0x02 +#define TRIGGER_OTHERLOC 0x04 +#define TRIGGER_CONNRETRY 0x08 +#define TRIGGER_CONNSUCCESS 0x10 +#define TRIGGER_CONNGIVEUP 0x20 +#define SETTING_TRIGGERON "TriggerOn" + +struct TConnectionSettings : public PROTOCOLSETTINGEX +{ + TConnectionSettings(PROTOACCOUNT *pa); + ~TConnectionSettings(); + + int lastStatusAckTime; // the time the last status ack was received +}; + +/* old; replaced by PROTOCOLSETTINGEX see m_statusplugins.h */ +typedef struct { + char *szName; // pointer to protocol modulename + WORD status; // the status + WORD lastStatus;// last status +} PROTOCOLSETTING; + +/* old; replaced by ME_CS_STATUSCHANGE see m_statusplugins.h */ +// wParam = PROTOCOLSETTING** +// lParam = 0 +#define ME_CS_STATUSCHANGE "CommonStatus/StatusChange" + +///////////////////////////////////////////////////////////////////////////////////////// +// main.cpp + +extern HINSTANCE hInst; +extern HANDLE hMainThread; +extern unsigned long mainThreadId; + +///////////////////////////////////////////////////////////////////////////////////////// +// keepstatus.cpp + +int LoadMainOptions(); +LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); + +#endif //__KEEPSTATUS_HEADER diff --git a/tools/_deprecated/StatusPlugins/KeepStatus/main.cpp b/tools/_deprecated/StatusPlugins/KeepStatus/main.cpp new file mode 100644 index 0000000000..b67757838d --- /dev/null +++ b/tools/_deprecated/StatusPlugins/KeepStatus/main.cpp @@ -0,0 +1,116 @@ +/* + KeepStatus Plugin for Miranda-IM (www.miranda-im.org) + Copyright 2003-2006 P. Boon + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "../commonstatus.h" +#include "keepstatus.h" +#include "../resource.h" + +HANDLE hMainThread = 0; +unsigned long mainThreadId = 0; +int hLangpack = 0; + +HANDLE hCSModuleLoadedHook = NULL; + +HANDLE hConnectionEvent = NULL; +HANDLE hStopRecon = NULL, hEnableProto = NULL, hIsProtoEnabled = NULL, hAnnounceStat = NULL; + +HINSTANCE hInst; +CLIST_INTERFACE *pcli; + +///////////////////////////////////////////////////////////////////////////////////////// +// dll entry point + +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) +{ + hInst = hinstDLL; + return TRUE; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// returns plugin's extended information + + +PLUGININFOEX pluginInfoEx = { + sizeof(PLUGININFOEX), + __PLUGIN_NAME, + PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), + __DESC, + __AUTHOR, + __AUTHOREMAIL, + __COPYRIGHT, + __AUTHORWEB, + UNICODE_AWARE, + { 0xa5bb1b7a, 0xb7cd, 0x4cbb, { 0xa7, 0xdb, 0xce, 0xb4, 0xeb, 0x71, 0xda, 0x49 } } // {A5BB1B7A-B7CD-4cbb-A7DB-CEB4EB71DA49} +}; + +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) +{ + return &pluginInfoEx; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// plugin's entry point + +int CSModuleLoaded(WPARAM wParam, LPARAM lParam); + +INT_PTR StopReconnectingService(WPARAM wParam, LPARAM lParam); +INT_PTR EnableProtocolService(WPARAM wParam, LPARAM lParam); +INT_PTR IsProtocolEnabledService(WPARAM wParam, LPARAM lParam); +INT_PTR AnnounceStatusChangeService(WPARAM wParam, LPARAM lParam); + +extern "C" int __declspec(dllexport) Load(void) +{ + mir_getLP(&pluginInfoEx); + pcli = Clist_GetInterface(); + + InitCommonStatus(); + + hCSModuleLoadedHook = HookEvent(ME_SYSTEM_MODULESLOADED, CSModuleLoaded); + + hConnectionEvent = CreateHookableEvent(ME_KS_CONNECTIONEVENT); + + hStopRecon = CreateServiceFunction(MS_KS_STOPRECONNECTING, StopReconnectingService); + hEnableProto = CreateServiceFunction(MS_KS_ENABLEPROTOCOL, EnableProtocolService); + hIsProtoEnabled = CreateServiceFunction(MS_KS_ISPROTOCOLENABLED, IsProtocolEnabledService); + hAnnounceStat = CreateServiceFunction(MS_KS_ANNOUNCESTATUSCHANGE, AnnounceStatusChangeService); + + DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &hMainThread, THREAD_SET_CONTEXT, FALSE, 0); + mainThreadId = GetCurrentThreadId(); + + return 0; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// plugin's exit point + +extern "C" int __declspec(dllexport) Unload(void) +{ + DestroyHookableEvent(hConnectionEvent); + + UnhookEvent(hCSModuleLoadedHook); + + if (hMainThread) + CloseHandle(hMainThread); + DestroyServiceFunction(hStopRecon); + DestroyServiceFunction(hEnableProto); + DestroyServiceFunction(hIsProtoEnabled); + DestroyServiceFunction(hAnnounceStat); + + return 0; +} diff --git a/tools/_deprecated/StatusPlugins/KeepStatus/options.cpp b/tools/_deprecated/StatusPlugins/KeepStatus/options.cpp new file mode 100644 index 0000000000..3a7328a2e3 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/KeepStatus/options.cpp @@ -0,0 +1,591 @@ +/* + KeepStatus Plugin for Miranda-IM (www.miranda-im.org) + Copyright 2003-2006 P. Boon + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include "../commonstatus.h" +#include "keepstatus.h" +#include "../resource.h" + +// prototypes +INT_PTR CALLBACK OptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); +INT_PTR CALLBACK PopupOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); + +static INT_PTR CALLBACK DlgProcKSBasicOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch (msg) { + case WM_INITDIALOG: + TranslateDialogDefault(hwndDlg); + { + LVCOLUMN lvCol; + LVITEM lvItem; + DBVARIANT dbv; + + SetDlgItemInt(hwndDlg, IDC_MAXRETRIES, db_get_b(NULL, MODULENAME, SETTING_MAXRETRIES, DEFAULT_MAXRETRIES), FALSE); + SetDlgItemInt(hwndDlg, IDC_INITDELAY, db_get_dw(NULL, MODULENAME, SETTING_INITDELAY, DEFAULT_INITDELAY), FALSE); + CheckDlgButton(hwndDlg, IDC_CHECKCONNECTION, db_get_b(NULL, MODULENAME, SETTING_CHECKCONNECTION, FALSE) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_SHOWCONNECTIONPOPUPS, (db_get_b(NULL, MODULENAME, SETTING_SHOWCONNECTIONPOPUPS, FALSE) && ServiceExists(MS_POPUP_SHOWMESSAGE)) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_CHKINET, db_get_b(NULL, MODULENAME, SETTING_CHKINET, FALSE) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_CONTCHECK, db_get_b(NULL, MODULENAME, SETTING_CONTCHECK, FALSE) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_BYPING, db_get_b(NULL, MODULENAME, SETTING_BYPING, FALSE) ? BST_CHECKED : BST_UNCHECKED); + if (!db_get_s(NULL, MODULENAME, SETTING_PINGHOST, &dbv)) { + SetDlgItemTextA(hwndDlg, IDC_PINGHOST, dbv.pszVal); + db_free(&dbv); + } + // proto list + HWND hList = GetDlgItem(hwndDlg, IDC_PROTOCOLLIST); + ListView_SetExtendedListViewStyleEx(hList, LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES, LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES); + memset(&lvCol, 0, sizeof(lvCol)); + lvCol.mask = LVCF_WIDTH | LVCF_TEXT; + lvCol.pszText = TranslateT("Protocol"); + lvCol.cx = 118; + ListView_InsertColumn(hList, 0, &lvCol); + // fill the list + memset(&lvItem, 0, sizeof(lvItem)); + lvItem.mask = LVIF_TEXT | LVIF_PARAM; + lvItem.iItem = 0; + lvItem.iSubItem = 0; + + int count; + PROTOACCOUNT** protos; + Proto_EnumAccounts(&count, &protos); + + for (int i = 0; i < count; i++) { + if (!IsSuitableProto(protos[i])) + continue; + + lvItem.pszText = protos[i]->tszAccountName; + lvItem.lParam = (LPARAM)protos[i]->szModuleName; + ListView_InsertItem(hList, &lvItem); + + char dbSetting[128]; + mir_snprintf(dbSetting, "%s_enabled", protos[i]->szModuleName); + ListView_SetCheckState(hList, lvItem.iItem, db_get_b(NULL, MODULENAME, dbSetting, TRUE)); + lvItem.iItem++; + } + EnableWindow(GetDlgItem(hwndDlg, IDC_MAXRETRIES), IsDlgButtonChecked(hwndDlg, IDC_CHECKCONNECTION)); + EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWCONNECTIONPOPUPS), ServiceExists(MS_POPUP_SHOWMESSAGE) && IsDlgButtonChecked(hwndDlg, IDC_CHECKCONNECTION)); + EnableWindow(GetDlgItem(hwndDlg, IDC_INITDELAY), IsDlgButtonChecked(hwndDlg, IDC_CHECKCONNECTION)); + EnableWindow(GetDlgItem(hwndDlg, IDC_PROTOCOLLIST), IsDlgButtonChecked(hwndDlg, IDC_CHECKCONNECTION)); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHKINET), IsDlgButtonChecked(hwndDlg, IDC_CHECKCONNECTION)); + EnableWindow(GetDlgItem(hwndDlg, IDC_CONTCHECK), IsDlgButtonChecked(hwndDlg, IDC_CHECKCONNECTION)); + EnableWindow(GetDlgItem(hwndDlg, IDC_BYPING), (IsDlgButtonChecked(hwndDlg, IDC_CONTCHECK) && IsDlgButtonChecked(hwndDlg, IDC_CHECKCONNECTION)) ? TRUE : FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_PINGHOST), (IsDlgButtonChecked(hwndDlg, IDC_CONTCHECK)) && (IsDlgButtonChecked(hwndDlg, IDC_BYPING) && IsDlgButtonChecked(hwndDlg, IDC_CHECKCONNECTION)) ? TRUE : FALSE); + } + break; + + case WM_COMMAND: + if (((HIWORD(wParam) == EN_CHANGE) || (HIWORD(wParam) == BN_CLICKED)) && ((HWND)lParam == GetFocus())) + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + // something changed + switch (LOWORD(wParam)) { + case IDC_CHECKCONNECTION: + case IDC_CONTCHECK: + case IDC_BYPING: + EnableWindow(GetDlgItem(hwndDlg, IDC_MAXRETRIES), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); + EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWCONNECTIONPOPUPS), ServiceExists(MS_POPUP_SHOWMESSAGE) && SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); + EnableWindow(GetDlgItem(hwndDlg, IDC_INITDELAY), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); + EnableWindow(GetDlgItem(hwndDlg, IDC_PROTOCOLLIST), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHKINET), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); + EnableWindow(GetDlgItem(hwndDlg, IDC_CONTCHECK), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); + EnableWindow(GetDlgItem(hwndDlg, IDC_BYPING), (IsDlgButtonChecked(hwndDlg, IDC_CONTCHECK) && SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)) ? TRUE : FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_PINGHOST), (IsDlgButtonChecked(hwndDlg, IDC_CONTCHECK)) && (IsDlgButtonChecked(hwndDlg, IDC_BYPING) && SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)) ? TRUE : FALSE); + break; + } + break; + + case WM_NOTIFY: + if (((NMHDR*)lParam)->idFrom == IDC_PROTOCOLLIST) { + switch (((NMHDR*)lParam)->code) { + case LVN_ITEMCHANGED: + { + NMLISTVIEW *nmlv = (NMLISTVIEW *)lParam; + if (IsWindowVisible(GetDlgItem(hwndDlg, IDC_PROTOCOLLIST)) && ((nmlv->uNewState^nmlv->uOldState)&LVIS_STATEIMAGEMASK)) + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + } + break; + } + } + + if (((LPNMHDR)lParam)->code == PSN_APPLY) { + int i; + LVITEM lvItem; + + db_set_b(NULL, MODULENAME, SETTING_MAXRETRIES, (BYTE)GetDlgItemInt(hwndDlg, IDC_MAXRETRIES, NULL, FALSE)); + db_set_b(NULL, MODULENAME, SETTING_CHECKCONNECTION, (BYTE)SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); + db_set_b(NULL, MODULENAME, SETTING_SHOWCONNECTIONPOPUPS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWCONNECTIONPOPUPS)); + db_set_dw(NULL, MODULENAME, SETTING_INITDELAY, (DWORD)GetDlgItemInt(hwndDlg, IDC_INITDELAY, NULL, FALSE)); + db_set_b(NULL, MODULENAME, SETTING_CHKINET, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CHKINET)); + db_set_b(NULL, MODULENAME, SETTING_CONTCHECK, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CONTCHECK)); + db_set_b(NULL, MODULENAME, SETTING_BYPING, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BYPING)); + if (IsDlgButtonChecked(hwndDlg, IDC_BYPING)) { + char *host; + + int len = SendDlgItemMessage(hwndDlg, IDC_PINGHOST, WM_GETTEXTLENGTH, 0, 0); + if (len > 0) { + host = (char*)malloc(len + 1); + if (host != NULL) { + memset(host, '\0', len + 1); + GetDlgItemTextA(hwndDlg, IDC_PINGHOST, host, len + 1); + db_set_s(NULL, MODULENAME, SETTING_PINGHOST, host); + } + } + } + HWND hList = GetDlgItem(hwndDlg, IDC_PROTOCOLLIST); + memset(&lvItem, 0, sizeof(lvItem)); + lvItem.mask = LVIF_PARAM; + for (i = 0; i < ListView_GetItemCount(hList); i++) { + lvItem.iItem = i; + lvItem.iSubItem = 0; + ListView_GetItem(hList, &lvItem); + + char dbSetting[128]; + mir_snprintf(dbSetting, "%s_enabled", (char *)lvItem.lParam); + db_set_b(NULL, MODULENAME, dbSetting, (BYTE)ListView_GetCheckState(hList, lvItem.iItem)); + } + } + break; + } + + return 0; +} + +static INT_PTR CALLBACK DlgProcKSAdvOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch (msg) { + case WM_INITDIALOG: { + TranslateDialogDefault(hwndDlg); + SetDlgItemInt(hwndDlg, IDC_MAXDELAY, db_get_dw(NULL, MODULENAME, SETTING_MAXDELAY, DEFAULT_MAXDELAY), FALSE); + SetDlgItemInt(hwndDlg, IDC_MAXCONNECTINGTIME, db_get_dw(NULL, MODULENAME, SETTING_MAXCONNECTINGTIME, 0), FALSE); + CheckDlgButton(hwndDlg, IDC_INCREASEEXPONENTIAL, db_get_b(NULL, MODULENAME, SETTING_INCREASEEXPONENTIAL, FALSE) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_CNCOTHERLOC, (db_get_b(NULL, MODULENAME, SETTING_CNCOTHERLOC, FALSE) && (CallService(MS_SYSTEM_GETVERSION, 0, 0) >= 0x00040000)) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_LOGINERR, db_get_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING) == LOGINERR_NOTHING ? BST_UNCHECKED : BST_CHECKED); + CheckDlgButton(hwndDlg, IDC_CHECKAPMRESUME, (db_get_b(NULL, MODULENAME, SETTING_CHECKAPMRESUME, FALSE) && (CallService(MS_SYSTEM_GETVERSION, 0, 0) >= 0x00040000)) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_FIRSTOFFLINE, (db_get_b(NULL, MODULENAME, SETTING_FIRSTOFFLINE, FALSE)) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_NOLOCKED, (db_get_b(NULL, MODULENAME, SETTING_NOLOCKED, FALSE)) ? BST_CHECKED : BST_UNCHECKED); + SetDlgItemInt(hwndDlg, IDC_LOGINERR_DELAY, db_get_dw(NULL, MODULENAME, SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY), FALSE); + SetDlgItemInt(hwndDlg, IDC_PINGCOUNT, db_get_w(NULL, MODULENAME, SETTING_PINGCOUNT, DEFAULT_PINGCOUNT), FALSE); + SetDlgItemInt(hwndDlg, IDC_CNTDELAY, db_get_dw(NULL, MODULENAME, SETTING_CNTDELAY, CHECKCONTIN_DELAY), FALSE); + switch (db_get_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_CANCEL)) { + case LOGINERR_SETDELAY: + CheckRadioButton(hwndDlg, IDC_LOGINERR_CANCEL, IDC_LOGINERR_SETDELAY, IDC_LOGINERR_SETDELAY); + break; + default: + case LOGINERR_CANCEL: + CheckRadioButton(hwndDlg, IDC_LOGINERR_CANCEL, IDC_LOGINERR_SETDELAY, IDC_LOGINERR_CANCEL); + break; + } + SendMessage(hwndDlg, KS_ENABLEITEMS, 0, 0); + break; + } + case WM_COMMAND: + if (((HIWORD(wParam) == EN_CHANGE) || (HIWORD(wParam) == BN_CLICKED)) && ((HWND)lParam == GetFocus())) + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + // something changed + switch (LOWORD(wParam)) { + case IDC_INCREASEEXPONENTIAL: + case IDC_LOGINERR: + SendMessage(hwndDlg, KS_ENABLEITEMS, 0, 0); + break; + + case IDC_LOGINERR_CANCEL: + case IDC_LOGINERR_SETDELAY: + CheckRadioButton(hwndDlg, IDC_LOGINERR_CANCEL, IDC_LOGINERR_SETDELAY, LOWORD(wParam)); + EnableWindow(GetDlgItem(hwndDlg, IDC_LOGINERR_DELAY), IsDlgButtonChecked(hwndDlg, IDC_LOGINERR_SETDELAY) && IsDlgButtonChecked(hwndDlg, IDC_LOGINERR) && SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); + break; + } + break; + + case WM_NOTIFY: + if (((LPNMHDR)lParam)->code == PSN_APPLY) { + db_set_b(NULL, MODULENAME, SETTING_INCREASEEXPONENTIAL, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_INCREASEEXPONENTIAL)); + db_set_dw(NULL, MODULENAME, SETTING_MAXDELAY, (DWORD)GetDlgItemInt(hwndDlg, IDC_MAXDELAY, NULL, FALSE)); + db_set_dw(NULL, MODULENAME, SETTING_MAXCONNECTINGTIME, (DWORD)GetDlgItemInt(hwndDlg, IDC_MAXCONNECTINGTIME, NULL, FALSE)); + db_set_b(NULL, MODULENAME, SETTING_FIRSTOFFLINE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_FIRSTOFFLINE)); + db_set_b(NULL, MODULENAME, SETTING_NOLOCKED, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOLOCKED)); + db_set_b(NULL, MODULENAME, SETTING_CNCOTHERLOC, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CNCOTHERLOC)); + db_set_b(NULL, MODULENAME, SETTING_LOGINERR, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_LOGINERR)); + if (IsDlgButtonChecked(hwndDlg, IDC_LOGINERR)) { + if (IsDlgButtonChecked(hwndDlg, IDC_LOGINERR_SETDELAY)) { + db_set_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_SETDELAY); + db_set_dw(NULL, MODULENAME, SETTING_LOGINERR_DELAY, GetDlgItemInt(hwndDlg, IDC_LOGINERR_DELAY, NULL, FALSE)); + } + else db_set_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_CANCEL); + } + else db_set_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING); + + db_set_b(NULL, MODULENAME, SETTING_CHECKAPMRESUME, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_CHECKAPMRESUME)); + db_set_w(NULL, MODULENAME, SETTING_PINGCOUNT, (WORD)GetDlgItemInt(hwndDlg, IDC_PINGCOUNT, NULL, FALSE)); + db_set_dw(NULL, MODULENAME, SETTING_CNTDELAY, (DWORD)GetDlgItemInt(hwndDlg, IDC_CNTDELAY, NULL, FALSE) == 0 ? CHECKCONTIN_DELAY : GetDlgItemInt(hwndDlg, IDC_CNTDELAY, NULL, FALSE)); + } + break; + + case KS_ENABLEITEMS: + EnableWindow(GetDlgItem(hwndDlg, IDC_INCREASEEXPONENTIAL), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); + EnableWindow(GetDlgItem(hwndDlg, IDC_MAXCONNECTINGTIME), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); + EnableWindow(GetDlgItem(hwndDlg, IDC_CNCOTHERLOC), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0) && (CallService(MS_SYSTEM_GETVERSION, 0, 0) >= 0x00040000)); + EnableWindow(GetDlgItem(hwndDlg, IDC_LOGINERR), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); + EnableWindow(GetDlgItem(hwndDlg, IDC_LOGINERR_SETDELAY), IsDlgButtonChecked(hwndDlg, IDC_LOGINERR) && SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); + EnableWindow(GetDlgItem(hwndDlg, IDC_LOGINERR_DELAY), IsDlgButtonChecked(hwndDlg, IDC_LOGINERR_SETDELAY) && IsDlgButtonChecked(hwndDlg, IDC_LOGINERR) && SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); + EnableWindow(GetDlgItem(hwndDlg, IDC_LOGINERR_CANCEL), IsDlgButtonChecked(hwndDlg, IDC_LOGINERR) && SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); + EnableWindow(GetDlgItem(hwndDlg, IDC_MAXDELAY), (IsDlgButtonChecked(hwndDlg, IDC_INCREASEEXPONENTIAL) && SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)) ? TRUE : FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CHECKAPMRESUME), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0) && (CallService(MS_SYSTEM_GETVERSION, 0, 0) >= 0x00040000)); + EnableWindow(GetDlgItem(hwndDlg, IDC_FIRSTOFFLINE), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); + EnableWindow(GetDlgItem(hwndDlg, IDC_NOLOCKED), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CHECKCONNECTION, 0)); + EnableWindow(GetDlgItem(hwndDlg, IDC_PINGCOUNT), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_BYPING, 0)); + EnableWindow(GetDlgItem(hwndDlg, IDC_CNTDELAY), SendMessage(GetParent(hwndDlg), KS_ISENABLED, (WPARAM)IDC_CONTCHECK, 0)); + break; + + case WM_SHOWWINDOW: + if (wParam) + SendMessage(hwndDlg, KS_ENABLEITEMS, 0, 0); + + break; + } + + return 0; +} + +static INT_PTR CALLBACK DlgProcKsTabs(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static HWND hBasicTab; + + switch (msg) { + case WM_INITDIALOG: + { + HWND hShow, hPage; + RECT rcTabs, rcOptions, rcPage; + + TranslateDialogDefault(hwndDlg); + + // set tabs + int tabCount = 0; + HWND hTab = GetDlgItem(hwndDlg, IDC_TABS); + GetWindowRect(hTab, &rcTabs); + GetWindowRect(hwndDlg, &rcOptions); + + // basic tab + TCITEM tci; + memset(&tci, 0, sizeof(TCITEM)); + tci.mask = TCIF_TEXT | TCIF_PARAM; + tci.pszText = TranslateT("Basic"); + hShow = hBasicTab = hPage = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_OPT_KS_BASIC), hwndDlg, DlgProcKSBasicOpts, (LPARAM)GetParent(hwndDlg)); + EnableThemeDialogTexture(hPage, ETDT_ENABLETAB); + + tci.lParam = (LPARAM)hPage; + GetClientRect(hPage, &rcPage); + MoveWindow(hPage, (rcTabs.left - rcOptions.left) + ((rcTabs.right - rcTabs.left) - (rcPage.right - rcPage.left)) / 2, 10 + (rcTabs.top - rcOptions.top) + ((rcTabs.bottom - rcTabs.top) - (rcPage.bottom - rcPage.top)) / 2, rcPage.right - rcPage.left, rcPage.bottom - rcPage.top, TRUE); + ShowWindow(hPage, SW_HIDE); + TabCtrl_InsertItem(hTab, tabCount++, &tci); + + // advanced tab + tci.mask = TCIF_TEXT | TCIF_PARAM; + tci.pszText = TranslateT("Advanced"); + hPage = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_OPT_KS_ADV), hwndDlg, DlgProcKSAdvOpts, (LPARAM)GetParent(hwndDlg)); + EnableThemeDialogTexture(hPage, ETDT_ENABLETAB); + + tci.lParam = (LPARAM)hPage; + GetClientRect(hPage, &rcPage); + MoveWindow(hPage, (rcTabs.left - rcOptions.left) + ((rcTabs.right - rcTabs.left) - (rcPage.right - rcPage.left)) / 2, 10 + (rcTabs.top - rcOptions.top) + ((rcTabs.bottom - rcTabs.top) - (rcPage.bottom - rcPage.top)) / 2, rcPage.right - rcPage.left, rcPage.bottom - rcPage.top, TRUE); + ShowWindow(hPage, SW_HIDE); + TabCtrl_InsertItem(hTab, tabCount++, &tci); + ShowWindow(hShow, SW_SHOW); + } + break; + + case KS_ISENABLED: + SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, (LONG_PTR)IsDlgButtonChecked(hBasicTab, wParam)); + return TRUE; + + case PSM_CHANGED: + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + break; + + case WM_NOTIFY: + if ((((NMHDR*)lParam)->idFrom == IDC_TABS)) { + if (((NMHDR*)lParam)->code == TCN_SELCHANGING) { + TCITEM tci; + + tci.mask = TCIF_PARAM; + TabCtrl_GetItem(GetDlgItem(hwndDlg, IDC_TABS), TabCtrl_GetCurSel(GetDlgItem(hwndDlg, IDC_TABS)), &tci); + ShowWindow((HWND)tci.lParam, SW_HIDE); + } + else if (((NMHDR*)lParam)->code == TCN_SELCHANGE) { + TCITEM tci; + + tci.mask = TCIF_PARAM; + TabCtrl_GetItem(GetDlgItem(hwndDlg, IDC_TABS), TabCtrl_GetCurSel(GetDlgItem(hwndDlg, IDC_TABS)), &tci); + ShowWindow((HWND)tci.lParam, SW_SHOW); + } + } + if (((LPNMHDR)lParam)->code == PSN_APPLY) { + TCITEM tci; + int i, count; + + tci.mask = TCIF_PARAM; + count = TabCtrl_GetItemCount(GetDlgItem(hwndDlg, IDC_TABS)); + for (i = 0; i < count; i++) { + TabCtrl_GetItem(GetDlgItem(hwndDlg, IDC_TABS), i, &tci); + SendMessage((HWND)tci.lParam, WM_NOTIFY, 0, lParam); + } + // let main reload options + LoadMainOptions(); + } + break; + } + + return FALSE; +} + +INT_PTR CALLBACK PopupOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static bool bFreeze = false; + + switch (msg) { + case WM_INITDIALOG: + TranslateDialogDefault(hwndDlg); + + bFreeze = true; + + // left action + switch (db_get_b(NULL, MODULENAME, SETTING_POPUP_LEFTCLICK, POPUP_ACT_CANCEL)) { + case POPUP_ACT_CLOSEPOPUP: + CheckDlgButton(hwndDlg, IDC_LCLOSE, BST_CHECKED); + break; + + case POPUP_ACT_CANCEL: + CheckDlgButton(hwndDlg, IDC_LCANCEL, BST_CHECKED); + break; + + case POPUP_ACT_NOTHING: + default: + CheckDlgButton(hwndDlg, IDC_LNOTHING, BST_CHECKED); + break; + } + // right action + switch (db_get_b(NULL, MODULENAME, SETTING_POPUP_RIGHTCLICK, POPUP_ACT_CANCEL)) { + case POPUP_ACT_CLOSEPOPUP: + CheckDlgButton(hwndDlg, IDC_RCLOSE, BST_CHECKED); + break; + + case POPUP_ACT_CANCEL: + CheckDlgButton(hwndDlg, IDC_RCANCEL, BST_CHECKED); + break; + + case POPUP_ACT_NOTHING: + default: + CheckDlgButton(hwndDlg, IDC_RNOTHING, BST_CHECKED); + break; + } + // delay + EnableWindow(GetDlgItem(hwndDlg, IDC_DELAYCUSTOM), ServiceExists(MS_POPUP_ADDPOPUPT)); + EnableWindow(GetDlgItem(hwndDlg, IDC_DELAYFROMPU), ServiceExists(MS_POPUP_ADDPOPUPT)); + EnableWindow(GetDlgItem(hwndDlg, IDC_DELAYPERMANENT), ServiceExists(MS_POPUP_ADDPOPUPT)); + EnableWindow(GetDlgItem(hwndDlg, IDC_DELAY), ServiceExists(MS_POPUP_ADDPOPUPT)); + switch (db_get_b(NULL, MODULENAME, SETTING_POPUP_DELAYTYPE, POPUP_DELAYFROMPU)) { + case POPUP_DELAYCUSTOM: + CheckDlgButton(hwndDlg, IDC_DELAYCUSTOM, BST_CHECKED); + EnableWindow(GetDlgItem(hwndDlg, IDC_DELAY), ServiceExists(MS_POPUP_ADDPOPUPT)); + break; + + case POPUP_DELAYPERMANENT: + CheckDlgButton(hwndDlg, IDC_DELAYPERMANENT, BST_CHECKED); + EnableWindow(GetDlgItem(hwndDlg, IDC_DELAY), FALSE); + break; + + case POPUP_DELAYFROMPU: + default: + CheckDlgButton(hwndDlg, IDC_DELAYFROMPU, BST_CHECKED); + EnableWindow(GetDlgItem(hwndDlg, IDC_DELAY), FALSE); + break; + } + // delay + SetDlgItemInt(hwndDlg, IDC_DELAY, db_get_dw(NULL, MODULENAME, SETTING_POPUP_TIMEOUT, 0), FALSE); + // back color + SendDlgItemMessage(hwndDlg, IDC_BGCOLOR, CPM_SETCOLOUR, 0, db_get_dw(NULL, MODULENAME, SETTING_POPUP_BACKCOLOR, 0xAAAAAA)); + // text + SendDlgItemMessage(hwndDlg, IDC_TEXTCOLOR, CPM_SETCOLOUR, 0, db_get_dw(NULL, MODULENAME, SETTING_POPUP_TEXTCOLOR, 0x0000CC)); + // wincolors + CheckDlgButton(hwndDlg, IDC_WINCOLORS, db_get_b(NULL, MODULENAME, SETTING_POPUP_USEWINCOLORS, 0) ? BST_CHECKED : BST_UNCHECKED); + // defaultcolors + CheckDlgButton(hwndDlg, IDC_DEFAULTCOLORS, ((db_get_b(NULL, MODULENAME, SETTING_POPUP_USEDEFCOLORS, 0)) && (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS))) ? BST_CHECKED : BST_UNCHECKED); + EnableWindow(GetDlgItem(hwndDlg, IDC_BGCOLOR), ((BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS)) && (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_DEFAULTCOLORS)))); + EnableWindow(GetDlgItem(hwndDlg, IDC_TEXTCOLOR), ((BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS)) && (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_DEFAULTCOLORS)))); + EnableWindow(GetDlgItem(hwndDlg, IDC_DEFAULTCOLORS), (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS))); + EnableWindow(GetDlgItem(hwndDlg, IDC_WINCOLORS), (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_DEFAULTCOLORS))); + // popup types + CheckDlgButton(hwndDlg, IDC_PUCONNLOST, db_get_b(NULL, MODULENAME, SETTING_PUCONNLOST, TRUE) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_PUOTHER, db_get_b(NULL, MODULENAME, SETTING_PUOTHER, TRUE) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_PUCONNRETRY, db_get_b(NULL, MODULENAME, SETTING_PUCONNRETRY, TRUE) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_PURESULT, db_get_b(NULL, MODULENAME, SETTING_PURESULT, TRUE) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_PUSHOWEXTRA, db_get_b(NULL, MODULENAME, SETTING_PUSHOWEXTRA, TRUE) ? BST_CHECKED : BST_UNCHECKED); + bFreeze = false; + break; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDC_WINCOLORS: + case IDC_DEFAULTCOLORS: + EnableWindow(GetDlgItem(hwndDlg, IDC_BGCOLOR), ((BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS)) && (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_DEFAULTCOLORS)))); + EnableWindow(GetDlgItem(hwndDlg, IDC_TEXTCOLOR), ((BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS)) && (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_DEFAULTCOLORS)))); + EnableWindow(GetDlgItem(hwndDlg, IDC_DEFAULTCOLORS), (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS))); + EnableWindow(GetDlgItem(hwndDlg, IDC_WINCOLORS), (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_DEFAULTCOLORS))); + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + break; + + case IDC_DELAYFROMPU: + case IDC_DELAYPERMANENT: + EnableWindow(GetDlgItem(hwndDlg, IDC_DELAY), FALSE); + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + break; + + case IDC_DELAYCUSTOM: + EnableWindow(GetDlgItem(hwndDlg, IDC_DELAY), TRUE); + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + break; + + case IDC_BGCOLOR: + case IDC_TEXTCOLOR: + case IDC_DELAY: + case IDC_LNOTHING: + case IDC_LCLOSE: + case IDC_LCANCEL: + case IDC_RNOTHING: + case IDC_RCLOSE: + case IDC_RCANCEL: + case IDC_PUCONNLOST: + case IDC_PUOTHER: + case IDC_PUCONNRETRY: + case IDC_PURESULT: + case IDC_PUSHOWEXTRA: + if (!bFreeze) + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + break; + + case IDC_PREV: + { + POPUPDATAT ppd = { NULL }; + + ppd.lchContact = NULL; + ppd.lchIcon = Skin_LoadIcon(SKINICON_STATUS_OFFLINE); + wcsncpy(ppd.lptzContactName, TranslateT("KeepStatus"), MAX_CONTACTNAME); + wcsncpy(ppd.lptzText, TranslateT("You broke the Internet!"), MAX_SECONDLINE); + if (IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS)) + { + ppd.colorBack = GetSysColor(COLOR_BTNFACE); + ppd.colorText = GetSysColor(COLOR_WINDOWTEXT); + } + else if (IsDlgButtonChecked(hwndDlg, IDC_DEFAULTCOLORS)) + { + ppd.colorBack = NULL; + ppd.colorText = NULL; + } + else + { + ppd.colorBack = SendDlgItemMessage(hwndDlg, IDC_BGCOLOR, CPM_GETCOLOUR, 0, 0); + ppd.colorText = SendDlgItemMessage(hwndDlg, IDC_TEXTCOLOR, CPM_GETCOLOUR, 0, 0); + } + ppd.PluginWindowProc = PopupDlgProc; + ppd.PluginData = NULL; + if (IsDlgButtonChecked(hwndDlg, IDC_DELAYFROMPU)) + { + ppd.iSeconds = 0; + } + else if (IsDlgButtonChecked(hwndDlg, IDC_DELAYCUSTOM)) + { + ppd.iSeconds = GetDlgItemInt(hwndDlg, IDC_DELAY, NULL, FALSE); + } + else if (IsDlgButtonChecked(hwndDlg, IDC_DELAYPERMANENT)) + { + ppd.iSeconds = -1; + } + PUAddPopupT(&ppd); + } + break; + } + break; + + case WM_NOTIFY: + if (((LPNMHDR)lParam)->code == PSN_APPLY) { + // left action + if (IsDlgButtonChecked(hwndDlg, IDC_LNOTHING)) + db_set_b(NULL, MODULENAME, SETTING_POPUP_LEFTCLICK, POPUP_ACT_NOTHING); + else if (IsDlgButtonChecked(hwndDlg, IDC_LCLOSE)) + db_set_b(NULL, MODULENAME, SETTING_POPUP_LEFTCLICK, POPUP_ACT_CLOSEPOPUP); + else if (IsDlgButtonChecked(hwndDlg, IDC_LCANCEL)) + db_set_b(NULL, MODULENAME, SETTING_POPUP_LEFTCLICK, POPUP_ACT_CANCEL); + // right action + if (IsDlgButtonChecked(hwndDlg, IDC_RNOTHING)) + db_set_b(NULL, MODULENAME, SETTING_POPUP_RIGHTCLICK, POPUP_ACT_NOTHING); + else if (IsDlgButtonChecked(hwndDlg, IDC_RCLOSE)) + db_set_b(NULL, MODULENAME, SETTING_POPUP_RIGHTCLICK, POPUP_ACT_CLOSEPOPUP); + else if (IsDlgButtonChecked(hwndDlg, IDC_RCANCEL)) + db_set_b(NULL, MODULENAME, SETTING_POPUP_RIGHTCLICK, POPUP_ACT_CANCEL); + // delay + if (IsDlgButtonChecked(hwndDlg, IDC_DELAYFROMPU)) + db_set_b(NULL, MODULENAME, SETTING_POPUP_DELAYTYPE, POPUP_DELAYFROMPU); + else if (IsDlgButtonChecked(hwndDlg, IDC_DELAYCUSTOM)) + db_set_b(NULL, MODULENAME, SETTING_POPUP_DELAYTYPE, POPUP_DELAYCUSTOM); + else if (IsDlgButtonChecked(hwndDlg, IDC_DELAYPERMANENT)) + db_set_b(NULL, MODULENAME, SETTING_POPUP_DELAYTYPE, POPUP_DELAYPERMANENT); + // delay + db_set_dw(NULL, MODULENAME, SETTING_POPUP_TIMEOUT, GetDlgItemInt(hwndDlg, IDC_DELAY, NULL, FALSE)); + // back color + db_set_dw(NULL, MODULENAME, SETTING_POPUP_BACKCOLOR, SendDlgItemMessage(hwndDlg, IDC_BGCOLOR, CPM_GETCOLOUR, 0, 0)); + // text color + db_set_dw(NULL, MODULENAME, SETTING_POPUP_TEXTCOLOR, SendDlgItemMessage(hwndDlg, IDC_TEXTCOLOR, CPM_GETCOLOUR, 0, 0)); + // use win + db_set_b(NULL, MODULENAME, SETTING_POPUP_USEWINCOLORS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_WINCOLORS)); + // use def + db_set_b(NULL, MODULENAME, SETTING_POPUP_USEDEFCOLORS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DEFAULTCOLORS)); + // store types + db_set_b(NULL, MODULENAME, SETTING_PUCONNLOST, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_PUCONNLOST)); + db_set_b(NULL, MODULENAME, SETTING_PUOTHER, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_PUOTHER)); + db_set_b(NULL, MODULENAME, SETTING_PUCONNRETRY, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_PUCONNRETRY)); + db_set_b(NULL, MODULENAME, SETTING_PURESULT, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_PURESULT)); + db_set_b(NULL, MODULENAME, SETTING_PUSHOWEXTRA, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_PUSHOWEXTRA)); + } + break; + } + + return 0; +} + +int OptionsInit(WPARAM wparam, LPARAM) +{ + OPTIONSDIALOGPAGE odp = { 0 }; + odp.hInstance = hInst; + odp.pwszGroup = LPGENW("Status"); + odp.pwszTitle = LPGENW("KeepStatus"); + odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; + odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_TABS); + odp.pfnDlgProc = DlgProcKsTabs; + Options_AddPage(wparam, &odp); + + if (ServiceExists(MS_POPUP_ADDPOPUPT)) { + memset(&odp, 0, sizeof(odp)); + odp.position = 150000000; + odp.pwszGroup = LPGENW("Popups"); + odp.groupPosition = 910000000; + odp.hInstance = hInst; + odp.pszTemplate = MAKEINTRESOURCEA(IDD_PUOPT_KEEPSTATUS); + odp.pwszTitle = LPGENW("KeepStatus"); + odp.pfnDlgProc = PopupOptDlgProc; + odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; + Options_AddPage(wparam, &odp); + } + return 0; +} diff --git a/tools/_deprecated/StatusPlugins/KeepStatus/version.h b/tools/_deprecated/StatusPlugins/KeepStatus/version.h new file mode 100644 index 0000000000..81672eb0d3 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/KeepStatus/version.h @@ -0,0 +1,17 @@ +// plugin version part +#define __MAJOR_VERSION 0 +#define __MINOR_VERSION 9 +#define __RELEASE_NUM 0 +#define __BUILD_NUM 2 + +// other stuff for Version resource +#include + +// stuff that will be used in PluginInfo section and in Version resource +#define __PLUGIN_NAME "Keep status" +#define __FILENAME "KeepStatus.dll" +#define __DESC "KeepStatus, A connection checker, for use with (or without) StartupStatus and/or AdvancedAutoAway." +#define __AUTHOR "P Boon" +#define __AUTHOREMAIL "unregistered@users.sourceforge.net" +#define __AUTHORWEB "http://miranda-ng.org/p/KeepStatus/" +#define __COPYRIGHT "© 2003-08 P. Boon, 2008-16 George Hazan" diff --git a/tools/_deprecated/StatusPlugins/StartupStatus/StartupStatus.rc b/tools/_deprecated/StatusPlugins/StartupStatus/StartupStatus.rc new file mode 100644 index 0000000000..a7a2bebb2a --- /dev/null +++ b/tools/_deprecated/StatusPlugins/StartupStatus/StartupStatus.rc @@ -0,0 +1,70 @@ +// Microsoft Visual C++ generated resource script. +// +#include "..\resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "..\\resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDI_TTBDOWN ICON "res\\ttbDown.ico" +IDI_TTBUP ICON "res\\ttbUp.ico" + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff --git a/tools/_deprecated/StatusPlugins/StartupStatus/StartupStatus_10.vcxproj b/tools/_deprecated/StatusPlugins/StartupStatus/StartupStatus_10.vcxproj new file mode 100644 index 0000000000..40f2155891 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/StartupStatus/StartupStatus_10.vcxproj @@ -0,0 +1,228 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + StartupStatus + {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2} + + + + DynamicLibrary + Unicode + true + + + DynamicLibrary + Unicode + + + DynamicLibrary + true + Unicode + + + DynamicLibrary + Unicode + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)\Plugins\ + $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)\Plugins\ + $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)64\Plugins\ + $(SolutionDir)$(Configuration)64\Plugins\ + $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ + true + + + + Disabled + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + _DEBUG;_WINDOWS;_USRDLL;STARTUPSTATUS_EXPORTS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + Use + ../commonstatus.h + Level3 + EditAndContinue + 4996;%(DisableSpecificWarnings) + false + + + _DEBUG;%(PreprocessorDefinitions) + ..\..\..\include\msapi + + + true + $(IntDir)$(TargetName).lib + Windows + false + 0x11bd0000 + wininet.lib;%(AdditionalDependencies) + $(ProfileDir)..\..\..\bin10\lib + + + + + Full + OnlyExplicitInline + Size + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + NDEBUG;_WINDOWS;_USRDLL;STARTUPSTATUS_EXPORTS;%(PreprocessorDefinitions) + true + false + false + true + Fast + Use + ../commonstatus.h + Level3 + 4996;%(DisableSpecificWarnings) + + + NDEBUG;%(PreprocessorDefinitions) + ..\..\..\include\msapi + + + wininet.lib;%(AdditionalDependencies) + true + true + true + 0x11bd0000 + $(IntDir)$(TargetName).lib + Windows + false + $(ProfileDir)..\..\..\bin10\lib + /PDBALTPATH:%_PDB% + + + + + Full + OnlyExplicitInline + Size + true + false + false + Fast + true + Use + ../commonstatus.h + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + NDEBUG;_WINDOWS;_USRDLL;STARTUPSTATUS_EXPORTS;%(PreprocessorDefinitions) + Level3 + 4996;%(DisableSpecificWarnings) + + + wininet.lib;%(AdditionalDependencies) + true + true + true + $(IntDir)$(TargetName).lib + Windows + false + 0x11bd0000 + $(ProfileDir)..\..\..\bin10\lib + /PDBALTPATH:%_PDB% + + + ..\..\..\include\msapi + NDEBUG;%(PreprocessorDefinitions) + + + + + Use + ../commonstatus.h + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + _DEBUG;_WINDOWS;_USRDLL;STARTUPSTATUS_EXPORTS;%(PreprocessorDefinitions) + Level3 + 4996;%(DisableSpecificWarnings) + Disabled + MultiThreadedDebugDLL + EnableFastChecks + false + + + wininet.lib;%(AdditionalDependencies) + true + $(IntDir)$(TargetName).lib + Windows + false + 0x11bd0000 + $(ProfileDir)..\..\..\bin10\lib + + + ..\..\..\include\msapi + _DEBUG;%(PreprocessorDefinitions) + + + + + Create + commonstatus.h + + + commonstatus.h + + + NotUsing + + + commonstatus.h + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/_deprecated/StatusPlugins/StartupStatus/StartupStatus_10.vcxproj.filters b/tools/_deprecated/StatusPlugins/StartupStatus/StartupStatus_10.vcxproj.filters new file mode 100644 index 0000000000..3078255c51 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/StartupStatus/StartupStatus_10.vcxproj.filters @@ -0,0 +1,68 @@ + + + + + {05912809-2743-4a01-8ca7-689106a3141a} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {2f9d749c-d579-43b5-af4c-485fec64ddfa} + h;hpp;hxx;hm;inl + + + {3731744d-2cbc-4ec4-bc69-7e184a77f957} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + Resource Files + + + Resource Files + + + \ No newline at end of file diff --git a/tools/_deprecated/StatusPlugins/StartupStatus/StartupStatus_12.vcxproj b/tools/_deprecated/StatusPlugins/StartupStatus/StartupStatus_12.vcxproj new file mode 100644 index 0000000000..c664325d2f --- /dev/null +++ b/tools/_deprecated/StatusPlugins/StartupStatus/StartupStatus_12.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + StartupStatus + {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2} + + + + DynamicLibrary + Unicode + true + v120_xp + + + DynamicLibrary + Unicode + v120_xp + + + DynamicLibrary + true + Unicode + v120_xp + + + DynamicLibrary + Unicode + v120_xp + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)\Plugins\ + $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)\Plugins\ + $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)64\Plugins\ + $(SolutionDir)$(Configuration)64\Plugins\ + $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ + true + + + + Disabled + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + _DEBUG;_WINDOWS;_USRDLL;STARTUPSTATUS_EXPORTS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + Use + ../commonstatus.h + Level3 + EditAndContinue + 4996;%(DisableSpecificWarnings) + false + + + _DEBUG;%(PreprocessorDefinitions) + ..\..\..\include\msapi + + + true + $(IntDir)$(TargetName).lib + Windows + false + 0x11bd0000 + wininet.lib;%(AdditionalDependencies) + $(ProfileDir)..\..\..\bin12\lib + false + + + + + Full + OnlyExplicitInline + Size + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + NDEBUG;_WINDOWS;_USRDLL;STARTUPSTATUS_EXPORTS;%(PreprocessorDefinitions) + true + false + false + true + Fast + Use + ../commonstatus.h + Level3 + 4996;%(DisableSpecificWarnings) + + + NDEBUG;%(PreprocessorDefinitions) + ..\..\..\include\msapi + + + wininet.lib;%(AdditionalDependencies) + true + true + true + 0x11bd0000 + $(IntDir)$(TargetName).lib + Windows + false + $(ProfileDir)..\..\..\bin12\lib + + + + + Full + OnlyExplicitInline + Size + true + false + false + Fast + true + Use + ../commonstatus.h + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + NDEBUG;_WINDOWS;_USRDLL;STARTUPSTATUS_EXPORTS;%(PreprocessorDefinitions) + Level3 + 4996;%(DisableSpecificWarnings) + + + wininet.lib;%(AdditionalDependencies) + true + true + true + $(IntDir)$(TargetName).lib + Windows + false + 0x11bd0000 + $(ProfileDir)..\..\..\bin12\lib + + + ..\..\..\include\msapi + NDEBUG;%(PreprocessorDefinitions) + + + + + Use + ../commonstatus.h + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + _DEBUG;_WINDOWS;_USRDLL;STARTUPSTATUS_EXPORTS;%(PreprocessorDefinitions) + Level3 + 4996;%(DisableSpecificWarnings) + Disabled + MultiThreadedDebugDLL + EnableFastChecks + false + + + wininet.lib;%(AdditionalDependencies) + true + $(IntDir)$(TargetName).lib + Windows + false + 0x11bd0000 + $(ProfileDir)..\..\..\bin12\lib + + + ..\..\..\include\msapi + _DEBUG;%(PreprocessorDefinitions) + + + + + Create + commonstatus.h + + + commonstatus.h + + + NotUsing + + + commonstatus.h + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/_deprecated/StatusPlugins/StartupStatus/StartupStatus_12.vcxproj.filters b/tools/_deprecated/StatusPlugins/StartupStatus/StartupStatus_12.vcxproj.filters new file mode 100644 index 0000000000..3078255c51 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/StartupStatus/StartupStatus_12.vcxproj.filters @@ -0,0 +1,68 @@ + + + + + {05912809-2743-4a01-8ca7-689106a3141a} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {2f9d749c-d579-43b5-af4c-485fec64ddfa} + h;hpp;hxx;hm;inl + + + {3731744d-2cbc-4ec4-bc69-7e184a77f957} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + Resource Files + + + Resource Files + + + \ No newline at end of file diff --git a/tools/_deprecated/StatusPlugins/StartupStatus/StartupStatus_14.vcxproj b/tools/_deprecated/StatusPlugins/StartupStatus/StartupStatus_14.vcxproj new file mode 100644 index 0000000000..794b36247e --- /dev/null +++ b/tools/_deprecated/StatusPlugins/StartupStatus/StartupStatus_14.vcxproj @@ -0,0 +1,231 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + StartupStatus + {1BD5E5B9-A750-4CF8-A370-0FBD40A92CB2} + + + + DynamicLibrary + Unicode + true + v140_xp + + + DynamicLibrary + Unicode + v140_xp + + + DynamicLibrary + true + Unicode + v140_xp + + + DynamicLibrary + Unicode + v140_xp + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)\Plugins\ + $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)\Plugins\ + $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)64\Plugins\ + $(SolutionDir)$(Configuration)64\Plugins\ + $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ + $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ + true + + + + Disabled + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + _DEBUG;_WINDOWS;_USRDLL;STARTUPSTATUS_EXPORTS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + Use + ../commonstatus.h + Level4 + EditAndContinue + 4996;%(DisableSpecificWarnings) + false + + + _DEBUG;%(PreprocessorDefinitions) + ..\..\..\include\msapi + + + true + $(IntDir)$(TargetName).lib + Windows + false + 0x11bd0000 + wininet.lib;%(AdditionalDependencies) + $(ProfileDir)..\..\..\bin14\lib + false + + + + + Full + OnlyExplicitInline + Size + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + NDEBUG;_WINDOWS;_USRDLL;STARTUPSTATUS_EXPORTS;%(PreprocessorDefinitions) + true + false + false + true + Fast + Use + ../commonstatus.h + Level4 + 4996;%(DisableSpecificWarnings) + + + NDEBUG;%(PreprocessorDefinitions) + ..\..\..\include\msapi + + + wininet.lib;%(AdditionalDependencies) + true + true + true + 0x11bd0000 + $(IntDir)$(TargetName).lib + Windows + false + $(ProfileDir)..\..\..\bin14\lib + + + + + Full + OnlyExplicitInline + Size + true + false + false + Fast + true + Use + ../commonstatus.h + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + NDEBUG;_WINDOWS;_USRDLL;STARTUPSTATUS_EXPORTS;%(PreprocessorDefinitions) + Level4 + 4996;%(DisableSpecificWarnings) + + + wininet.lib;%(AdditionalDependencies) + true + true + true + $(IntDir)$(TargetName).lib + Windows + false + 0x11bd0000 + $(ProfileDir)..\..\..\bin14\lib + + + ..\..\..\include\msapi + NDEBUG;%(PreprocessorDefinitions) + + + + + Use + ../commonstatus.h + ..\..\..\include;..\..\ExternalAPI;%(AdditionalIncludeDirectories) + _DEBUG;_WINDOWS;_USRDLL;STARTUPSTATUS_EXPORTS;%(PreprocessorDefinitions) + Level4 + 4996;%(DisableSpecificWarnings) + Disabled + MultiThreadedDebugDLL + EnableFastChecks + false + + + wininet.lib;%(AdditionalDependencies) + true + $(IntDir)$(TargetName).lib + Windows + false + 0x11bd0000 + $(ProfileDir)..\..\..\bin14\lib + + + ..\..\..\include\msapi + _DEBUG;%(PreprocessorDefinitions) + + + + + Create + commonstatus.h + + + commonstatus.h + + + NotUsing + + + commonstatus.h + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/_deprecated/StatusPlugins/StartupStatus/StartupStatus_14.vcxproj.filters b/tools/_deprecated/StatusPlugins/StartupStatus/StartupStatus_14.vcxproj.filters new file mode 100644 index 0000000000..3078255c51 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/StartupStatus/StartupStatus_14.vcxproj.filters @@ -0,0 +1,68 @@ + + + + + {05912809-2743-4a01-8ca7-689106a3141a} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {2f9d749c-d579-43b5-af4c-485fec64ddfa} + h;hpp;hxx;hm;inl + + + {3731744d-2cbc-4ec4-bc69-7e184a77f957} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + Resource Files + + + Resource Files + + + \ No newline at end of file diff --git a/tools/_deprecated/StatusPlugins/StartupStatus/main.cpp b/tools/_deprecated/StatusPlugins/StartupStatus/main.cpp new file mode 100644 index 0000000000..9a3ceb3e84 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/StartupStatus/main.cpp @@ -0,0 +1,116 @@ +/* + StartupStatus Plugin for Miranda-IM (www.miranda-im.org) + Copyright 2003-2006 P. Boon + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "../commonstatus.h" +#include "startupstatus.h" + + +static HANDLE + hCSModuleLoadedHook, + hGetProfileService, + hGetProfileCountService, + hGetProfileNameService; + +HINSTANCE hInst; + +int hLangpack = 0; +CLIST_INTERFACE *pcli; + +int CSModuleLoaded( WPARAM, LPARAM ); + +///////////////////////////////////////////////////////////////////////////////////////// +// dll entry point + +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) +{ + hInst = hinstDLL; + return TRUE; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// returns plugin's extended information + +PLUGININFOEX pluginInfoEx={ + sizeof(PLUGININFOEX), + __PLUGIN_NAME, + PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), + __DESC, + __AUTHOR, + __AUTHOREMAIL, + __COPYRIGHT, + __AUTHORWEB, + UNICODE_AWARE, + { 0x4b733944, 0x5a70, 0x4b52, { 0xab, 0x2d, 0x68, 0xb1, 0xef, 0x38, 0xff, 0xe8 } } // {4B733944-5A70-4b52-AB2D-68B1EF38FFE8} +}; + +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) +{ + return &pluginInfoEx; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// plugin's entry point + +static INT_PTR SrvGetProfile( WPARAM wParam, LPARAM lParam ) +{ return GetProfile(( int )wParam, *(TSettingsList*)lParam ); +} + +extern "C" int __declspec(dllexport) Load(void) +{ + mir_getLP( &pluginInfoEx ); + pcli = Clist_GetInterface(); + + if ( db_get_b(NULL, MODULENAME, SETTING_SETPROFILE, 1) || + db_get_b(NULL, MODULENAME, SETTING_OFFLINECLOSE, 0)) + db_set_w(NULL, "CList", "Status", (WORD)ID_STATUS_OFFLINE); + + // docking + if (db_get_b(NULL, MODULENAME, SETTING_SETDOCKED, 0)) { + int docked = db_get_b(NULL, MODULENAME, SETTING_DOCKED, DOCKED_NONE); + if ( docked == DOCKED_LEFT || docked == DOCKED_RIGHT ) + docked = -docked; + + db_set_b(NULL, MODULE_CLIST, SETTING_DOCKED, (BYTE)docked); + } + + // Create service functions; the get functions are created here; they don't rely on commonstatus + hGetProfileService = CreateServiceFunction(MS_SS_GETPROFILE, SrvGetProfile); + hGetProfileCountService = CreateServiceFunction(MS_SS_GETPROFILECOUNT, GetProfileCount); + hGetProfileNameService = CreateServiceFunction(MS_SS_GETPROFILENAME, GetProfileName); + + LoadProfileModule(); + + // protocols must be loaded first + InitCommonStatus(); + hCSModuleLoadedHook = HookEvent(ME_SYSTEM_MODULESLOADED, CSModuleLoaded); + return 0; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// plugin's exit point + +extern "C" int __declspec(dllexport) Unload(void) +{ + UnhookEvent(hCSModuleLoadedHook); + + DestroyServiceFunction(hGetProfileService); + DestroyServiceFunction(hGetProfileCountService); + DestroyServiceFunction(hGetProfileNameService); + return 0; +} diff --git a/tools/_deprecated/StatusPlugins/StartupStatus/options.cpp b/tools/_deprecated/StatusPlugins/StartupStatus/options.cpp new file mode 100644 index 0000000000..87a969726b --- /dev/null +++ b/tools/_deprecated/StatusPlugins/StartupStatus/options.cpp @@ -0,0 +1,932 @@ +/* + StartupStatus Plugin for Miranda-IM (www.miranda-im.org) + Copyright 2003-2006 P. Boon + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "../commonstatus.h" +#include "startupstatus.h" +#include "../resource.h" + + +///////////////////////////////////////////////////////////////////////////////////////// + +TSettingsList* GetCurrentProtoSettings() +{ + int count; + PROTOACCOUNT **protos; + Proto_EnumAccounts(&count, &protos); + + TSettingsList *result = new TSettingsList(count, CompareSettings); + if (result == NULL) + return NULL; + + for (int i=0; i < count; i++) + if ( IsSuitableProto(protos[i])) + result->insert( new TSSSetting(protos[i])); + + return result; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// Command line processing + +static char* GetStatusDesc(int status) +{ + switch (status) { + case ID_STATUS_AWAY: return "away"; + case ID_STATUS_NA: return "na"; + case ID_STATUS_DND: return "dnd"; + case ID_STATUS_OCCUPIED: return "occupied"; + case ID_STATUS_FREECHAT: return "freechat"; + case ID_STATUS_ONLINE: return "online"; + case ID_STATUS_OFFLINE: return "offline"; + case ID_STATUS_INVISIBLE: return "invisible"; + case ID_STATUS_ONTHEPHONE: return "onthephone"; + case ID_STATUS_OUTTOLUNCH: return "outtolunch"; + case ID_STATUS_LAST: return "last"; + } + return "offline"; +} + +static char* GetCMDLArguments(TSettingsList& protoSettings) +{ + if ( protoSettings.getCount() == NULL ) + return NULL; + + char *cmdl, *pnt; + pnt = cmdl = ( char* )malloc(mir_strlen(protoSettings[0].szName) + mir_strlen(GetStatusDesc(protoSettings[0].status)) + 4); + + for (int i=0; i < protoSettings.getCount(); i++ ) { + *pnt++ = '/'; + mir_strcpy(pnt, protoSettings[i].szName); + pnt += mir_strlen(protoSettings[i].szName); + *pnt++ = '='; + mir_strcpy(pnt, GetStatusDesc(protoSettings[i].status)); + pnt += mir_strlen(GetStatusDesc(protoSettings[i].status)); + if (i != protoSettings.getCount()-1) { + *pnt++ = ' '; + *pnt++ = '\0'; + cmdl = ( char* )realloc(cmdl, mir_strlen(cmdl) + mir_strlen(protoSettings[i+1].szName) + mir_strlen(GetStatusDesc(protoSettings[i+1].status)) + 4); + pnt = cmdl + mir_strlen(cmdl); + } } + + if ( db_get_b( NULL, MODULENAME, SETTING_SHOWDIALOG, FALSE ) == TRUE ) { + *pnt++ = ' '; + *pnt++ = '\0'; + cmdl = ( char* )realloc(cmdl, mir_strlen(cmdl) + 12); + pnt = cmdl + mir_strlen(cmdl); + mir_strcpy(pnt, "/showdialog"); + pnt += 11; + *pnt = '\0'; + } + + return cmdl; +} + +static char* GetCMDL(TSettingsList& protoSettings) +{ + char path[MAX_PATH]; + GetModuleFileNameA(NULL, path, MAX_PATH); + + char* cmdl = ( char* )malloc(mir_strlen(path) + 4); + mir_snprintf(cmdl, mir_strlen(path) + 4, "\"%s\" ", path); + + char* args = GetCMDLArguments(protoSettings); + if ( args ) { + cmdl = ( char* )realloc(cmdl, mir_strlen(cmdl) + mir_strlen(args) + 1); + mir_strcat(cmdl, args); + free(args); + } + return cmdl; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// Link processing + +static wchar_t* GetLinkDescription(TSettingsList& protoSettings) +{ + if ( protoSettings.getCount() == 0 ) + return NULL; + + CMStringW result(SHORTCUT_DESC); + for (int i=0; i < protoSettings.getCount(); i++) { + TSSSetting &p = protoSettings[i]; + + wchar_t *status; + if ( p.status == ID_STATUS_LAST) + status = TranslateT(""); + else if (p.status == ID_STATUS_CURRENT) + status = TranslateT(""); + else if (p.status >= MIN_STATUS && p.status <= MAX_STATUS) + status = pcli->pfnGetStatusModeDescription(p.status, 0); + else + status = NULL; + if (status == NULL) + status = TranslateT(""); + + result.AppendChar('\r'); + result.Append(p.tszAccName); + result.AppendChar(':'); + result.AppendChar(' '); + result.Append(status); + } + + return mir_wstrndup(result, result.GetLength()); +} + +HRESULT CreateLink(TSettingsList& protoSettings) +{ + wchar_t savePath[MAX_PATH]; + if (SHGetSpecialFolderPath(NULL, savePath, 0x10, FALSE)) + wcsncat_s(savePath, SHORTCUT_FILENAME, _countof(savePath) - mir_wstrlen(savePath)); + else + mir_snwprintf(savePath, L".\\%s", SHORTCUT_FILENAME); + + // Get a pointer to the IShellLink interface. + IShellLink *psl; + HRESULT hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, ( void** )&psl); + if (SUCCEEDED(hres)) { + char *args = GetCMDLArguments(protoSettings); + wchar_t *desc = GetLinkDescription(protoSettings); + + // Set the path to the shortcut target, and add the + // description. + wchar_t path[MAX_PATH]; + GetModuleFileName(NULL, path, _countof(path)); + psl->SetPath(path); + psl->SetDescription(desc); + psl->SetArguments( _A2T(args)); + + // Query IShellLink for the IPersistFile interface for saving the + // shortcut in persistent storage. + IPersistFile *ppf; + hres = psl->QueryInterface(IID_IPersistFile, ( void** )&ppf); + + if (SUCCEEDED(hres)) { + // Save the link by calling IPersistFile::Save. + hres = ppf->Save(savePath, TRUE); + ppf->Release(); + } + psl->Release(); + free(args); + free(desc); + } + + return hres; +} + +INT_PTR CALLBACK CmdlOptionsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam) +{ + static TSettingsList* optionsProtoSettings; + + switch(msg) { + case WM_INITDIALOG: + TranslateDialogDefault(hwndDlg); + { + optionsProtoSettings = (TSettingsList*)lParam; + char* cmdl = GetCMDL(*optionsProtoSettings); + SetDlgItemTextA(hwndDlg, IDC_CMDL, cmdl); + free(cmdl); + } + break; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDC_COPY: + if ( OpenClipboard( hwndDlg )) { + EmptyClipboard(); + + char cmdl[2048]; + GetDlgItemTextA(hwndDlg,IDC_CMDL, cmdl, _countof(cmdl)); + HGLOBAL cmdlGlob = GlobalAlloc(GMEM_MOVEABLE, sizeof(cmdl)); + if (cmdlGlob == NULL) { + CloseClipboard(); + break; + } + LPTSTR cmdlStr = ( LPTSTR )GlobalLock(cmdlGlob); + memcpy(cmdlStr, &cmdl, sizeof(cmdl)); + GlobalUnlock(cmdlGlob); + SetClipboardData(CF_TEXT, cmdlGlob); + CloseClipboard(); + } + break; + + case IDC_SHORTCUT: + CreateLink(*optionsProtoSettings); + break; + + case IDC_OK: + DestroyWindow(hwndDlg); + break; + } + break; + + case WM_CLOSE: + DestroyWindow(hwndDlg); + break; + + case WM_DESTROY: + delete optionsProtoSettings; optionsProtoSettings = 0; + break; + } + + return 0; +} + +static INT_PTR CALLBACK StartupStatusOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam) +{ + static BOOL bInitDone = FALSE; + + switch(msg) { + case WM_INITDIALOG: + bInitDone = FALSE; + + TranslateDialogDefault(hwndDlg); + CheckDlgButton(hwndDlg, IDC_SETPROFILE, db_get_b(NULL, MODULENAME, SETTING_SETPROFILE, 1) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_OVERRIDE, db_get_b(NULL, MODULENAME, SETTING_OVERRIDE, 1) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_SHOWDIALOG, db_get_b(NULL, MODULENAME, SETTING_SHOWDIALOG, 0) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_SETWINSTATE, db_get_b(NULL, MODULENAME, SETTING_SETWINSTATE, 0) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_SETWINLOCATION, db_get_b(NULL, MODULENAME, SETTING_SETWINLOCATION, 0) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_SETDOCKED, db_get_b(NULL, MODULENAME, SETTING_SETDOCKED, 0) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_SETWINSIZE, db_get_b(NULL, MODULENAME, SETTING_SETWINSIZE, 0) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_OFFLINECLOSE, db_get_b(NULL, MODULENAME, SETTING_OFFLINECLOSE, 1) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_AUTODIAL, db_get_b(NULL, MODULENAME, SETTING_AUTODIAL, 0) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_AUTOHANGUP, db_get_b(NULL, MODULENAME, SETTING_AUTOHANGUP, 0) ? BST_CHECKED : BST_UNCHECKED); + SetDlgItemInt(hwndDlg, IDC_SETPROFILEDELAY, db_get_dw(NULL, MODULENAME, SETTING_SETPROFILEDELAY, 500), FALSE); + SetDlgItemInt(hwndDlg, IDC_DLGTIMEOUT, db_get_dw(NULL, MODULENAME, SETTING_DLGTIMEOUT, 5), FALSE); + SetDlgItemInt(hwndDlg, IDC_XPOS, db_get_dw(NULL, MODULENAME, SETTING_XPOS, 0), TRUE); + SetDlgItemInt(hwndDlg, IDC_YPOS, db_get_dw(NULL, MODULENAME, SETTING_YPOS, 0), TRUE); + SetDlgItemInt(hwndDlg, IDC_WIDTH, db_get_dw(NULL, MODULENAME, SETTING_WIDTH, 0), FALSE); + SetDlgItemInt(hwndDlg, IDC_HEIGHT, db_get_dw(NULL, MODULENAME, SETTING_HEIGHT, 0), FALSE); + { + int val = db_get_b(NULL, MODULENAME, SETTING_DOCKED, DOCKED_NONE); + int item = SendDlgItemMessage(hwndDlg, IDC_DOCKED, CB_ADDSTRING, 0, (LPARAM)TranslateT("Left")); + SendDlgItemMessage(hwndDlg, IDC_DOCKED, CB_SETITEMDATA, (WPARAM)item, (LPARAM)DOCKED_LEFT); + if (val == DOCKED_LEFT) + SendDlgItemMessage(hwndDlg, IDC_DOCKED, CB_SETCURSEL, (WPARAM)item, 0); + + item = SendDlgItemMessage(hwndDlg, IDC_DOCKED, CB_ADDSTRING, 0, (LPARAM)TranslateT("Right")); + SendDlgItemMessage(hwndDlg, IDC_DOCKED, CB_SETITEMDATA, (WPARAM)item, (LPARAM)DOCKED_RIGHT); + if (val == DOCKED_RIGHT) + SendDlgItemMessage(hwndDlg, IDC_DOCKED, CB_SETCURSEL, (WPARAM)item, 0); + + item = SendDlgItemMessage(hwndDlg, IDC_DOCKED, CB_ADDSTRING, 0, (LPARAM)TranslateT("None")); + SendDlgItemMessage(hwndDlg, IDC_DOCKED, CB_SETITEMDATA, (WPARAM)item, (LPARAM)DOCKED_NONE); + if (val == DOCKED_NONE) + SendDlgItemMessage(hwndDlg, IDC_DOCKED, CB_SETCURSEL, (WPARAM)item, 0); + } + + EnableWindow(GetDlgItem(hwndDlg, IDC_PROFILE), IsDlgButtonChecked(hwndDlg, IDC_SETPROFILE)||IsDlgButtonChecked(hwndDlg, IDC_SHOWDIALOG)); + EnableWindow(GetDlgItem(hwndDlg, IDC_SETPROFILEDELAY), IsDlgButtonChecked(hwndDlg, IDC_SETPROFILE)); + EnableWindow(GetDlgItem(hwndDlg, IDC_OVERRIDE), IsDlgButtonChecked(hwndDlg, IDC_SETPROFILE)); + EnableWindow(GetDlgItem(hwndDlg, IDC_DLGTIMEOUT), IsDlgButtonChecked(hwndDlg, IDC_SHOWDIALOG)); + EnableWindow(GetDlgItem(hwndDlg, IDC_WINSTATE), IsDlgButtonChecked(hwndDlg, IDC_SETWINSTATE)); + EnableWindow(GetDlgItem(hwndDlg, IDC_XPOS), IsDlgButtonChecked(hwndDlg, IDC_SETWINLOCATION)); + EnableWindow(GetDlgItem(hwndDlg, IDC_YPOS), IsDlgButtonChecked(hwndDlg, IDC_SETWINLOCATION)); + SendMessage(hwndDlg, UM_REINITPROFILES, 0, 0); + SendMessage(hwndDlg, UM_REINITDOCKED, 0, 0); + SendMessage(hwndDlg, UM_REINITWINSTATE, 0, 0); + SendMessage(hwndDlg, UM_REINITWINSIZE, 0, 0); + SetTimer(hwndDlg, 0, 100, NULL); + bInitDone = TRUE; + break; + + case WM_TIMER: + if ( BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_SETWINLOCATION) && BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_SETWINSIZE)) { + SetDlgItemTextA(hwndDlg, IDC_CURWINSIZE, ""); + SetDlgItemTextA(hwndDlg, IDC_CURWINLOC, ""); + break; + } + else { + wchar_t text[128]; + mir_snwprintf(text, TranslateT("size: %d x %d"), + db_get_dw(NULL, MODULE_CLIST, SETTING_WIDTH, 0), + db_get_dw(NULL, MODULE_CLIST, SETTING_HEIGHT, 0)); + SetDlgItemText(hwndDlg, IDC_CURWINSIZE, text); + + mir_snwprintf(text, TranslateT("loc: %d x %d"), + db_get_dw(NULL, MODULE_CLIST, SETTING_XPOS, 0), + db_get_dw(NULL, MODULE_CLIST, SETTING_YPOS, 0)); + SetDlgItemText(hwndDlg, IDC_CURWINLOC, text); + } + break; + + case UM_REINITPROFILES: + // creates profile combo box according to 'dat' + SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_RESETCONTENT, 0, 0); + { + int defProfile; + int profileCount = GetProfileCount((WPARAM)&defProfile, 0); + for ( int i=0; i < profileCount; i++ ) { + wchar_t profileName[128]; + if ( GetProfileName(i, (LPARAM)profileName)) + continue; + + int item = SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_ADDSTRING, 0, (LPARAM)profileName); + SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_SETITEMDATA, item, i); + } + SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_SETCURSEL, defProfile, 0); + } + break; + + case UM_REINITDOCKED: + EnableWindow(GetDlgItem(hwndDlg, IDC_SETDOCKED), db_get_b(NULL, MODULE_CLIST, SETTING_TOOLWINDOW, 1)); + if (!IsWindowEnabled(GetDlgItem(hwndDlg,IDC_SETDOCKED))) + CheckDlgButton(hwndDlg, IDC_SETDOCKED, BST_UNCHECKED); + + EnableWindow(GetDlgItem(hwndDlg, IDC_DOCKED), IsDlgButtonChecked(hwndDlg, IDC_SETDOCKED)); + break; + + case UM_REINITWINSTATE: + { + int val = db_get_b(NULL, MODULENAME, SETTING_WINSTATE, SETTING_STATE_NORMAL); + SendDlgItemMessage(hwndDlg, IDC_WINSTATE, CB_RESETCONTENT, 0, 0); + + int item = SendDlgItemMessage(hwndDlg, IDC_WINSTATE, CB_ADDSTRING, 0, (LPARAM)TranslateT("Hidden")); + SendDlgItemMessage(hwndDlg, IDC_WINSTATE, CB_SETITEMDATA, item, (LPARAM)SETTING_STATE_HIDDEN); + if (val == SETTING_STATE_HIDDEN) + SendDlgItemMessage(hwndDlg, IDC_WINSTATE, CB_SETCURSEL, item, 0); + + if (!db_get_b(NULL, MODULE_CLIST, SETTING_TOOLWINDOW, 0)) { + item = SendDlgItemMessage(hwndDlg, IDC_WINSTATE, CB_ADDSTRING, 0, (LPARAM)TranslateT("Minimized")); + SendDlgItemMessage(hwndDlg, IDC_WINSTATE, CB_SETITEMDATA, item, SETTING_STATE_MINIMIZED); + if (val == SETTING_STATE_MINIMIZED) + SendDlgItemMessage(hwndDlg, IDC_WINSTATE, CB_SETCURSEL, item, 0); + } + item = SendDlgItemMessage(hwndDlg, IDC_WINSTATE, CB_ADDSTRING, 0, (LPARAM)TranslateT("Normal")); + SendDlgItemMessage(hwndDlg, IDC_WINSTATE, CB_SETITEMDATA, item, SETTING_STATE_NORMAL); + if ( val == SETTING_STATE_NORMAL || (val == SETTING_STATE_MINIMIZED) && db_get_b(NULL, MODULE_CLIST, SETTING_TOOLWINDOW, 0)) + SendDlgItemMessage(hwndDlg, IDC_WINSTATE, CB_SETCURSEL, item, 0); + } + break; + + case UM_REINITWINSIZE: + EnableWindow(GetDlgItem(hwndDlg, IDC_WIDTH), IsDlgButtonChecked(hwndDlg, IDC_SETWINSIZE)); + EnableWindow(GetDlgItem(hwndDlg, IDC_HEIGHT), !db_get_b(NULL, MODULE_CLUI, SETTING_AUTOSIZE, 0)&&IsDlgButtonChecked(hwndDlg, IDC_SETWINSIZE)); + + case WM_COMMAND: + if ( HIWORD(wParam) == BN_CLICKED || HIWORD(wParam) == LBN_SELCHANGE || HIWORD(wParam) == CBN_SELCHANGE || HIWORD(wParam) == EN_CHANGE ) + if ( bInitDone ) + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + + switch (LOWORD(wParam)) { + case IDC_SETPROFILE: + EnableWindow(GetDlgItem(hwndDlg, IDC_PROFILE), IsDlgButtonChecked(hwndDlg, IDC_SETPROFILE)||IsDlgButtonChecked(hwndDlg, IDC_SHOWDIALOG)); + EnableWindow(GetDlgItem(hwndDlg, IDC_SETPROFILEDELAY), IsDlgButtonChecked(hwndDlg, IDC_SETPROFILE)); + EnableWindow(GetDlgItem(hwndDlg, IDC_OVERRIDE), IsDlgButtonChecked(hwndDlg, IDC_SETPROFILE)); + break; + case IDC_SHOWDIALOG: + EnableWindow(GetDlgItem(hwndDlg, IDC_PROFILE), IsDlgButtonChecked(hwndDlg, IDC_SETPROFILE)||IsDlgButtonChecked(hwndDlg, IDC_SHOWDIALOG)); + EnableWindow(GetDlgItem(hwndDlg, IDC_DLGTIMEOUT), IsDlgButtonChecked(hwndDlg, IDC_SHOWDIALOG)); + break; + case IDC_SETWINSTATE: + EnableWindow(GetDlgItem(hwndDlg, IDC_WINSTATE), IsDlgButtonChecked(hwndDlg, IDC_SETWINSTATE)); + break; + case IDC_SETDOCKED: + EnableWindow(GetDlgItem(hwndDlg, IDC_DOCKED), IsDlgButtonChecked(hwndDlg, IDC_SETDOCKED)); + break; + case IDC_SETWINLOCATION: + EnableWindow(GetDlgItem(hwndDlg, IDC_XPOS), IsDlgButtonChecked(hwndDlg, IDC_SETWINLOCATION)); + EnableWindow(GetDlgItem(hwndDlg, IDC_YPOS), IsDlgButtonChecked(hwndDlg, IDC_SETWINLOCATION)); + break; + case IDC_SETWINSIZE: + SendMessage(hwndDlg, UM_REINITWINSIZE, 0, 0); + break; + case IDC_SHOWCMDL: + { + int defProfile = (int)SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETITEMDATA, + SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETCURSEL, 0, 0), 0); + + TSettingsList* ps = GetCurrentProtoSettings(); + if ( ps ) { + GetProfile( defProfile, *ps ); + for ( int i=0; i < ps->getCount(); i++ ) + if ( (*ps)[i].szMsg != NULL ) + (*ps)[i].szMsg = wcsdup( (*ps)[i].szMsg ); + + CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_CMDLOPTIONS), hwndDlg, CmdlOptionsDlgProc, (LPARAM)ps); + } + break; + } + } + break; + + case WM_SHOWWINDOW: + if (wParam == FALSE) + break; + + bInitDone = FALSE; + SendMessage(hwndDlg, UM_REINITPROFILES, 0, 0); + SendMessage(hwndDlg, UM_REINITDOCKED, 0, 0); + SendMessage(hwndDlg, UM_REINITWINSTATE, 0, 0); + SendMessage(hwndDlg, UM_REINITWINSIZE, 0, 0); + bInitDone = TRUE; + break; + + case WM_NOTIFY: + if (((LPNMHDR)lParam)->code == PSN_APPLY) { + int val; + + db_set_b(NULL, MODULENAME, SETTING_SETPROFILE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SETPROFILE)); + if (IsDlgButtonChecked(hwndDlg, IDC_SETPROFILE)) + db_set_dw(NULL, MODULENAME, SETTING_SETPROFILEDELAY, GetDlgItemInt(hwndDlg, IDC_SETPROFILEDELAY, NULL, FALSE)); + + if (IsDlgButtonChecked(hwndDlg, IDC_SETPROFILE) || IsDlgButtonChecked(hwndDlg, IDC_SHOWDIALOG)) { + val = (int)SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETITEMDATA, + SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETCURSEL, 0, 0), 0); + db_set_w(NULL, MODULENAME, SETTING_DEFAULTPROFILE, (WORD)val); + } + db_set_b(NULL, MODULENAME, SETTING_OVERRIDE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_OVERRIDE)); + db_set_b(NULL, MODULENAME, SETTING_SHOWDIALOG, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWDIALOG)); + if (IsDlgButtonChecked(hwndDlg, IDC_SHOWDIALOG)) + db_set_dw(NULL, MODULENAME, SETTING_DLGTIMEOUT, GetDlgItemInt(hwndDlg, IDC_DLGTIMEOUT, NULL, FALSE)); + + db_set_b(NULL, MODULENAME, SETTING_SETWINSTATE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SETWINSTATE)); + if (IsDlgButtonChecked(hwndDlg, IDC_SETWINSTATE)) { + val = (int)SendDlgItemMessage(hwndDlg, IDC_WINSTATE, CB_GETITEMDATA, + SendDlgItemMessage(hwndDlg, IDC_WINSTATE, CB_GETCURSEL, 0, 0), 0); + db_set_b(NULL, MODULENAME, SETTING_WINSTATE, (BYTE)val); + } + db_set_b(NULL, MODULENAME, SETTING_SETDOCKED, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SETDOCKED)); + if (IsDlgButtonChecked(hwndDlg, IDC_SETDOCKED)) { + val = (int)SendDlgItemMessage(hwndDlg, IDC_DOCKED, CB_GETITEMDATA, + SendDlgItemMessage(hwndDlg, IDC_DOCKED, CB_GETCURSEL, 0, 0), 0); + db_set_b(NULL, MODULENAME, SETTING_DOCKED, (BYTE)val); + } + db_set_b(NULL, MODULENAME, SETTING_SETWINLOCATION, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SETWINLOCATION)); + if (IsDlgButtonChecked(hwndDlg, IDC_SETWINLOCATION)) { + db_set_dw(NULL, MODULENAME, SETTING_XPOS, GetDlgItemInt(hwndDlg, IDC_XPOS, NULL, TRUE)); + db_set_dw(NULL, MODULENAME, SETTING_YPOS, GetDlgItemInt(hwndDlg, IDC_YPOS, NULL, TRUE)); + } + db_set_b(NULL, MODULENAME, SETTING_SETWINSIZE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SETWINSIZE)); + if (IsDlgButtonChecked(hwndDlg, IDC_SETWINSIZE)) { + db_set_dw(NULL, MODULENAME, SETTING_WIDTH, GetDlgItemInt(hwndDlg, IDC_WIDTH, NULL, FALSE)); + db_set_dw(NULL, MODULENAME, SETTING_HEIGHT, GetDlgItemInt(hwndDlg, IDC_HEIGHT, NULL, FALSE)); + } + db_set_b(NULL, MODULENAME, SETTING_OFFLINECLOSE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_OFFLINECLOSE)); + db_set_b(NULL, MODULENAME, SETTING_AUTODIAL, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTODIAL)); + db_set_b(NULL, MODULENAME, SETTING_AUTOHANGUP, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOHANGUP)); + } + break; + } + + return FALSE; +} + +/////////////////////////////////////////////////////////////////////////////// +// for db cleanup + +static int DeleteSetting(const char *szSetting, LPARAM lParam) +{ + LIST *p = (LIST *)lParam; + p->insert(mir_strdup(szSetting)); + return 0; +} + +static int ClearDatabase(char* filter) +{ + LIST arSettings(10); + db_enum_settings(NULL, DeleteSetting, MODULENAME, &arSettings); + + for (int i = 0; i < arSettings.getCount(); i++) { + if ((filter == NULL) || (!strncmp(filter, arSettings[i], mir_strlen(filter)))) + db_unset(NULL, MODULENAME, arSettings[i]); + mir_free(arSettings[i]); + } + + if (filter == NULL) + db_unset(NULL, "AutoAway", "Confirm"); + + return 0; +} + + +static OBJLIST arProfiles(5); + +INT_PTR CALLBACK addProfileDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static HWND hwndParent; + + switch (msg) { + case WM_INITDIALOG: + TranslateDialogDefault(hwndDlg); + hwndParent = (HWND)lParam; + EnableWindow(GetDlgItem(hwndDlg, IDC_OK), FALSE); + break; + + case WM_COMMAND: + if (LOWORD(wParam) == IDC_OK) { + wchar_t profileName[128]; + GetDlgItemText(hwndDlg, IDC_PROFILENAME, profileName, _countof(profileName)); + SendMessage(hwndParent, UM_ADDPROFILE, 0, (LPARAM)profileName); + // done and exit + DestroyWindow(hwndDlg); + } + else if (LOWORD(wParam) == IDC_CANCEL) { + DestroyWindow(hwndDlg); + } + else if (LOWORD(wParam) == IDC_PROFILENAME) { + (SendDlgItemMessage(hwndDlg, IDC_PROFILENAME, EM_LINELENGTH, 0, 0) > 0) ? EnableWindow(GetDlgItem(hwndDlg, IDC_OK), TRUE) : EnableWindow(GetDlgItem(hwndDlg, IDC_OK), FALSE); + } + break; + + case WM_DESTROY: + EnableWindow(hwndParent, TRUE); + break; + } + + return 0; +} + +static INT_PTR CALLBACK StatusProfilesOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam) +{ + static BOOL bNeedRebuildMenu = FALSE; + static BOOL bInitDone = FALSE; + + switch(msg) { + case WM_INITDIALOG: + bInitDone = false; + + TranslateDialogDefault(hwndDlg); + SetDlgItemText(hwndDlg, IDC_CREATEMMI, TranslateT("Create a status menu item")); + { + int defProfile; + int profileCount = GetProfileCount((WPARAM)&defProfile, 0); + if (profileCount == 0) { + profileCount = 1; + defProfile = 0; + } + + for (int i=0; i < profileCount; i++) { + PROFILEOPTIONS *ppo = new PROFILEOPTIONS; + ppo->ps = GetCurrentProtoSettings(); + TSettingsList& ar = *ppo->ps; + + if ( GetProfile(i, ar) == -1) { + /* create an empty profile */ + if (i == defProfile) + ppo->tszName = mir_wstrdup( TranslateT("default")); + else + ppo->tszName = mir_wstrdup( TranslateT("unknown")); + } + else { + for (int j=0; j < ar.getCount(); j++) + if ( ar[j].szMsg != NULL) + ar[j].szMsg = wcsdup( ar[j].szMsg ); + + ppo->tszName = db_get_wsa(NULL, MODULENAME, OptName(i, SETTING_PROFILENAME)); + if (ppo->tszName == NULL) { + if (i == defProfile) + ppo->tszName = mir_wstrdup( TranslateT("default")); + else + ppo->tszName = mir_wstrdup( TranslateT("unknown")); + } + ppo->createTtb = db_get_b(NULL, MODULENAME, OptName(i, SETTING_CREATETTBBUTTON), 0); + ppo->showDialog = db_get_b(NULL, MODULENAME, OptName(i, SETTING_SHOWCONFIRMDIALOG), 0); + ppo->createMmi = db_get_b(NULL, MODULENAME, OptName(i, SETTING_CREATEMMITEM), 0); + ppo->inSubMenu = db_get_b(NULL, MODULENAME, OptName(i, SETTING_INSUBMENU), 1); + ppo->regHotkey = db_get_b(NULL, MODULENAME, OptName(i, SETTING_REGHOTKEY), 0); + ppo->hotKey = db_get_w(NULL, MODULENAME, OptName(i, SETTING_HOTKEY), MAKEWORD((char)('0'+i), HOTKEYF_CONTROL|HOTKEYF_SHIFT)); + } + arProfiles.insert(ppo); + } + if (hTTBModuleLoadedHook == NULL) + EnableWindow(GetDlgItem(hwndDlg, IDC_CREATETTB), FALSE); + + SendMessage(hwndDlg, UM_REINITPROFILES, 0, 0); + ShowWindow(GetDlgItem(hwndDlg, IDC_VARIABLESHELP), ServiceExists(MS_VARS_SHOWHELPEX)?SW_SHOW:SW_HIDE); + bInitDone = true; + } + break; + + case UM_REINITPROFILES: + bInitDone = false; + { + // creates profile combo box according to 'dat' + SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_RESETCONTENT, 0, 0); + for (int i=0; i < arProfiles.getCount(); i++ ) { + int item = SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_ADDSTRING, 0, (LPARAM)arProfiles[i].tszName); + SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_SETITEMDATA, (WPARAM)item, (LPARAM)i); + } + SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_SETCURSEL, 0, 0); + SendMessage(hwndDlg, UM_SETPROFILE, 0, 0); + } + bInitDone = true; + break; + + case UM_SETPROFILE: + { + int sel = (int)SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETITEMDATA, + SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETCURSEL, 0, 0), 0); + CheckDlgButton(hwndDlg, IDC_CREATETTB, arProfiles[sel].createTtb ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_SHOWDIALOG, arProfiles[sel].showDialog ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_CREATEMMI, arProfiles[sel].createMmi ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_INSUBMENU, arProfiles[sel].inSubMenu ? BST_CHECKED : BST_UNCHECKED); + EnableWindow(GetDlgItem(hwndDlg, IDC_INSUBMENU), IsDlgButtonChecked(hwndDlg, IDC_CREATEMMI)); + CheckDlgButton(hwndDlg, IDC_REGHOTKEY, arProfiles[sel].regHotkey ? BST_CHECKED : BST_UNCHECKED); + SendDlgItemMessage(hwndDlg, IDC_HOTKEY, HKM_SETHOTKEY, arProfiles[sel].hotKey, 0); + EnableWindow(GetDlgItem(hwndDlg, IDC_HOTKEY), IsDlgButtonChecked(hwndDlg, IDC_REGHOTKEY)); + SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, LB_RESETCONTENT, 0, 0); + + // fill proto list + TSettingsList& ar = *arProfiles[sel].ps; + for ( int i=0; i < ar.getCount(); i++ ) { + int item = SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, LB_ADDSTRING, 0, (LPARAM)ar[i].tszAccName ); + SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, LB_SETITEMDATA, (WPARAM)item, (LPARAM)&ar[i]); + } + SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, LB_SETCURSEL, 0, 0); + SendMessage(hwndDlg, UM_SETPROTOCOL, 0, 0); + } + break; + + case UM_SETPROTOCOL: + { + int idx = SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, LB_GETCURSEL, 0, 0); + if ( idx != -1 ) { + // fill status box + TSSSetting* ps = ( TSSSetting* )SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, LB_GETITEMDATA, idx, 0); + + int flags = (CallProtoService(ps->szName, PS_GETCAPS, PFLAGNUM_2, 0))&~(CallProtoService(ps->szName, PS_GETCAPS, PFLAGNUM_5, 0)); + SendDlgItemMessage(hwndDlg, IDC_STATUS, LB_RESETCONTENT, 0, 0); + for ( int i=0; i < _countof(statusModeList); i++ ) { + if ( (flags&statusModePf2List[i]) || (statusModeList[i] == ID_STATUS_OFFLINE)) { + int item = SendDlgItemMessage(hwndDlg, IDC_STATUS, LB_ADDSTRING, 0, (LPARAM)pcli->pfnGetStatusModeDescription(statusModeList[i], 0)); + SendDlgItemMessage(hwndDlg, IDC_STATUS, LB_SETITEMDATA, (WPARAM)item, (LPARAM)statusModeList[i]); + if (ps->status == statusModeList[i]) + SendDlgItemMessage(hwndDlg, IDC_STATUS, LB_SETCURSEL, (WPARAM)item, 0); + } + } + + int item = SendDlgItemMessage(hwndDlg, IDC_STATUS, LB_ADDSTRING, 0, (LPARAM)TranslateT("")); + SendDlgItemMessage(hwndDlg, IDC_STATUS, LB_SETITEMDATA, (WPARAM)item, (LPARAM)ID_STATUS_CURRENT); + if (ps->status == ID_STATUS_CURRENT) + SendDlgItemMessage(hwndDlg, IDC_STATUS, LB_SETCURSEL, (WPARAM)item, 0); + + item = SendDlgItemMessage(hwndDlg, IDC_STATUS, LB_ADDSTRING, 0, (LPARAM)TranslateT("")); + SendDlgItemMessage(hwndDlg, IDC_STATUS, LB_SETITEMDATA, (WPARAM)item, (LPARAM)ID_STATUS_LAST); + if (ps->status == ID_STATUS_LAST) + SendDlgItemMessage(hwndDlg, IDC_STATUS, LB_SETCURSEL, (WPARAM)item, 0); + } + + SendMessage(hwndDlg, UM_SETSTATUSMSG, 0, 0); + } + break; + + case UM_SETSTATUSMSG: + { + // set status message + BOOL bStatusMsg = FALSE; + int idx = SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, LB_GETCURSEL, 0, 0); + if ( idx != -1 ) { + TSSSetting* ps = ( TSSSetting* )SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, LB_GETITEMDATA, idx, 0); + + CheckRadioButton(hwndDlg, IDC_MIRANDAMSG, IDC_CUSTOMMSG, ps->szMsg!=NULL?IDC_CUSTOMMSG:IDC_MIRANDAMSG); + if (ps->szMsg != NULL) + SetDlgItemText(hwndDlg, IDC_STATUSMSG, ps->szMsg); + + bStatusMsg = ( (((CallProtoService(ps->szName, PS_GETCAPS, PFLAGNUM_1, 0)&PF1_MODEMSGSEND&~PF1_INDIVMODEMSG)) && + (CallProtoService(ps->szName, PS_GETCAPS, PFLAGNUM_3, 0)&Proto_Status2Flag(ps->status))) || (ps->status == ID_STATUS_CURRENT) || (ps->status == ID_STATUS_LAST)); + } + EnableWindow(GetDlgItem(hwndDlg, IDC_MIRANDAMSG), bStatusMsg); + EnableWindow(GetDlgItem(hwndDlg, IDC_CUSTOMMSG), bStatusMsg); + EnableWindow(GetDlgItem(hwndDlg, IDC_STATUSMSG), bStatusMsg&&IsDlgButtonChecked(hwndDlg, IDC_CUSTOMMSG)); + EnableWindow(GetDlgItem(hwndDlg, IDC_VARIABLESHELP), bStatusMsg&&IsDlgButtonChecked(hwndDlg, IDC_CUSTOMMSG)); + } + break; + + case UM_ADDPROFILE: + { + wchar_t *tszName = (wchar_t*)lParam; + if (tszName == NULL) + break; + + PROFILEOPTIONS* ppo = new PROFILEOPTIONS; + ppo->tszName = mir_wstrdup(tszName); + ppo->ps = GetCurrentProtoSettings(); + arProfiles.insert(ppo); + + SendMessage(hwndDlg, UM_REINITPROFILES, 0, 0); + } + break; + + case UM_DELPROFILE: { + // wparam == profile no + int i=(int)wParam; + + if ( arProfiles.getCount() == 1) { + MessageBox(NULL, TranslateT("At least one profile must exist"), TranslateT("StartupStatus"), MB_OK); + break; + } + + arProfiles.remove(i); + + int defProfile; + GetProfileCount((WPARAM)&defProfile, 0); + if (i == defProfile) { + MessageBox(NULL, TranslateT("Your default profile will be changed"), TranslateT("StartupStatus"), MB_OK); + db_set_w(NULL, MODULENAME, SETTING_DEFAULTPROFILE, 0); + } + SendMessage(hwndDlg, UM_REINITPROFILES, 0, 0); + break; + } + + case WM_COMMAND: + if ( ((HIWORD(wParam) == EN_CHANGE) || (HIWORD(wParam) == BN_CLICKED) || (HIWORD(wParam) == LBN_SELCHANGE)) && ((HWND)lParam == GetFocus())) + if ( bInitDone ) + SendMessage(GetParent(hwndDlg),PSM_CHANGED,0,0); + + switch (LOWORD(wParam)) { + case IDC_STATUS: + if (HIWORD(wParam) == LBN_SELCHANGE) { + int idx = SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, LB_GETCURSEL, 0, 0); + if ( idx != -1 ) { + TSSSetting* ps = ( TSSSetting* )SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, LB_GETITEMDATA, idx, 0); + ps->status = (int)SendDlgItemMessage(hwndDlg, IDC_STATUS, LB_GETITEMDATA, + SendDlgItemMessage(hwndDlg, IDC_STATUS, LB_GETCURSEL, 0, 0), 0); + } + SendMessage(hwndDlg, UM_SETSTATUSMSG, 0, 0); + } + break; + + case IDC_PROFILE: + if (HIWORD(wParam) != CBN_SELCHANGE) + break; + + SendMessage(hwndDlg, UM_SETPROFILE, 0, 0); + break; + + case IDC_PROTOCOL: + if (HIWORD(wParam) != LBN_SELCHANGE) + break; + + SendMessage(hwndDlg, UM_SETPROTOCOL, 0, 0); + break; + + case IDC_MIRANDAMSG: + case IDC_CUSTOMMSG: + { + int len; + TSSSetting* ps = ( TSSSetting* )SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, LB_GETITEMDATA, + SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, LB_GETCURSEL, 0, 0), 0); + if (ps->szMsg != NULL) + free(ps->szMsg); + + ps->szMsg = NULL; + if (IsDlgButtonChecked(hwndDlg, IDC_CUSTOMMSG)) { + len = SendDlgItemMessage(hwndDlg, IDC_STATUSMSG, WM_GETTEXTLENGTH, 0, 0); + ps->szMsg = (wchar_t*)calloc(sizeof(wchar_t), len+1); + GetDlgItemText(hwndDlg, IDC_STATUSMSG, ps->szMsg, (len + 1)); + } + SendMessage(hwndDlg, UM_SETSTATUSMSG, 0, 0); + } + break; + + case IDC_STATUSMSG: + if (HIWORD(wParam) == EN_CHANGE) { + // update the status message in memory, this is done on each character tick, not nice + // but it works + TSSSetting* ps = ( TSSSetting* )SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, LB_GETITEMDATA, + SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, LB_GETCURSEL, 0, 0), 0); + if (ps->szMsg != NULL) { + if ( *ps->szMsg ) + free(ps->szMsg); + ps->szMsg = NULL; + } + int len = SendDlgItemMessage(hwndDlg, IDC_STATUSMSG, WM_GETTEXTLENGTH, 0, 0); + ps->szMsg = (wchar_t*)calloc(sizeof(wchar_t), len+1); + GetDlgItemText(hwndDlg, IDC_STATUSMSG, ps->szMsg, (len + 1)); + } + break; + + case IDC_CREATEMMI: + EnableWindow(GetDlgItem(hwndDlg, IDC_INSUBMENU), IsDlgButtonChecked(hwndDlg, IDC_CREATEMMI)); + case IDC_INSUBMENU: + bNeedRebuildMenu = TRUE; + case IDC_REGHOTKEY: + case IDC_CREATETTB: + case IDC_SHOWDIALOG: + { + int sel = (int)SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETCURSEL, 0, 0), 0); + PROFILEOPTIONS& po = arProfiles[sel]; + po.createMmi = IsDlgButtonChecked(hwndDlg, IDC_CREATEMMI); + po.inSubMenu = IsDlgButtonChecked(hwndDlg, IDC_INSUBMENU); + po.createTtb = IsDlgButtonChecked(hwndDlg, IDC_CREATETTB); + po.regHotkey = IsDlgButtonChecked(hwndDlg, IDC_REGHOTKEY); + po.showDialog = IsDlgButtonChecked(hwndDlg, IDC_SHOWDIALOG); + EnableWindow(GetDlgItem(hwndDlg, IDC_HOTKEY), IsDlgButtonChecked(hwndDlg, IDC_REGHOTKEY)); + } + break; + + case IDC_HOTKEY: + if (HIWORD(wParam) == EN_CHANGE) { + int sel = (int)SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETITEMDATA, + SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETCURSEL, 0, 0), 0); + arProfiles[sel].hotKey = (WORD)SendDlgItemMessage(hwndDlg, IDC_HOTKEY, HKM_GETHOTKEY, 0, 0); + } + break; + + case IDC_ADDPROFILE: + // add a profile + CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_ADDPROFILE), hwndDlg, addProfileDlgProc, (LPARAM)hwndDlg); + EnableWindow(hwndDlg, FALSE); + break; + + case IDC_DELPROFILE: + { + int sel = (int)SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETITEMDATA, + SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETCURSEL, 0, 0), 0); + SendMessage(hwndDlg, UM_DELPROFILE, (WPARAM)sel, 0); + } + break; + + case IDC_VARIABLESHELP: + variables_showhelp(hwndDlg, IDC_STATUSMSG, VHF_INPUT|VHF_EXTRATEXT|VHF_HELP|VHF_FULLFILLSTRUCT|VHF_HIDESUBJECTTOKEN, NULL, "Protocol ID"); + break; + } + break; + + case WM_NOTIFY: + if (((LPNMHDR)lParam)->code == PSN_APPLY) { + char setting[128]; + int oldCount = db_get_w(NULL, MODULENAME, SETTING_PROFILECOUNT, 0); + for (int i=0; i < oldCount; i++) { + mir_snprintf(setting, "%d_", i); + ClearDatabase(setting); + } + for (int i=0; i < arProfiles.getCount(); i++) { + PROFILEOPTIONS& po = arProfiles[i]; + db_set_b(NULL, MODULENAME, OptName(i, SETTING_SHOWCONFIRMDIALOG), po.showDialog); + db_set_b(NULL, MODULENAME, OptName(i, SETTING_CREATETTBBUTTON), po.createTtb); + db_set_b(NULL, MODULENAME, OptName(i, SETTING_CREATEMMITEM), po.createMmi); + db_set_b(NULL, MODULENAME, OptName(i, SETTING_INSUBMENU), po.inSubMenu); + db_set_b(NULL, MODULENAME, OptName(i, SETTING_REGHOTKEY), po.regHotkey); + db_set_w(NULL, MODULENAME, OptName(i, SETTING_HOTKEY), po.hotKey); + db_set_ws(NULL, MODULENAME, OptName(i, SETTING_PROFILENAME), po.tszName); + + TSettingsList& ar = *po.ps; + for (int j=0; j < ar.getCount(); j++) { + if ( ar[j].szMsg != NULL ) { + mir_snprintf(setting, "%s_%s", ar[j].szName, SETTING_PROFILE_STSMSG); + db_set_ws(NULL, MODULENAME, OptName(i, setting), ar[j].szMsg); + } + db_set_w(NULL, MODULENAME, OptName(i, ar[j].szName), ar[j].status); + } + } + db_set_w(NULL, MODULENAME, SETTING_PROFILECOUNT, (WORD)arProfiles.getCount()); + + // Rebuild status menu + if (bNeedRebuildMenu) + pcli->pfnReloadProtoMenus(); + + LoadMainOptions(); + } + break; + + case WM_DESTROY: + arProfiles.destroy(); + break; + } + + return 0; +} + +int OptionsInit(WPARAM wparam,LPARAM) +{ + OPTIONSDIALOGPAGE odp = { 0 }; + odp.hInstance = hInst; + odp.pszGroup = LPGEN("Status"); + odp.pszTitle = LPGEN("StartupStatus"); + odp.flags = ODPF_BOLDGROUPS; + + odp.pszTab = LPGEN("General"); + odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_STARTUPSTATUS); + odp.pfnDlgProc = StartupStatusOptDlgProc; + Options_AddPage(wparam,&odp); + + odp.pszTab = LPGEN("Status profiles"); + odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_STATUSPROFILES); + odp.pfnDlgProc = StatusProfilesOptDlgProc; + Options_AddPage(wparam,&odp); + return 0; +} + +char* OptName(int i, const char* setting) +{ + static char buf[100]; + mir_snprintf(buf, "%d_%s", i, setting); + return buf; +} diff --git a/tools/_deprecated/StatusPlugins/StartupStatus/profiles.cpp b/tools/_deprecated/StatusPlugins/StartupStatus/profiles.cpp new file mode 100644 index 0000000000..51a4bccc71 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/StartupStatus/profiles.cpp @@ -0,0 +1,348 @@ +/* + StartupStatus Plugin for Miranda-IM (www.miranda-im.org) + Copyright 2003-2006 P. Boon + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "../commonstatus.h" +#include "startupstatus.h" +#include "../resource.h" +#include + +#include + +#define MAX_MMITEMS 6 + +extern HINSTANCE hInst; +extern int protoCount; + +static int menuprofiles[MAX_MMITEMS]; +static HANDLE hProfileServices[MAX_MMITEMS]; +static int mcount = 0; + +static PROFILECE *pce = NULL; +static int pceCount = 0; + +static UINT_PTR releaseTtbTimerId = 0; + +static HANDLE hTBModuleLoadedHook; +static HANDLE hLoadAndSetProfileService; +static HANDLE hMessageHook = NULL; + +static HWND hMessageWindow = NULL; +static HKINFO *hkInfo = NULL; +static int hkiCount = 0; + +static HANDLE* ttbButtons = NULL; +static int ttbButtonCount = 0; + +HANDLE hTTBModuleLoadedHook; + +static INT_PTR profileService(WPARAM, LPARAM, LPARAM param) +{ + LoadAndSetProfile((WPARAM)menuprofiles[param], 0); + return 0; +} + +static int CreateMainMenuItems(WPARAM, LPARAM) +{ + CMenuItem mi; + mi.position = 2000100000; + mi.flags = CMIF_UNICODE; + mcount = 0; + int count = GetProfileCount(0, 0); + for (int i = 0; i < count && mcount < MAX_MMITEMS; i++) { + wchar_t profilename[128]; + if (!db_get_b(NULL, MODULENAME, OptName(i, SETTING_CREATEMMITEM), 0) || GetProfileName(i, (LPARAM)profilename)) + continue; + + if (db_get_b(NULL, MODULENAME, OptName(i, SETTING_INSUBMENU), 1) && !mi.root) { + mi.root = Menu_CreateRoot(MO_STATUS, LPGENW("Status profiles"), 2000100000); + Menu_ConfigureItem(mi.root, MCI_OPT_UID, "1AB30D51-BABA-4B27-9288-1A12278BAD8D"); + } + + char servicename[128]; + mir_snprintf(servicename, "%s%d", MS_SS_MENUSETPROFILEPREFIX, mcount); + hProfileServices[mcount] = CreateServiceFunctionParam(servicename, profileService, mcount); + + mi.name.w = profilename; + mi.position = 2000100000 + mcount; + mi.pszService = servicename; + if (Menu_AddStatusMenuItem(&mi)) + menuprofiles[mcount++] = i; + } + + return 0; +} + +///////////////////////////////////////////////////////////////////////////////////////// + +INT_PTR GetProfileName(WPARAM wParam, LPARAM lParam) +{ + int profile = (int)wParam; + if (profile < 0) // get default profile + profile = db_get_w(NULL, MODULENAME, SETTING_DEFAULTPROFILE, 0); + + int count = db_get_w(NULL, MODULENAME, SETTING_PROFILECOUNT, 0); + if (profile >= count && count > 0) + return -1; + + wchar_t* buf = (wchar_t*)lParam; + if (count == 0) { + wcsncpy(buf, TranslateT("default"), 128 - 1); + return 0; + } + + DBVARIANT dbv; + char setting[80]; + mir_snprintf(setting, "%d_%s", profile, SETTING_PROFILENAME); + if (db_get_ws(NULL, MODULENAME, setting, &dbv)) + return -1; + + wcsncpy(buf, dbv.ptszVal, 128 - 1); buf[127] = 0; + db_free(&dbv); + return 0; +} + +INT_PTR GetProfileCount(WPARAM wParam, LPARAM) +{ + int *def = (int*)wParam; + int count = db_get_w(NULL, MODULENAME, SETTING_PROFILECOUNT, 1); + if (def != 0) { + *def = db_get_w(NULL, MODULENAME, SETTING_DEFAULTPROFILE, 0); + if (*def >= count) + *def = 0; + } + + return count; +} + +wchar_t *GetStatusMessage(int profile, char *szProto) +{ + char dbSetting[80]; + DBVARIANT dbv; + + for (int i = 0; i < pceCount; i++) { + if ((pce[i].profile == profile) && (!mir_strcmp(pce[i].szProto, szProto))) { + mir_snprintf(dbSetting, "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG); + if (!db_get_ws(NULL, MODULENAME, dbSetting, &dbv)) { // reload from db + pce[i].msg = (wchar_t*)realloc(pce[i].msg, sizeof(wchar_t)*(mir_wstrlen(dbv.ptszVal) + 1)); + if (pce[i].msg != NULL) { + mir_wstrcpy(pce[i].msg, dbv.ptszVal); + } + db_free(&dbv); + } + else { + if (pce[i].msg != NULL) { + free(pce[i].msg); + pce[i].msg = NULL; + } + } + return pce[i].msg; + } + } + pce = (PROFILECE*)realloc(pce, (pceCount + 1)*sizeof(PROFILECE)); + if (pce == NULL) + return NULL; + + pce[pceCount].profile = profile; + pce[pceCount].szProto = _strdup(szProto); + pce[pceCount].msg = NULL; + mir_snprintf(dbSetting, "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG); + if (!db_get_ws(NULL, MODULENAME, dbSetting, &dbv)) { + pce[pceCount].msg = wcsdup(dbv.ptszVal); + db_free(&dbv); + } + pceCount++; + + return pce[pceCount - 1].msg; +} + +int GetProfile(int profile, TSettingsList& arSettings) +{ + if (profile < 0) // get default profile + profile = db_get_w(NULL, MODULENAME, SETTING_DEFAULTPROFILE, 0); + + int count = db_get_w(NULL, MODULENAME, SETTING_PROFILECOUNT, 0); + if (profile >= count && count > 0) + return -1; + + arSettings.destroy(); + + // if count == 0, continue so the default profile will be returned + PROTOACCOUNT** protos; + Proto_EnumAccounts(&count, &protos); + + for (int i = 0; i < count; i++) + if (IsSuitableProto(protos[i])) + arSettings.insert(new TSSSetting(profile, protos[i])); + + return (arSettings.getCount() == 0) ? -1 : 0; +} + +static void CALLBACK releaseTtbTimerFunction(HWND, UINT, UINT_PTR, DWORD) +{ + KillTimer(NULL, releaseTtbTimerId); + for (int i = 0; i < ttbButtonCount; i++) + CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)ttbButtons[i], 0); +} + +INT_PTR LoadAndSetProfile(WPARAM iProfileNo, LPARAM) +{ + // wParam == profile no. + int profile = (int)iProfileNo; + TSettingsList profileSettings(10, CompareSettings); + if (!GetProfile(profile, profileSettings)) { + profile = (profile >= 0) ? profile : db_get_w(NULL, MODULENAME, SETTING_DEFAULTPROFILE, 0); + + char setting[64]; + mir_snprintf(setting, "%d_%s", profile, SETTING_SHOWCONFIRMDIALOG); + if (!db_get_b(NULL, MODULENAME, setting, 0)) + CallService(MS_CS_SETSTATUSEX, (WPARAM)&profileSettings, 0); + else + CallService(MS_CS_SHOWCONFIRMDLGEX, (WPARAM)&profileSettings, (LPARAM)db_get_dw(NULL, MODULENAME, SETTING_DLGTIMEOUT, 5)); + } + + // add timer here + if (hTTBModuleLoadedHook) + releaseTtbTimerId = SetTimer(NULL, 0, 100, releaseTtbTimerFunction); + + return 0; +} + +static UINT GetFsModifiers(WORD wHotKey) +{ + UINT fsm = 0; + if (HIBYTE(wHotKey)&HOTKEYF_ALT) + fsm |= MOD_ALT; + if (HIBYTE(wHotKey)&HOTKEYF_CONTROL) + fsm |= MOD_CONTROL; + if (HIBYTE(wHotKey)&HOTKEYF_SHIFT) + fsm |= MOD_SHIFT; + if (HIBYTE(wHotKey)&HOTKEYF_EXT) + fsm |= MOD_WIN; + + return fsm; +} + +static DWORD CALLBACK MessageWndProc(HWND, UINT msg, WPARAM wParam, LPARAM) +{ + if (msg == WM_HOTKEY) { + for (int i = 0; i < hkiCount; i++) + if ((int)hkInfo[i].id == wParam) + LoadAndSetProfile((WPARAM)hkInfo[i].profile, 0); + } + + return TRUE; +} + +static int UnregisterHotKeys() +{ + if (hkInfo != NULL) { + for (int i = 0; i < hkiCount; i++) { + UnregisterHotKey(hMessageWindow, (int)hkInfo[i].id); + GlobalDeleteAtom(hkInfo[i].id); + } + free(hkInfo); + } + DestroyWindow(hMessageWindow); + + hkiCount = 0; + hkInfo = NULL; + hMessageWindow = NULL; + + return 0; +} + +// assumes UnregisterHotKeys was called before +static int RegisterHotKeys() +{ + hMessageWindow = CreateWindowEx(0, L"STATIC", NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL); + SetWindowLongPtr(hMessageWindow, GWLP_WNDPROC, (LONG_PTR)MessageWndProc); + + int count = GetProfileCount(0, 0); + for (int i = 0; i < count; i++) { + if (!db_get_b(NULL, MODULENAME, OptName(i, SETTING_REGHOTKEY), 0)) + continue; + + WORD wHotKey = db_get_w(NULL, MODULENAME, OptName(i, SETTING_HOTKEY), 0); + hkInfo = (HKINFO*)realloc(hkInfo, (hkiCount + 1)*sizeof(HKINFO)); + if (hkInfo == NULL) + return -1; + + char atomname[255]; + mir_snprintf(atomname, "StatusProfile_%d", i); + hkInfo[hkiCount].id = GlobalAddAtomA(atomname); + if (hkInfo[hkiCount].id == 0) + continue; + + hkInfo[hkiCount].profile = i; + hkiCount++; + RegisterHotKey(hMessageWindow, (int)hkInfo[hkiCount - 1].id, GetFsModifiers(wHotKey), LOBYTE(wHotKey)); + } + + if (hkiCount == 0) + UnregisterHotKeys(); + + return 0; +} + +int LoadMainOptions() +{ + if (hTTBModuleLoadedHook) { + RemoveTopToolbarButtons(); + CreateTopToolbarButtons(0, 0); + } + + UnregisterHotKeys(); + RegisterHotKeys(); + return 0; +} + +int LoadProfileModule() +{ + hLoadAndSetProfileService = CreateServiceFunction(MS_SS_LOADANDSETPROFILE, LoadAndSetProfile); + return 0; +} + +int InitProfileModule() +{ + hTTBModuleLoadedHook = HookEvent(ME_TTB_MODULELOADED, CreateTopToolbarButtons); + + HookEvent(ME_CLIST_PREBUILDSTATUSMENU, CreateMainMenuItems); + + CreateMainMenuItems(0, 0); + RegisterHotKeys(); + return 0; +} + +int DeinitProfilesModule() +{ + for (int i = 0; i < mcount; i++) + DestroyServiceFunction(hProfileServices[i]); + + if (pce) { + for (int i = 0; i < pceCount; i++) + free(pce[i].szProto); + free(pce); + } + + UnregisterHotKeys(); + RemoveTopToolbarButtons(); + + DestroyServiceFunction(hLoadAndSetProfileService); + return 0; +} diff --git a/tools/_deprecated/StatusPlugins/StartupStatus/res/ttbDown.ico b/tools/_deprecated/StatusPlugins/StartupStatus/res/ttbDown.ico new file mode 100644 index 0000000000..84e3269c89 Binary files /dev/null and b/tools/_deprecated/StatusPlugins/StartupStatus/res/ttbDown.ico differ diff --git a/tools/_deprecated/StatusPlugins/StartupStatus/res/ttbUp.ico b/tools/_deprecated/StatusPlugins/StartupStatus/res/ttbUp.ico new file mode 100644 index 0000000000..150d8c3b0c Binary files /dev/null and b/tools/_deprecated/StatusPlugins/StartupStatus/res/ttbUp.ico differ diff --git a/tools/_deprecated/StatusPlugins/StartupStatus/startupstatus.cpp b/tools/_deprecated/StatusPlugins/StartupStatus/startupstatus.cpp new file mode 100644 index 0000000000..3cf1f07b49 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/StartupStatus/startupstatus.cpp @@ -0,0 +1,487 @@ +/* + StartupStatus Plugin for Miranda-IM (www.miranda-im.org) + Copyright 2003-2006 P. Boon + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "../commonstatus.h" +#include "startupstatus.h" + +static UINT_PTR setStatusTimerId = 0; + +int CompareSettings(const TSSSetting *p1, const TSSSetting *p2) +{ + return mir_strcmp(p1->szName, p2->szName); +} + +static TSettingsList startupSettings(10, CompareSettings); + +TSSSetting::TSSSetting(PROTOACCOUNT *pa) +{ + cbSize = sizeof(PROTOCOLSETTINGEX); + szName = pa->szModuleName; + tszAccName = pa->tszAccountName; + status = lastStatus = CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0); + szMsg = NULL; +} + +TSSSetting::TSSSetting(int profile, PROTOACCOUNT *pa) +{ + cbSize = sizeof(PROTOCOLSETTINGEX); + + // copy name + szName = pa->szModuleName; + tszAccName = pa->tszAccountName; + + // load status + char setting[80]; + mir_snprintf(setting, "%d_%s", profile, pa->szModuleName); + int iStatus = db_get_w(NULL, MODULENAME, setting, 0); + if (iStatus < MIN_STATUS || iStatus > MAX_STATUS) + iStatus = DEFAULT_STATUS; + status = iStatus; + + // load last status + mir_snprintf(setting, "%s%s", PREFIX_LAST, szName); + iStatus = db_get_w(NULL, MODULENAME, setting, 0); + if (iStatus < MIN_STATUS || iStatus > MAX_STATUS) + iStatus = DEFAULT_STATUS; + lastStatus = iStatus; + + szMsg = GetStatusMessage(profile, szName); + if (szMsg) + szMsg = wcsdup(szMsg); +} + +TSSSetting::~TSSSetting() +{ + free(szMsg); +} + +///////////////////////////////////////////////////////////////////////////////////////// + +static HANDLE hProtoAckHook, hCSStatusChangeHook, hStatusChangeHook; + +static HWND hMessageWindow; + +static BYTE showDialogOnStartup = 0; + +///////////////////////////////////////////////////////////////////////////////////////// +// command line options + +static PROTOCOLSETTINGEX* IsValidProtocol(TSettingsList& protoSettings, char* protoName) +{ + for (int i = 0; i < protoSettings.getCount(); i++) + if (!strncmp(protoSettings[i].szName, protoName, mir_strlen(protoSettings[i].szName))) + return &protoSettings[i]; + + return NULL; +} + +static int IsValidStatusDesc(char* statusDesc) +{ + if (!strncmp("away", statusDesc, 4)) + return ID_STATUS_AWAY; + if (!strncmp("na", statusDesc, 2)) + return ID_STATUS_NA; + if (!strncmp("dnd", statusDesc, 3)) + return ID_STATUS_DND; + if (!strncmp("occupied", statusDesc, 8)) + return ID_STATUS_OCCUPIED; + if (!strncmp("freechat", statusDesc, 8)) + return ID_STATUS_FREECHAT; + if (!strncmp("online", statusDesc, 6)) + return ID_STATUS_ONLINE; + if (!strncmp("offline", statusDesc, 7)) + return ID_STATUS_OFFLINE; + if (!strncmp("invisible", statusDesc, 9)) + return ID_STATUS_INVISIBLE; + if (!strncmp("onthephone", statusDesc, 10)) + return ID_STATUS_ONTHEPHONE; + if (!strncmp("outtolunch", statusDesc, 10)) + return ID_STATUS_OUTTOLUNCH; + if (!strncmp("last", statusDesc, 4)) + return ID_STATUS_LAST; + + return 0; +} + +static void ProcessCommandLineOptions(TSettingsList& protoSettings) +{ + if (protoSettings.getCount() == 0) + return; + + char *cmdl = GetCommandLineA(); + while (*cmdl != '\0') { + while (*cmdl != '/') { + if (*cmdl == '\0') + return; + + cmdl++; + } + if (*cmdl == '\0') + return; + + cmdl++; + if (!strncmp(cmdl, "showdialog", 10)) { + showDialogOnStartup = TRUE; + continue; + } + char *protoName = cmdl; // first protocol ? + PROTOCOLSETTINGEX* protoSetting = IsValidProtocol(protoSettings, protoName); + if (protoSetting != NULL) { + while (*cmdl != '=') { + if (*cmdl == '\0') + return; + + cmdl++; // skip to status + } + + if (*cmdl == '\0') + return; + + cmdl++; + char *statusDesc = cmdl; + int status = IsValidStatusDesc(statusDesc); + if (status != 0) + protoSetting->status = status; + } + } +} + +static void SetLastStatusMessages(TSettingsList &ps) +{ + for (int i = 0; i < ps.getCount(); i++) { + if (ps[i].status != ID_STATUS_LAST) + continue; + + char dbSetting[128]; + mir_snprintf(dbSetting, "%s%s", PREFIX_LASTMSG, ps[i].szName); + + DBVARIANT dbv; + if (ps[i].szMsg == NULL && !db_get_ws(NULL, MODULENAME, dbSetting, &dbv)) { + ps[i].szMsg = wcsdup(dbv.ptszVal); // remember this won't be freed + db_free(&dbv); + } + } +} + +///////////////////////////////////////////////////////////////////////////////////////// +// Account control event + +int OnAccChanged(WPARAM wParam, LPARAM lParam) +{ + PROTOACCOUNT *pa = (PROTOACCOUNT*)lParam; + switch (wParam) { + case PRAC_ADDED: + startupSettings.insert(new TSSSetting(-1, pa)); + break; + + case PRAC_REMOVED: + for (int i = 0; i < startupSettings.getCount(); i++) { + if (!mir_strcmp(startupSettings[i].szName, pa->szModuleName)) { + startupSettings.remove(i); + break; + } + } + break; + } + + return 0; +} + +// 'allow override' +static int ProcessProtoAck(WPARAM, LPARAM lParam) +{ + // 'something' made a status change + ACKDATA *ack = (ACKDATA*)lParam; + if (ack->type != ACKTYPE_STATUS && ack->result != ACKRESULT_FAILED) + return 0; + + if (!db_get_b(NULL, MODULENAME, SETTING_OVERRIDE, 1) || startupSettings.getCount() == 0) + return 0; + + for (int i = 0; i < startupSettings.getCount(); i++) { + if (!mir_strcmp(ack->szModule, startupSettings[i].szName)) { + startupSettings[i].szName = ""; + log_debugA("StartupStatus: %s overridden by ME_PROTO_ACK, status will not be set", ack->szModule); + } + } + + return 0; +} + +static int StatusChange(WPARAM, LPARAM lParam) +{ + // change by menu + if (!db_get_b(NULL, MODULENAME, SETTING_OVERRIDE, 1) || startupSettings.getCount() == 0) + return 0; + + char *szProto = (char *)lParam; + if (szProto == NULL) { // global status change + for (int i = 0; i < startupSettings.getCount(); i++) { + startupSettings[i].szName = ""; + log_debugA("StartupStatus: all protos overridden by ME_CLIST_STATUSMODECHANGE, status will not be set"); + } + } + else { + for (int i = 0; i < startupSettings.getCount(); i++) { + if (!mir_strcmp(startupSettings[i].szName, szProto)) { + startupSettings[i].szName = ""; + log_debugA("StartupStatus: %s overridden by ME_CLIST_STATUSMODECHANGE, status will not be set", szProto); + } + } + } + + return 0; +} + +static int CSStatusChangeEx(WPARAM wParam, LPARAM) +{ + // another status plugin made the change + if (!db_get_b(NULL, MODULENAME, SETTING_OVERRIDE, 1) || startupSettings.getCount() == 0) + return 0; + + if (wParam != 0) { + PROTOCOLSETTINGEX** ps = *(PROTOCOLSETTINGEX***)wParam; + if (ps == NULL) + return -1; + + for (int i = 0; i < startupSettings.getCount(); i++) { + for (int j = 0; j < startupSettings.getCount(); j++) { + if (ps[i]->szName == NULL || startupSettings[j].szName == NULL) + continue; + + if (!mir_strcmp(ps[i]->szName, startupSettings[j].szName)) { + log_debugA("StartupStatus: %s overridden by MS_CS_SETSTATUSEX, status will not be set", ps[i]->szName); + // use a hack to disable this proto + startupSettings[j].szName = ""; + } + } + } + } + + return 0; +} + +static void CALLBACK SetStatusTimed(HWND, UINT, UINT_PTR, DWORD) +{ + KillTimer(NULL, setStatusTimerId); + UnhookEvent(hProtoAckHook); + UnhookEvent(hCSStatusChangeHook); + UnhookEvent(hStatusChangeHook); + CallService(MS_CS_SETSTATUSEX, (WPARAM)&startupSettings, 0); +} + +static int OnOkToExit(WPARAM, LPARAM) +{ + // save last protocolstatus + int count; + PROTOACCOUNT** protos; + Proto_EnumAccounts(&count, &protos); + + for (int i = 0; i < count; i++) { + PROTOACCOUNT *pa = protos[i]; + if (!IsSuitableProto(pa)) + continue; + + if (!Proto_GetAccount(pa->szModuleName)) + continue; + + char lastName[128], lastMsg[128]; + mir_snprintf(lastName, "%s%s", PREFIX_LAST, pa->szModuleName); + db_set_w(NULL, MODULENAME, lastName, (WORD)CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0)); + mir_snprintf(lastMsg, "%s%s", PREFIX_LASTMSG, pa->szModuleName); + db_unset(NULL, MODULENAME, lastMsg); + + if (!(CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND & ~PF1_INDIVMODEMSG)) + continue; + + int status = CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0); + if (!(CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(status))) + continue; + + // NewAwaySys + if (ServiceExists(MS_NAS_GETSTATE)) { + NAS_PROTOINFO npi = { sizeof(npi) }; + npi.szProto = pa->szModuleName; + CallService(MS_NAS_GETSTATE, (WPARAM)&npi, 1); + if (npi.szMsg == NULL) { + npi.status = 0; + npi.szProto = NULL; + CallService(MS_NAS_GETSTATE, (WPARAM)&npi, 1); + } + if (npi.szMsg != NULL) { + db_set_ws(NULL, MODULENAME, lastMsg, npi.tszMsg); + mir_free(npi.tszMsg); + } + } + } + + if (db_get_b(NULL, MODULENAME, SETTING_SETPROFILE, 1) || db_get_b(NULL, MODULENAME, SETTING_OFFLINECLOSE, 0)) { + if (ServiceExists(MS_CLIST_SETSTATUSMODE)) + CallService(MS_CLIST_SETSTATUSMODE, ID_STATUS_OFFLINE, 0); + else + log_debugA("StartupStatus: MS_CLIST_SETSTATUSMODE not available!"); + } + + return 0; +} + +static int OnShutdown(WPARAM, LPARAM) +{ + DeinitProfilesModule(); + + // set windowstate and docked for next startup + if (db_get_b(NULL, MODULENAME, SETTING_SETWINSTATE, 0)) { + int state = db_get_b(NULL, MODULENAME, SETTING_WINSTATE, SETTING_STATE_NORMAL); + HWND hClist = pcli->hwndContactList; + BOOL isHidden = !IsWindowVisible(hClist); + switch (state) { + case SETTING_STATE_HIDDEN: + // try to use services where possible + if (!isHidden) + pcli->pfnShowHide(); + break; + + case SETTING_STATE_MINIMIZED: + if (!db_get_b(NULL, MODULE_CLIST, SETTING_TOOLWINDOW, 0)) + ShowWindow(hClist, SW_SHOWMINIMIZED); + break; + + case SETTING_STATE_NORMAL: + // try to use services where possible (that's what they're for) + if (isHidden) + pcli->pfnShowHide(); + break; + } + } + + // hangup + if (db_get_b(NULL, MODULENAME, SETTING_AUTOHANGUP, 0)) + InternetAutodialHangup(0); + + int state = db_get_b(NULL, MODULENAME, SETTING_WINSTATE, SETTING_STATE_NORMAL); + // set windowstate and docked for next startup + if (db_get_b(NULL, MODULENAME, SETTING_SETWINSTATE, 0)) + db_set_b(NULL, MODULE_CLIST, SETTING_WINSTATE, (BYTE)state); + + if (hMessageWindow) + DestroyWindow(hMessageWindow); + + startupSettings.destroy(); + return 0; +} + +/* Window proc for poweroff event */ +static DWORD CALLBACK MessageWndProc(HWND, UINT msg, WPARAM wParam, LPARAM) +{ + switch (msg) { + case WM_ENDSESSION: + log_debugA("WM_ENDSESSION"); + if (wParam) { + log_debugA("WM_ENDSESSION: calling exit"); + OnShutdown(0, 0); + log_debugA("WM_ENDSESSION: exit called"); + } + break; + } + + return TRUE; +} + +int CSModuleLoaded(WPARAM, LPARAM) +{ + protoList = (OBJLIST*)&startupSettings; + + InitProfileModule(); + + HookEvent(ME_PROTO_ACCLISTCHANGED, OnAccChanged); + HookEvent(ME_OPT_INITIALISE, OptionsInit); + + /* shutdown hook for normal shutdown */ + HookEvent(ME_SYSTEM_OKTOEXIT, OnOkToExit); + HookEvent(ME_SYSTEM_PRESHUTDOWN, OnShutdown); + /* message window for poweroff */ + hMessageWindow = CreateWindowEx(0, L"STATIC", NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL); + SetWindowLongPtr(hMessageWindow, GWLP_WNDPROC, (LONG_PTR)MessageWndProc); + + GetProfile(-1, startupSettings); + + // override with cmdl + ProcessCommandLineOptions(startupSettings); + if (startupSettings.getCount() == 0) + return 0;// no protocols are loaded + + SetLastStatusMessages(startupSettings); + showDialogOnStartup = (showDialogOnStartup || db_get_b(NULL, MODULENAME, SETTING_SHOWDIALOG, 0)); + + // dial + if (showDialogOnStartup || db_get_b(NULL, MODULENAME, SETTING_SETPROFILE, 1)) + if (db_get_b(NULL, MODULENAME, SETTING_AUTODIAL, 0)) + InternetAutodial(0, NULL); + + // set the status! + if (showDialogOnStartup || db_get_b(NULL, MODULENAME, SETTING_SHOWDIALOG, 0)) + CallService(MS_CS_SHOWCONFIRMDLGEX, (WPARAM)&startupSettings, db_get_dw(NULL, MODULENAME, SETTING_DLGTIMEOUT, 5)); + else if (db_get_b(NULL, MODULENAME, SETTING_SETPROFILE, 1)) { + // set hooks for override + if (db_get_b(NULL, MODULENAME, SETTING_OVERRIDE, 1)) { + hProtoAckHook = HookEvent(ME_PROTO_ACK, ProcessProtoAck); + hCSStatusChangeHook = HookEvent(ME_CS_STATUSCHANGEEX, CSStatusChangeEx); + hStatusChangeHook = HookEvent(ME_CLIST_STATUSMODECHANGE, StatusChange); + } + setStatusTimerId = SetTimer(NULL, 0, db_get_dw(NULL, MODULENAME, SETTING_SETPROFILEDELAY, 500), SetStatusTimed); + } + + // win size and location + if (db_get_b(NULL, MODULENAME, SETTING_SETWINLOCATION, 0) || db_get_b(NULL, MODULENAME, SETTING_SETWINSIZE, 0)) { + HWND hClist = pcli->hwndContactList; + + // store in db + if (db_get_b(NULL, MODULENAME, SETTING_SETWINLOCATION, 0)) { + db_set_dw(NULL, MODULE_CLIST, SETTING_XPOS, db_get_dw(NULL, MODULENAME, SETTING_XPOS, 0)); + db_set_dw(NULL, MODULE_CLIST, SETTING_YPOS, db_get_dw(NULL, MODULENAME, SETTING_YPOS, 0)); + } + if (db_get_b(NULL, MODULENAME, SETTING_SETWINSIZE, 0)) { + db_set_dw(NULL, MODULE_CLIST, SETTING_WIDTH, db_get_dw(NULL, MODULENAME, SETTING_WIDTH, 0)); + if (!db_get_b(NULL, MODULE_CLUI, SETTING_AUTOSIZE, 0)) + db_set_dw(NULL, MODULE_CLIST, SETTING_HEIGHT, db_get_dw(NULL, MODULENAME, SETTING_HEIGHT, 0)); + } + + WINDOWPLACEMENT wndpl = { sizeof(wndpl) }; + if (GetWindowPlacement(hClist, &wndpl)) { + if (wndpl.showCmd == SW_SHOWNORMAL && !Clist_IsDocked()) { + RECT rc; + if (GetWindowRect(hClist, &rc)) { + int x = rc.left; + int y = rc.top; + int width = rc.right - rc.left; + int height = rc.bottom - rc.top; + if (db_get_b(NULL, MODULENAME, SETTING_SETWINLOCATION, 0)) { + x = db_get_dw(NULL, MODULENAME, SETTING_XPOS, x); + y = db_get_dw(NULL, MODULENAME, SETTING_YPOS, y); + } + if (db_get_b(NULL, MODULENAME, SETTING_SETWINSIZE, 0)) { + width = db_get_dw(NULL, MODULENAME, SETTING_WIDTH, width); + if (!db_get_b(NULL, MODULE_CLUI, SETTING_AUTOSIZE, 0)) + height = db_get_dw(NULL, MODULENAME, SETTING_HEIGHT, height); + } + MoveWindow(hClist, x, y, width, height, TRUE); + } } } } + + return 0; +} diff --git a/tools/_deprecated/StatusPlugins/StartupStatus/startupstatus.h b/tools/_deprecated/StatusPlugins/StartupStatus/startupstatus.h new file mode 100644 index 0000000000..5303ab3468 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/StartupStatus/startupstatus.h @@ -0,0 +1,161 @@ +/* + StartupStatus Plugin for Miranda-IM (www.miranda-im.org) + Copyright 2003-2006 P. Boon + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +#ifndef __STARTUPSTATUSHEADER +#define __STARTUPSTATUSHEADER + +#include +#include +#include +#include +#include "version.h" + +#define MODULENAME "StartupStatus" + +struct TSSSetting : public PROTOCOLSETTINGEX, public MZeroedObject +{ + TSSSetting(PROTOACCOUNT *pa); + TSSSetting(int profile, PROTOACCOUNT *pa); + ~TSSSetting(); +}; + +typedef OBJLIST TSettingsList; + +struct PROFILECE +{ + int profile; + char *szProto; + wchar_t *msg; +}; + +struct PROFILEOPTIONS : public MZeroedObject +{ + __inline ~PROFILEOPTIONS() + { + delete ps; + mir_free(tszName); + } + + wchar_t *tszName; + TSettingsList* ps; + BOOL showDialog; + BOOL createTtb; + BOOL createMmi; + BOOL inSubMenu; + BOOL regHotkey; + WORD hotKey; +}; + +typedef struct { + ATOM id; + int profile; +} HKINFO; + +#define UM_REINITPROFILES WM_USER + 1 +#define UM_SETPROFILE WM_USER + 2 +#define UM_SETPROTOCOL WM_USER + 3 +#define UM_SETSTATUSMSG WM_USER + 4 +#define UM_ADDPROFILE WM_USER + 5 +#define UM_DELPROFILE WM_USER + 6 +#define UM_REINITDOCKED WM_USER + 7 +#define UM_REINITWINSTATE WM_USER + 8 +#define UM_REINITWINSIZE WM_USER + 9 + +#define CLUIINTM_REDRAW (WM_USER+100) + +#define MODULE_CLIST "CList" +#define MODULE_CLUI "CLUI" +#define SETTING_STATUS "Status" + +#define SETTING_SETWINSTATE "SetState" +#define SETTING_WINSTATE "State" + +#define SETTING_SETDOCKED "SetDocked" +#define SETTING_DOCKED "Docked" + +#define SETTING_SHOWDIALOG "ShowDialog" +#define SETTING_OFFLINECLOSE "OfflineOnClose" +#define SETTING_SETPROFILE "SetStatusOnStartup" +#define SETTING_AUTODIAL "AutoDial" +#define SETTING_AUTOHANGUP "AutoHangup" + +#define SETTING_TOOLWINDOW "ToolWindow" + +#define SETTING_OVERRIDE "AllowOverride" + +#define SETTING_SETWINLOCATION "SetWinLoc" +#define SETTING_XPOS "x" +#define SETTING_YPOS "y" + +#define SETTING_SETWINSIZE "SetWinSize" +#define SETTING_WIDTH "Width" +#define SETTING_HEIGHT "Height" +#define SETTING_AUTOSIZE "AutoSize" + +#define SETTING_PROFILECOUNT "ProfileCount" +#define SETTING_DEFAULTPROFILE "DefaultProfile" +#define SETTING_PROFILENAME "ProfileName" +#define SETTING_CREATETTBBUTTON "CreateTTBButton" +#define SETTING_PROFILE_STSMSG "StatusMsg" +#define SETTING_SHOWCONFIRMDIALOG "profile_ShowDialog" +#define SETTING_CREATEMMITEM "CreateMMItem" +#define SETTING_INSUBMENU "InSubMenu" +#define SETTING_REGHOTKEY "RegHotKey" +#define SETTING_HOTKEY "HotKey" +#define SETTING_PROFILENO "ProfileNo" + +#define SETTING_SETPROFILEDELAY "SetStatusDelay" +#define SETTING_DLGTIMEOUT "DialogTimeout" + +#define SHORTCUT_DESC L"Miranda NG" +#define SHORTCUT_FILENAME L"\\Miranda NG.lnk" + +#define DOCKED_NONE 0 +#define DOCKED_LEFT 1 +#define DOCKED_RIGHT 2 + +#define MS_SS_MENUSETPROFILEPREFIX "StartupStatus/SetProfile_" + +// options +int OptionsInit(WPARAM wparam,LPARAM lparam); +char* OptName(int i, const char* setting); + +// startupstatus +int LoadMainOptions(); + +int CompareSettings( const TSSSetting* p1, const TSSSetting* p2 ); + +TSettingsList* GetCurrentProtoSettings(); + +// profile +int GetProfile(int profileID, TSettingsList& arSettings ); +wchar_t *GetStatusMessage(int profile, char *szProto); + +INT_PTR LoadAndSetProfile(WPARAM wParam, LPARAM lParam); +INT_PTR GetProfileCount(WPARAM wParam, LPARAM lParam); +INT_PTR GetProfileName(WPARAM wParam, LPARAM lParam); + +extern HANDLE hTTBModuleLoadedHook; +void RemoveTopToolbarButtons(); +int CreateTopToolbarButtons(WPARAM wParam, LPARAM lParam); + +int LoadProfileModule(); +int InitProfileModule(); +int DeinitProfilesModule(); + +#endif //__STARTUPSTATUSHEADER diff --git a/tools/_deprecated/StatusPlugins/StartupStatus/toolbars.cpp b/tools/_deprecated/StatusPlugins/StartupStatus/toolbars.cpp new file mode 100644 index 0000000000..acb76f5c28 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/StartupStatus/toolbars.cpp @@ -0,0 +1,77 @@ +/* + StartupStatus Plugin for Miranda-IM (www.miranda-im.org) + Copyright 2003-2006 P. Boon + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "../commonstatus.h" +#include "startupstatus.h" +#include "../resource.h" +#include + +#include + +#define MAX_MMITEMS 6 + +static LIST ttbButtons(1); + +static IconItem iconList[] = +{ + { LPGEN("Pressed toolbar icon"), "StartupStatus/TtbDown", IDI_TTBDOWN }, + { LPGEN("Released toolbar icon"), "StartupStatus/TtbUp", IDI_TTBUP }, +}; + +///////////////////////////////////////////////////////////////////////////////////////// + +void RemoveTopToolbarButtons() +{ + for (int i=ttbButtons.getCount()-1; i >= 0; i--) + CallService(MS_TTB_REMOVEBUTTON, (WPARAM)ttbButtons[i], 0); + ttbButtons.destroy(); +} + +int CreateTopToolbarButtons(WPARAM, LPARAM) +{ + if (iconList[0].hIcolib == NULL) + Icon_Register(hInst, "Toolbar/StartupStatus", iconList, _countof(iconList)); + + int profileCount = CallService(MS_SS_GETPROFILECOUNT, 0, 0); + + TTBButton ttb = { 0 }; + ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP; + ttb.pszService = MS_SS_LOADANDSETPROFILE; + for (int i=0; i < profileCount; i++) { + char setting[80]; + mir_snprintf(setting, "%d_%s", i, SETTING_CREATETTBBUTTON); + if (!db_get_b(NULL, MODULENAME, setting, FALSE)) + continue; + + DBVARIANT dbv; + mir_snprintf(setting, "%d_%s", i, SETTING_PROFILENAME); + if (db_get(NULL, MODULENAME, setting, &dbv)) + continue; + + ttb.hIconHandleDn = iconList[0].hIcolib; + ttb.hIconHandleUp = iconList[1].hIcolib; + ttb.wParamDown = ttb.wParamUp = i; + ttb.name = ttb.pszTooltipUp = dbv.pszVal; + HANDLE ttbAddResult = TopToolbar_AddButton(&ttb); + if (ttbAddResult) + ttbButtons.insert(ttbAddResult); + db_free(&dbv); + } + return 0; +} diff --git a/tools/_deprecated/StatusPlugins/StartupStatus/version.h b/tools/_deprecated/StatusPlugins/StartupStatus/version.h new file mode 100644 index 0000000000..1760bbdcfb --- /dev/null +++ b/tools/_deprecated/StatusPlugins/StartupStatus/version.h @@ -0,0 +1,23 @@ +// Set the version number here - it will affect the version resource and the version field of the pluginInfo structure +// (Be careful that you don't have the resource file open when you change this and rebuild, otherwise the changes may not +// take effect within the version resource) +// Do not forget to define symbol "_DEBUG" for resource compiler if you use debug configuration (in VisualStudio you can +// find it under Project properties - Configuration properties - Resource - General - Preprocessor definitions) + +// plugin version part +#define __MAJOR_VERSION 0 +#define __MINOR_VERSION 8 +#define __RELEASE_NUM 0 +#define __BUILD_NUM 48 + +// other stuff for Version resource +#include + +// stuff that will be used in PluginInfo section and in Version resource +#define __PLUGIN_NAME "StartupStatus" +#define __FILENAME "StartupStatus.dll" +#define __DESC "StartupStatus, allows you to define the status Miranda should set on startup, configurable per protocol." +#define __AUTHOR "P Boon" +#define __AUTHOREMAIL "unregistered@users.sourceforge.net" +#define __AUTHORWEB "http://miranda-ng.org/p/StartupStatus/" +#define __COPYRIGHT "© 2003-08 P. Boon, 2008-16 George Hazan" diff --git a/tools/_deprecated/StatusPlugins/commonstatus.cpp b/tools/_deprecated/StatusPlugins/commonstatus.cpp new file mode 100644 index 0000000000..621f5f372c --- /dev/null +++ b/tools/_deprecated/StatusPlugins/commonstatus.cpp @@ -0,0 +1,328 @@ +/* + AdvancedAutoAway Plugin for Miranda-IM (www.miranda-im.org) + KeepStatus Plugin for Miranda-IM (www.miranda-im.org) + StartupStatus Plugin for Miranda-IM (www.miranda-im.org) + Copyright 2003-2006 P. Boon + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "commonstatus.h" + +// handles for hooks and other Miranda thingies +static HANDLE hCSStatusChangedExEvent; + +OBJLIST *protoList; + +// prototypes +char* StatusModeToDbSetting(int status, const char *suffix); +DWORD StatusModeToProtoFlag(int status); +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) +{ + char *prefix; + static char str[64]; + + switch (status) { + case ID_STATUS_AWAY: prefix = "Away"; break; + case ID_STATUS_NA: prefix = "Na"; break; + case ID_STATUS_DND: prefix = "Dnd"; break; + case ID_STATUS_OCCUPIED: prefix = "Occupied"; break; + case ID_STATUS_FREECHAT: prefix = "FreeChat"; break; + case ID_STATUS_ONLINE: prefix = "On"; break; + case ID_STATUS_OFFLINE: prefix = "Off"; break; + case ID_STATUS_INVISIBLE: prefix = "Inv"; break; + case ID_STATUS_ONTHEPHONE: prefix = "Otp"; break; + case ID_STATUS_OUTTOLUNCH: prefix = "Otl"; break; + default: return NULL; + } + mir_strcpy(str, prefix); mir_strcat(str, suffix); + return str; +} + +DWORD StatusModeToProtoFlag(int status) +{ + // *not* the same as in core, + switch (status) { + case ID_STATUS_ONLINE: return PF2_ONLINE; + case ID_STATUS_OFFLINE: return PF2_OFFLINE; + case ID_STATUS_INVISIBLE: return PF2_INVISIBLE; + case ID_STATUS_OUTTOLUNCH: return PF2_OUTTOLUNCH; + case ID_STATUS_ONTHEPHONE: return PF2_ONTHEPHONE; + case ID_STATUS_AWAY: return PF2_SHORTAWAY; + case ID_STATUS_NA: return PF2_LONGAWAY; + case ID_STATUS_OCCUPIED: return PF2_LIGHTDND; + case ID_STATUS_DND: return PF2_HEAVYDND; + case ID_STATUS_FREECHAT: return PF2_FREECHAT; + } + return 0; +} + +int GetActualStatus(PROTOCOLSETTINGEX *protoSetting) +{ + if (protoSetting->status == ID_STATUS_LAST) { + if ((protoSetting->lastStatus < MIN_STATUS) || (protoSetting->lastStatus > MAX_STATUS)) + return CallProtoService(protoSetting->szName, PS_GETSTATUS, 0, 0); + return protoSetting->lastStatus; + } + if (protoSetting->status == ID_STATUS_CURRENT) + return CallProtoService(protoSetting->szName, PS_GETSTATUS, 0, 0); + + if ((protoSetting->status < ID_STATUS_OFFLINE) || (protoSetting->status > ID_STATUS_OUTTOLUNCH)) { + log_debugA("invalid status detected: %d", protoSetting->status); + return 0; + } + return protoSetting->status; +} + +// helper, from core +static wchar_t* GetDefaultMessage(int status) +{ + switch (status) { + case ID_STATUS_AWAY: return TranslateT("I've been away since %time%."); + case ID_STATUS_NA: return TranslateT("Give it up, I'm not in!"); + case ID_STATUS_OCCUPIED: return TranslateT("Not right now."); + case ID_STATUS_DND: return TranslateT("Give a guy some peace, would ya?"); + case ID_STATUS_FREECHAT: return TranslateT("I'm a chatbot!"); + case ID_STATUS_ONLINE: return TranslateT("Yep, I'm here."); + case ID_STATUS_OFFLINE: return TranslateT("Nope, not here."); + case ID_STATUS_INVISIBLE: return TranslateT("I'm hiding from the mafia."); + case ID_STATUS_ONTHEPHONE: return TranslateT("That'll be the phone."); + case ID_STATUS_OUTTOLUNCH: return TranslateT("Mmm... food."); + case ID_STATUS_IDLE: return TranslateT("idleeeeeeee"); + } + return NULL; +} + +wchar_t* GetDefaultStatusMessage(PROTOCOLSETTINGEX *ps, int newstatus) +{ + if (ps->szMsg != NULL) {// custom message set + log_infoA("CommonStatus: Status message set by calling plugin"); + return mir_wstrdup(ps->szMsg); + } + + wchar_t *tMsg = (wchar_t*)CallService(MS_AWAYMSG_GETSTATUSMSGW, newstatus, (LPARAM)ps->szName); + log_debugA("CommonStatus: Status message retrieved from general awaysys: %S", tMsg); + return tMsg; +} + +static int equalsGlobalStatus(PROTOCOLSETTINGEX **ps) +{ + + int i, j, pstatus = 0, gstatus = 0; + + for (i = 0; i < protoList->getCount(); i++) + if (ps[i]->szMsg != NULL && GetActualStatus(ps[i]) != ID_STATUS_OFFLINE) + return 0; + + int count; + PROTOACCOUNT **protos; + Proto_EnumAccounts(&count, &protos); + + for (i = 0; i < count; i++) { + if (!IsSuitableProto(protos[i])) + continue; + + pstatus = 0; + for (j = 0; j < protoList->getCount(); j++) + if (!mir_strcmp(protos[i]->szModuleName, ps[j]->szName)) + pstatus = GetActualStatus(ps[j]); + + if (pstatus == 0) + pstatus = CallProtoService(protos[i]->szModuleName, PS_GETSTATUS, 0, 0); + + if (db_get_b(NULL, protos[i]->szModuleName, "LockMainStatus", 0)) { + // if proto is locked, pstatus must be the current status + if (pstatus != CallProtoService(protos[i]->szModuleName, PS_GETSTATUS, 0, 0)) + return 0; + } + else { + if (gstatus == 0) + gstatus = pstatus; + + if (pstatus != gstatus) + return 0; + } + } + + return gstatus; +} + +static void SetStatusMsg(PROTOCOLSETTINGEX *ps, int newstatus) +{ + wchar_t* tszMsg = GetDefaultStatusMessage(ps, newstatus); + if (tszMsg) { + /* replace the default vars in msg (I believe this is from core) */ + for (int j = 0; tszMsg[j]; j++) { + if (tszMsg[j] != '%') + continue; + + wchar_t substituteStr[128]; + if (!wcsnicmp(tszMsg + j, L"%time%", 6)) + GetTimeFormat(LOCALE_USER_DEFAULT, TIME_NOSECONDS, 0, 0, substituteStr, _countof(substituteStr)); + else if (!wcsnicmp(tszMsg + j, L"%date%", 6)) + GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, 0, 0, substituteStr, _countof(substituteStr)); + else + continue; + + if (mir_wstrlen(substituteStr) > 6) + tszMsg = (wchar_t*)mir_realloc(tszMsg, sizeof(wchar_t)*(mir_wstrlen(tszMsg) + 1 + mir_wstrlen(substituteStr) - 6)); + memmove(tszMsg + j + mir_wstrlen(substituteStr), tszMsg + j + 6, sizeof(wchar_t)*(mir_wstrlen(tszMsg) - j - 5)); + memcpy(tszMsg + j, substituteStr, sizeof(wchar_t)*mir_wstrlen(substituteStr)); + } + + wchar_t *szFormattedMsg = variables_parsedup(tszMsg, ps->tszAccName, NULL); + if (szFormattedMsg != NULL) { + mir_free(tszMsg); + tszMsg = szFormattedMsg; + } + } + log_debugA("CommonStatus sets status message for %s directly", ps->szName); + CallProtoService(ps->szName, PS_SETAWAYMSG, newstatus, (LPARAM)tszMsg); + mir_free(tszMsg); +} + +INT_PTR SetStatusEx(WPARAM wParam, LPARAM) +{ + PROTOCOLSETTINGEX** protoSettings = *(PROTOCOLSETTINGEX***)wParam; + if (protoSettings == NULL) + return -1; + + int globStatus = equalsGlobalStatus(protoSettings); + + // issue with setting global status; + // things get messy because SRAway hooks ME_CLIST_STATUSMODECHANGE, so the status messages of SRAway and + // commonstatus will clash + NotifyEventHooks(hCSStatusChangedExEvent, (WPARAM)&protoSettings, protoList->getCount()); + + // set all status messages first + for (int i = 0; i < protoList->getCount(); i++) { + char *szProto = protoSettings[i]->szName; + if (!Proto_GetAccount(szProto)) { + log_debugA("CommonStatus: %s is not loaded", szProto); + continue; + } + // some checks + int newstatus = GetActualStatus(protoSettings[i]); + if (newstatus == 0) { + log_debugA("CommonStatus: incorrect status for %s (%d)", szProto, protoSettings[i]->status); + continue; + } + int oldstatus = CallProtoService(szProto, PS_GETSTATUS, 0, 0); + // set last status + protoSettings[i]->lastStatus = oldstatus; + if (IsStatusConnecting(oldstatus)) { + // ignore if connecting, but it didn't came this far if it did + log_debugA("CommonStatus: %s is already connecting", szProto); + continue; + } + + // status checks + long protoFlag = Proto_Status2Flag(newstatus); + int b_Caps2 = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_2, 0) & protoFlag; + int b_Caps5 = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_5, 0) & protoFlag; + if (newstatus != ID_STATUS_OFFLINE && (!b_Caps2 || b_Caps5)) { + // status and status message for this status not supported + //log_debug("CommonStatus: status not supported %s", szProto); + continue; + } + + int b_Caps1 = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND & ~PF1_INDIVMODEMSG; + int b_Caps3 = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & protoFlag; + if (newstatus == oldstatus && (!b_Caps1 || !b_Caps3)) { + // no status change and status messages are not supported + //log_debug("CommonStatus: no change, %s (%d %d)", szProto, oldstatus, newstatus); + continue; + } + + // set status message first + if (b_Caps1 && b_Caps3) + SetStatusMsg(protoSettings[i], newstatus); + + // set the status + if (newstatus != oldstatus /*&& !(b_Caps1 && b_Caps3 && ServiceExists(MS_NAS_SETSTATE))*/) { + log_debugA("CommonStatus sets status for %s to %d", szProto, newstatus); + CallProtoService(szProto, PS_SETSTATUS, newstatus, 0); + } + } + + if (globStatus != 0) { + if (!ServiceExists(MS_CLIST_SETSTATUSMODE)) { + log_debugA("CommonStatus: MS_CLIST_SETSTATUSMODE not available!"); + return -1; + } + log_debugA("CommonStatus: setting global status %u", globStatus); + CallService(MS_CLIST_SETSTATUSMODE, globStatus, 0); + } + + return 0; +} + +static INT_PTR GetProtocolCountService(WPARAM, LPARAM) +{ + return GetProtoCount(); +} + +bool IsSuitableProto(PROTOACCOUNT *pa) +{ + return (pa == NULL) ? false : (pcli->pfnGetProtocolVisibility(pa->szModuleName) != 0); +} + +int GetProtoCount() +{ + int pCount = 0, count; + PROTOACCOUNT **accs; + Proto_EnumAccounts(&count, &accs); + + for (int i = 0; i < count; i++) + if (IsSuitableProto(accs[i])) + pCount++; + + return pCount; +} + +static int CreateServices() +{ + if (ServiceExists(MS_CS_SETSTATUSEX)) + return -1; + + hCSStatusChangedExEvent = CreateHookableEvent(ME_CS_STATUSCHANGEEX); + + CreateServiceFunction(MS_CS_SETSTATUSEX, SetStatusEx); + CreateServiceFunction(MS_CS_SHOWCONFIRMDLGEX, ShowConfirmDialogEx); + CreateServiceFunction(MS_CS_GETPROTOCOUNT, GetProtocolCountService); + return 0; +} + +static int onShutdown(WPARAM, LPARAM) +{ + DestroyHookableEvent(hCSStatusChangedExEvent); + return 0; +} + +int InitCommonStatus() +{ + if (!CreateServices()) + HookEvent(ME_SYSTEM_PRESHUTDOWN, onShutdown); + + return 0; +} diff --git a/tools/_deprecated/StatusPlugins/commonstatus.h b/tools/_deprecated/StatusPlugins/commonstatus.h new file mode 100644 index 0000000000..2288cc0e34 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/commonstatus.h @@ -0,0 +1,88 @@ +/* + AdvancedAutoAway Plugin for Miranda-IM (www.miranda-im.org) + KeepStatus Plugin for Miranda-IM (www.miranda-im.org) + StartupStatus Plugin for Miranda-IM (www.miranda-im.org) + Copyright 2003-2006 P. Boon + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef COMMONSTATUSHEADER +#define COMMONSTATUSHEADER + +#define _CRT_SECURE_NO_WARNINGS + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "m_statusplugins.h" +#include +#include +#include + +#if defined( _WIN64 ) +#define __PLATFORM_NAME "64" +#else +#define __PLATFORM_NAME "" +#endif + +#include "../helpers/gen_helpers.h" + +#define UM_STSMSGDLGCLOSED WM_APP+1 +#define UM_CLOSECONFIRMDLG WM_APP+2 + +#define PREFIX_LAST "last_" +#define PREFIX_LASTMSG "lastmsg_" +#define DEFAULT_STATUS ID_STATUS_LAST +#define ID_STATUS_LAST 40081 // doesn't interfere with ID_STATUS_IDLE, since we don't use it. However this *is* a good lesson not to do this again. +#define ID_STATUS_CURRENT 40082 +#define ID_STATUS_DISABLED 41083 // this should not be send to setstatus(ex) +#define MAX_STATUS ID_STATUS_CURRENT +#define MIN_STATUS ID_STATUS_OFFLINE +#define DEF_CLOSE_TIME 5 //secs +#define PF2_OFFLINE 0x00000200 +static int statusModeList[] = { ID_STATUS_OFFLINE, ID_STATUS_ONLINE, ID_STATUS_AWAY, ID_STATUS_NA, ID_STATUS_OCCUPIED, ID_STATUS_DND, ID_STATUS_FREECHAT, ID_STATUS_INVISIBLE, ID_STATUS_ONTHEPHONE, ID_STATUS_OUTTOLUNCH }; +static int statusModePf2List[] = { PF2_OFFLINE, PF2_ONLINE, PF2_SHORTAWAY, PF2_LONGAWAY, PF2_LIGHTDND, PF2_HEAVYDND, PF2_FREECHAT, PF2_INVISIBLE, PF2_ONTHEPHONE, PF2_OUTTOLUNCH }; + +wchar_t *GetDefaultStatusMessage(PROTOCOLSETTINGEX *ps, int status); +int GetActualStatus(PROTOCOLSETTINGEX *protoSetting); +int InitCommonStatus(); +bool IsSuitableProto(PROTOACCOUNT *pa); + +/* SimpleAway */ + +// wParam = 0 +// lParam = 0 +// allways returns 1 +#define MS_SA_ISSARUNNING "SimpleAway/IsSARunning" + +extern HINSTANCE hInst; +extern OBJLIST* protoList; + +#endif //COMMONSTATUSHEADER diff --git a/tools/_deprecated/StatusPlugins/confirmdialog.cpp b/tools/_deprecated/StatusPlugins/confirmdialog.cpp new file mode 100644 index 0000000000..e19b1d0a55 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/confirmdialog.cpp @@ -0,0 +1,426 @@ +/* + AdvancedAutoAway Plugin for Miranda-IM (www.miranda-im.org) + KeepStatus Plugin for Miranda-IM (www.miranda-im.org) + StartupStatus Plugin for Miranda-IM (www.miranda-im.org) + Copyright 2003-2006 P. Boon + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "commonstatus.h" +#include "resource.h" + +#define TIMER_ID 1 + +// variables +static HWND win; +static int timeOut; + +struct TConfirmSetting : public PROTOCOLSETTINGEX +{ + TConfirmSetting(const PROTOCOLSETTINGEX& x) + { + memcpy(this, &x, sizeof(PROTOCOLSETTINGEX)); + if (szMsg) + szMsg = wcsdup(szMsg); + } + + ~TConfirmSetting() + { + free(szMsg); + } +}; + +static int CompareSettings(const TConfirmSetting* p1, const TConfirmSetting* p2) +{ + return mir_strcmp(p1->szName, p2->szName); +} + +static OBJLIST *confirmSettings; + +static INT_PTR CALLBACK StatusMessageDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static PROTOCOLSETTINGEX* protoSetting = NULL; + switch (msg) { + case WM_INITDIALOG: + TranslateDialogDefault(hwndDlg); + + protoSetting = (PROTOCOLSETTINGEX *)lParam; + if (protoSetting->szMsg == NULL) { + wchar_t* smsg = GetDefaultStatusMessage(protoSetting, GetActualStatus(protoSetting)); + if (smsg != NULL) { + SetDlgItemText(hwndDlg, IDC_STSMSG, smsg); + mir_free(smsg); + } + } + else SetDlgItemText(hwndDlg, IDC_STSMSG, protoSetting->szMsg); + + { + wchar_t desc[512]; + mir_snwprintf(desc, TranslateT("Set %s message for %s."), + pcli->pfnGetStatusModeDescription(GetActualStatus(protoSetting), 0), protoSetting->tszAccName); + SetDlgItemText(hwndDlg, IDC_DESCRIPTION, desc); + } + break; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDC_OK: + { + int len = SendDlgItemMessage(hwndDlg, IDC_STSMSG, WM_GETTEXTLENGTH, 0, 0); + if (len > 0) { + protoSetting->szMsg = (wchar_t*)realloc(protoSetting->szMsg, sizeof(wchar_t)*(len + 1)); + if (protoSetting->szMsg != NULL) + GetDlgItemText(hwndDlg, IDC_STSMSG, protoSetting->szMsg, len + 1); + } + SendMessage(GetParent(hwndDlg), UM_STSMSGDLGCLOSED, TRUE, 0); + EndDialog(hwndDlg, IDC_OK); + } + break; + + case IDC_CANCEL: + SendMessage(GetParent(hwndDlg), UM_STSMSGDLGCLOSED, 0, 0); + EndDialog(hwndDlg, IDC_CANCEL); + break; + } + break; + } + + return FALSE; +} + +static int SetStatusList(HWND hwndDlg) +{ + if (confirmSettings->getCount() == 0) + return -1; + + HWND hList = GetDlgItem(hwndDlg, IDC_STARTUPLIST); + wchar_t buf[100]; + + // create items + LVITEM lvItem = { 0 }; + lvItem.mask = LVIF_TEXT | LVIF_PARAM; + + for (int i = 0; i < confirmSettings->getCount(); i++) { + lvItem.pszText = (*confirmSettings)[i].tszAccName; + if (ListView_GetItemCount(hList) < confirmSettings->getCount()) + ListView_InsertItem(hList, &lvItem); + + int actualStatus; + switch ((*confirmSettings)[i].status) { + case ID_STATUS_LAST: actualStatus = (*confirmSettings)[i].lastStatus; break; + case ID_STATUS_CURRENT: actualStatus = CallProtoService((*confirmSettings)[i].szName, PS_GETSTATUS, 0, 0); break; + default: actualStatus = (*confirmSettings)[i].status; + } + wchar_t* status = pcli->pfnGetStatusModeDescription(actualStatus, 0); + switch ((*confirmSettings)[i].status) { + case ID_STATUS_LAST: + mir_snwprintf(buf, L"%s (%s)", TranslateT(""), status); + ListView_SetItemText(hList, lvItem.iItem, 1, buf); + break; + case ID_STATUS_CURRENT: + mir_snwprintf(buf, L"%s (%s)", TranslateT(""), status); + ListView_SetItemText(hList, lvItem.iItem, 1, buf); + break; + default: + ListView_SetItemText(hList, lvItem.iItem, 1, status); + } + + // status message + if (!((!((CallProtoService((*confirmSettings)[i].szName, PS_GETCAPS, (WPARAM)PFLAGNUM_1, 0)&PF1_MODEMSGSEND)&~PF1_INDIVMODEMSG)) || (!(CallProtoService((*confirmSettings)[i].szName, PS_GETCAPS, (WPARAM)PFLAGNUM_3, 0)&Proto_Status2Flag(actualStatus))))) { + wchar_t *msg = GetDefaultStatusMessage(&(*confirmSettings)[i], actualStatus); + if (msg != NULL) { + wchar_t* fMsg = variables_parsedup(msg, (*confirmSettings)[i].tszAccName, NULL); + ListView_SetItemText(hList, lvItem.iItem, 2, fMsg); + mir_free(fMsg); + mir_free(msg); + } + else ListView_SetItemText(hList, lvItem.iItem, 2, TranslateT("")); + } + else ListView_SetItemText(hList, lvItem.iItem, 2, TranslateT("")); + + ListView_SetColumnWidth(hList, 0, LVSCW_AUTOSIZE); + ListView_SetColumnWidth(hList, 2, LVSCW_AUTOSIZE); + lvItem.lParam = (LPARAM)&(*confirmSettings)[i]; + ListView_SetItem(hList, &lvItem); + lvItem.iItem++; + } + + // grey out status box + EnableWindow(GetDlgItem(hwndDlg, IDC_STATUS), (ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_STARTUPLIST), -1, LVNI_SELECTED) >= 0)); + return 0; +} + +static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch (msg) { + case WM_INITDIALOG: + TranslateDialogDefault(hwndDlg); + { + HWND hList = GetDlgItem(hwndDlg, IDC_STARTUPLIST); + SendMessage(hList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT); + + // create columns + LVCOLUMN lvCol = { 0 }; + lvCol.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM; + lvCol.pszText = TranslateT("Protocol"); + ListView_InsertColumn(hList, 0, &lvCol); + + lvCol.cx = 100; + lvCol.pszText = TranslateT("Status"); + ListView_InsertColumn(hList, 1, &lvCol); + + lvCol.pszText = TranslateT("Message"); + ListView_InsertColumn(hList, 2, &lvCol); + } + + // create items + SetStatusList(hwndDlg); + + EnableWindow(GetDlgItem(hwndDlg, IDC_SETSTSMSG), FALSE); + // fill profile combo box + if (!ServiceExists(MS_SS_GETPROFILE)) + EnableWindow(GetDlgItem(hwndDlg, IDC_PROFILE), FALSE); + else { + int defaultProfile; + int profileCount = (int)CallService(MS_SS_GETPROFILECOUNT, (WPARAM)&defaultProfile, 0); + for (int i = 0; i < profileCount; i++) { + wchar_t profileName[128]; + CallService(MS_SS_GETPROFILENAME, i, (LPARAM)profileName); + int item = SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_ADDSTRING, 0, (LPARAM)profileName); + SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_SETITEMDATA, item, i); + } + if (profileCount == 0) + EnableWindow(GetDlgItem(hwndDlg, IDC_PROFILE), FALSE); + else + SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_SETCURSEL, defaultProfile, 0); + } + // start timer + if (timeOut > 0) { + wchar_t text[32]; + mir_snwprintf(text, TranslateT("Closing in %d"), timeOut); + SetDlgItemText(hwndDlg, IDC_CLOSE, text); + SetTimer(hwndDlg, TIMER_ID, 1000, NULL); + } + return TRUE; + + case WM_TIMER: + { + wchar_t text[32]; + mir_snwprintf(text, TranslateT("Closing in %d"), timeOut - 1); + SetDlgItemText(hwndDlg, IDC_CLOSE, text); + if (timeOut <= 0) { + KillTimer(hwndDlg, TIMER_ID); + SendMessage(hwndDlg, UM_CLOSECONFIRMDLG, 0, 0); + } + else timeOut--; + } + break; + + case WM_COMMAND: + // stop timer + KillTimer(hwndDlg, TIMER_ID); + SetDlgItemText(hwndDlg, IDC_CLOSE, TranslateT("Close")); + if ((HIWORD(wParam) == CBN_SELCHANGE) || (HIWORD(wParam) == BN_CLICKED) || (HIWORD(wParam) == NM_CLICK)) { // something clicked + switch (LOWORD(wParam)) { + case IDC_PROFILE: + { + int profile = (int)SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETCURSEL, 0, 0), 0); + for (int i = 0; i < confirmSettings->getCount(); i++) + if ((*confirmSettings)[i].szMsg != NULL) { + free((*confirmSettings)[i].szMsg); + (*confirmSettings)[i].szMsg = NULL; + } + + CallService(MS_SS_GETPROFILE, (WPARAM)profile, (LPARAM)confirmSettings); + for (int i = 0; i < confirmSettings->getCount(); i++) + if ((*confirmSettings)[i].szMsg != NULL) // we free this later, copy to our memory space + (*confirmSettings)[i].szMsg = wcsdup((*confirmSettings)[i].szMsg); + + SetStatusList(hwndDlg); + } + break; + + case IDC_STATUS: + { + LVITEM lvItem = { 0 }; + lvItem.mask = LVIF_TEXT | LVIF_PARAM; + lvItem.iSubItem = 0; + lvItem.iItem = ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_STARTUPLIST), -1, LVNI_SELECTED); + if (lvItem.iItem == -1) + break; + + ListView_GetItem(GetDlgItem(hwndDlg, IDC_STARTUPLIST), &lvItem); + PROTOCOLSETTINGEX* proto = (PROTOCOLSETTINGEX*)lvItem.lParam; + int actualStatus = proto->status = (int)SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_GETCURSEL, 0, 0), 0); + + // LAST STATUS + if (proto->status == ID_STATUS_LAST) { + wchar_t last[80]; + mir_snwprintf(last, L"%s (%s)", TranslateT(""), pcli->pfnGetStatusModeDescription(proto->lastStatus, 0)); + ListView_SetItemText(GetDlgItem(hwndDlg, IDC_STARTUPLIST), lvItem.iItem, 1, last); + actualStatus = proto->lastStatus; + } + + // CURRENT STATUS + else if (proto->status == ID_STATUS_CURRENT) { + int currentStatus = CallProtoService(proto->szName, PS_GETSTATUS, 0, 0); + wchar_t current[80]; + mir_snwprintf(current, L"%s (%s)", TranslateT(""), pcli->pfnGetStatusModeDescription(currentStatus, 0)); + ListView_SetItemText(GetDlgItem(hwndDlg, IDC_STARTUPLIST), lvItem.iItem, 1, current); + actualStatus = currentStatus; + } + else ListView_SetItemText(GetDlgItem(hwndDlg, IDC_STARTUPLIST), lvItem.iItem, 1, pcli->pfnGetStatusModeDescription(proto->status, 0)); + + if ((!((CallProtoService(proto->szName, PS_GETCAPS, (WPARAM)PFLAGNUM_1, 0)&PF1_MODEMSGSEND)&~PF1_INDIVMODEMSG)) || (!(CallProtoService(proto->szName, PS_GETCAPS, (WPARAM)PFLAGNUM_3, 0)&Proto_Status2Flag(actualStatus)))) + EnableWindow(GetDlgItem(hwndDlg, IDC_SETSTSMSG), FALSE); + else if ((proto->status == ID_STATUS_LAST) || (proto->status == ID_STATUS_CURRENT)) + EnableWindow(GetDlgItem(hwndDlg, IDC_SETSTSMSG), TRUE); + else + EnableWindow(GetDlgItem(hwndDlg, IDC_SETSTSMSG), (CallProtoService(proto->szName, PS_GETCAPS, (WPARAM)PFLAGNUM_3, 0)&Proto_Status2Flag(actualStatus)) ? TRUE : FALSE); + SetStatusList(hwndDlg); + } + break; + + case IDC_SETSTSMSG: + { + LVITEM lvItem = { 0 }; + lvItem.mask = LVIF_TEXT | LVIF_PARAM; + lvItem.iSubItem = 0; + lvItem.iItem = ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_STARTUPLIST), -1, LVNI_SELECTED); + if (lvItem.iItem == -1) + break; + + ListView_GetItem(GetDlgItem(hwndDlg, IDC_STARTUPLIST), &lvItem); + DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SETSTSMSGDIALOG), hwndDlg, StatusMessageDlgProc, lvItem.lParam); + } + break; + + case IDC_CLOSE: + SendMessage(hwndDlg, UM_CLOSECONFIRMDLG, 0, 0); + break; + + case IDC_CANCEL: + DestroyWindow(hwndDlg); + break; + } + } + break; + + case WM_NOTIFY: + switch (((NMHDR*)lParam)->idFrom) { + case IDC_STARTUPLIST: + if (((NMHDR*)lParam)->code == NM_CLICK) { + KillTimer(hwndDlg, TIMER_ID); + SetDlgItemText(hwndDlg, IDC_CLOSE, TranslateT("Close")); + + LVITEM lvItem = { 0 }; + lvItem.mask = LVIF_TEXT | LVIF_PARAM; + lvItem.iSubItem = 0; + lvItem.iItem = ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_STARTUPLIST), -1, LVNI_SELECTED); + + if (ListView_GetItem(GetDlgItem(hwndDlg, IDC_STARTUPLIST), &lvItem) == FALSE) { + SetStatusList(hwndDlg); + break; + } + + PROTOCOLSETTINGEX *proto = (PROTOCOLSETTINGEX*)lvItem.lParam; + int flags = CallProtoService(proto->szName, PS_GETCAPS, PFLAGNUM_2, 0) & ~CallProtoService(proto->szName, PS_GETCAPS, (WPARAM)PFLAGNUM_5, 0); + // clear box and add new status, loop status and check if compatible with proto + SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_RESETCONTENT, 0, 0); + int actualStatus = proto->status; + + // last + wchar_t buf[100]; + mir_snwprintf(buf, L"%s (%s)", TranslateT(""), pcli->pfnGetStatusModeDescription(proto->lastStatus, 0)); + int item = SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_ADDSTRING, 0, (LPARAM)buf); + SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_SETITEMDATA, item, ID_STATUS_LAST); + if (proto->status == ID_STATUS_LAST) { + SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_SETCURSEL, item, 0); + actualStatus = proto->lastStatus; + } + + // current + int currentStatus = CallProtoService(proto->szName, PS_GETSTATUS, 0, 0); + mir_snwprintf(buf, L"%s (%s)", TranslateT(""), pcli->pfnGetStatusModeDescription(currentStatus, 0)); + item = SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_ADDSTRING, 0, (LPARAM)buf); + SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_SETITEMDATA, item, ID_STATUS_CURRENT); + if (proto->status == ID_STATUS_CURRENT) { + SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_SETCURSEL, item, 0); + actualStatus = currentStatus; + } + + for (int i = 0; i < _countof(statusModeList); i++) { + if (((flags & statusModePf2List[i]) || (statusModePf2List[i] == PF2_OFFLINE)) && (!((!(flags)& Proto_Status2Flag(statusModePf2List[i]))) || ((CallProtoService(proto->szName, PS_GETCAPS, (WPARAM)PFLAGNUM_5, 0)&Proto_Status2Flag(statusModePf2List[i]))))) { + wchar_t *statusMode = pcli->pfnGetStatusModeDescription(statusModeList[i], 0); + item = SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_ADDSTRING, 0, (LPARAM)statusMode); + SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_SETITEMDATA, item, statusModeList[i]); + if (statusModeList[i] == proto->status) + SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_SETCURSEL, item, 0); + } + } + + // enable status box + EnableWindow(GetDlgItem(hwndDlg, IDC_STATUS), (ListView_GetNextItem(GetDlgItem(hwndDlg, IDC_STARTUPLIST), -1, LVNI_SELECTED) >= 0)); + if ((!((CallProtoService(proto->szName, PS_GETCAPS, PFLAGNUM_1, 0)&PF1_MODEMSGSEND)&~PF1_INDIVMODEMSG)) || (!(CallProtoService(proto->szName, PS_GETCAPS, PFLAGNUM_3, 0)&Proto_Status2Flag(actualStatus)))) + EnableWindow(GetDlgItem(hwndDlg, IDC_SETSTSMSG), FALSE); + else if (proto->status == ID_STATUS_LAST || proto->status == ID_STATUS_CURRENT) + EnableWindow(GetDlgItem(hwndDlg, IDC_SETSTSMSG), TRUE); + else + EnableWindow(GetDlgItem(hwndDlg, IDC_SETSTSMSG), (CallProtoService(proto->szName, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(actualStatus)) ? TRUE : FALSE); + } + } + break; + + case UM_STSMSGDLGCLOSED: + SetStatusList(hwndDlg); + break; + + case UM_CLOSECONFIRMDLG: + CallService(MS_CS_SETSTATUSEX, (WPARAM)confirmSettings, 0); + DestroyWindow(hwndDlg); + break; + + case WM_DESTROY: + delete confirmSettings; confirmSettings = 0; + break; + } + + return 0; +} + +INT_PTR ShowConfirmDialogEx(WPARAM wParam, LPARAM lParam) +{ + if (wParam == 0) + return -1; + + delete confirmSettings; + confirmSettings = new OBJLIST(10, CompareSettings); + + OBJLIST& param = *(OBJLIST*)wParam; + for (int i = 0; i < param.getCount(); i++) + confirmSettings->insert(new TConfirmSetting(param[i])); + + timeOut = lParam; + if (timeOut < 0) + timeOut = DEF_CLOSE_TIME; + + if (GetWindow(win, 0) == NULL) { + win = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_CONFIRMDIALOG), NULL, ConfirmDlgProc, NULL); + EnableWindow(win, TRUE); + } + + return (INT_PTR)win; +} diff --git a/tools/_deprecated/StatusPlugins/copying.txt b/tools/_deprecated/StatusPlugins/copying.txt new file mode 100644 index 0000000000..cff645bda5 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/copying.txt @@ -0,0 +1,346 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. + diff --git a/tools/_deprecated/StatusPlugins/notick.ico b/tools/_deprecated/StatusPlugins/notick.ico new file mode 100644 index 0000000000..7f93490642 Binary files /dev/null and b/tools/_deprecated/StatusPlugins/notick.ico differ diff --git a/tools/_deprecated/StatusPlugins/notick1.ico b/tools/_deprecated/StatusPlugins/notick1.ico new file mode 100644 index 0000000000..609504d614 Binary files /dev/null and b/tools/_deprecated/StatusPlugins/notick1.ico differ diff --git a/tools/_deprecated/StatusPlugins/resource.h b/tools/_deprecated/StatusPlugins/resource.h new file mode 100644 index 0000000000..e64104da80 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/resource.h @@ -0,0 +1,168 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by resource.rc +// +#define IDD_OPT_KEEPSTATUS 101 +#define IDD_OPT_KS_BASIC 101 +#define IDD_CONFIRMDIALOG 102 +#define IDD_OPT_AUTOAWAY 104 +#define IDD_CMDLOPTIONS 106 +#define IDD_ADDPROFILE 109 +#define IDD_OPT_STARTUPSTATUS 110 +#define IDD_PUOPT_KEEPSTATUS 113 +#define IDD_OPT_AUTOAWAYMSG 114 +#define IDI_TICK 117 +#define IDI_NOTICK 118 +#define IDD_OPT_GENAUTOAWAY 119 +#define IDD_OPT_KS_ACTION 120 +#define IDD_SETSTSMSGDIALOG 121 +#define IDD_OPT_STATUSPROFILES 123 +#define IDD_OPT_AAATABS 126 +#define IDD_OPT_TABS 126 +#define IDD_OPT_KS_ADV 127 +#define IDD_TRG_AAASTATECHANGE 128 +#define IDI_TTBDOWN 129 +#define IDI_TTBUP 130 +#define IDC_PROTOCOL 1000 +#define IDC_STATUS 1001 +#define IDC_PROFILE 1002 +#define IDC_STARTUPLIST 1008 +#define IDC_STATUSMSG 1008 +#define IDC_SETSTATUSONSTARTUP 1010 +#define IDC_SETPROFILE 1010 +#define IDC_SETWINDOW 1011 +#define IDC_SETWINSTATE 1011 +#define IDC_WINDOW 1012 +#define IDC_WINSTATE 1012 +#define IDC_CLOSE 1013 +#define IDC_SHOWDIALOG 1014 +#define IDC_OFFLINECLOSE 1016 +#define IDC_CONFIRM 1017 +#define IDC_SHOWCMDL 1018 +#define IDC_COPY 1019 +#define IDC_CMDL 1020 +#define IDC_OK 1021 +#define IDC_SHORTCUT 1022 +#define IDC_CHECKCONNECTION 1025 +#define IDC_MAXRETRIES 1026 +#define IDC_INITDELAY 1027 +#define IDC_SETSTATUSDELAY 1027 +#define IDC_SETPROFILEDELAY 1027 +#define IDC_DOCKED 1028 +#define IDC_SETDOCKED 1029 +#define IDC_MAXDELAY 1031 +#define IDC_INCREASEEXPONENTIAL 1032 +#define IDC_LNOTHING 1032 +#define IDC_LCLOSE 1033 +#define IDC_LV1STATUS 1035 +#define IDC_LV2STATUS 1036 +#define IDC_STATUSLIST 1037 +#define IDC_LV1AFTERSTR 1038 +#define IDC_SHOWCONNECTIONPOPUPS 1040 +#define IDC_ADDPROFILE 1041 +#define IDC_DELPROFILE 1042 +#define IDC_PROFILENAME 1043 +#define IDC_CANCEL 1044 +#define IDC_DEFAULTPROFILE 1045 +#define IDC_MONITORMIRANDA 1045 +#define IDC_WINCOLORS 1045 +#define IDC_CHKINET 1045 +#define IDC_IGNLOCK 1045 +#define IDC_CREATETTBBUTTONS 1046 +#define IDC_CREATETTB 1046 +#define IDC_PERPROTOCOLSETTINGS 1050 +#define IDC_SAMESETTINGS 1051 +#define IDC_RESETSTATUS 1052 +#define IDC_SETSTSMSG 1053 +#define IDC_DEFAULTCOLORS 1057 +#define IDC_ONLOCK 1057 +#define IDC_LOGINERR 1057 +#define IDC_LV2ONINACTIVE 1062 +#define IDC_CNCOTHERLOC 1062 +#define IDC_PUCONNLOST 1062 +#define IDC_DLGTIMEOUT 1063 +#define IDC_AWAYCHECKTIMEINSECS 1063 +#define IDC_STSMSG 1063 +#define IDC_PINGHOST 1063 +#define IDC_CONFIRMDELAY 1064 +#define IDC_PROTOCOLLIST 1066 +#define IDC_LCANCEL 1068 +#define IDC_RNOTHING 1069 +#define IDC_RCLOSE 1070 +#define IDC_RCANCEL 1071 +#define IDC_DELAY 1072 +#define IDC_BGCOLOR 1074 +#define IDC_TEXTCOLOR 1075 +#define IDC_PREV 1076 +#define IDC_LOGINERR_DELAY 1077 +#define IDC_PROTOLIST 1079 +#define IDC_ENABLECHECKING 1080 +#define IDC_DISABLECHECKING 1081 +#define IDC_IDLEWARNING 1084 +#define IDC_DESCRIPTION 1085 +#define IDC_CONTCHECK 1087 +#define IDC_BYPING 1088 +#define IDC_CHECKAPMRESUME 1089 +#define IDC_PUCONNRETRY 1090 +#define IDC_PURESULT 1091 +#define IDC_PUOTHER 1092 +#define IDC_DELAYFROMPU 1093 +#define IDC_DELAYCUSTOM 1094 +#define IDC_DELAYPERMANENT 1095 +#define IDC_LOGINERR_CANCEL 1096 +#define IDC_LOGINERR_SETDELAY 1097 +#define IDC_PUSHOWEXTRA 1098 +#define IDC_CREATEMMI 1100 +#define IDC_SETWINLOCATION 1104 +#define IDC_XPOS 1105 +#define IDC_YPOS 1106 +#define IDC_SETWINSIZE 1107 +#define IDC_WIDTH 1108 +#define IDC_HEIGHT 1109 +#define IDC_OVERRIDE 1111 +#define IDC_MIRANDAMSG 1112 +#define IDC_CUSTOMMSG 1113 +#define IDC_CURWINLOC 1114 +#define IDC_CURWINSIZE 1115 +#define IDC_HOTKEY 1116 +#define IDC_REGHOTKEY 1117 +#define IDC_VARIABLESHELP 1118 +#define IDC_AUTODIAL 1120 +#define IDC_AUTOHANGUP 1121 +#define IDC_MONITORKEYBOARD 1122 +#define IDC_MONITORMOUSE 1123 +#define IDC_IGNSYSKEYS 1124 +#define IDC_IGNALTCOMBO 1125 +#define IDC_FIRSTOFFLINE 1126 +#define IDC_INSUBMENU 1127 +#define IDC_MAXCONNECTINGTIME 1128 +#define IDC_TABS 1130 +#define IDC_NOLOCKED 1131 +#define IDC_PINGCOUNT 1132 +#define IDC_CNTDELAY 1133 +#define IDC_ENTERFIRST 1134 +#define IDC_ENTERSECOND 1135 +#define IDC_LEAVEFIRST 1136 +#define IDC_LEAVESECOND 1137 +#define IDC_BECOMEACTIVE 1138 +#define IDC_SCREENSAVE 1145 +#define IDC_TIMED 1146 +#define IDC_AWAYTIME 1147 +#define IDC_SETNA 1148 +#define IDC_NATIME 1149 +#define IDC_SCREENSAVE2 1150 +#define IDC_FULLSCREEN 1150 +#define IDC_RADUSEMIRANDA 1210 +#define IDC_RADUSECUSTOM 1212 +#define IDC_SETNASTR 1568 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 129 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1141 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/tools/_deprecated/StatusPlugins/resource.rc b/tools/_deprecated/StatusPlugins/resource.rc new file mode 100644 index 0000000000..5553c4dbf6 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/resource.rc @@ -0,0 +1,409 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// German (Germany) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN +#pragma code_page(1252) + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_OPT_KS_BASIC DIALOGEX 0, 0, 292, 224 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD +EXSTYLE WS_EX_CONTROLPARENT +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + CONTROL "Check connection",IDC_CHECKCONNECTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,51,162,10 + EDITTEXT IDC_MAXRETRIES,21,70,22,14,ES_AUTOHSCROLL | ES_NUMBER + LTEXT "Maximum retries (0 - infinite)",IDC_STATIC,47,73,129,14 + GROUPBOX "Account connection",IDC_STATIC,3,32,286,116 + EDITTEXT IDC_INITDELAY,21,92,22,14,ES_AUTOHSCROLL | ES_NUMBER + LTEXT "Delay between retries (secs)",IDC_STATIC,47,95,130,17 + CONTROL "Show popups",IDC_SHOWCONNECTIONPOPUPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,12,269,10 + GROUPBOX "General",IDC_STATIC,3,0,286,30 + CONTROL "",IDC_PROTOCOLLIST,"SysListView32",LVS_REPORT | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,180,52,101,92 + CTEXT "Accounts to check",IDC_STATIC,180,41,96,8 + GROUPBOX "Dial-Up",IDC_STATIC,4,149,285,69 + CONTROL "Don't reconnect if no internet connection seems available",IDC_CHKINET, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,161,265,8 + CONTROL "Continuously check for internet connection",IDC_CONTCHECK, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,175,265,8 + CONTROL "Do so by pinging host",IDC_BYPING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,21,188,256,8 + EDITTEXT IDC_PINGHOST,36,198,237,14,ES_AUTOHSCROLL +END + +IDD_CONFIRMDIALOG DIALOGEX 0, 0, 257, 121 +STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "Confirm status" +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + PUSHBUTTON "Close",IDC_CLOSE,7,100,59,14 + COMBOBOX IDC_STATUS,185,100,65,101,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CONTROL "List1",IDC_STARTUPLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,7,23,243,74 + PUSHBUTTON "Cancel",IDC_CANCEL,69,100,59,14 + LTEXT "Profile",IDC_STATIC,7,9,116,8 + COMBOBOX IDC_PROFILE,185,7,65,89,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Message",IDC_SETSTSMSG,131,100,50,14 +END + +IDD_OPT_AUTOAWAY DIALOGEX 0, 0, 284, 198 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD +EXSTYLE WS_EX_CONTROLPARENT +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + RTEXT "Account",IDC_STATIC,93,11,78,8 + COMBOBOX IDC_PROTOCOL,177,9,100,138,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + RTEXT "Set",IDC_STATIC,5,41,33,8 + COMBOBOX IDC_LV1STATUS,41,39,65,101,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CONTROL "when full-screen mode is active",IDC_FULLSCREEN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,60,152,10 + CONTROL "when screen saver engages",IDC_SCREENSAVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,73,152,10 + CONTROL "when workstation is locked",IDC_ONLOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,86,153,10 + CONTROL "after",IDC_TIMED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,100,32,8 + EDITTEXT IDC_AWAYTIME,51,98,26,12,ES_AUTOHSCROLL + LTEXT "minutes of inactivity",IDC_LV1AFTERSTR,82,100,87,8 + RTEXT "Set",IDC_STATIC,5,115,33,8 + COMBOBOX IDC_LV2STATUS,41,113,65,101,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CONTROL "after",IDC_SETNA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,131,32,8 + EDITTEXT IDC_NATIME,51,129,26,12,ES_AUTOHSCROLL + LTEXT "minutes of level 1 mode",IDC_SETNASTR,82,131,86,8 + CONTROL "only set when inactive",IDC_LV2ONINACTIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,143,151,10 + CONTROL "Monitor Miranda's activity only",IDC_MONITORMIRANDA, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,9,155,168,12 + CONTROL "Reset status on return",IDC_RESETSTATUS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,9,168,168,11 + CONTROL "Confirm resetting status",IDC_CONFIRM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,9,181,168,10 + LTEXT "Only set if current status is",IDC_STATIC,180,42,95,8 + CONTROL "",IDC_STATUSLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,177,55,100,84 +END + +IDD_CMDLOPTIONS DIALOGEX 0, 0, 315, 82 +STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "Command line" +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + DEFPUSHBUTTON "OK",IDC_OK,257,61,51,14 + PUSHBUTTON "Copy to clipboard",IDC_COPY,132,61,120,14 + EDITTEXT IDC_CMDL,7,19,301,35,ES_MULTILINE | ES_READONLY + LTEXT "Command line:",IDC_STATIC,7,7,301,8 + PUSHBUTTON "Create shortcut",IDC_SHORTCUT,7,61,120,14 +END + +IDD_ADDPROFILE DIALOGEX 0, 0, 131, 60 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Add new profile" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + DEFPUSHBUTTON "OK",IDC_OK,68,39,50,14 + PUSHBUTTON "Cancel",IDC_CANCEL,14,39,50,14 + EDITTEXT IDC_PROFILENAME,14,21,104,14,ES_AUTOHSCROLL + LTEXT "Profile name",IDC_STATIC,11,11,55,8 +END + +IDD_OPT_STARTUPSTATUS DIALOGEX 0, 0, 305, 223 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD +EXSTYLE WS_EX_CONTROLPARENT +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + COMBOBOX IDC_WINSTATE,209,34,80,60,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CONTROL "Set window state",IDC_SETWINSTATE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,209,22,80,10 + CONTROL "Show dialog",IDC_SHOWDIALOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,71,127,10 + CONTROL "Set status to offline before exit",IDC_OFFLINECLOSE, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,180,174,10 + PUSHBUTTON "Show CMDL",IDC_SHOWCMDL,14,194,53,14 + CONTROL "Activate status profile",IDC_SETPROFILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,20,89,10 + COMBOBOX IDC_DOCKED,209,64,80,60,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CONTROL "Set docked",IDC_SETDOCKED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,209,52,80,10 + GROUPBOX "Other",IDC_STATIC,7,166,182,50 + GROUPBOX "Status on startup",IDC_STATIC,7,7,182,102 + EDITTEXT IDC_SETPROFILEDELAY,57,35,28,14,ES_AUTOHSCROLL | ES_NUMBER + LTEXT "ms",IDC_STATIC,88,37,13,8 + LTEXT "Set after",IDC_STATIC,26,37,28,8 + EDITTEXT IDC_DLGTIMEOUT,57,86,28,14,ES_AUTOHSCROLL | ES_NUMBER + LTEXT "Timeout",IDC_STATIC,26,89,30,8 + LTEXT "s",IDC_STATIC,88,89,12,8 + CONTROL "Set window location",IDC_SETWINLOCATION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,209,82,80,10 + LTEXT "Left",IDC_STATIC,214,97,35,8 + EDITTEXT IDC_XPOS,259,94,30,14,ES_AUTOHSCROLL | ES_NUMBER + LTEXT "Top",IDC_STATIC,214,113,35,8 + EDITTEXT IDC_YPOS,259,110,30,14,ES_AUTOHSCROLL | ES_NUMBER + CONTROL "Set window size",IDC_SETWINSIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,209,140,80,10 + LTEXT "Width",IDC_STATIC,214,155,35,8 + EDITTEXT IDC_WIDTH,259,152,30,14,ES_AUTOHSCROLL | ES_NUMBER + LTEXT "Height",IDC_STATIC,214,171,35,8 + EDITTEXT IDC_HEIGHT,259,168,30,14,ES_AUTOHSCROLL | ES_NUMBER + COMBOBOX IDC_PROFILE,105,19,78,92,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CONTROL "Allow override",IDC_OVERRIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,53,76,10 + LTEXT "Note: status profiles can be created in the 'Status profiles' options screen",IDC_STATIC,105,37,77,34 + LTEXT "",IDC_CURWINLOC,209,128,80,8 + LTEXT "",IDC_CURWINSIZE,209,186,80,8 + GROUPBOX "Window on startup",IDC_STATIC,194,7,104,209 + CONTROL "Automatically dial on startup",IDC_AUTODIAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,129,168,10 + CONTROL "Automatically hang up on exit",IDC_AUTOHANGUP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,144,168,10 + GROUPBOX "Dial-up (experimental)",IDC_STATIC,7,113,182,49 +END + +IDD_PUOPT_KEEPSTATUS DIALOGEX 0, 0, 254, 223 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD +EXSTYLE WS_EX_CONTROLPARENT +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + CONTROL "",IDC_BGCOLOR,"ColourPicker",WS_TABSTOP,15,19,35,14 + LTEXT "Background color",IDC_STATIC,59,23,66,8 + CONTROL "",IDC_TEXTCOLOR,"ColourPicker",WS_TABSTOP,15,37,35,14 + LTEXT "Text color",IDC_STATIC,59,41,66,8 + CONTROL "Use Windows colors",IDC_WINCOLORS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,56,108,10 + CONTROL "Use default colors",IDC_DEFAULTCOLORS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,66,107,10 + GROUPBOX "Delay",IDC_STATIC,137,7,110,52 + EDITTEXT IDC_DELAY,221,30,20,14,ES_AUTOHSCROLL | ES_NUMBER + GROUPBOX "On left click",IDC_STATIC,7,84,103,51 + GROUPBOX "On right click",IDC_STATIC,137,84,101,51,WS_GROUP + CONTROL "Do nothing",IDC_LNOTHING,"Button",BS_AUTORADIOBUTTON | WS_GROUP,15,96,80,10 + CONTROL "Close popup",IDC_LCLOSE,"Button",BS_AUTORADIOBUTTON,15,108,79,10 + CONTROL "Cancel reconnecting",IDC_LCANCEL,"Button",BS_AUTORADIOBUTTON,15,120,94,10 + CONTROL "Do nothing",IDC_RNOTHING,"Button",BS_AUTORADIOBUTTON | WS_GROUP,143,96,78,10 + CONTROL "Close popup",IDC_RCLOSE,"Button",BS_AUTORADIOBUTTON,143,108,78,10 + CONTROL "Cancel reconnecting",IDC_RCANCEL,"Button",BS_AUTORADIOBUTTON,143,120,94,10 + GROUPBOX "Colors",IDC_STATIC,7,7,126,73 + PUSHBUTTON "Preview",IDC_PREV,137,63,50,14 + GROUPBOX "Events",IDC_STATIC,7,140,240,76 + CONTROL "Show when connection is lost",IDC_PUCONNLOST,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,153,226,10 + CONTROL "Show when a connection attempt is made",IDC_PUCONNRETRY, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,165,226,10 + CONTROL "Show when reconnection has finished",IDC_PURESULT, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,177,226,10 + CONTROL "Show other messages",IDC_PUOTHER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,189,226,10 + CONTROL "From popup plugin",IDC_DELAYFROMPU,"Button",BS_AUTORADIOBUTTON | WS_GROUP,143,19,94,10 + CONTROL "Custom",IDC_DELAYCUSTOM,"Button",BS_AUTORADIOBUTTON,143,32,47,10 + CONTROL "Permanent",IDC_DELAYPERMANENT,"Button",BS_AUTORADIOBUTTON,143,45,50,10 + CONTROL "Show additional information in popups",IDC_PUSHOWEXTRA, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,201,226,10 +END + +IDD_OPT_AUTOAWAYMSG DIALOGEX 0, 0, 263, 153 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD +EXSTYLE WS_EX_CONTROLPARENT +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + COMBOBOX IDC_STATUS,12,19,240,97,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CONTROL "Use Miranda's message setting",IDC_RADUSEMIRANDA,"Button",BS_AUTORADIOBUTTON,23,56,165,10 + CONTROL "Use this message:",IDC_RADUSECUSTOM,"Button",BS_AUTORADIOBUTTON,23,69,165,10 + EDITTEXT IDC_STATUSMSG,33,82,219,50,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL + LTEXT "Use %time% for the current time, %date% for the current date",IDC_STATIC,33,135,220,8 + PUSHBUTTON "Variables...",IDC_VARIABLESHELP,198,65,54,14,NOT WS_VISIBLE +END + +IDD_OPT_GENAUTOAWAY DIALOGEX 0, 0, 258, 191 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD +EXSTYLE WS_EX_CONTROLPARENT +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + CONTROL "Specify settings for each account",IDC_PERPROTOCOLSETTINGS, + "Button",BS_AUTORADIOBUTTON,20,20,220,10 + CONTROL "Use same settings for all accounts",IDC_SAMESETTINGS, + "Button",BS_AUTORADIOBUTTON,20,31,220,10 + CONTROL "Ignore Caps Lock, Num Lock and Scroll Lock keys",IDC_IGNLOCK, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,44,220,10 + LTEXT "Check interval (secs)",IDC_STATIC,21,125,133,8 + EDITTEXT IDC_AWAYCHECKTIMEINSECS,159,122,22,14,ES_AUTOHSCROLL + LTEXT "Confirm dialog timeout (secs)",IDC_STATIC,21,142,133,8 + EDITTEXT IDC_CONFIRMDELAY,159,138,22,14,ES_AUTOHSCROLL + CTEXT "You enabled ""Change my status mode to"" in the ""Idle"" options dialog, AdvancedAutoAway's options are ignored.",IDC_IDLEWARNING,7,164,244,20,NOT WS_VISIBLE + CONTROL "Monitor keyboard activity",IDC_MONITORKEYBOARD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,77,220,10 + CONTROL "Monitor mouse activity",IDC_MONITORMOUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,88,220,10 + CONTROL "Ignore CTRL, ALT, SHIFT, TAB, ESC and Windows keys",IDC_IGNSYSKEYS, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,55,220,10 + CONTROL "Ignore any key combination with above keys",IDC_IGNALTCOMBO, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,66,220,10 +END + +IDD_OPT_KS_ACTION DIALOGEX 0, 0, 140, 162 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD +EXSTYLE WS_EX_CONTROLPARENT +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + CONTROL "",IDC_PROTOLIST,"SysListView32",LVS_REPORT | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,16,63,100,72 + LTEXT "Accounts",IDC_STATIC,19,51,30,8 + CONTROL "Enable checking",IDC_ENABLECHECKING,"Button",BS_AUTORADIOBUTTON,16,17,69,10 + CONTROL "Disable checking",IDC_DISABLECHECKING,"Button",BS_AUTORADIOBUTTON,16,33,71,10 +END + +IDD_SETSTSMSGDIALOG DIALOG 0, 0, 240, 126 +STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Set status message" +FONT 8, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "OK",IDC_OK,183,105,50,14 + PUSHBUTTON "Cancel",IDC_CANCEL,127,105,50,14 + EDITTEXT IDC_STSMSG,7,19,226,79,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN + LTEXT "Set status message",IDC_DESCRIPTION,7,7,226,8 +END + +IDD_OPT_STATUSPROFILES DIALOGEX 0, 0, 305, 234 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD +EXSTYLE WS_EX_CONTROLPARENT +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "Account",IDC_STATIC,16,78,77,8 + LTEXT "Status",IDC_STATIC,156,78,77,8 + LISTBOX IDC_PROTOCOL,16,88,133,58,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + LISTBOX IDC_STATUS,156,88,133,58,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + LTEXT "Profile",IDC_STATIC,16,18,78,8 + PUSHBUTTON "Add...",IDC_ADDPROFILE,16,44,64,14 + PUSHBUTTON "Delete",IDC_DELPROFILE,81,44,67,14 + CONTROL "Create a TopToolBar button",IDC_CREATETTB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,156,27,135,10 + CONTROL "Show confirm dialog when loading",IDC_SHOWDIALOG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,156,17,135,10 + COMBOBOX IDC_PROFILE,16,27,133,106,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CONTROL "Create a main menu item",IDC_CREATEMMI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,156,37,135,10 + EDITTEXT IDC_STATUSMSG,16,174,273,46,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN + GROUPBOX "Status profiles",IDC_STATIC,7,7,291,220 + CONTROL "Use Miranda's message setting",IDC_MIRANDAMSG,"Button",BS_AUTORADIOBUTTON,16,150,195,10 + CONTROL "Use this message:",IDC_CUSTOMMSG,"Button",BS_AUTORADIOBUTTON,16,161,192,10 + CONTROL "HotKey1",IDC_HOTKEY,"msctls_hotkey32",WS_BORDER | WS_TABSTOP,105,63,111,14 + CONTROL "Hotkey",IDC_REGHOTKEY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,64,88,10 + PUSHBUTTON "Variables...",IDC_VARIABLESHELP,215,157,74,14,NOT WS_VISIBLE + CONTROL "In submenu",IDC_INSUBMENU,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,169,47,119,10 +END + +IDD_OPT_TABS DIALOGEX 0, 0, 314, 250 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD +EXSTYLE WS_EX_CONTROLPARENT +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + CONTROL "Tab1",IDC_TABS,"SysTabControl32",0x0,3,4,306,242 +END + +IDD_OPT_KS_ADV DIALOGEX 0, 0, 292, 224 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD +EXSTYLE WS_EX_CONTROLPARENT +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + EDITTEXT IDC_MAXDELAY,11,32,22,14,ES_AUTOHSCROLL | ES_NUMBER + LTEXT "Max. delay (secs)",IDC_STATIC,39,35,84,8 + CONTROL "Increase delay exponential",IDC_INCREASEEXPONENTIAL, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,14,263,10 + CONTROL "Cancel all if an account connects from another location",IDC_CNCOTHERLOC, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,96,234,10 + CONTROL "Reconnect on APM resume",IDC_CHECKAPMRESUME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,108,234,10 + CONTROL "Stop trying to reconnect",IDC_LOGINERR_CANCEL,"Button",BS_AUTORADIOBUTTON,22,132,169,10 + CONTROL "Set delay to",IDC_LOGINERR_SETDELAY,"Button",BS_AUTORADIOBUTTON,22,143,110,12 + CONTROL "React on login errors",IDC_LOGINERR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,120,234,10 + EDITTEXT IDC_LOGINERR_DELAY,136,142,22,14,ES_AUTOHSCROLL | ES_NUMBER + LTEXT "seconds",IDC_STATIC,164,145,77,8 + CONTROL "Set account offline before a connection attempt",IDC_FIRSTOFFLINE, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,84,234,10 + EDITTEXT IDC_MAXCONNECTINGTIME,127,32,22,14,ES_AUTOHSCROLL | ES_NUMBER + LTEXT "Max. account connecting time (secs)",IDC_STATIC,154,35,121,19 + GROUPBOX "Timers",IDC_STATIC,3,2,284,54 + GROUPBOX "Reconnecting",IDC_STATIC,4,58,283,106 + CONTROL "Ignore locked status of accounts",IDC_NOLOCKED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,72,234,10 + GROUPBOX "Dial-Up",IDC_STATIC,5,166,282,51 + LTEXT "Consider connection lost after",IDC_STATIC,12,180,122,8 + EDITTEXT IDC_PINGCOUNT,135,177,22,14,ES_AUTOHSCROLL | ES_NUMBER + LTEXT "failed pings",IDC_STATIC,160,180,101,8 + EDITTEXT IDC_CNTDELAY,11,193,22,14,ES_AUTOHSCROLL | ES_NUMBER + LTEXT "Continuously check interval (secs)",IDC_STATIC,36,196,160,8 +END + +IDD_TRG_AAASTATECHANGE DIALOGEX 0, 0, 212, 144 +STYLE DS_SETFONT | DS_3DLOOK | WS_CHILD +EXSTYLE WS_EX_CONTROLPARENT +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + CONTROL "Entering first auto-away status",IDC_ENTERFIRST,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,24,110,10 + CONTROL "Entering second auto-away status",IDC_ENTERSECOND, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,37,123,10 + CONTROL "Leaving first auto-away status",IDC_LEAVEFIRST,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,50,109,10 + CONTROL "Leaving second auto-away status",IDC_LEAVESECOND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,63,122,10 + CONTROL "Becoming active without status change",IDC_BECOMEACTIVE, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,76,140,10 + GROUPBOX "Pre-conditions",IDC_STATIC,7,7,198,89 + GROUPBOX "TriggerData",IDC_STATIC,7,97,198,40 + LTEXT "Status: The status the account will change to\r\nAccount: The account changing state",IDC_STATIC,19,111,177,18 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_OPT_KS_BASIC, DIALOG + BEGIN + END + + IDD_OPT_AUTOAWAY, DIALOG + BEGIN + END + + IDD_OPT_TABS, DIALOG + BEGIN + BOTTOMMARGIN, 248 + END + + IDD_OPT_KS_ADV, DIALOG + BEGIN + END +END +#endif // APSTUDIO_INVOKED + +#endif // German (Germany) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/tools/_deprecated/StatusPlugins/stdafx.cpp b/tools/_deprecated/StatusPlugins/stdafx.cpp new file mode 100644 index 0000000000..8adbd4ce11 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/stdafx.cpp @@ -0,0 +1,18 @@ +/* +Copyright (C) 2012-16 Miranda NG project (http://miranda-ng.org) + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation version 2 +of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include "commonstatus.h" \ No newline at end of file diff --git a/tools/_deprecated/StatusPlugins/useronli.ico b/tools/_deprecated/StatusPlugins/useronli.ico new file mode 100644 index 0000000000..2760c47d5c Binary files /dev/null and b/tools/_deprecated/StatusPlugins/useronli.ico differ diff --git a/tools/_deprecated/StatusPlugins/version.rc b/tools/_deprecated/StatusPlugins/version.rc new file mode 100644 index 0000000000..312430aa29 --- /dev/null +++ b/tools/_deprecated/StatusPlugins/version.rc @@ -0,0 +1,43 @@ +#ifdef APSTUDIO_INVOKED +#error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + +#include "version.h" +#include "winres.h" + +#ifdef _WIN32 +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL +#endif //_WIN32 + +VS_VERSION_INFO VERSIONINFO + FILEVERSION __FILEVERSION_STRING + PRODUCTVERSION __FILEVERSION_STRING + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +//#else +// FILEFLAGS 0x0L +#endif + + FILEOS VOS__WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE VFT2_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004b0" // LOCALE_NEUTRAL<<16 + 1200 (ANSI - Unicode) + BEGIN + VALUE "Author", __AUTHOR + VALUE "FileDescription", __DESC + VALUE "InternalName", __PLUGIN_NAME + VALUE "LegalCopyright", __COPYRIGHT + VALUE "OriginalFilename", __FILENAME + VALUE "FileVersion", __VERSION_STRING + VALUE "ProductName", "Miranda NG" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", /*LOCALE_NEUTRAL from WinNT.h */ 0x0, 1200 + END +END -- cgit v1.2.3 From aab5ffecbae90011d715cdc3872232f9b0b4b667 Mon Sep 17 00:00:00 2001 From: dartraiden Date: Sat, 22 Oct 2016 22:13:16 +0300 Subject: lpgen.js: remove statusplugins-related logic --- tools/lpgen/lpgen.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/tools/lpgen/lpgen.js b/tools/lpgen/lpgen.js index 2300ecd360..40aec13a41 100644 --- a/tools/lpgen/lpgen.js +++ b/tools/lpgen/lpgen.js @@ -224,8 +224,6 @@ function GeneratePluginTranslate (pluginpath,langpackfilepath,vcxprojfile) { FindFiles(pluginpath,"\\.rc$",resourcefiles); //find all source files and list files in array FindFiles(pluginpath,"\\.h$|\\.cpp$|\\.c$|\\.pas$|\\.dpr$|\\.inc$",sourcefiles); - //Check for "Status plugins". They have few common resource files to translate, which located one layer upper, than plugin folder. - CheckStatusPlugins(plugin); //Parse files "resourcefiles", put result into "foundstrings" using "ParseRCFile" function ParseFiles(resourcefiles,foundstrings,ParseRCFile); //Parse files "sourcefiles", put result into "foundstrings" using "ParseSourceFile" function @@ -372,15 +370,6 @@ function GetMUUID (folder,array) { if (log) WScript.Echo(muuid); }; -//For status plugins, namely KeepStatus, StartupStatus and AdvancedAutoAway we need add for all of them common source files to parsing array, because they exist one layer upper of pluginfolder -function CheckStatusPlugins (plug) { -if (plug.match(/(KeepStatus|StartupStatus|AdvancedAutoAway)/)) { - resourcefiles.push(trunk+"\\Plugins\\StatusPlugins\\resource.rc"); - sourcefiles.push(trunk+"\\Plugins\\StatusPlugins\\commonstatus.cpp"); - sourcefiles.push(trunk+"\\Plugins\\StatusPlugins\\confirmdialog.cpp"); - } -} - //read text file, removing all commented text for further processing function ReadFile (file) { //If file zero size, return; -- cgit v1.2.3 From 00c92727207587b0b4277a623bcf4a25ed0090ee Mon Sep 17 00:00:00 2001 From: dartraiden Date: Sat, 22 Oct 2016 22:13:51 +0300 Subject: langpacks/english: update --- langpacks/english/=CORE=.txt | 2 +- langpacks/english/Plugins/AdvancedAutoAway.txt | 164 -------------------- langpacks/english/Plugins/KeepStatus.txt | 178 ---------------------- langpacks/english/Plugins/StartupStatus.txt | 178 ---------------------- langpacks/english/Plugins/StatusManager.txt | 201 +++++++++++++++++++++++++ langpacks/english/Plugins/VKontakte.txt | 2 +- 6 files changed, 203 insertions(+), 522 deletions(-) delete mode 100644 langpacks/english/Plugins/AdvancedAutoAway.txt delete mode 100644 langpacks/english/Plugins/KeepStatus.txt delete mode 100644 langpacks/english/Plugins/StartupStatus.txt create mode 100644 langpacks/english/Plugins/StatusManager.txt diff --git a/langpacks/english/=CORE=.txt b/langpacks/english/=CORE=.txt index d71c22fa0a..eb1cae303d 100644 --- a/langpacks/english/=CORE=.txt +++ b/langpacks/english/=CORE=.txt @@ -1204,9 +1204,9 @@ [Open logging options] [Open 'Find user' dialog] ;file \src\mir_app\src\lpopts.cpp +[built-in] [(incompatible)] [Unknown] -[built-in] [Languages] ;file \src\mir_app\src\menu_clist.cpp [Custom status] diff --git a/langpacks/english/Plugins/AdvancedAutoAway.txt b/langpacks/english/Plugins/AdvancedAutoAway.txt deleted file mode 100644 index dedd897ab4..0000000000 --- a/langpacks/english/Plugins/AdvancedAutoAway.txt +++ /dev/null @@ -1,164 +0,0 @@ -#muuid {f0fdf73a-753d-499d-8dba-336db79cdd41} -;============================================================ -; File: AdvancedAutoAway.dll -; Plugin: Advanced Auto Away -; Version: 0.8.1.1 -; Authors: P Boon -;============================================================ -[An Auto Away module with some more options than the original.] -;file \Plugins\StatusPlugins\resource.rc -[Check connection] -[Max. retries] -[Account connection] -[Delay between retries (secs)] -[Show popups] -[General] -[Accounts to check] -[Dial-Up] -[Don't reconnect if no internet connection seems available] -[Continuously check for internet connection] -[Do so by pinging host] -[Confirm status] -[Close] -[Cancel] -[Profile] -[Message] -[Account] -[Set] -[when full-screen mode is active] -[when screen saver engages] -[when workstation is locked] -[after] -[minutes of inactivity] -[minutes of level 1 mode] -[only set when inactive] -[Monitor Miranda's activity only] -[Reset status on return] -[Confirm resetting status] -[Only set if current status is] -[Command line] -[Copy to clipboard] -[Command line:] -[Create shortcut] -[Add new profile] -[Profile name] -[Set window state] -[Show dialog] -[Set status to offline before exit] -[Show CMDL] -[Activate status profile] -[Set docked] -[Other] -[Status on startup] -[ms] -[Set after] -[Timeout] -[s] -[Set window location] -[Left] -[Top] -[Set window size] -[Width] -[Height] -[Allow override] -[Note: status profiles can be created in the 'Status profiles' options screen] -[Window on startup] -[Automatically dial on startup] -[Automatically hang up on exit] -[Dial-up (experimental)] -[Background color] -[Text color] -[Use Windows colors] -[Use default colors] -[Delay] -[On left click] -[On right click] -[Do nothing] -[Close popup] -[Cancel reconnecting] -[Colors] -[Preview] -[Events] -[Show when connection is lost] -[Show when a connection attempt is made] -[Show when reconnection has finished] -[Show other messages] -[From popup plugin] -[Custom] -[Permanent] -[Show additional information in popups] -[Use Miranda's message setting] -[Use this message:] -[Use %time% for the current time, %date% for the current date] -[Variables...] -[Specify settings for each account] -[Use same settings for all accounts] -[Ignore Caps Lock, Num Lock and Scroll Lock keys] -[Check interval (secs)] -[Confirm dialog timeout (secs)] -[You enabled "Change my status mode to" in the "Idle" options dialog, AdvancedAutoAway's options are ignored.] -[Monitor keyboard activity] -[Monitor mouse activity] -[Ignore CTRL, ALT, SHIFT, TAB, ESC and Windows keys] -[Ignore any key combination with above keys] -[Accounts] -[Enable checking] -[Disable checking] -[Set status message] -[Status] -[Add...] -[Delete] -[Create a TopToolBar button] -[Show confirm dialog when loading] -[Create a main menu item] -[Status profiles] -[Hotkey] -[In submenu] -[Max. delay (secs)] -[Increase delay exponential] -[Cancel all if an account connects from another location] -[Reconnect on APM resume] -[Stop trying to reconnect] -[Set delay to] -[React on login errors] -[seconds] -[Set account offline before a connection attempt] -[Max. account connecting time (secs)] -[Timers] -[Reconnecting] -[Ignore locked status of accounts] -[Consider connection lost after] -[failed pings] -[Continuously check interval (secs)] -[Entering first auto-away status] -[Entering second auto-away status] -[Leaving first auto-away status] -[Leaving second auto-away status] -[Becoming active without status change] -[Pre-conditions] -[TriggerData] -[Status: The status the account will change to\r\nAccount: The account changing state] -;file \plugins\StatusPlugins\AdvancedAutoAway\options.cpp -[minutes of %s mode] -[Rules] -[Status messages] -[Auto Away] -;file \Plugins\StatusPlugins\commonstatus.cpp -[I've been away since %time%.] -[Give it up, I'm not in!] -[Not right now.] -[Give a guy some peace, would ya?] -[I'm a chatbot!] -[Yep, I'm here.] -[Nope, not here.] -[I'm hiding from the mafia.] -[That'll be the phone.] -[Mmm... food.] -[idleeeeeeee] -;file \Plugins\StatusPlugins\confirmdialog.cpp -[Set %s message for %s.] -[] -[] -[] -[Protocol] -[Closing in %d] diff --git a/langpacks/english/Plugins/KeepStatus.txt b/langpacks/english/Plugins/KeepStatus.txt deleted file mode 100644 index 1170a32724..0000000000 --- a/langpacks/english/Plugins/KeepStatus.txt +++ /dev/null @@ -1,178 +0,0 @@ -#muuid {a5bb1b7a-b7cd-4cbb-a7db-ceb4eb71da49} -;============================================================ -; File: KeepStatus.dll -; Plugin: Keep status -; Version: 0.9.0.2 -; Authors: P Boon -;============================================================ -[KeepStatus, A connection checker, for use with (or without) StartupStatus and/or AdvancedAutoAway.] -;file \Plugins\StatusPlugins\resource.rc -[Check connection] -[Max. retries] -[Account connection] -[Delay between retries (secs)] -[Show popups] -[General] -[Accounts to check] -[Dial-Up] -[Don't reconnect if no internet connection seems available] -[Continuously check for internet connection] -[Do so by pinging host] -[Confirm status] -[Close] -[Cancel] -[Profile] -[Message] -[Account] -[Set] -[when full-screen mode is active] -[when screen saver engages] -[when workstation is locked] -[after] -[minutes of inactivity] -[minutes of level 1 mode] -[only set when inactive] -[Monitor Miranda's activity only] -[Reset status on return] -[Confirm resetting status] -[Only set if current status is] -[Command line] -[Copy to clipboard] -[Command line:] -[Create shortcut] -[Add new profile] -[Profile name] -[Set window state] -[Show dialog] -[Set status to offline before exit] -[Show CMDL] -[Activate status profile] -[Set docked] -[Other] -[Status on startup] -[ms] -[Set after] -[Timeout] -[s] -[Set window location] -[Left] -[Top] -[Set window size] -[Width] -[Height] -[Allow override] -[Note: status profiles can be created in the 'Status profiles' options screen] -[Window on startup] -[Automatically dial on startup] -[Automatically hang up on exit] -[Dial-up (experimental)] -[Background color] -[Text color] -[Use Windows colors] -[Use default colors] -[Delay] -[On left click] -[On right click] -[Do nothing] -[Close popup] -[Cancel reconnecting] -[Colors] -[Preview] -[Events] -[Show when connection is lost] -[Show when a connection attempt is made] -[Show when reconnection has finished] -[Show other messages] -[From popup plugin] -[Custom] -[Permanent] -[Show additional information in popups] -[Use Miranda's message setting] -[Use this message:] -[Use %time% for the current time, %date% for the current date] -[Variables...] -[Specify settings for each account] -[Use same settings for all accounts] -[Ignore Caps Lock, Num Lock and Scroll Lock keys] -[Check interval (secs)] -[Confirm dialog timeout (secs)] -[You enabled "Change my status mode to" in the "Idle" options dialog, AdvancedAutoAway's options are ignored.] -[Monitor keyboard activity] -[Monitor mouse activity] -[Ignore CTRL, ALT, SHIFT, TAB, ESC and Windows keys] -[Ignore any key combination with above keys] -[Accounts] -[Enable checking] -[Disable checking] -[Set status message] -[Status] -[Add...] -[Delete] -[Create a TopToolBar button] -[Show confirm dialog when loading] -[Create a main menu item] -[Status profiles] -[Hotkey] -[In submenu] -[Max. delay (secs)] -[Increase delay exponential] -[Cancel all if an account connects from another location] -[Reconnect on APM resume] -[Stop trying to reconnect] -[Set delay to] -[React on login errors] -[seconds] -[Set account offline before a connection attempt] -[Max. account connecting time (secs)] -[Timers] -[Reconnecting] -[Ignore locked status of accounts] -[Consider connection lost after] -[failed pings] -[Continuously check interval (secs)] -[Entering first auto-away status] -[Entering second auto-away status] -[Leaving first auto-away status] -[Leaving second auto-away status] -[Becoming active without status change] -[Pre-conditions] -[TriggerData] -[Status: The status the account will change to\r\nAccount: The account changing state] -;file \plugins\StatusPlugins\KeepStatus\keepstatus.cpp -[Protocol] -[%s connected from another location] -[%s login error, cancel reconnecting] -[%s login error (next retry (%d) in %d s)] -[%s status error (next retry (%d) in %d s)] -[Status error (next retry (%d) in %d s)] -[%s\t(will be set to %s)\r\n] -[Resetting status... (last try (%d))%s] -[Resetting status... (next retry (%d) in %d s)%s] -[No internet connection seems available... (last try (%d))] -[No internet connection seems available... (next retry (%d) in %d s)] -[Status was set ok] -[Giving up] -[KeepStatus] -;file \plugins\StatusPlugins\KeepStatus\options.cpp -[Basic] -[Advanced] -[You broke the Internet!] -[Popups] -;file \Plugins\StatusPlugins\commonstatus.cpp -[I've been away since %time%.] -[Give it up, I'm not in!] -[Not right now.] -[Give a guy some peace, would ya?] -[I'm a chatbot!] -[Yep, I'm here.] -[Nope, not here.] -[I'm hiding from the mafia.] -[That'll be the phone.] -[Mmm... food.] -[idleeeeeeee] -;file \Plugins\StatusPlugins\confirmdialog.cpp -[Set %s message for %s.] -[] -[] -[] -[Closing in %d] diff --git a/langpacks/english/Plugins/StartupStatus.txt b/langpacks/english/Plugins/StartupStatus.txt deleted file mode 100644 index d52d61d1a9..0000000000 --- a/langpacks/english/Plugins/StartupStatus.txt +++ /dev/null @@ -1,178 +0,0 @@ -#muuid {4b733944-5a70-4b52-ab2d-68b1ef38ffe8} -;============================================================ -; File: StartupStatus.dll -; Plugin: StartupStatus -; Version: 0.8.0.48 -; Authors: P Boon -;============================================================ -[StartupStatus, allows you to define the status Miranda should set on startup, configurable per protocol.] -;file \Plugins\StatusPlugins\resource.rc -[Check connection] -[Max. retries] -[Account connection] -[Delay between retries (secs)] -[Show popups] -[General] -[Accounts to check] -[Dial-Up] -[Don't reconnect if no internet connection seems available] -[Continuously check for internet connection] -[Do so by pinging host] -[Confirm status] -[Close] -[Cancel] -[Profile] -[Message] -[Account] -[Set] -[when full-screen mode is active] -[when screen saver engages] -[when workstation is locked] -[after] -[minutes of inactivity] -[minutes of level 1 mode] -[only set when inactive] -[Monitor Miranda's activity only] -[Reset status on return] -[Confirm resetting status] -[Only set if current status is] -[Command line] -[Copy to clipboard] -[Command line:] -[Create shortcut] -[Add new profile] -[Profile name] -[Set window state] -[Show dialog] -[Set status to offline before exit] -[Show CMDL] -[Activate status profile] -[Set docked] -[Other] -[Status on startup] -[ms] -[Set after] -[Timeout] -[s] -[Set window location] -[Left] -[Top] -[Set window size] -[Width] -[Height] -[Allow override] -[Note: status profiles can be created in the 'Status profiles' options screen] -[Window on startup] -[Automatically dial on startup] -[Automatically hang up on exit] -[Dial-up (experimental)] -[Background color] -[Text color] -[Use Windows colors] -[Use default colors] -[Delay] -[On left click] -[On right click] -[Do nothing] -[Close popup] -[Cancel reconnecting] -[Colors] -[Preview] -[Events] -[Show when connection is lost] -[Show when a connection attempt is made] -[Show when reconnection has finished] -[Show other messages] -[From popup plugin] -[Custom] -[Permanent] -[Show additional information in popups] -[Use Miranda's message setting] -[Use this message:] -[Use %time% for the current time, %date% for the current date] -[Variables...] -[Specify settings for each account] -[Use same settings for all accounts] -[Ignore Caps Lock, Num Lock and Scroll Lock keys] -[Check interval (secs)] -[Confirm dialog timeout (secs)] -[You enabled "Change my status mode to" in the "Idle" options dialog, AdvancedAutoAway's options are ignored.] -[Monitor keyboard activity] -[Monitor mouse activity] -[Ignore CTRL, ALT, SHIFT, TAB, ESC and Windows keys] -[Ignore any key combination with above keys] -[Accounts] -[Enable checking] -[Disable checking] -[Set status message] -[Status] -[Add...] -[Delete] -[Create a TopToolBar button] -[Show confirm dialog when loading] -[Create a main menu item] -[Status profiles] -[Hotkey] -[In submenu] -[Max. delay (secs)] -[Increase delay exponential] -[Cancel all if an account connects from another location] -[Reconnect on APM resume] -[Stop trying to reconnect] -[Set delay to] -[React on login errors] -[seconds] -[Set account offline before a connection attempt] -[Max. account connecting time (secs)] -[Timers] -[Reconnecting] -[Ignore locked status of accounts] -[Consider connection lost after] -[failed pings] -[Continuously check interval (secs)] -[Entering first auto-away status] -[Entering second auto-away status] -[Leaving first auto-away status] -[Leaving second auto-away status] -[Becoming active without status change] -[Pre-conditions] -[TriggerData] -[Status: The status the account will change to\r\nAccount: The account changing state] -;file \plugins\StatusPlugins\StartupStatus\options.cpp -[] -[] -[] -[Right] -[None] -[size: %d x %d] -[loc: %d x %d] -[Hidden] -[Minimized] -[Normal] -[Create a status menu item] -[default] -[unknown] -[At least one profile must exist] -[StartupStatus] -[Your default profile will be changed] -;file \plugins\StatusPlugins\StartupStatus\profiles.cpp -;file \plugins\StatusPlugins\StartupStatus\toolbars.cpp -[Pressed toolbar icon] -[Released toolbar icon] -;file \Plugins\StatusPlugins\commonstatus.cpp -[I've been away since %time%.] -[Give it up, I'm not in!] -[Not right now.] -[Give a guy some peace, would ya?] -[I'm a chatbot!] -[Yep, I'm here.] -[Nope, not here.] -[I'm hiding from the mafia.] -[That'll be the phone.] -[Mmm... food.] -[idleeeeeeee] -;file \Plugins\StatusPlugins\confirmdialog.cpp -[Set %s message for %s.] -[] -[Protocol] -[Closing in %d] diff --git a/langpacks/english/Plugins/StatusManager.txt b/langpacks/english/Plugins/StatusManager.txt new file mode 100644 index 0000000000..977bd1d953 --- /dev/null +++ b/langpacks/english/Plugins/StatusManager.txt @@ -0,0 +1,201 @@ +#muuid {fadd4a8a-1fd0-4398-83bd-e378b85ed8f1} +;============================================================ +; File: StatusManager.dll +; Plugin: Status manager +; Version: 0.11.0.0 +; Authors: P Boon +;============================================================ +;file \plugins\StatusManager\res\resource.rc +[Check connection] +[Maximum retries (0 - infinite)] +[Account connection] +[Delay between retries (secs)] +[Show popups] +[General] +[Accounts to check] +[Dial-Up] +[Don't reconnect if no internet connection seems available] +[Continuously check for internet connection] +[Do so by pinging host] +[Confirm status] +[Close] +[Cancel] +[Profile] +[Message] +[Account] +[Set] +[when full-screen mode is active] +[when screen saver engages] +[when workstation is locked] +[after] +[minutes of inactivity] +[minutes of level 1 mode] +[only set when inactive] +[Monitor Miranda's activity only] +[Reset status on return] +[Confirm resetting status] +[Only set if current status is] +[Command line] +[Copy to clipboard] +[Command line:] +[Create shortcut] +[Add new profile] +[Profile name] +[Set window state] +[Show dialog] +[Set status to offline before exit] +[Show CMDL] +[Activate status profile] +[Set docked] +[Other] +[Status on startup] +[ms] +[Set after] +[Timeout] +[s] +[Set window location] +[Left] +[Top] +[Set window size] +[Width] +[Height] +[Allow override] +[Note: status profiles can be created in the 'Status profiles' options screen] +[Window on startup] +[Automatically dial on startup] +[Automatically hang up on exit] +[Dial-up (experimental)] +[Background color] +[Text color] +[Use Windows colors] +[Use default colors] +[Delay] +[On left click] +[On right click] +[Do nothing] +[Close popup] +[Cancel reconnecting] +[Colors] +[Preview] +[Events] +[Show when connection is lost] +[Show when a connection attempt is made] +[Show when reconnection has finished] +[Show other messages] +[From popup plugin] +[Custom] +[Permanent] +[Show additional information in popups] +[Use Miranda's message setting] +[Use this message:] +[Use %time% for the current time, %date% for the current date] +[Variables...] +[Specify settings for each account] +[Use same settings for all accounts] +[Ignore Caps Lock, Num Lock and Scroll Lock keys] +[Check interval (secs)] +[Confirm dialog timeout (secs)] +[You enabled "Change my status mode to" in the "Idle" options dialog, AdvancedAutoAway's options are ignored.] +[Monitor keyboard activity] +[Monitor mouse activity] +[Ignore CTRL, ALT, SHIFT, TAB, ESC and Windows keys] +[Ignore any key combination with above keys] +[Accounts] +[Enable checking] +[Disable checking] +[Set status message] +[Status] +[Add...] +[Delete] +[Create a TopToolBar button] +[Show confirm dialog when loading] +[Create a main menu item] +[Status profiles] +[Hotkey] +[In submenu] +[Max. delay (secs)] +[Increase delay exponential] +[Cancel all if an account connects from another location] +[Reconnect on APM resume] +[Stop trying to reconnect] +[Set delay to] +[React on login errors] +[seconds] +[Set account offline before a connection attempt] +[Max. account connecting time (secs)] +[Timers] +[Reconnecting] +[Ignore locked status of accounts] +[Consider connection lost after] +[failed pings] +[Continuously check interval (secs)] +[Entering first auto-away status] +[Entering second auto-away status] +[Leaving first auto-away status] +[Leaving second auto-away status] +[Becoming active without status change] +[Pre-conditions] +[TriggerData] +[Status: The status the account will change to\r\nAccount: The account changing state] +;file \plugins\StatusManager\src\aaa_options.cpp +[minutes of %s mode] +[Rules] +[Status messages] +[Auto Away] +;file \plugins\StatusManager\src\commonstatus.cpp +[I've been away since %time%.] +[Give it up, I'm not in!] +[Not right now.] +[Give a guy some peace, would ya?] +[I'm a chatbot!] +[Yep, I'm here.] +[Nope, not here.] +[I'm hiding from the mafia.] +[That'll be the phone.] +[Mmm... food.] +[idleeeeeeee] +;file \plugins\StatusManager\src\confirmdialog.cpp +[Set %s message for %s.] +[] +[] +[] +[Protocol] +[Closing in %d] +;file \plugins\StatusManager\src\keepstatus.cpp +[%s connected from another location] +[%s login error, cancel reconnecting] +[%s login error (next retry (%d) in %d s)] +[%s status error (next retry (%d) in %d s)] +[Status error (next retry (%d) in %d s)] +[%s\t(will be set to %s)\r\n] +[Resetting status... (last try (%d))%s] +[Resetting status... (next retry (%d) in %d s)%s] +[No internet connection seems available... (last try (%d))] +[No internet connection seems available... (next retry (%d) in %d s)] +[Status was set ok] +[Giving up] +[KeepStatus] +;file \plugins\StatusManager\src\ks_options.cpp +[Basic] +[Advanced] +[You broke the Internet!] +[Popups] +;file \plugins\StatusManager\src\ss_options.cpp +[] +[Right] +[None] +[size: %d x %d] +[loc: %d x %d] +[Hidden] +[Minimized] +[Normal] +[Create a status menu item] +[default] +[unknown] +[At least one profile must exist] +[StartupStatus] +[Your default profile will be changed] +;file \plugins\StatusManager\src\ss_profiles.cpp +;file \plugins\StatusManager\src\ss_toolbars.cpp +[Pressed toolbar icon] +[Released toolbar icon] diff --git a/langpacks/english/Plugins/VKontakte.txt b/langpacks/english/Plugins/VKontakte.txt index a09efa45f0..33a96d5888 100644 --- a/langpacks/english/Plugins/VKontakte.txt +++ b/langpacks/english/Plugins/VKontakte.txt @@ -2,7 +2,7 @@ ;============================================================ ; File: VKontakte.dll ; Plugin: VKontakte protocol -; Version: 0.1.2.6 +; Version: 0.1.2.7 ; Authors: Miranda NG Team ;============================================================ [VKontakte protocol support for Miranda NG.] -- cgit v1.2.3