mirror of https://github.com/2dust/v2rayN
Add double-click server as active parameter
parent
fcbc9471aa
commit
d6db4f0e4c
|
@ -63,6 +63,7 @@ namespace v2rayN.Mode
|
|||
public string? colorPrimaryName { get; set; }
|
||||
public string currentLanguage { get; set; }
|
||||
public bool enableDragDropSort { get; set; }
|
||||
public bool doubleClick2Activate { get; set; }
|
||||
public Dictionary<string, int> mainLvColWidth { get; set; }
|
||||
}
|
||||
|
||||
|
|
|
@ -2401,6 +2401,15 @@ namespace v2rayN.Resx {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Double-click server make active 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string TbSettingsDoubleClick2Activate {
|
||||
get {
|
||||
return ResourceManager.GetString("TbSettingsDoubleClick2Activate", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Automatically adjust column width after updating subscription 的本地化字符串。
|
||||
/// </summary>
|
||||
|
|
|
@ -1078,4 +1078,7 @@
|
|||
<data name="menuEditServer" xml:space="preserve">
|
||||
<value>Edit Server (Ctrl+D)</value>
|
||||
</data>
|
||||
<data name="TbSettingsDoubleClick2Activate" xml:space="preserve">
|
||||
<value>Double-click server make active</value>
|
||||
</data>
|
||||
</root>
|
|
@ -1078,4 +1078,7 @@
|
|||
<data name="menuEditServer" xml:space="preserve">
|
||||
<value>编辑服务器 (Ctrl+D)</value>
|
||||
</data>
|
||||
<data name="TbSettingsDoubleClick2Activate" xml:space="preserve">
|
||||
<value>主界面双击设为活动服务器</value>
|
||||
</data>
|
||||
</root>
|
|
@ -560,7 +560,16 @@ namespace v2rayN.ViewModels
|
|||
item.totalDown = Utils.HumanFy(update.totalDown);
|
||||
item.totalUp = Utils.HumanFy(update.totalUp);
|
||||
|
||||
_profileItems.Replace(item, Utils.DeepCopy(item));
|
||||
if (SelectedProfile?.indexId == item.indexId)
|
||||
{
|
||||
var temp = Utils.DeepCopy(item);
|
||||
_profileItems.Replace(item, temp);
|
||||
SelectedProfile = temp;
|
||||
}
|
||||
else
|
||||
{
|
||||
_profileItems.Replace(item, Utils.DeepCopy(item));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -727,7 +736,15 @@ namespace v2rayN.ViewModels
|
|||
_profileItems.AddRange(lstModel);
|
||||
if (lstModel.Count > 0)
|
||||
{
|
||||
SelectedProfile = lstModel[0];
|
||||
var selected = lstModel.FirstOrDefault(t => t.indexId == _config.indexId);
|
||||
if (selected != null)
|
||||
{
|
||||
SelectedProfile = selected;
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectedProfile = lstModel[0];
|
||||
}
|
||||
}
|
||||
|
||||
RefreshServersMenu();
|
||||
|
@ -918,7 +935,7 @@ namespace v2rayN.ViewModels
|
|||
|
||||
public void SetDefaultServer()
|
||||
{
|
||||
if (Utils.IsNullOrEmpty(SelectedProfile.indexId))
|
||||
if (Utils.IsNullOrEmpty(SelectedProfile?.indexId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -56,6 +56,7 @@ namespace v2rayN.ViewModels
|
|||
[Reactive] public bool AutoHideStartup { get; set; }
|
||||
[Reactive] public bool EnableCheckPreReleaseUpdate { get; set; }
|
||||
[Reactive] public bool EnableDragDropSort { get; set; }
|
||||
[Reactive] public bool DoubleClick2Activate { get; set; }
|
||||
[Reactive] public int autoUpdateInterval { get; set; }
|
||||
[Reactive] public int autoUpdateSubInterval { get; set; }
|
||||
[Reactive] public int trayMenuServersLimit { get; set; }
|
||||
|
@ -137,6 +138,7 @@ namespace v2rayN.ViewModels
|
|||
AutoHideStartup = _config.autoHideStartup;
|
||||
EnableCheckPreReleaseUpdate = _config.checkPreReleaseUpdate;
|
||||
EnableDragDropSort = _config.uiItem.enableDragDropSort;
|
||||
DoubleClick2Activate = _config.uiItem.doubleClick2Activate;
|
||||
autoUpdateInterval = _config.autoUpdateInterval;
|
||||
autoUpdateSubInterval = _config.autoUpdateSubInterval;
|
||||
trayMenuServersLimit = _config.trayMenuServersLimit;
|
||||
|
@ -302,6 +304,7 @@ namespace v2rayN.ViewModels
|
|||
_config.autoUpdateSubInterval = autoUpdateSubInterval;
|
||||
_config.checkPreReleaseUpdate = EnableCheckPreReleaseUpdate;
|
||||
_config.uiItem.enableDragDropSort = EnableDragDropSort;
|
||||
_config.uiItem.doubleClick2Activate = DoubleClick2Activate;
|
||||
_config.trayMenuServersLimit = trayMenuServersLimit;
|
||||
|
||||
//systemProxy
|
||||
|
|
|
@ -241,7 +241,14 @@ namespace v2rayN.Views
|
|||
|
||||
private void LstProfiles_MouseDoubleClick(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
ViewModel?.EditServer(false, EConfigType.Custom);
|
||||
if (_config.uiItem.doubleClick2Activate)
|
||||
{
|
||||
ViewModel?.SetDefaultServer();
|
||||
}
|
||||
else
|
||||
{
|
||||
ViewModel?.EditServer(false, EConfigType.Custom);
|
||||
}
|
||||
}
|
||||
|
||||
private void LstProfiles_ColumnHeader_Click(object sender, RoutedEventArgs e)
|
||||
|
|
|
@ -419,6 +419,7 @@
|
|||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
|
@ -571,16 +572,30 @@
|
|||
Margin="{StaticResource SettingItemMargin}"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource ToolbarTextBlock}"
|
||||
Text="{x:Static resx:ResUI.TbSettingsDoubleClick2Activate}" />
|
||||
<ToggleButton
|
||||
x:Name="togDoubleClick2Activate"
|
||||
Grid.Row="11"
|
||||
Grid.Column="1"
|
||||
Margin="{StaticResource SettingItemMargin}"
|
||||
HorizontalAlignment="Left" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="12"
|
||||
Grid.Column="0"
|
||||
Margin="{StaticResource SettingItemMargin}"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource ToolbarTextBlock}"
|
||||
Text="{x:Static resx:ResUI.TbSettingsAutoUpdateInterval}" />
|
||||
<TextBox
|
||||
x:Name="txtautoUpdateInterval"
|
||||
Grid.Row="11"
|
||||
Grid.Row="12"
|
||||
Grid.Column="1"
|
||||
Width="200"
|
||||
Margin="{StaticResource SettingItemMargin}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="12"
|
||||
Grid.Row="13"
|
||||
Grid.Column="0"
|
||||
Margin="{StaticResource SettingItemMargin}"
|
||||
VerticalAlignment="Center"
|
||||
|
@ -588,13 +603,13 @@
|
|||
Text="{x:Static resx:ResUI.TbSettingsAutoUpdate}" />
|
||||
<TextBox
|
||||
x:Name="txtautoUpdateSubInterval"
|
||||
Grid.Row="12"
|
||||
Grid.Row="13"
|
||||
Grid.Column="1"
|
||||
Width="200"
|
||||
Margin="{StaticResource SettingItemMargin}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="13"
|
||||
Grid.Row="14"
|
||||
Grid.Column="0"
|
||||
Margin="{StaticResource SettingItemMargin}"
|
||||
VerticalAlignment="Center"
|
||||
|
@ -602,7 +617,7 @@
|
|||
Text="{x:Static resx:ResUI.TbSettingsTrayMenuServersLimit}" />
|
||||
<TextBox
|
||||
x:Name="txttrayMenuServersLimit"
|
||||
Grid.Row="13"
|
||||
Grid.Row="14"
|
||||
Grid.Column="1"
|
||||
Width="200"
|
||||
Margin="{StaticResource SettingItemMargin}" />
|
||||
|
|
|
@ -88,6 +88,7 @@ namespace v2rayN.Views
|
|||
this.Bind(ViewModel, vm => vm.AutoHideStartup, v => v.togAutoHideStartup.IsChecked).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.EnableCheckPreReleaseUpdate, v => v.togEnableCheckPreReleaseUpdate.IsChecked).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.EnableDragDropSort, v => v.togEnableDragDropSort.IsChecked).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.DoubleClick2Activate, v => v.togDoubleClick2Activate.IsChecked).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.autoUpdateInterval, v => v.txtautoUpdateInterval.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.autoUpdateSubInterval, v => v.txtautoUpdateSubInterval.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.trayMenuServersLimit, v => v.txttrayMenuServersLimit.Text).DisposeWith(disposables);
|
||||
|
|
Loading…
Reference in New Issue