Skip to content

Commit 4bce18a

Browse files
author
Student Main
committed
Add check box to toggle plugin argument input
1 parent 0cb9158 commit 4bce18a

File tree

2 files changed

+52
-20
lines changed

2 files changed

+52
-20
lines changed

shadowsocks-csharp/View/ConfigForm.Designer.cs

Lines changed: 35 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

shadowsocks-csharp/View/ConfigForm.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,22 @@ private void SetServerDetailsToUI(Server server)
144144
PluginTextBox.Text = server.plugin;
145145
PluginOptionsTextBox.Text = server.plugin_opts;
146146
PluginArgumentsTextBox.Text = server.plugin_args;
147+
148+
bool showPluginArgInput = !string.IsNullOrEmpty(server.plugin_args);
149+
UsePluginArgCheckBox.Checked = showPluginArgInput;
150+
ShowHidePluginArgInput(showPluginArgInput);
151+
147152
RemarksTextBox.Text = server.remarks;
148153
TimeoutTextBox.Text = server.timeout.ToString();
149154
}
150155

156+
private void ShowHidePluginArgInput(bool show)
157+
{
158+
PluginArgumentsTextBox.Visible = show;
159+
PluginArgumentsLabel.Visible = show;
160+
}
161+
162+
151163
private void LoadServerNameListToUI(Configuration configuration)
152164
{
153165
ServersListBox.Items.Clear();
@@ -362,5 +374,10 @@ private void ShowPasswdCheckBox_CheckedChanged(object sender, EventArgs e)
362374
{
363375
this.PasswordTextBox.UseSystemPasswordChar = !this.ShowPasswdCheckBox.Checked;
364376
}
377+
378+
private void UsePluginArgCheckBox_CheckedChanged(object sender, EventArgs e)
379+
{
380+
ShowHidePluginArgInput(this.UsePluginArgCheckBox.Checked);
381+
}
365382
}
366383
}

0 commit comments

Comments
 (0)