summaryrefslogtreecommitdiff
path: root/plugins/StatusManager/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-06-10 14:03:24 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-06-10 14:03:24 +0300
commit527c89ab4ce37f593a58c74675c44b829a0603c1 (patch)
treeb0d41f19d7e57d13315b327675a3342ffc9189b5 /plugins/StatusManager/src
parent5dcc5f9ff7be79500caacea1ca581981c3430f6a (diff)
AAA:
- added ability to react to terminal session disconnection; - options dialog rework; - version bump
Diffstat (limited to 'plugins/StatusManager/src')
-rw-r--r--plugins/StatusManager/src/AdvancedAutoAway/aaa_options.cpp23
-rw-r--r--plugins/StatusManager/src/AdvancedAutoAway/advancedautoaway.cpp2
-rw-r--r--plugins/StatusManager/src/commonstatus.h1
-rw-r--r--plugins/StatusManager/src/resource.h23
-rw-r--r--plugins/StatusManager/src/version.h2
5 files changed, 34 insertions, 17 deletions
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>