Add import URL from clipboard

This commit is contained in:
noisyfox
2016-12-13 02:52:58 +11:00
parent 5650b1d847
commit 2a0dd88525
3 changed files with 14 additions and 1 deletions
+12 -1
View File
@@ -261,8 +261,10 @@ namespace Shadowsocks.View
this.SeperatorItem = new MenuItem("-"),
this.ConfigItem = CreateMenuItem("Edit Servers...", new EventHandler(this.Config_Click)),
CreateMenuItem("Statistics Config...", StatisticsConfigItem_Click),
new MenuItem("-"),
CreateMenuItem("Share Server Config...", new EventHandler(this.QRCodeItem_Click)),
CreateMenuItem("Scan QRCode from Screen...", new EventHandler(this.ScanQRCodeItem_Click))
CreateMenuItem("Scan QRCode from Screen...", new EventHandler(this.ScanQRCodeItem_Click)),
CreateMenuItem("Import URL from Clipboard...", new EventHandler(this.ImportURLItem_Click))
}),
CreateMenuGroup("PAC ", new MenuItem[] {
this.localPACItem = CreateMenuItem("Local PAC", new EventHandler(this.LocalPACItem_Click)),
@@ -739,6 +741,15 @@ namespace Shadowsocks.View
MessageBox.Show(I18N.GetString("No QRCode found. Try to zoom in or move it to the center of the screen."));
}
private void ImportURLItem_Click(object sender, EventArgs e)
{
var success = controller.AddServerBySSURL(Clipboard.GetText(TextDataFormat.Text));
if (success)
{
ShowConfigForm();
}
}
void splash_FormClosed(object sender, FormClosedEventArgs e)
{
ShowConfigForm();