mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-21 17:11:29 +01:00
Compacted logic that toggles control visibility.
Signed-off-by: Konstantina Chremmou <Konstantina.Chremmou@cloud.com>
This commit is contained in:
parent
85347aa95c
commit
6f1daff1fc
@ -169,33 +169,14 @@ namespace XenAdmin.Controls
|
||||
}
|
||||
}
|
||||
|
||||
if (comboBoxDrive.Items.Count == 0)
|
||||
{
|
||||
comboBoxDrive.Visible = false;
|
||||
cdChanger1.Visible = false;
|
||||
labelSingleDvd.Visible = false;
|
||||
linkLabelEject.Visible = false;
|
||||
newCDLabel.Visible = VM != null && !VM.is_control_domain;
|
||||
|
||||
}
|
||||
else if (comboBoxDrive.Items.Count == 1)
|
||||
{
|
||||
comboBoxDrive.Visible = false;
|
||||
cdChanger1.Visible = true;
|
||||
labelSingleDvd.Visible = comboBoxDrive.Items.Count == 1;
|
||||
if (labelSingleDvd.Visible)
|
||||
labelSingleDvd.Text = comboBoxDrive.Items[0].ToString();
|
||||
labelSingleDvd.Visible = true;
|
||||
tableLayoutPanel1.ColumnStyles[0].Width = labelSingleDvd.Width;
|
||||
newCDLabel.Visible = false;
|
||||
linkLabelEject.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
comboBoxDrive.Visible = true;
|
||||
cdChanger1.Visible = true;
|
||||
labelSingleDvd.Visible = false;
|
||||
newCDLabel.Visible = false;
|
||||
linkLabelEject.Visible = true;
|
||||
}
|
||||
|
||||
comboBoxDrive.Visible = comboBoxDrive.Items.Count > 1;
|
||||
cdChanger1.Visible = comboBoxDrive.Items.Count > 0;
|
||||
linkLabelEject.Visible = comboBoxDrive.Items.Count > 0;
|
||||
newCDLabel.Visible = comboBoxDrive.Items.Count == 0 && VM != null && !VM.is_control_domain;
|
||||
|
||||
_inRefresh = false;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user