mirror of
https://github.com/2dust/v2rayN.git
synced 2025-07-02 04:52:09 +00:00
Tun mode can be auto turned on at startup
This commit is contained in:
parent
373d89874c
commit
3575e69b43
4 changed files with 9 additions and 6 deletions
|
@ -143,8 +143,6 @@
|
||||||
|
|
||||||
public int trayMenuServersLimit { get; set; } = 20;
|
public int trayMenuServersLimit { get; set; } = 20;
|
||||||
|
|
||||||
public bool autoHideStartup { get; set; }
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region other entities
|
#region other entities
|
||||||
|
|
|
@ -65,6 +65,7 @@ namespace v2rayN.Mode
|
||||||
public string currentFontFamily { get; set; }
|
public string currentFontFamily { get; set; }
|
||||||
public bool enableDragDropSort { get; set; }
|
public bool enableDragDropSort { get; set; }
|
||||||
public bool doubleClick2Activate { get; set; }
|
public bool doubleClick2Activate { get; set; }
|
||||||
|
public bool autoHideStartup { get; set; } = true;
|
||||||
public Dictionary<string, int> mainLvColWidth { get; set; }
|
public Dictionary<string, int> mainLvColWidth { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -212,6 +212,10 @@ namespace v2rayN.ViewModels
|
||||||
SelectedMoveToGroup = new();
|
SelectedMoveToGroup = new();
|
||||||
SelectedRouting = new();
|
SelectedRouting = new();
|
||||||
SelectedServer = new();
|
SelectedServer = new();
|
||||||
|
if (_config.tunModeItem.enableTun && Utils.IsAdministrator())
|
||||||
|
{
|
||||||
|
EnableTun = true;
|
||||||
|
}
|
||||||
|
|
||||||
//RefreshServers();
|
//RefreshServers();
|
||||||
InitSubscriptionView();
|
InitSubscriptionView();
|
||||||
|
@ -255,7 +259,7 @@ namespace v2rayN.ViewModels
|
||||||
x => x.EnableTun,
|
x => x.EnableTun,
|
||||||
y => y == true)
|
y => y == true)
|
||||||
.Subscribe(c => DoEnableTun(c));
|
.Subscribe(c => DoEnableTun(c));
|
||||||
|
|
||||||
BindingUI();
|
BindingUI();
|
||||||
RestoreUI();
|
RestoreUI();
|
||||||
AutoHideStartup();
|
AutoHideStartup();
|
||||||
|
@ -1679,7 +1683,7 @@ namespace v2rayN.ViewModels
|
||||||
|
|
||||||
private void AutoHideStartup()
|
private void AutoHideStartup()
|
||||||
{
|
{
|
||||||
if (_config.autoHideStartup)
|
if (_config.uiItem.autoHideStartup)
|
||||||
{
|
{
|
||||||
Observable.Range(1, 1)
|
Observable.Range(1, 1)
|
||||||
.Delay(TimeSpan.FromSeconds(1))
|
.Delay(TimeSpan.FromSeconds(1))
|
||||||
|
|
|
@ -141,7 +141,7 @@ namespace v2rayN.ViewModels
|
||||||
IgnoreGeoUpdateCore = _config.ignoreGeoUpdateCore;
|
IgnoreGeoUpdateCore = _config.ignoreGeoUpdateCore;
|
||||||
EnableAutoAdjustMainLvColWidth = _config.uiItem.enableAutoAdjustMainLvColWidth;
|
EnableAutoAdjustMainLvColWidth = _config.uiItem.enableAutoAdjustMainLvColWidth;
|
||||||
EnableSecurityProtocolTls13 = _config.enableSecurityProtocolTls13;
|
EnableSecurityProtocolTls13 = _config.enableSecurityProtocolTls13;
|
||||||
AutoHideStartup = _config.autoHideStartup;
|
AutoHideStartup = _config.uiItem.autoHideStartup;
|
||||||
EnableCheckPreReleaseUpdate = _config.checkPreReleaseUpdate;
|
EnableCheckPreReleaseUpdate = _config.checkPreReleaseUpdate;
|
||||||
EnableDragDropSort = _config.uiItem.enableDragDropSort;
|
EnableDragDropSort = _config.uiItem.enableDragDropSort;
|
||||||
DoubleClick2Activate = _config.uiItem.doubleClick2Activate;
|
DoubleClick2Activate = _config.uiItem.doubleClick2Activate;
|
||||||
|
@ -309,7 +309,7 @@ namespace v2rayN.ViewModels
|
||||||
_config.ignoreGeoUpdateCore = IgnoreGeoUpdateCore;
|
_config.ignoreGeoUpdateCore = IgnoreGeoUpdateCore;
|
||||||
_config.uiItem.enableAutoAdjustMainLvColWidth = EnableAutoAdjustMainLvColWidth;
|
_config.uiItem.enableAutoAdjustMainLvColWidth = EnableAutoAdjustMainLvColWidth;
|
||||||
_config.enableSecurityProtocolTls13 = EnableSecurityProtocolTls13;
|
_config.enableSecurityProtocolTls13 = EnableSecurityProtocolTls13;
|
||||||
_config.autoHideStartup = AutoHideStartup;
|
_config.uiItem.autoHideStartup = AutoHideStartup;
|
||||||
_config.autoUpdateInterval = autoUpdateInterval;
|
_config.autoUpdateInterval = autoUpdateInterval;
|
||||||
_config.autoUpdateSubInterval = autoUpdateSubInterval;
|
_config.autoUpdateSubInterval = autoUpdateSubInterval;
|
||||||
_config.checkPreReleaseUpdate = EnableCheckPreReleaseUpdate;
|
_config.checkPreReleaseUpdate = EnableCheckPreReleaseUpdate;
|
||||||
|
|
Loading…
Reference in a new issue