mirror of https://github.com/2dust/v2rayN
parent
fd4af7c90c
commit
b1814c246a
|
@ -30,7 +30,7 @@
|
|||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.scMain = new System.Windows.Forms.SplitContainer();
|
||||
this.lvServers = new v2rayN.Base.ListViewFlickerFree();
|
||||
this.cmsLv = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.menuAddVmessServer = new System.Windows.Forms.ToolStripMenuItem();
|
||||
|
@ -124,10 +124,10 @@
|
|||
this.tsbPromotion = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.tsbClose = new System.Windows.Forms.ToolStripButton();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.scMain)).BeginInit();
|
||||
this.scMain.Panel1.SuspendLayout();
|
||||
this.scMain.Panel2.SuspendLayout();
|
||||
this.scMain.SuspendLayout();
|
||||
this.cmsLv.SuspendLayout();
|
||||
this.cmsMain.SuspendLayout();
|
||||
this.groupBox1.SuspendLayout();
|
||||
|
@ -136,21 +136,20 @@
|
|||
this.tsMain.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// splitContainer1
|
||||
// scMain
|
||||
//
|
||||
resources.ApplyResources(this.splitContainer1, "splitContainer1");
|
||||
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
||||
this.splitContainer1.Name = "splitContainer1";
|
||||
resources.ApplyResources(this.scMain, "scMain");
|
||||
this.scMain.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
||||
this.scMain.Name = "scMain";
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
// scMain.Panel1
|
||||
//
|
||||
this.splitContainer1.Panel1.Controls.Add(this.lvServers);
|
||||
this.scMain.Panel1.Controls.Add(this.lvServers);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
// scMain.Panel2
|
||||
//
|
||||
this.splitContainer1.Panel2.Controls.Add(this.qrCodeControl);
|
||||
this.splitContainer1.TabStop = false;
|
||||
this.splitContainer1.SplitterMoved += new System.Windows.Forms.SplitterEventHandler(this.splitContainer1_SplitterMoved);
|
||||
this.scMain.Panel2.Controls.Add(this.qrCodeControl);
|
||||
this.scMain.TabStop = false;
|
||||
//
|
||||
// lvServers
|
||||
//
|
||||
|
@ -510,7 +509,7 @@
|
|||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Controls.Add(this.splitContainer1);
|
||||
this.groupBox1.Controls.Add(this.scMain);
|
||||
resources.ApplyResources(this.groupBox1, "groupBox1");
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.TabStop = false;
|
||||
|
@ -667,7 +666,7 @@
|
|||
//
|
||||
this.tsbQRCodeSwitch.CheckOnClick = true;
|
||||
this.tsbQRCodeSwitch.ForeColor = System.Drawing.Color.Black;
|
||||
this.tsbQRCodeSwitch.Image = global::v2rayN.Properties.Resources.qr_code;
|
||||
this.tsbQRCodeSwitch.Image = global::v2rayN.Properties.Resources.share;
|
||||
resources.ApplyResources(this.tsbQRCodeSwitch, "tsbQRCodeSwitch");
|
||||
this.tsbQRCodeSwitch.Name = "tsbQRCodeSwitch";
|
||||
this.tsbQRCodeSwitch.CheckedChanged += new System.EventHandler(this.tsbQRCodeSwitch_CheckedChanged);
|
||||
|
@ -822,10 +821,10 @@
|
|||
this.Shown += new System.EventHandler(this.MainForm_Shown);
|
||||
this.VisibleChanged += new System.EventHandler(this.MainForm_VisibleChanged);
|
||||
this.Resize += new System.EventHandler(this.MainForm_Resize);
|
||||
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
|
||||
this.splitContainer1.ResumeLayout(false);
|
||||
this.scMain.Panel1.ResumeLayout(false);
|
||||
this.scMain.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.scMain)).EndInit();
|
||||
this.scMain.ResumeLayout(false);
|
||||
this.cmsLv.ResumeLayout(false);
|
||||
this.cmsMain.ResumeLayout(false);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
|
@ -882,7 +881,7 @@
|
|||
private System.Windows.Forms.ToolStripMenuItem menuAddCustomServer;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
|
||||
private System.Windows.Forms.ToolStripMenuItem menuAddShadowsocksServer;
|
||||
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||
private System.Windows.Forms.SplitContainer scMain;
|
||||
private QRCodeControl qrCodeControl;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator10;
|
||||
private System.Windows.Forms.ToolStripDropDownButton tsbCheckUpdate;
|
||||
|
|
|
@ -46,20 +46,10 @@ namespace v2rayN.Forms
|
|||
|
||||
private void MainForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
splitContainer1.Panel2Collapsed = true;
|
||||
|
||||
ConfigHandler.LoadConfig(ref config);
|
||||
v2rayHandler = new V2rayHandler();
|
||||
v2rayHandler.ProcessEvent += v2rayHandler_ProcessEvent;
|
||||
|
||||
if(!config.formMainSize.IsEmpty) {
|
||||
this.Left = config.formMainSize.X;
|
||||
this.Top = config.formMainSize.Y;
|
||||
this.Width = config.formMainSize.Width;
|
||||
this.Height = config.formMainSize.Height;
|
||||
}
|
||||
this.WindowState = config.windowState;
|
||||
|
||||
if (config.enableStatistics)
|
||||
{
|
||||
statistics = new StatisticsHandler(config, UpdateStatisticsHandler);
|
||||
|
@ -83,6 +73,7 @@ namespace v2rayN.Forms
|
|||
{
|
||||
InitServersView();
|
||||
RefreshServers();
|
||||
RestoreUI();
|
||||
|
||||
LoadV2ray();
|
||||
|
||||
|
@ -94,10 +85,7 @@ namespace v2rayN.Forms
|
|||
{
|
||||
if (e.CloseReason == CloseReason.UserClosing)
|
||||
{
|
||||
if (this.WindowState != FormWindowState.Maximized)
|
||||
config.formMainSize = new Rectangle(this.Left, this.Top, this.Width, this.Height);
|
||||
config.windowState = this.WindowState;
|
||||
|
||||
StorageUI();
|
||||
e.Cancel = true;
|
||||
HideForm();
|
||||
return;
|
||||
|
@ -112,14 +100,10 @@ namespace v2rayN.Forms
|
|||
//}
|
||||
//else
|
||||
//{
|
||||
// //this.splitContainer1.SplitterDistance = config.uiItem.mainQRCodeWidth;
|
||||
|
||||
//}
|
||||
}
|
||||
|
||||
private void splitContainer1_SplitterMoved(object sender, SplitterEventArgs e)
|
||||
{
|
||||
//config.uiItem.mainQRCodeWidth = splitContainer1.SplitterDistance;
|
||||
}
|
||||
|
||||
//private const int WM_QUERYENDSESSION = 0x0011;
|
||||
//protected override void WndProc(ref Message m)
|
||||
|
@ -139,6 +123,34 @@ namespace v2rayN.Forms
|
|||
// break;
|
||||
// }
|
||||
//}
|
||||
|
||||
private void RestoreUI()
|
||||
{
|
||||
scMain.Panel2Collapsed = true;
|
||||
|
||||
if (!config.uiItem.mainSize.IsEmpty)
|
||||
{
|
||||
this.Width = config.uiItem.mainSize.Width;
|
||||
this.Height = config.uiItem.mainSize.Height;
|
||||
}
|
||||
|
||||
for (int k = 0; k < lvServers.Columns.Count; k++)
|
||||
{
|
||||
var width = ConfigHandler.GetformMainLvColWidth(ref config, ((EServerColName)k).ToString(), lvServers.Columns[k].Width);
|
||||
lvServers.Columns[k].Width = width;
|
||||
}
|
||||
}
|
||||
|
||||
private void StorageUI()
|
||||
{
|
||||
config.uiItem.mainSize = new Size(this.Width, this.Height);
|
||||
|
||||
for (int k = 0; k < lvServers.Columns.Count; k++)
|
||||
{
|
||||
ConfigHandler.AddformMainLvColWidth(ref config, ((EServerColName)k).ToString(), lvServers.Columns[k].Width);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 显示服务器 listview 和 menu
|
||||
|
@ -168,22 +180,22 @@ namespace v2rayN.Forms
|
|||
lvServers.MultiSelect = true;
|
||||
lvServers.HeaderStyle = ColumnHeaderStyle.Nonclickable;
|
||||
|
||||
lvServers.Columns.Add("", 30, HorizontalAlignment.Center);
|
||||
lvServers.Columns.Add(UIRes.I18N("LvServiceType"), 80, HorizontalAlignment.Left);
|
||||
lvServers.Columns.Add(UIRes.I18N("LvAlias"), 100, HorizontalAlignment.Left);
|
||||
lvServers.Columns.Add(UIRes.I18N("LvAddress"), 120, HorizontalAlignment.Left);
|
||||
lvServers.Columns.Add(UIRes.I18N("LvPort"), 50, HorizontalAlignment.Left);
|
||||
lvServers.Columns.Add(UIRes.I18N("LvEncryptionMethod"), 90, HorizontalAlignment.Left);
|
||||
lvServers.Columns.Add(UIRes.I18N("LvTransportProtocol"), 70, HorizontalAlignment.Left);
|
||||
lvServers.Columns.Add(UIRes.I18N("LvSubscription"), 50, HorizontalAlignment.Left);
|
||||
lvServers.Columns.Add(UIRes.I18N("LvTestResults"), 70, HorizontalAlignment.Left);
|
||||
lvServers.Columns.Add("", 30);
|
||||
lvServers.Columns.Add(UIRes.I18N("LvServiceType"), 80);
|
||||
lvServers.Columns.Add(UIRes.I18N("LvAlias"), 100);
|
||||
lvServers.Columns.Add(UIRes.I18N("LvAddress"), 120);
|
||||
lvServers.Columns.Add(UIRes.I18N("LvPort"), 50);
|
||||
lvServers.Columns.Add(UIRes.I18N("LvEncryptionMethod"), 90);
|
||||
lvServers.Columns.Add(UIRes.I18N("LvTransportProtocol"), 70);
|
||||
lvServers.Columns.Add(UIRes.I18N("LvSubscription"), 50);
|
||||
lvServers.Columns.Add(UIRes.I18N("LvTestResults"), 70,HorizontalAlignment.Right);
|
||||
|
||||
if (statistics != null && statistics.Enable)
|
||||
{
|
||||
lvServers.Columns.Add(UIRes.I18N("LvTodayDownloadDataAmount"), 70, HorizontalAlignment.Left);
|
||||
lvServers.Columns.Add(UIRes.I18N("LvTodayUploadDataAmount"), 70, HorizontalAlignment.Left);
|
||||
lvServers.Columns.Add(UIRes.I18N("LvTotalDownloadDataAmount"), 70, HorizontalAlignment.Left);
|
||||
lvServers.Columns.Add(UIRes.I18N("LvTotalUploadDataAmount"), 70, HorizontalAlignment.Left);
|
||||
lvServers.Columns.Add(UIRes.I18N("LvTodayDownloadDataAmount"), 70);
|
||||
lvServers.Columns.Add(UIRes.I18N("LvTodayUploadDataAmount"), 70);
|
||||
lvServers.Columns.Add(UIRes.I18N("LvTotalDownloadDataAmount"), 70);
|
||||
lvServers.Columns.Add(UIRes.I18N("LvTotalUploadDataAmount"), 70);
|
||||
}
|
||||
lvServers.EndUpdate();
|
||||
}
|
||||
|
@ -227,22 +239,20 @@ namespace v2rayN.Forms
|
|||
}
|
||||
}
|
||||
ListViewItem lvItem = new ListViewItem(def);
|
||||
_addSubItem(lvItem, "type", ((EConfigType)item.configType).ToString());
|
||||
_addSubItem(lvItem, "remarks", item.remarks);
|
||||
_addSubItem(lvItem, "address", item.address);
|
||||
_addSubItem(lvItem, "port", item.port.ToString());
|
||||
//_addSubItem(lvItem, "id", item.id);
|
||||
//_addSubItem(lvItem, "alterId", item.alterId.ToString());
|
||||
_addSubItem(lvItem, "security", item.security);
|
||||
_addSubItem(lvItem, "network", item.network);
|
||||
_addSubItem(lvItem, "SubRemarks", item.getSubRemarks(config));
|
||||
_addSubItem(lvItem, "testResult", item.testResult);
|
||||
_addSubItem(lvItem, EServerColName.type.ToString(), ((EConfigType)item.configType).ToString());
|
||||
_addSubItem(lvItem, EServerColName.remarks.ToString(), item.remarks);
|
||||
_addSubItem(lvItem, EServerColName.address.ToString(), item.address);
|
||||
_addSubItem(lvItem, EServerColName.port.ToString(), item.port.ToString());
|
||||
_addSubItem(lvItem, EServerColName.security.ToString(), item.security);
|
||||
_addSubItem(lvItem, EServerColName.network.ToString(), item.network);
|
||||
_addSubItem(lvItem, EServerColName.subRemarks.ToString(), item.getSubRemarks(config));
|
||||
_addSubItem(lvItem, EServerColName.testResult.ToString(), item.testResult);
|
||||
if (stats)
|
||||
{
|
||||
_addSubItem(lvItem, "todayDown", todayDown);
|
||||
_addSubItem(lvItem, "todayUp", todayUp);
|
||||
_addSubItem(lvItem, "totalDown", totalDown);
|
||||
_addSubItem(lvItem, "totalUp", totalUp);
|
||||
_addSubItem(lvItem, EServerColName.todayDown.ToString(), todayDown);
|
||||
_addSubItem(lvItem, EServerColName.todayUp.ToString(), todayUp);
|
||||
_addSubItem(lvItem, EServerColName.totalDown.ToString(), totalDown);
|
||||
_addSubItem(lvItem, EServerColName.totalUp.ToString(), totalUp);
|
||||
}
|
||||
|
||||
if (k % 2 == 1) // 隔行着色
|
||||
|
@ -665,6 +675,17 @@ namespace v2rayN.Forms
|
|||
SpeedtestHandler statistics = new SpeedtestHandler(ref config, ref v2rayHandler, lvSelecteds, actionType, UpdateSpeedtestHandler);
|
||||
}
|
||||
|
||||
private void tsbTestMe_Click(object sender, EventArgs e)
|
||||
{
|
||||
string result = httpProxyTest() + "ms";
|
||||
AppendText(false, string.Format(UIRes.I18N("TestMeOutput"), result));
|
||||
}
|
||||
private int httpProxyTest()
|
||||
{
|
||||
SpeedtestHandler statistics = new SpeedtestHandler(ref config, ref v2rayHandler, lvSelecteds, "", UpdateSpeedtestHandler);
|
||||
return statistics.RunAvailabilityCheck();
|
||||
}
|
||||
|
||||
private void menuExport2ClientConfig_Click(object sender, EventArgs e)
|
||||
{
|
||||
int index = GetLvSelectedIndex();
|
||||
|
@ -998,10 +1019,10 @@ namespace v2rayN.Forms
|
|||
|
||||
private void ShowForm()
|
||||
{
|
||||
this.ShowInTaskbar = true;
|
||||
//this.WindowState = config.windowState;
|
||||
this.Show();
|
||||
this.WindowState = FormWindowState.Normal;
|
||||
this.Activate();
|
||||
this.ShowInTaskbar = true;
|
||||
//this.notifyIcon1.Visible = false;
|
||||
this.txtMsgBox.ScrollToCaret();
|
||||
lvServers.EnsureVisible(config.index); // workaround
|
||||
|
@ -1392,6 +1413,11 @@ namespace v2rayN.Forms
|
|||
Process.Start(Global.AboutUrl);
|
||||
}
|
||||
|
||||
private void tsbV2rayWebsite_Click(object sender, EventArgs e)
|
||||
{
|
||||
Process.Start(Global.v2rayWebsiteUrl);
|
||||
}
|
||||
|
||||
private void tsbPromotion_Click(object sender, EventArgs e)
|
||||
{
|
||||
Process.Start($"{Utils.Base64Decode(Global.PromotionUrl)}?t={DateTime.Now.Ticks}");
|
||||
|
@ -1510,6 +1536,11 @@ namespace v2rayN.Forms
|
|||
}
|
||||
}
|
||||
|
||||
private void tsbQRCodeSwitch_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
bool bShow = tsbQRCodeSwitch.Checked;
|
||||
scMain.Panel2Collapsed = !bShow;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Language
|
||||
|
@ -1532,26 +1563,6 @@ namespace v2rayN.Forms
|
|||
|
||||
#endregion
|
||||
|
||||
private void tsbV2rayWebsite_Click(object sender, EventArgs e)
|
||||
{
|
||||
Process.Start(Global.v2rayWebsiteUrl);
|
||||
}
|
||||
|
||||
private void tsbTestMe_Click(object sender, EventArgs e)
|
||||
{
|
||||
string result = httpProxyTest() + "ms";
|
||||
AppendText(false, string.Format(UIRes.I18N("TestMeOutput"), result));
|
||||
}
|
||||
private int httpProxyTest()
|
||||
{
|
||||
SpeedtestHandler statistics = new SpeedtestHandler(ref config, ref v2rayHandler, lvSelecteds, "", UpdateSpeedtestHandler);
|
||||
return statistics.RunAvailabilityCheck();
|
||||
}
|
||||
|
||||
private void tsbQRCodeSwitch_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
bool bShow = tsbQRCodeSwitch.Checked;
|
||||
splitContainer1.Panel2Collapsed = !bShow;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -118,11 +118,11 @@
|
|||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="splitContainer1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<data name="scMain.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Fill</value>
|
||||
</data>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="splitContainer1.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<data name="scMain.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>3, 17</value>
|
||||
</data>
|
||||
<metadata name="cmsLv.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
|
@ -342,21 +342,21 @@
|
|||
<value>v2rayN.Base.ListViewFlickerFree, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>lvServers.Parent" xml:space="preserve">
|
||||
<value>splitContainer1.Panel1</value>
|
||||
<value>scMain.Panel1</value>
|
||||
</data>
|
||||
<data name=">>lvServers.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>splitContainer1.Panel1.Name" xml:space="preserve">
|
||||
<value>splitContainer1.Panel1</value>
|
||||
<data name=">>scMain.Panel1.Name" xml:space="preserve">
|
||||
<value>scMain.Panel1</value>
|
||||
</data>
|
||||
<data name=">>splitContainer1.Panel1.Type" xml:space="preserve">
|
||||
<data name=">>scMain.Panel1.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>splitContainer1.Panel1.Parent" xml:space="preserve">
|
||||
<value>splitContainer1</value>
|
||||
<data name=">>scMain.Panel1.Parent" xml:space="preserve">
|
||||
<value>scMain</value>
|
||||
</data>
|
||||
<data name=">>splitContainer1.Panel1.ZOrder" xml:space="preserve">
|
||||
<data name=">>scMain.Panel1.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="qrCodeControl.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
|
@ -378,45 +378,45 @@
|
|||
<value>v2rayN.Forms.QRCodeControl, v2rayN, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>qrCodeControl.Parent" xml:space="preserve">
|
||||
<value>splitContainer1.Panel2</value>
|
||||
<value>scMain.Panel2</value>
|
||||
</data>
|
||||
<data name=">>qrCodeControl.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>splitContainer1.Panel2.Name" xml:space="preserve">
|
||||
<value>splitContainer1.Panel2</value>
|
||||
<data name=">>scMain.Panel2.Name" xml:space="preserve">
|
||||
<value>scMain.Panel2</value>
|
||||
</data>
|
||||
<data name=">>splitContainer1.Panel2.Type" xml:space="preserve">
|
||||
<data name=">>scMain.Panel2.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>splitContainer1.Panel2.Parent" xml:space="preserve">
|
||||
<value>splitContainer1</value>
|
||||
<data name=">>scMain.Panel2.Parent" xml:space="preserve">
|
||||
<value>scMain</value>
|
||||
</data>
|
||||
<data name=">>splitContainer1.Panel2.ZOrder" xml:space="preserve">
|
||||
<data name=">>scMain.Panel2.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="splitContainer1.Panel2MinSize" type="System.Int32, mscorlib">
|
||||
<data name="scMain.Panel2MinSize" type="System.Int32, mscorlib">
|
||||
<value>100</value>
|
||||
</data>
|
||||
<data name="splitContainer1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<data name="scMain.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>946, 331</value>
|
||||
</data>
|
||||
<data name="splitContainer1.SplitterDistance" type="System.Int32, mscorlib">
|
||||
<data name="scMain.SplitterDistance" type="System.Int32, mscorlib">
|
||||
<value>686</value>
|
||||
</data>
|
||||
<data name="splitContainer1.TabIndex" type="System.Int32, mscorlib">
|
||||
<data name="scMain.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>splitContainer1.Name" xml:space="preserve">
|
||||
<value>splitContainer1</value>
|
||||
<data name=">>scMain.Name" xml:space="preserve">
|
||||
<value>scMain</value>
|
||||
</data>
|
||||
<data name=">>splitContainer1.Type" xml:space="preserve">
|
||||
<data name=">>scMain.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>splitContainer1.Parent" xml:space="preserve">
|
||||
<data name=">>scMain.Parent" xml:space="preserve">
|
||||
<value>groupBox1</value>
|
||||
</data>
|
||||
<data name=">>splitContainer1.ZOrder" xml:space="preserve">
|
||||
<data name=">>scMain.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<metadata name="notifyMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
|
@ -780,10 +780,10 @@
|
|||
<value>Magenta</value>
|
||||
</data>
|
||||
<data name="tsbQRCodeSwitch.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>65, 53</value>
|
||||
<value>45, 53</value>
|
||||
</data>
|
||||
<data name="tsbQRCodeSwitch.Text" xml:space="preserve">
|
||||
<value>QR Code</value>
|
||||
<value>Share</value>
|
||||
</data>
|
||||
<data name="tsbQRCodeSwitch.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
|
||||
<value>BottomCenter</value>
|
||||
|
|
|
@ -119,6 +119,11 @@ namespace v2rayN.Handler
|
|||
{
|
||||
config.uiItem = new UIItem();
|
||||
}
|
||||
if (config.uiItem.mainLvColWidth == null)
|
||||
{
|
||||
config.uiItem.mainLvColWidth = new Dictionary<string, int>();
|
||||
}
|
||||
|
||||
//// 如果是用户升级,首次会有端口号为0的情况,不可用,这里处理
|
||||
//if (config.pacPort == 0)
|
||||
//{
|
||||
|
@ -196,7 +201,7 @@ namespace v2rayN.Handler
|
|||
vmessItem.headerType = vmessItem.headerType.TrimEx();
|
||||
vmessItem.requestHost = vmessItem.requestHost.TrimEx();
|
||||
vmessItem.path = vmessItem.path.TrimEx();
|
||||
vmessItem.streamSecurity = vmessItem.streamSecurity.TrimEx();
|
||||
vmessItem.streamSecurity = vmessItem.streamSecurity.TrimEx();
|
||||
|
||||
if (index >= 0)
|
||||
{
|
||||
|
@ -884,5 +889,38 @@ namespace v2rayN.Handler
|
|||
ToJsonFile(config);
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int AddformMainLvColWidth(ref Config config, string name, int width)
|
||||
{
|
||||
if (config.uiItem.mainLvColWidth == null)
|
||||
{
|
||||
config.uiItem.mainLvColWidth = new Dictionary<string, int>();
|
||||
}
|
||||
if (config.uiItem.mainLvColWidth.ContainsKey(name))
|
||||
{
|
||||
config.uiItem.mainLvColWidth[name] = width;
|
||||
}
|
||||
else
|
||||
{
|
||||
config.uiItem.mainLvColWidth.Add(name, width);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
public static int GetformMainLvColWidth(ref Config config, string name, int width)
|
||||
{
|
||||
if (config.uiItem.mainLvColWidth == null)
|
||||
{
|
||||
config.uiItem.mainLvColWidth = new Dictionary<string, int>();
|
||||
}
|
||||
if (config.uiItem.mainLvColWidth.ContainsKey(name))
|
||||
{
|
||||
return config.uiItem.mainLvColWidth[name];
|
||||
}
|
||||
else
|
||||
{
|
||||
return width;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ namespace v2rayN.Handler
|
|||
RunPingSub((int index) =>
|
||||
{
|
||||
long time = Utils.Ping(_config.vmess[index].address);
|
||||
_updateFunc(index, string.Format("{0}ms", time));
|
||||
_updateFunc(index, FormatOut(time, "ms"));
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ namespace v2rayN.Handler
|
|||
RunPingSub((int index) =>
|
||||
{
|
||||
int time = GetTcpingTime(_config.vmess[index].address, _config.vmess[index].port);
|
||||
_updateFunc(index, string.Format("{0}ms", time));
|
||||
_updateFunc(index, FormatOut(time, "ms"));
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ namespace v2rayN.Handler
|
|||
WebProxy webProxy = new WebProxy(Global.Loopback, httpPort + itemIndex);
|
||||
int responseTime = -1;
|
||||
string status = GetRealPingTime(_config.speedPingTestUrl, webProxy, out responseTime);
|
||||
string output = Utils.IsNullOrEmpty(status) ? string.Format("{0}ms", responseTime) : string.Format("{0}", status);
|
||||
string output = Utils.IsNullOrEmpty(status) ? FormatOut(responseTime, "ms") : FormatOut(status, "");
|
||||
_updateFunc(itemIndex, output);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
@ -289,5 +289,13 @@ namespace v2rayN.Handler
|
|||
}
|
||||
return msg;
|
||||
}
|
||||
private string FormatOut(object time, string unit)
|
||||
{
|
||||
if (time.ToString().Equals("-1"))
|
||||
{
|
||||
return "Timeout";
|
||||
}
|
||||
return string.Format("{0}{1}", time, unit).PadLeft(6, ' ');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,17 +36,6 @@ namespace v2rayN.Mode
|
|||
get; set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 主窗口的大小和位置
|
||||
/// </summary>
|
||||
public System.Drawing.Rectangle formMainSize
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public System.Windows.Forms.FormWindowState windowState
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
/// <summary>
|
||||
/// 活动配置序号
|
||||
/// </summary>
|
||||
|
@ -180,7 +169,7 @@ namespace v2rayN.Mode
|
|||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 自定义远程DNS
|
||||
|
@ -216,7 +205,7 @@ namespace v2rayN.Mode
|
|||
public List<string> userPacRule
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
|
||||
#region 函数
|
||||
|
||||
|
@ -715,10 +704,16 @@ namespace v2rayN.Mode
|
|||
[Serializable]
|
||||
public class UIItem
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int mainQRCodeWidth { get; set; } = 600;
|
||||
|
||||
|
||||
public System.Drawing.Size mainSize
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public Dictionary<string, int> mainLvColWidth
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
namespace v2rayN.Mode
|
||||
{
|
||||
public enum EServerColName
|
||||
{
|
||||
def = 0,
|
||||
type,
|
||||
remarks,
|
||||
address,
|
||||
port,
|
||||
security,
|
||||
network,
|
||||
subRemarks,
|
||||
testResult,
|
||||
|
||||
todayDown,
|
||||
todayUp,
|
||||
totalDown,
|
||||
totalUp
|
||||
}
|
||||
}
|
|
@ -32,4 +32,4 @@ using System.Runtime.InteropServices;
|
|||
// 方法是按如下所示使用“*”:
|
||||
//[assembly: AssemblyVersion("1.0.*")]
|
||||
//[assembly: AssemblyVersion("1.0.0")]
|
||||
[assembly: AssemblyFileVersion("3.14")]
|
||||
[assembly: AssemblyFileVersion("3.15")]
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace v2rayN.Properties {
|
|||
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
|
||||
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
|
||||
// (以 /str 作为命令选项),或重新生成 VS 项目。
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
@ -177,16 +177,6 @@ namespace v2rayN.Properties {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap qr_code {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("qr-code", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||
/// </summary>
|
||||
|
@ -207,6 +197,16 @@ namespace v2rayN.Properties {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap share {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("share", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
|
||||
/// </summary>
|
||||
|
|
|
@ -166,7 +166,7 @@
|
|||
<data name="abp_js" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\abp.js.gz;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="qr-code" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\qr-code.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
<data name="share" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\resources\share.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
Binary file not shown.
Before Width: | Height: | Size: 685 B |
Binary file not shown.
After Width: | Height: | Size: 802 B |
|
@ -157,6 +157,7 @@
|
|||
</Compile>
|
||||
<Compile Include="HttpProxyHandler\SysProxyHandle.cs" />
|
||||
<Compile Include="Mode\EMove.cs" />
|
||||
<Compile Include="Mode\EServerColName.cs" />
|
||||
<Compile Include="Mode\ServerStatistics.cs" />
|
||||
<Compile Include="Mode\SysproxyConfig.cs" />
|
||||
<Compile Include="Mode\EConfigType.cs" />
|
||||
|
@ -369,6 +370,7 @@
|
|||
<None Include="Resources\minimize.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Resources\share.png" />
|
||||
<None Include="Resources\promotion.png" />
|
||||
<EmbeddedResource Include="Sample\BlankPac.txt" />
|
||||
<None Include="Resources\sub.png" />
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<ErrorReportUrlHistory />
|
||||
<FallbackCulture>zh-CN</FallbackCulture>
|
||||
<VerifyUploadedFiles>false</VerifyUploadedFiles>
|
||||
<ProjectView>ProjectFiles</ProjectView>
|
||||
<ProjectView>ShowAllFiles</ProjectView>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<EnableSecurityDebugging>false</EnableSecurityDebugging>
|
||||
|
|
Loading…
Reference in New Issue