mirror of
https://github.com/2dust/v2rayN.git
synced 2025-10-27 18:42:52 +00:00
Compare commits
No commits in common. "c3e56e84f1b93bee4f99b632e0ab518536959531" and "d1e6898290566d2b6b6c11410c47390f06407358" have entirely different histories.
c3e56e84f1
...
d1e6898290
11 changed files with 15 additions and 44 deletions
2
.github/workflows/build-linux.yml
vendored
2
.github/workflows/build-linux.yml
vendored
|
|
@ -32,7 +32,7 @@ jobs:
|
||||||
fetch-depth: '0'
|
fetch-depth: '0'
|
||||||
|
|
||||||
- name: Setup
|
- name: Setup
|
||||||
uses: actions/setup-dotnet@v4.3.1
|
uses: actions/setup-dotnet@v4.3.0
|
||||||
with:
|
with:
|
||||||
dotnet-version: '8.0.x'
|
dotnet-version: '8.0.x'
|
||||||
|
|
||||||
|
|
|
||||||
2
.github/workflows/build-osx.yml
vendored
2
.github/workflows/build-osx.yml
vendored
|
|
@ -32,7 +32,7 @@ jobs:
|
||||||
fetch-depth: '0'
|
fetch-depth: '0'
|
||||||
|
|
||||||
- name: Setup
|
- name: Setup
|
||||||
uses: actions/setup-dotnet@v4.3.1
|
uses: actions/setup-dotnet@v4.3.0
|
||||||
with:
|
with:
|
||||||
dotnet-version: '8.0.x'
|
dotnet-version: '8.0.x'
|
||||||
|
|
||||||
|
|
|
||||||
2
.github/workflows/build-windows-desktop.yml
vendored
2
.github/workflows/build-windows-desktop.yml
vendored
|
|
@ -32,7 +32,7 @@ jobs:
|
||||||
fetch-depth: '0'
|
fetch-depth: '0'
|
||||||
|
|
||||||
- name: Setup
|
- name: Setup
|
||||||
uses: actions/setup-dotnet@v4.3.1
|
uses: actions/setup-dotnet@v4.3.0
|
||||||
with:
|
with:
|
||||||
dotnet-version: '8.0.x'
|
dotnet-version: '8.0.x'
|
||||||
|
|
||||||
|
|
|
||||||
2
.github/workflows/build-windows.yml
vendored
2
.github/workflows/build-windows.yml
vendored
|
|
@ -30,7 +30,7 @@ jobs:
|
||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v4.2.2
|
||||||
|
|
||||||
- name: Setup
|
- name: Setup
|
||||||
uses: actions/setup-dotnet@v4.3.1
|
uses: actions/setup-dotnet@v4.3.0
|
||||||
with:
|
with:
|
||||||
dotnet-version: '8.0.x'
|
dotnet-version: '8.0.x'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -63,10 +63,6 @@ public partial class App : Application
|
||||||
if (desktop.MainWindow != null)
|
if (desktop.MainWindow != null)
|
||||||
{
|
{
|
||||||
var clipboardData = await AvaUtils.GetClipboardData(desktop.MainWindow);
|
var clipboardData = await AvaUtils.GetClipboardData(desktop.MainWindow);
|
||||||
if (clipboardData.IsNullOrEmpty())
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var service = Locator.Current.GetService<MainWindowViewModel>();
|
var service = Locator.Current.GetService<MainWindowViewModel>();
|
||||||
if (service != null)
|
if (service != null)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,7 @@ namespace v2rayN.Desktop.Common
|
||||||
{
|
{
|
||||||
var clipboard = TopLevel.GetTopLevel(owner)?.Clipboard;
|
var clipboard = TopLevel.GetTopLevel(owner)?.Clipboard;
|
||||||
if (clipboard == null)
|
if (clipboard == null)
|
||||||
{
|
|
||||||
return null;
|
return null;
|
||||||
}
|
|
||||||
|
|
||||||
return await clipboard.GetTextAsync();
|
return await clipboard.GetTextAsync();
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
|
|
|
||||||
|
|
@ -247,7 +247,7 @@ namespace v2rayN.Desktop.Views
|
||||||
|
|
||||||
case EViewAction.AddServerViaClipboard:
|
case EViewAction.AddServerViaClipboard:
|
||||||
var clipboardData = await AvaUtils.GetClipboardData(this);
|
var clipboardData = await AvaUtils.GetClipboardData(this);
|
||||||
if (clipboardData.IsNotEmpty() && ViewModel != null)
|
if (ViewModel != null)
|
||||||
{
|
{
|
||||||
await ViewModel.AddServerViaClipboardAsync(clipboardData);
|
await ViewModel.AddServerViaClipboardAsync(clipboardData);
|
||||||
}
|
}
|
||||||
|
|
@ -315,7 +315,7 @@ namespace v2rayN.Desktop.Views
|
||||||
{
|
{
|
||||||
case Key.V:
|
case Key.V:
|
||||||
var clipboardData = await AvaUtils.GetClipboardData(this);
|
var clipboardData = await AvaUtils.GetClipboardData(this);
|
||||||
if (clipboardData.IsNotEmpty() && ViewModel != null)
|
if (ViewModel != null)
|
||||||
{
|
{
|
||||||
await ViewModel.AddServerViaClipboardAsync(clipboardData);
|
await ViewModel.AddServerViaClipboardAsync(clipboardData);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -109,20 +109,13 @@ namespace v2rayN.Desktop.Views
|
||||||
|
|
||||||
case EViewAction.SetClipboardData:
|
case EViewAction.SetClipboardData:
|
||||||
if (obj is null)
|
if (obj is null)
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
await AvaUtils.SetClipboardData(this, (string)obj);
|
await AvaUtils.SetClipboardData(this, (string)obj);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EViewAction.ImportRulesFromClipboard:
|
case EViewAction.ImportRulesFromClipboard:
|
||||||
var clipboardData = await AvaUtils.GetClipboardData(this);
|
var clipboardData = await AvaUtils.GetClipboardData(this);
|
||||||
if (clipboardData.IsNotEmpty())
|
ViewModel?.ImportRulesFromClipboardAsync(clipboardData);
|
||||||
{
|
|
||||||
ViewModel?.ImportRulesFromClipboardAsync(clipboardData);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,11 @@ namespace v2rayN
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static string? GetClipboardData()
|
public static string? GetClipboardData()
|
||||||
{
|
{
|
||||||
var strData = string.Empty;
|
string? strData = string.Empty;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var data = Clipboard.GetDataObject();
|
IDataObject data = Clipboard.GetDataObject();
|
||||||
if (data?.GetDataPresent(DataFormats.UnicodeText) == true)
|
if (data.GetDataPresent(DataFormats.UnicodeText))
|
||||||
{
|
{
|
||||||
strData = data.GetData(DataFormats.UnicodeText)?.ToString();
|
strData = data.GetData(DataFormats.UnicodeText)?.ToString();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -232,10 +232,7 @@ namespace v2rayN.Views
|
||||||
|
|
||||||
case EViewAction.AddServerViaClipboard:
|
case EViewAction.AddServerViaClipboard:
|
||||||
var clipboardData = WindowsUtils.GetClipboardData();
|
var clipboardData = WindowsUtils.GetClipboardData();
|
||||||
if (clipboardData.IsNotEmpty())
|
ViewModel?.AddServerViaClipboardAsync(clipboardData);
|
||||||
{
|
|
||||||
ViewModel?.AddServerViaClipboardAsync(clipboardData);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EViewAction.AdjustMainLvColWidth:
|
case EViewAction.AdjustMainLvColWidth:
|
||||||
|
|
@ -287,20 +284,11 @@ namespace v2rayN.Views
|
||||||
{
|
{
|
||||||
case Key.V:
|
case Key.V:
|
||||||
if (Keyboard.FocusedElement is TextBox)
|
if (Keyboard.FocusedElement is TextBox)
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
var clipboardData = WindowsUtils.GetClipboardData();
|
var clipboardData = WindowsUtils.GetClipboardData();
|
||||||
if (clipboardData.IsNotEmpty())
|
var service = Locator.Current.GetService<MainWindowViewModel>();
|
||||||
{
|
if (service != null)
|
||||||
var service = Locator.Current.GetService<MainWindowViewModel>();
|
_ = service.AddServerViaClipboardAsync(clipboardData);
|
||||||
if (service != null)
|
|
||||||
{
|
|
||||||
_ = service.AddServerViaClipboardAsync(clipboardData);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Key.S:
|
case Key.S:
|
||||||
|
|
|
||||||
|
|
@ -110,10 +110,7 @@ namespace v2rayN.Views
|
||||||
|
|
||||||
case EViewAction.ImportRulesFromClipboard:
|
case EViewAction.ImportRulesFromClipboard:
|
||||||
var clipboardData = WindowsUtils.GetClipboardData();
|
var clipboardData = WindowsUtils.GetClipboardData();
|
||||||
if (clipboardData.IsNotEmpty())
|
ViewModel?.ImportRulesFromClipboardAsync(clipboardData);
|
||||||
{
|
|
||||||
ViewModel?.ImportRulesFromClipboardAsync(clipboardData);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue