mirror of
https://github.com/2dust/v2rayN.git
synced 2025-10-13 20:09:12 +00:00
Compare commits
No commits in common. "4d2eb324f1d3c48abd7a20720d175266f0820a19" and "fd8f863c5bf7aab1f915c98416d33dae3f26ca42" have entirely different histories.
4d2eb324f1
...
fd8f863c5b
11 changed files with 69 additions and 68 deletions
|
@ -46,13 +46,11 @@
|
|||
|
||||
public bool InitApp()
|
||||
{
|
||||
Logging.Setup();
|
||||
var config = ConfigHandler.LoadConfig();
|
||||
if (config == null)
|
||||
_config = ConfigHandler.LoadConfig();
|
||||
if (_config == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
_config = config;
|
||||
Thread.CurrentThread.CurrentUICulture = new(_config.UiItem.CurrentLanguage);
|
||||
|
||||
//Under Win10
|
||||
|
@ -72,9 +70,10 @@
|
|||
|
||||
public bool InitComponents()
|
||||
{
|
||||
Logging.Setup();
|
||||
Logging.LoggingEnabled(_config.GuiItem.EnableLog);
|
||||
Logging.SaveLog($"v2rayN start up | {Utils.GetVersion()} | {Utils.GetExePath()}");
|
||||
Logging.SaveLog($"{Environment.OSVersion} - {(Environment.Is64BitOperatingSystem ? 64 : 32)}");
|
||||
Logging.LoggingEnabled(_config.GuiItem.EnableLog);
|
||||
Logging.ClearLogs();
|
||||
|
||||
return true;
|
||||
|
|
|
@ -41,34 +41,7 @@ namespace v2rayN.Desktop.Views
|
|||
ViewModel = new MainWindowViewModel(UpdateViewHandler);
|
||||
Locator.CurrentMutable.RegisterLazySingleton(() => ViewModel, typeof(MainWindowViewModel));
|
||||
|
||||
switch (_config.UiItem.MainGirdOrientation)
|
||||
{
|
||||
case EGirdOrientation.Horizontal:
|
||||
tabProfiles.Content ??= new ProfilesView(this);
|
||||
tabMsgView.Content ??= new MsgView();
|
||||
tabClashProxies.Content ??= new ClashProxiesView();
|
||||
tabClashConnections.Content ??= new ClashConnectionsView();
|
||||
gridMain.IsVisible = true;
|
||||
break;
|
||||
|
||||
case EGirdOrientation.Vertical:
|
||||
tabProfiles1.Content ??= new ProfilesView(this);
|
||||
tabMsgView1.Content ??= new MsgView();
|
||||
tabClashProxies1.Content ??= new ClashProxiesView();
|
||||
tabClashConnections1.Content ??= new ClashConnectionsView();
|
||||
gridMain1.IsVisible = true;
|
||||
break;
|
||||
|
||||
case EGirdOrientation.Tab:
|
||||
default:
|
||||
tabProfiles2.Content ??= new ProfilesView(this);
|
||||
tabMsgView2.Content ??= new MsgView();
|
||||
tabClashProxies2.Content ??= new ClashProxiesView();
|
||||
tabClashConnections2.Content ??= new ClashConnectionsView();
|
||||
gridMain2.IsVisible = true;
|
||||
break;
|
||||
}
|
||||
conTheme.Content ??= new ThemeSettingView();
|
||||
//WindowsHandler.Instance.RegisterGlobalHotkey(_config, OnHotkeyHandler, null);
|
||||
|
||||
this.WhenActivated(disposables =>
|
||||
{
|
||||
|
@ -111,6 +84,7 @@ namespace v2rayN.Desktop.Views
|
|||
switch (_config.UiItem.MainGirdOrientation)
|
||||
{
|
||||
case EGirdOrientation.Horizontal:
|
||||
gridMain.IsVisible = true;
|
||||
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabMsgView.IsVisible).DisposeWith(disposables);
|
||||
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashProxies.IsVisible).DisposeWith(disposables);
|
||||
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashConnections.IsVisible).DisposeWith(disposables);
|
||||
|
@ -118,6 +92,7 @@ namespace v2rayN.Desktop.Views
|
|||
break;
|
||||
|
||||
case EGirdOrientation.Vertical:
|
||||
gridMain1.IsVisible = true;
|
||||
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabMsgView1.IsVisible).DisposeWith(disposables);
|
||||
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashProxies1.IsVisible).DisposeWith(disposables);
|
||||
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashConnections1.IsVisible).DisposeWith(disposables);
|
||||
|
@ -126,6 +101,7 @@ namespace v2rayN.Desktop.Views
|
|||
|
||||
case EGirdOrientation.Tab:
|
||||
default:
|
||||
gridMain2.IsVisible = true;
|
||||
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashProxies2.IsVisible).DisposeWith(disposables);
|
||||
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashConnections2.IsVisible).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.TabMainSelectedIndex, v => v.tabMain2.SelectedIndex).DisposeWith(disposables);
|
||||
|
@ -152,10 +128,35 @@ namespace v2rayN.Desktop.Views
|
|||
menuGlobalHotkeySetting.IsVisible = false;
|
||||
}
|
||||
menuAddServerViaScan.IsVisible = false;
|
||||
|
||||
|
||||
switch (_config.UiItem.MainGirdOrientation)
|
||||
{
|
||||
case EGirdOrientation.Horizontal:
|
||||
tabProfiles.Content ??= new ProfilesView(this);
|
||||
tabMsgView.Content ??= new MsgView();
|
||||
tabClashProxies.Content ??= new ClashProxiesView();
|
||||
tabClashConnections.Content ??= new ClashConnectionsView();
|
||||
break;
|
||||
|
||||
case EGirdOrientation.Vertical:
|
||||
tabProfiles1.Content ??= new ProfilesView(this);
|
||||
tabMsgView1.Content ??= new MsgView();
|
||||
tabClashProxies1.Content ??= new ClashProxiesView();
|
||||
tabClashConnections1.Content ??= new ClashConnectionsView();
|
||||
break;
|
||||
|
||||
case EGirdOrientation.Tab:
|
||||
default:
|
||||
tabProfiles2.Content ??= new ProfilesView(this);
|
||||
tabMsgView2.Content ??= new MsgView();
|
||||
tabClashProxies2.Content ??= new ClashProxiesView();
|
||||
tabClashConnections2.Content ??= new ClashConnectionsView();
|
||||
break;
|
||||
}
|
||||
conTheme.Content ??= new ThemeSettingView();
|
||||
|
||||
RestoreUI();
|
||||
AddHelpMenuItem();
|
||||
//WindowsHandler.Instance.RegisterGlobalHotkey(_config, OnHotkeyHandler, null);
|
||||
}
|
||||
|
||||
#region Event
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
|
||||
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
|
||||
Title="{x:Static resx:ResUI.menuRoutingRuleSetting}"
|
||||
Width="1000"
|
||||
Width="960"
|
||||
Height="700"
|
||||
x:DataType="vms:RoutingRuleSettingViewModel"
|
||||
ShowInTaskbar="False"
|
||||
|
@ -237,11 +237,11 @@
|
|||
Binding="{Binding Network}"
|
||||
Header="network" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Width="200"
|
||||
Binding="{Binding Domains}"
|
||||
Header="domain" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Width="200"
|
||||
Binding="{Binding Ips}"
|
||||
Header="ip" />
|
||||
</DataGrid.Columns>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
|
||||
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
|
||||
Title="{x:Static resx:ResUI.menuRoutingSetting}"
|
||||
Width="1000"
|
||||
Width="990"
|
||||
Height="700"
|
||||
x:DataType="vms:RoutingSettingViewModel"
|
||||
ShowInTaskbar="False"
|
||||
|
@ -109,7 +109,7 @@
|
|||
<DataGrid.Columns>
|
||||
<DataGridCheckBoxColumn Width="40" Binding="{Binding IsActive}" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Width="250"
|
||||
Binding="{Binding Remarks}"
|
||||
Header="{x:Static resx:ResUI.LvRemarks}" />
|
||||
<DataGridTextColumn
|
||||
|
@ -121,7 +121,7 @@
|
|||
Binding="{Binding Sort}"
|
||||
Header="{x:Static resx:ResUI.LvSort}" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Width="300"
|
||||
Binding="{Binding Url}"
|
||||
Header="{x:Static resx:ResUI.LvUrl}" />
|
||||
<DataGridTextColumn
|
||||
|
|
|
@ -8,7 +8,9 @@
|
|||
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
|
||||
Title="{x:Static resx:ResUI.menuSubSetting}"
|
||||
Width="700"
|
||||
Height="650"
|
||||
Height="600"
|
||||
d:DesignHeight="600"
|
||||
d:DesignWidth="800"
|
||||
ShowInTaskbar="False"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
|
|
|
@ -8,8 +8,10 @@
|
|||
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
|
||||
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
|
||||
Title="{x:Static resx:ResUI.menuSubSetting}"
|
||||
Width="1000"
|
||||
Height="700"
|
||||
Width="800"
|
||||
Height="600"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
x:DataType="vms:SubSettingViewModel"
|
||||
ShowInTaskbar="False"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
|
@ -47,7 +49,7 @@
|
|||
</DataGrid.KeyBindings>
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Width="120"
|
||||
Binding="{Binding Remarks}"
|
||||
Header="{x:Static resx:ResUI.LvRemarks}" />
|
||||
<DataGridTextColumn
|
||||
|
|
|
@ -40,6 +40,7 @@ namespace v2rayN.Views
|
|||
ViewModel = new MainWindowViewModel(UpdateViewHandler);
|
||||
Locator.CurrentMutable.RegisterLazySingleton(() => ViewModel, typeof(MainWindowViewModel));
|
||||
|
||||
WindowsHandler.Instance.RegisterGlobalHotkey(_config, OnHotkeyHandler, null);
|
||||
switch (_config.UiItem.MainGirdOrientation)
|
||||
{
|
||||
case EGirdOrientation.Horizontal:
|
||||
|
@ -47,7 +48,6 @@ namespace v2rayN.Views
|
|||
tabMsgView.Content ??= new MsgView();
|
||||
tabClashProxies.Content ??= new ClashProxiesView();
|
||||
tabClashConnections.Content ??= new ClashConnectionsView();
|
||||
gridMain.Visibility = Visibility.Visible;
|
||||
break;
|
||||
|
||||
case EGirdOrientation.Vertical:
|
||||
|
@ -55,7 +55,6 @@ namespace v2rayN.Views
|
|||
tabMsgView1.Content ??= new MsgView();
|
||||
tabClashProxies1.Content ??= new ClashProxiesView();
|
||||
tabClashConnections1.Content ??= new ClashConnectionsView();
|
||||
gridMain1.Visibility = Visibility.Visible;
|
||||
break;
|
||||
|
||||
case EGirdOrientation.Tab:
|
||||
|
@ -64,7 +63,6 @@ namespace v2rayN.Views
|
|||
tabMsgView2.Content ??= new MsgView();
|
||||
tabClashProxies2.Content ??= new ClashProxiesView();
|
||||
tabClashConnections2.Content ??= new ClashConnectionsView();
|
||||
gridMain2.Visibility = Visibility.Visible;
|
||||
break;
|
||||
}
|
||||
pbTheme.Content ??= new ThemeSettingView();
|
||||
|
@ -110,6 +108,7 @@ namespace v2rayN.Views
|
|||
switch (_config.UiItem.MainGirdOrientation)
|
||||
{
|
||||
case EGirdOrientation.Horizontal:
|
||||
gridMain.Visibility = Visibility.Visible;
|
||||
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabMsgView.Visibility).DisposeWith(disposables);
|
||||
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashProxies.Visibility).DisposeWith(disposables);
|
||||
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashConnections.Visibility).DisposeWith(disposables);
|
||||
|
@ -117,6 +116,7 @@ namespace v2rayN.Views
|
|||
break;
|
||||
|
||||
case EGirdOrientation.Vertical:
|
||||
gridMain1.Visibility = Visibility.Visible;
|
||||
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabMsgView1.Visibility).DisposeWith(disposables);
|
||||
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashProxies1.Visibility).DisposeWith(disposables);
|
||||
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashConnections1.Visibility).DisposeWith(disposables);
|
||||
|
@ -125,6 +125,7 @@ namespace v2rayN.Views
|
|||
|
||||
case EGirdOrientation.Tab:
|
||||
default:
|
||||
gridMain2.Visibility = Visibility.Visible;
|
||||
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashProxies2.Visibility).DisposeWith(disposables);
|
||||
this.OneWayBind(ViewModel, vm => vm.ShowClashUI, v => v.tabClashConnections2.Visibility).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.TabMainSelectedIndex, v => v.tabMain2.SelectedIndex).DisposeWith(disposables);
|
||||
|
@ -141,7 +142,6 @@ namespace v2rayN.Views
|
|||
|
||||
RestoreUI();
|
||||
AddHelpMenuItem();
|
||||
WindowsHandler.Instance.RegisterGlobalHotkey(_config, OnHotkeyHandler, null);
|
||||
}
|
||||
|
||||
#region Event
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
<reactiveui:ReactiveWindow
|
||||
x:Class="v2rayN.Views.RoutingRuleSettingWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:reactiveui="http://reactiveui.net"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
|
||||
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
|
||||
Title="{x:Static resx:ResUI.menuRoutingRuleSetting}"
|
||||
Width="1000"
|
||||
Width="960"
|
||||
Height="700"
|
||||
x:TypeArguments="vms:RoutingRuleSettingViewModel"
|
||||
ResizeMode="CanResize"
|
||||
ShowInTaskbar="False"
|
||||
Style="{StaticResource WindowGlobal}"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
|
@ -322,11 +321,11 @@
|
|||
Binding="{Binding Network}"
|
||||
Header="network" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Width="200"
|
||||
Binding="{Binding Domains}"
|
||||
Header="domain" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Width="200"
|
||||
Binding="{Binding Ips}"
|
||||
Header="ip" />
|
||||
</DataGrid.Columns>
|
||||
|
|
|
@ -9,10 +9,9 @@
|
|||
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
|
||||
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
|
||||
Title="{x:Static resx:ResUI.menuRoutingSetting}"
|
||||
Width="1000"
|
||||
Width="990"
|
||||
Height="700"
|
||||
x:TypeArguments="vms:RoutingSettingViewModel"
|
||||
ResizeMode="CanResize"
|
||||
ShowInTaskbar="False"
|
||||
Style="{StaticResource WindowGlobal}"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
|
@ -175,7 +174,7 @@
|
|||
</DataGrid.Resources>
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Width="250"
|
||||
Binding="{Binding Remarks}"
|
||||
Header="{x:Static resx:ResUI.LvRemarks}" />
|
||||
<DataGridTextColumn
|
||||
|
@ -187,7 +186,7 @@
|
|||
Binding="{Binding Sort}"
|
||||
Header="{x:Static resx:ResUI.LvSort}" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Width="300"
|
||||
Binding="{Binding Url}"
|
||||
Header="{x:Static resx:ResUI.LvUrl}" />
|
||||
<DataGridTextColumn
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
<reactiveui:ReactiveWindow
|
||||
x:Class="v2rayN.Views.SubEditWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:reactiveui="http://reactiveui.net"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
|
||||
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
|
||||
Title="{x:Static resx:ResUI.menuSubSetting}"
|
||||
Width="700"
|
||||
Height="650"
|
||||
Height="600"
|
||||
x:TypeArguments="vms:SubEditViewModel"
|
||||
ShowInTaskbar="False"
|
||||
Style="{StaticResource WindowGlobal}"
|
||||
|
|
|
@ -9,10 +9,9 @@
|
|||
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
|
||||
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
|
||||
Title="{x:Static resx:ResUI.menuSubSetting}"
|
||||
Width="1000"
|
||||
Height="700"
|
||||
Width="800"
|
||||
Height="600"
|
||||
x:TypeArguments="vms:SubSettingViewModel"
|
||||
ResizeMode="CanResize"
|
||||
ShowInTaskbar="False"
|
||||
Style="{StaticResource WindowGlobal}"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
|
@ -93,7 +92,7 @@
|
|||
Style="{StaticResource DefDataGrid}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Width="120"
|
||||
Binding="{Binding Remarks}"
|
||||
Header="{x:Static resx:ResUI.LvRemarks}" />
|
||||
<DataGridTextColumn
|
||||
|
|
Loading…
Reference in a new issue