+ }
+
+ private void chkRunServiceAsThisUser_CheckedChanged(object sender, EventArgs e)
+ {
+ txtUser.Enabled = !txtUser.Enabled;
+ 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);
+ }
+
+ private void btnAddGlobalZone_Click(object sender, EventArgs e)
+ {
+ GlobalZonesInputBox gzib = new GlobalZonesInputBox(lvwGlobalZones.Items);
+
+ if (gzib.ShowDialog(this) == DialogResult.Cancel)
+ return;
+
+ ListViewItem lvi = new ListViewItem();
+ lvi.Text = gzib.txtGlobalZoneName.Text;
+
+ lvwGlobalZones.Items.Add(lvi);
+ }
+
+ private void btnRemoveGlobalZone_Click(object sender, EventArgs e)
+ {
+ while (lvwGlobalZones.SelectedItems.Count > 0) {
+ lvwGlobalZones.Items.Remove(lvwGlobalZones.SelectedItems[0]);
+ }
+ }
+
+ private void lvwGlobalZones_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ btnEditGlobalZone.Enabled = lvwGlobalZones.SelectedItems.Count > 0;
+ btnRemoveGlobalZone.Enabled = lvwGlobalZones.SelectedItems.Count > 0;
+ }
+
+ private void btnEditGlobalZone_Click(object sender, EventArgs e)
+ {
+ ListViewItem lvi = lvwGlobalZones.SelectedItems[0];
+ GlobalZonesInputBox gzib = new GlobalZonesInputBox(lvwGlobalZones.Items);
+
+ gzib.Text = "Edit Global Zone";
+ gzib.txtGlobalZoneName.Text = lvi.SubItems[0].Text;
+
+ if (gzib.ShowDialog(this) == DialogResult.Cancel)
+ return;
+
+ lvwGlobalZones.Items.Remove(lvi);
+
+ ListViewItem lvi2 = new ListViewItem();
+ lvi2.Text = gzib.txtGlobalZoneName.Text;
+
+ lvwGlobalZones.Items.Add(lvi2);
+ }
+
+ private void checkBox1_CheckedChanged(object sender, EventArgs e)
+ {
+
+ }
+
+ private void SetupWizard_Load(object sender, EventArgs e)
+ {
+ this.MinimumSize = this.Size;
+ this.MaximumSize = this.Size;
+ }