diff options
author | George Hazan <ghazan@miranda.im> | 2018-06-10 14:03:24 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-06-10 14:03:24 +0300 |
commit | 527c89ab4ce37f593a58c74675c44b829a0603c1 (patch) | |
tree | b0d41f19d7e57d13315b327675a3342ffc9189b5 /plugins/StatusManager | |
parent | 5dcc5f9ff7be79500caacea1ca581981c3430f6a (diff) |
AAA:
- added ability to react to terminal session disconnection;
- options dialog rework;
- version bump
Diffstat (limited to 'plugins/StatusManager')
-rw-r--r-- | plugins/StatusManager/res/resource.rc | 58 | ||||
-rw-r--r-- | plugins/StatusManager/src/AdvancedAutoAway/aaa_options.cpp | 23 | ||||
-rw-r--r-- | plugins/StatusManager/src/AdvancedAutoAway/advancedautoaway.cpp | 2 | ||||
-rw-r--r-- | plugins/StatusManager/src/commonstatus.h | 1 | ||||
-rw-r--r-- | plugins/StatusManager/src/resource.h | 23 | ||||
-rw-r--r-- | plugins/StatusManager/src/version.h | 2 |
6 files changed, 65 insertions, 44 deletions
diff --git a/plugins/StatusManager/res/resource.rc b/plugins/StatusManager/res/resource.rc index 9424df8dd2..7bd71d111b 100644 --- a/plugins/StatusManager/res/resource.rc +++ b/plugins/StatusManager/res/resource.rc @@ -125,33 +125,41 @@ BEGIN PUSHBUTTON "Message",IDC_SETSTSMSG,131,100,50,14 END -IDD_OPT_AUTOAWAY DIALOGEX 0, 0, 284, 198 +IDD_OPT_AUTOAWAY DIALOGEX 0, 0, 298, 204 STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD EXSTYLE WS_EX_CONTROLPARENT FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - RTEXT "Account",IDC_STATIC,16,11,155,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,155,10 - CONTROL "when screen saver engages",IDC_SCREENSAVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,73,155,10 - CONTROL "when workstation is locked",IDC_ONLOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,86,155,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,89,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,89,8 - CONTROL "only set when inactive",IDC_LV2ONINACTIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,143,261,10 + LTEXT "Account:",IDC_STATIC,191,11,96,8 + COMBOBOX IDC_PROTOCOL,190,22,106,138,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + + GROUPBOX "Away mode",IDC_STATIC,8,5,174,95 + RTEXT "Set",IDC_STATIC,15,18,33,8 + COMBOBOX IDC_LV1STATUS,51,16,65,101,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CONTROL "when full-screen mode is active",IDC_FULLSCREEN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,34,160,10 + CONTROL "when screen saver engages",IDC_SCREENSAVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,46,160,10 + CONTROL "when workstation is locked",IDC_ONLOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,59,160,10 + CONTROL "when terminal session is disconnected",IDC_ONTSDISCONNECT, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,72,160,10 + CONTROL "after",IDC_TIMED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,86,32,8 + EDITTEXT IDC_AWAYTIME,53,84,26,12,ES_AUTOHSCROLL + LTEXT "minutes of inactivity",IDC_LV1AFTERSTR,85,86,89,8 + + GROUPBOX "After away",IDC_STATIC,8,101,174,58 + RTEXT "Set",IDC_STATIC,15,115,33,8 + COMBOBOX IDC_LV2STATUS,51,113,65,101,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CONTROL "after",IDC_SETNA,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,131,32,8 + EDITTEXT IDC_NATIME,53,129,26,12,ES_AUTOHSCROLL + LTEXT "minutes of level 1 mode",IDC_SETNASTR,84,131,89,8 + CONTROL "only set when inactive",IDC_LV2ONINACTIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,144,159,10 CONTROL "Monitor Miranda's activity only",IDC_MONITORMIRANDA, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,9,155,268,12 - CONTROL "Reset status on return",IDC_RESETSTATUS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,9,168,268,11 - CONTROL "Confirm resetting status",IDC_CONFIRM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,9,181,268,10 - LTEXT "Only set if current status is",IDC_STATIC,177,42,100,8 - CONTROL "",IDC_STATUSLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,177,55,100,84 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,163,174,12 + + CONTROL "Reset status on return",IDC_RESETSTATUS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,176,174,11 + CONTROL "Confirm resetting status",IDC_CONFIRM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,189,174,10 + + LTEXT "Only set if current status is",IDC_STATIC,191,42,106,8 + CONTROL "",IDC_STATUSLIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP,191,52,107,146 END IDD_CMDLOPTIONS DIALOGEX 0, 0, 315, 82 @@ -415,11 +423,7 @@ BEGIN IDD_OPT_AUTOAWAY, DIALOG BEGIN - VERTGUIDE, 9 - VERTGUIDE, 16 - VERTGUIDE, 171 - VERTGUIDE, 177 - VERTGUIDE, 277 + VERTGUIDE, 182 END IDD_PUOPT_KEEPSTATUS, DIALOG diff --git a/plugins/StatusManager/src/AdvancedAutoAway/aaa_options.cpp b/plugins/StatusManager/src/AdvancedAutoAway/aaa_options.cpp index c2ad74929f..bd96bccb30 100644 --- a/plugins/StatusManager/src/AdvancedAutoAway/aaa_options.cpp +++ b/plugins/StatusManager/src/AdvancedAutoAway/aaa_options.cpp @@ -49,14 +49,19 @@ static int WriteAutoAwaySetting(SMProto &autoAwaySetting, char *protoName) static void SetDialogItems(HWND hwndDlg, SMProto *setting) { - bool bIsTimed = (setting->optionFlags & FLAG_ONMOUSE) != 0; bool bSetNA = (setting->optionFlags & FLAG_SETNA) != 0; + + bool bIsTimed = (setting->optionFlags & FLAG_ONMOUSE) != 0; bool bSaver = (setting->optionFlags & FLAG_ONSAVER) != 0; bool bFullScr = (setting->optionFlags & FLAG_FULLSCREEN) != 0; + bool bOnLock = (setting->optionFlags & FLAG_ONLOCK) != 0; + bool bOnTS = (setting->optionFlags & FLAG_ONTS) != 0; + bool bAnyOption = bIsTimed | bSaver | bFullScr | bOnLock | bOnTS; 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_ONTSDISCONNECT, bOnTS ? 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); @@ -72,14 +77,17 @@ static void SetDialogItems(HWND hwndDlg, SMProto *setting) 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_LV1STATUS), bAnyOption); + EnableWindow(GetDlgItem(hwndDlg, IDC_STATUSLIST), bAnyOption); + EnableWindow(GetDlgItem(hwndDlg, IDC_RESETSTATUS), bAnyOption && IsDlgButtonChecked(hwndDlg, IDC_LV2ONINACTIVE)); + EnableWindow(GetDlgItem(hwndDlg, IDC_CONFIRM), bAnyOption && 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); } @@ -248,6 +256,11 @@ static INT_PTR CALLBACK DlgProcAutoAwayRulesOpts(HWND hwndDlg, UINT msg, WPARAM SetDialogItems(hwndDlg, setting); break; + case IDC_ONTSDISCONNECT: + setting->optionFlags ^= FLAG_ONTS; + SetDialogItems(hwndDlg, setting); + break; + case IDC_TIMED: setting->optionFlags ^= FLAG_ONMOUSE; SetDialogItems(hwndDlg, setting); diff --git a/plugins/StatusManager/src/AdvancedAutoAway/advancedautoaway.cpp b/plugins/StatusManager/src/AdvancedAutoAway/advancedautoaway.cpp index ae7c2bd791..734d50ffdb 100644 --- a/plugins/StatusManager/src/AdvancedAutoAway/advancedautoaway.cpp +++ b/plugins/StatusManager/src/AdvancedAutoAway/advancedautoaway.cpp @@ -228,6 +228,8 @@ static VOID CALLBACK AutoAwayTimer(HWND, UINT, UINT_PTR, DWORD) bTrigger |= IsScreenSaverRunning(); if (it->optionFlags & FLAG_ONLOCK) bTrigger |= IsWorkstationLocked(); + if (it->optionFlags & FLAG_ONTS) + bTrigger |= IsTerminalDisconnected(); if (it->optionFlags & FLAG_FULLSCREEN) bTrigger |= IsFullScreen(); diff --git a/plugins/StatusManager/src/commonstatus.h b/plugins/StatusManager/src/commonstatus.h index 1577f6a5a7..fe80354d9c 100644 --- a/plugins/StatusManager/src/commonstatus.h +++ b/plugins/StatusManager/src/commonstatus.h @@ -88,6 +88,7 @@ bool IsSuitableProto(PROTOACCOUNT *pa); #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 +#define FLAG_ONTS 0x0200 // db: on terminal session disconnect typedef enum { diff --git a/plugins/StatusManager/src/resource.h b/plugins/StatusManager/src/resource.h index 05d5dda364..d3701f8c2f 100644 --- a/plugins/StatusManager/src/resource.h +++ b/plugins/StatusManager/src/resource.h @@ -1,6 +1,6 @@ //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. -// Used by E:\Projects\C++\miranda-ng\plugins\StatusManager\res\resource.rc +// Used by w:\miranda-ng\plugins\StatusManager\res\resource.rc // #define IDD_OPT_KS_BASIC 101 #define IDD_CONFIRMDIALOG 102 @@ -64,17 +64,18 @@ #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_DEFAULTCOLORS 1054 +#define IDC_ONLOCK 1055 +#define IDC_LOGINERR 1056 +#define IDC_ONTSDISCONNECT 1057 +#define IDC_LV2ONINACTIVE 1058 +#define IDC_CNCOTHERLOC 1059 +#define IDC_PUCONNLOST 1060 +#define IDC_DLGTIMEOUT 1061 +#define IDC_AWAYCHECKTIMEINSECS 1062 #define IDC_STSMSG 1063 -#define IDC_PINGHOST 1063 -#define IDC_CONFIRMDELAY 1064 +#define IDC_PINGHOST 1064 +#define IDC_CONFIRMDELAY 1065 #define IDC_PROTOCOLLIST 1066 #define IDC_LCANCEL 1068 #define IDC_RNOTHING 1069 diff --git a/plugins/StatusManager/src/version.h b/plugins/StatusManager/src/version.h index 0ca0207b67..307a57bb4a 100644 --- a/plugins/StatusManager/src/version.h +++ b/plugins/StatusManager/src/version.h @@ -2,7 +2,7 @@ #define __MAJOR_VERSION 1 #define __MINOR_VERSION 2 #define __RELEASE_NUM 0 -#define __BUILD_NUM 1 +#define __BUILD_NUM 2 // other stuff for Version resource #include <stdver.h> |