mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
RDP Minutes to Idle Timeout - Update 5
Incorrect values entered in the Minutes to Idle Timout setting will be corrected to fit in the range of 0-240, rather than be truncated.
This commit is contained in:
@@ -233,7 +233,14 @@ namespace mRemoteNG.Connection
|
||||
public virtual int RDPMinutesToIdleTimeout
|
||||
{
|
||||
get { return GetPropertyValue("RDPMinutesToIdleTimeout", _rdpMinutesToIdleTimeout); }
|
||||
set { SetField(ref _rdpMinutesToIdleTimeout, value, "RDPMinutesToIdleTimeout"); }
|
||||
set {
|
||||
if(value < 0) {
|
||||
value = 0;
|
||||
} else if(value > 240) {
|
||||
value = 240;
|
||||
}
|
||||
SetField(ref _rdpMinutesToIdleTimeout, value, "RDPMinutesToIdleTimeout");
|
||||
}
|
||||
}
|
||||
[LocalizedAttributes.LocalizedCategory("strCategoryProtocol", 3),
|
||||
LocalizedAttributes.LocalizedDisplayName("strPropertyNameRDPAlertIdleTimeout"),
|
||||
|
||||
@@ -132,20 +132,7 @@ namespace mRemoteNG.Connection.Protocol.RDP
|
||||
_rdpClient.FullScreenTitle = _connectionInfo.Name;
|
||||
|
||||
_alertOnIdleDisconnect = _connectionInfo.RDPAlertIdleTimeout;
|
||||
|
||||
// Set the timeout to the default (zero) if it is out of bounds.
|
||||
if (_connectionInfo.RDPMinutesToIdleTimeout < 0)
|
||||
{
|
||||
_rdpClient.AdvancedSettings2.MinutesToIdleTimeout = Settings.Default.ConDefaultRDPMinutesToIdleTimeout;
|
||||
} // Set the timeout to the max (240) if it is out of bounds.
|
||||
else if (_connectionInfo.RDPMinutesToIdleTimeout > 240)
|
||||
{
|
||||
_rdpClient.AdvancedSettings2.MinutesToIdleTimeout = 240;
|
||||
}
|
||||
else
|
||||
{
|
||||
_rdpClient.AdvancedSettings2.MinutesToIdleTimeout = _connectionInfo.RDPMinutesToIdleTimeout;
|
||||
}
|
||||
_rdpClient.AdvancedSettings2.MinutesToIdleTimeout = _connectionInfo.RDPMinutesToIdleTimeout;
|
||||
|
||||
//not user changeable
|
||||
_rdpClient.AdvancedSettings2.GrabFocusOnConnect = true;
|
||||
|
||||
Reference in New Issue
Block a user