Merge branch 'mcktr-mcktr/feature/4128-win-edit-button'

fixes #4128
This commit is contained in:
Noah Hilverling 2017-10-16 15:08:47 +02:00
commit 61e441be41
5 changed files with 685 additions and 639 deletions

File diff suppressed because it is too large Load Diff

View File

@ -259,7 +259,7 @@ namespace Icinga
"--scm-install --scm-user \"" + txtUser.Text + "\" daemon",
out output)) {
ShowErrorText("\nRunning command 'icinga2.exe --scm-install --scm-user \"" +
txtUser.Text + "\" daemon' produced the following output:\n" + output);
txtUser.Text + "\" daemon' produced the following output:\n" + output);
return;
}
@ -478,6 +478,7 @@ namespace Icinga
private void lvwEndpoints_SelectedIndexChanged(object sender, EventArgs e)
{
btnRemoveEndpoint.Enabled = lvwEndpoints.SelectedItems.Count > 0;
btnEditEndpoint.Enabled = lvwEndpoints.SelectedItems.Count > 0;
}
private void lvwX509Fields_SelectedIndexChanged(object sender, EventArgs e)
@ -503,5 +504,36 @@ namespace Icinga
if (!txtUser.Enabled)
txtUser.Text = Icinga2User;
}
private void btnEditEndpoint_Click(object sender, EventArgs e)
{
ListViewItem lvi = lvwEndpoints.SelectedItems[0];
EndpointInputBox eib = new EndpointInputBox();
eib.Text = "Edit Endpoint";
eib.txtInstanceName.Text = lvi.SubItems[0].Text;
if (lvi.SubItems.Count >= 2) {
eib.txtHost.Text = lvi.SubItems[1].Text;
eib.txtPort.Text = lvi.SubItems[2].Text;
eib.chkConnect.Checked = true;
}
if (eib.ShowDialog(this) == DialogResult.Cancel)
return;
lvwEndpoints.Items.Remove(lvi);
ListViewItem lvi2 = new ListViewItem();
lvi2.Text = eib.txtInstanceName.Text;
if (eib.chkConnect.Checked) {
lvi2.SubItems.Add(eib.txtHost.Text);
lvi2.SubItems.Add(eib.txtPort.Text);
}
lvwEndpoints.Items.Add(lvi2);
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 35 KiB