diff --git a/XenAdmin/ConsoleView/VNCTabView.Designer.cs b/XenAdmin/ConsoleView/VNCTabView.Designer.cs
index 88e6d596e..848fb7298 100644
--- a/XenAdmin/ConsoleView/VNCTabView.Designer.cs
+++ b/XenAdmin/ConsoleView/VNCTabView.Designer.cs
@@ -57,6 +57,7 @@ private void InitializeComponent()
this.fullscreenButton = new System.Windows.Forms.Button();
this.dockButton = new System.Windows.Forms.Button();
this.tip = new System.Windows.Forms.ToolTip(this.components);
+ this.toggleConsoleButton = new System.Windows.Forms.Button();
this.LifeCycleMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
this.powerStateLabel = new System.Windows.Forms.Label();
this.dedicatedGpuWarning = new System.Windows.Forms.Label();
@@ -64,7 +65,6 @@ private void InitializeComponent()
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.HostLabel = new System.Windows.Forms.Label();
this.buttonSSH = new System.Windows.Forms.Button();
- this.toggleConsoleButton = new System.Windows.Forms.Button();
this.multipleDvdIsoList1 = new XenAdmin.Controls.MultipleDvdIsoList();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.tableLayoutPanel1.SuspendLayout();
@@ -136,6 +136,14 @@ private void InitializeComponent()
//
this.tip.ShowAlways = true;
//
+ // toggleConsoleButton
+ //
+ resources.ApplyResources(this.toggleConsoleButton, "toggleConsoleButton");
+ this.toggleConsoleButton.Name = "toggleConsoleButton";
+ this.tip.SetToolTip(this.toggleConsoleButton, resources.GetString("toggleConsoleButton.ToolTip"));
+ this.toggleConsoleButton.UseVisualStyleBackColor = true;
+ this.toggleConsoleButton.Click += new System.EventHandler(this.toggleConsoleButton_Click);
+ //
// LifeCycleMenuStrip
//
this.LifeCycleMenuStrip.ImageScalingSize = new System.Drawing.Size(20, 20);
@@ -180,8 +188,8 @@ private void InitializeComponent()
//
// HostLabel
//
- this.HostLabel.AutoEllipsis = true;
resources.ApplyResources(this.HostLabel, "HostLabel");
+ this.HostLabel.AutoEllipsis = true;
this.HostLabel.ForeColor = System.Drawing.Color.White;
this.HostLabel.Name = "HostLabel";
//
@@ -192,14 +200,6 @@ private void InitializeComponent()
this.buttonSSH.UseVisualStyleBackColor = true;
this.buttonSSH.Click += new System.EventHandler(this.buttonSSH_Click);
//
- // toggleConsoleButton
- //
- resources.ApplyResources(this.toggleConsoleButton, "toggleConsoleButton");
- this.toggleConsoleButton.Name = "toggleConsoleButton";
- this.tip.SetToolTip(this.toggleConsoleButton, resources.GetString("toggleConsoleButton.ToolTip"));
- this.toggleConsoleButton.UseVisualStyleBackColor = true;
- this.toggleConsoleButton.Click += new System.EventHandler(this.toggleConsoleButton_Click);
- //
// multipleDvdIsoList1
//
resources.ApplyResources(this.multipleDvdIsoList1, "multipleDvdIsoList1");
@@ -254,7 +254,6 @@ private void InitializeComponent()
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.ContextMenuStrip LifeCycleMenuStrip;
private System.Windows.Forms.PictureBox pictureBox1;
- private XenAdmin.Controls.GradientPanel.GradientPanel gradientPanel1;
private System.Windows.Forms.Label HostLabel;
private System.Windows.Forms.Button toggleConsoleButton;
private XenAdmin.Controls.MultipleDvdIsoList multipleDvdIsoList1;
@@ -263,5 +262,6 @@ private void InitializeComponent()
private System.Windows.Forms.Button buttonSSH;
private System.Windows.Forms.PictureBox pictureBoxGeneralInformationMessage;
private System.Windows.Forms.Label labelGeneralInformationMessage;
+ private Controls.GradientPanel.HorizontalGradientPanel gradientPanel1;
}
}
diff --git a/XenAdmin/ConsoleView/VNCTabView.cs b/XenAdmin/ConsoleView/VNCTabView.cs
index bb3314f8c..7a3e97b61 100644
--- a/XenAdmin/ConsoleView/VNCTabView.cs
+++ b/XenAdmin/ConsoleView/VNCTabView.cs
@@ -1291,10 +1291,12 @@ internal void VMPowerOff()
{
toggleConsoleButton.Enabled = false;
- VBD cddrive = source.FindVMCDROM();
- bool allowEject = cddrive != null ? cddrive.allowed_operations.Contains(vbd_operations.eject) : false;
- bool allowInsert = cddrive != null ? cddrive.allowed_operations.Contains(vbd_operations.insert) : false;
- multipleDvdIsoList1.Enabled = (source.power_state == vm_power_state.Halted) && (allowEject || allowInsert);
+ VBD cdDrive = source.FindVMCDROM();
+
+ multipleDvdIsoList1.Enabled = cdDrive == null ||
+ source.power_state == vm_power_state.Halted &&
+ (cdDrive.allowed_operations.Contains(vbd_operations.eject) ||
+ cdDrive.allowed_operations.Contains(vbd_operations.insert));
sendCAD.Enabled = false;
}
diff --git a/XenAdmin/ConsoleView/VNCTabView.resx b/XenAdmin/ConsoleView/VNCTabView.resx
index 09cd837d7..4e22ae94c 100644
--- a/XenAdmin/ConsoleView/VNCTabView.resx
+++ b/XenAdmin/ConsoleView/VNCTabView.resx
@@ -199,7 +199,7 @@
NoControl
- 223, 4
+ 223, 2
0, 0, 3, 0
@@ -208,7 +208,7 @@
0, 30
- 200, 26
+ 205, 30
5
@@ -429,6 +429,42 @@
17, 17
+
+ Left
+
+
+ False
+
+
+ NoControl
+
+
+ 525, 6
+
+
+ 175, 24
+
+
+ 3
+
+
+ Looking for guest console...
+
+
+ Remote access is not enabled on this guest
+
+
+ toggleConsoleButton
+
+
+ System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ tableLayoutPanel2
+
+
+ 2
+
81, 17
@@ -513,12 +549,12 @@
5
+
+ Left
+
True
-
- Fill
-
Segoe UI, 11.25pt
@@ -526,20 +562,17 @@
NoControl
- 3, 0
+ 3, 8
8, 0, 0, 0
- 8, 37
+ 8, 20
0
-
- MiddleLeft
-
HostLabel
@@ -553,7 +586,7 @@
0
- Top, Right
+ Left
True
@@ -565,13 +598,10 @@
NoControl
- 399, 6
-
-
- 3, 6, 6, 6
+ 397, 7
- 114, 23
+ 122, 23
2
@@ -591,56 +621,20 @@
1
-
- Top, Right
+
+ Left, Right
-
- False
-
-
- NoControl
-
-
- 522, 6
-
-
- 3, 6, 6, 6
-
-
- 175, 24
-
-
- 3
-
-
- Looking for guest console...
-
-
- Remote access is not enabled on this guest
-
-
- toggleConsoleButton
-
-
- System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- tableLayoutPanel2
-
-
- 2
+
+ True
-
- Fill
+
+ GrowAndShrink
- 47, 3
-
-
- 3, 3, 12, 3
+ 47, 5
- 337, 31
+ 344, 27
1
@@ -649,7 +643,7 @@
multipleDvdIsoList1
- XenAdmin.Controls.MultipleDvdIsoList, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
+ XenAdmin.Controls.MultipleDvdIsoList, [XenCenter], Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
tableLayoutPanel2
@@ -657,26 +651,20 @@
3
+
+ Left
+
None
-
- Fill
-
NoControl
- 15, 1
-
-
- 1, 1, 1, 1
+ 17, 6
- 28, 35
-
-
- CenterImage
+ 24, 24
8
@@ -730,7 +718,7 @@
0
- <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="HostLabel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="buttonSSH" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="toggleConsoleButton" Row="0" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="multipleDvdIsoList1" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="pictureBox1" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,AutoSize,0,Percent,100,AutoSize,0,AutoSize,0" /><Rows Styles="Percent,100,Absolute,100" /></TableLayoutSettings>
+ <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="HostLabel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="buttonSSH" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="toggleConsoleButton" Row="0" RowSpan="1" Column="5" ColumnSpan="1" /><Control Name="multipleDvdIsoList1" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="pictureBox1" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,AutoSize,0,Percent,100,AutoSize,0,AutoSize,0" /><Rows Styles="Percent,100,Absolute,37" /></TableLayoutSettings>
Top
@@ -748,7 +736,7 @@
gradientPanel1
- XenAdmin.Controls.GradientPanel.GradientPanel, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
+ XenAdmin.Controls.GradientPanel.HorizontalGradientPanel, [XenCenter], Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
$this
diff --git a/XenAdmin/Controls/ComboBoxes/ISODropDownBox.cs b/XenAdmin/Controls/ComboBoxes/ISODropDownBox.cs
index d7d1f202b..45e85dc16 100644
--- a/XenAdmin/Controls/ComboBoxes/ISODropDownBox.cs
+++ b/XenAdmin/Controls/ComboBoxes/ISODropDownBox.cs
@@ -232,6 +232,8 @@ private void AddSR(ToStringWrapper srWrapper)
}
}
+ [Browsable(false)]
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public IXenConnection connection
{
set
diff --git a/XenAdmin/Controls/MultipleDvdIsoList.Designer.cs b/XenAdmin/Controls/MultipleDvdIsoList.Designer.cs
index 8c0f39680..fbdb877e9 100644
--- a/XenAdmin/Controls/MultipleDvdIsoList.Designer.cs
+++ b/XenAdmin/Controls/MultipleDvdIsoList.Designer.cs
@@ -36,11 +36,9 @@ private void InitializeComponent()
this.newCDLabel = new System.Windows.Forms.Label();
this.comboBoxDrive = new System.Windows.Forms.ComboBox();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
- this.panel1 = new System.Windows.Forms.Panel();
this.cdChanger1 = new XenAdmin.Controls.CDChanger();
- this.linkLabel1 = new System.Windows.Forms.LinkLabel();
+ this.linkLabelEject = new System.Windows.Forms.LinkLabel();
this.tableLayoutPanel1.SuspendLayout();
- this.panel1.SuspendLayout();
this.SuspendLayout();
//
// labelSingleDvd
@@ -51,6 +49,7 @@ private void InitializeComponent()
// newCDLabel
//
resources.ApplyResources(this.newCDLabel, "newCDLabel");
+ this.tableLayoutPanel1.SetColumnSpan(this.newCDLabel, 4);
this.newCDLabel.Cursor = System.Windows.Forms.Cursors.Hand;
this.newCDLabel.ForeColor = System.Drawing.SystemColors.HotTrack;
this.newCDLabel.Name = "newCDLabel";
@@ -69,20 +68,13 @@ private void InitializeComponent()
resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1");
this.tableLayoutPanel1.Controls.Add(this.labelSingleDvd, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.comboBoxDrive, 1, 0);
- this.tableLayoutPanel1.Controls.Add(this.newCDLabel, 2, 1);
- this.tableLayoutPanel1.Controls.Add(this.panel1, 2, 0);
+ this.tableLayoutPanel1.Controls.Add(this.cdChanger1, 2, 0);
+ this.tableLayoutPanel1.Controls.Add(this.linkLabelEject, 3, 0);
+ this.tableLayoutPanel1.Controls.Add(this.newCDLabel, 0, 1);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
//
- // panel1
- //
- resources.ApplyResources(this.panel1, "panel1");
- this.panel1.Controls.Add(this.cdChanger1);
- this.panel1.Controls.Add(this.linkLabel1);
- this.panel1.Name = "panel1";
- //
// cdChanger1
//
- this.cdChanger1.connection = null;
resources.ApplyResources(this.cdChanger1, "cdChanger1");
this.cdChanger1.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
this.cdChanger1.DropDownHeight = 500;
@@ -90,12 +82,12 @@ private void InitializeComponent()
this.cdChanger1.FormattingEnabled = true;
this.cdChanger1.Name = "cdChanger1";
//
- // linkLabel1
+ // linkLabelEject
//
- resources.ApplyResources(this.linkLabel1, "linkLabel1");
- this.linkLabel1.Name = "linkLabel1";
- this.linkLabel1.TabStop = true;
- this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
+ resources.ApplyResources(this.linkLabelEject, "linkLabelEject");
+ this.linkLabelEject.Name = "linkLabelEject";
+ this.linkLabelEject.TabStop = true;
+ this.linkLabelEject.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelEject_LinkClicked);
//
// MultipleDvdIsoList
//
@@ -105,9 +97,8 @@ private void InitializeComponent()
this.Name = "MultipleDvdIsoList";
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
- this.panel1.ResumeLayout(false);
- this.panel1.PerformLayout();
this.ResumeLayout(false);
+ this.PerformLayout();
}
@@ -118,7 +109,6 @@ private void InitializeComponent()
private System.Windows.Forms.ComboBox comboBoxDrive;
private System.Windows.Forms.Label newCDLabel;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
- private System.Windows.Forms.Panel panel1;
- private System.Windows.Forms.LinkLabel linkLabel1;
+ private System.Windows.Forms.LinkLabel linkLabelEject;
}
}
diff --git a/XenAdmin/Controls/MultipleDvdIsoList.cs b/XenAdmin/Controls/MultipleDvdIsoList.cs
index 578324002..0376a4ae3 100644
--- a/XenAdmin/Controls/MultipleDvdIsoList.cs
+++ b/XenAdmin/Controls/MultipleDvdIsoList.cs
@@ -44,7 +44,7 @@ namespace XenAdmin.Controls
{
public partial class MultipleDvdIsoList : UserControl
{
- bool inRefresh = false;
+ private bool _inRefresh;
public MultipleDvdIsoList()
{
@@ -61,7 +61,7 @@ public VM VM
cdChanger1.VM = value;
if (value != null)
cdChanger1.VM.PropertyChanged += vm_PropertyChanged;
- refreshDrives();
+ RefreshDrives();
}
get => cdChanger1.VM;
}
@@ -72,24 +72,24 @@ public VM VM
[Category("Appearance")]
public Color LabelSingleDvdForeColor
{
- get { return labelSingleDvd.ForeColor; }
- set { labelSingleDvd.ForeColor = value; }
+ get => labelSingleDvd.ForeColor;
+ set => labelSingleDvd.ForeColor = value;
}
[Browsable(true)]
[Category("Appearance")]
public Color LabelNewCdForeColor
{
- get { return newCDLabel.ForeColor; }
- set { newCDLabel.ForeColor = value; }
+ get => newCDLabel.ForeColor;
+ set => newCDLabel.ForeColor = value;
}
[Browsable(true)]
[Category("Appearance")]
public Color LinkLabelLinkColor
{
- get { return linkLabel1.LinkColor; }
- set { linkLabel1.LinkColor = value; }
+ get => linkLabelEject.LinkColor;
+ set => linkLabelEject.LinkColor = value;
}
#endregion
@@ -115,24 +115,25 @@ internal virtual void DeregisterEvents()
cdChanger1.DeregisterEvents();
}
- void vm_PropertyChanged(object sender, PropertyChangedEventArgs e)
+ private void vm_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == "VBDs")
- refreshDrives();
+ RefreshDrives();
}
- private void refreshDrives()
+ private void RefreshDrives()
{
VbdCombiItem prevSelection = comboBoxDrive.SelectedItem as VbdCombiItem;
- inRefresh = true;
+ _inRefresh = true;
foreach (object o in comboBoxDrive.Items)
{
- VbdCombiItem v = o as VbdCombiItem;
- v.vbd.PropertyChanged -= new PropertyChangedEventHandler(vbd_PropertyChanged);
+ if (o is VbdCombiItem v)
+ v.Vbd.PropertyChanged -= vbd_PropertyChanged;
}
comboBoxDrive.Items.Clear();
+
if (VM != null && !VM.is_control_domain)
{
List vbds = VM.Connection.ResolveAll(VM.VBDs);
@@ -142,122 +143,115 @@ private void refreshDrives()
VM.Connection.CachePopulated += CachePopulatedMethod;
return;
}
+
vbds.RemoveAll(vbd => !vbd.IsCDROM() && !vbd.IsFloppyDrive());
vbds.Sort();
+
int dvdCount = 0;
int floppyCount = 0;
+
foreach (VBD vbd in vbds)
{
- vbd.PropertyChanged +=new PropertyChangedEventHandler(vbd_PropertyChanged);
+ vbd.PropertyChanged += vbd_PropertyChanged;
+ VbdCombiItem item;
+
if (vbd.IsCDROM())
{
dvdCount++;
- VbdCombiItem i = new VbdCombiItem();
- i.name = string.Format(Messages.DVD_DRIVE_LABEL_NUMBERED, dvdCount);
- i.vbd = vbd;
- comboBoxDrive.Items.Add(i);
+ item = new VbdCombiItem(string.Format(Messages.DVD_DRIVE_LABEL_NUMBERED, dvdCount), vbd);
}
else
{
floppyCount++;
- VbdCombiItem i = new VbdCombiItem();
- i.name = string.Format(Messages.FLOPPY_DRIVE_LABEL_NUMBERED, floppyCount);
- i.vbd = vbd;
- comboBoxDrive.Items.Add(i);
- }
+ item = new VbdCombiItem(string.Format(Messages.FLOPPY_DRIVE_LABEL_NUMBERED, floppyCount), vbd);
+ }
+ comboBoxDrive.Items.Add(item);
}
}
- if (comboBoxDrive.Items.Count == 0)
- {
- comboBoxDrive.Visible = false;
- cdChanger1.Visible = false;
- labelSingleDvd.Visible = false;
- linkLabel1.Visible = false;
- panel1.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;
- panel1.Visible = true;
- linkLabel1.Visible = true;
- }
- else
- {
- comboBoxDrive.Visible = true;
- cdChanger1.Visible = true;
- labelSingleDvd.Visible = false;
- panel1.Visible = true;
- newCDLabel.Visible = false;
- linkLabel1.Visible = true;
- }
- inRefresh = false;
+
+ 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;
+
// Restore prev selection or select the top item by default
if (prevSelection != null)
{
foreach (object o in comboBoxDrive.Items)
{
- VbdCombiItem v = o as VbdCombiItem;
- if (v.vbd.uuid == prevSelection.vbd.uuid)
+ if (o is VbdCombiItem v && v.Vbd.uuid == prevSelection.Vbd.uuid)
{
comboBoxDrive.SelectedItem = o;
return;
}
}
}
- if (comboBoxDrive.Items.Count == 0)
- comboBoxDrive.SelectedItem = null;
- else
- comboBoxDrive.SelectedItem = comboBoxDrive.Items[0];
+
+ comboBoxDrive.SelectedItem = comboBoxDrive.Items.Count == 0 ? null : comboBoxDrive.Items[0];
}
- void vbd_PropertyChanged(object sender, PropertyChangedEventArgs e)
+ private void vbd_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
- refreshDrives();
+ RefreshDrives();
}
private void CachePopulatedMethod(IXenConnection conn)
{
VM.Connection.CachePopulated -= CachePopulatedMethod;
- refreshDrives();
+ RefreshDrives();
}
- internal class VbdCombiItem
+ private class VbdCombiItem
{
- public string name;
- public VBD vbd;
+ public string Name { get; }
+ public VBD Vbd { get; }
+
+ public VbdCombiItem(string name, VBD vbd)
+ {
+ Name = name;
+ Vbd = vbd;
+ }
public override string ToString()
{
- return name;
+ return Name;
}
}
private void comboBoxDrive_SelectedIndexChanged(object sender, EventArgs e)
{
- if (inRefresh)
+ if (_inRefresh)
return;
- cdChanger1.Drive = (comboBoxDrive.SelectedItem as VbdCombiItem)?.vbd;
+ cdChanger1.Drive = (comboBoxDrive.SelectedItem as VbdCombiItem)?.Vbd;
}
-
private void newCDLabel_Click(object sender, EventArgs e)
{
- if (VM != null)
- {
- var createDriveAction = new CreateCdDriveAction(VM);
- createDriveAction.ShowUserInstruction += CreateDriveAction_ShowUserInstruction;
+ if (VM == null)
+ return;
- using (var dlg = new ActionProgressDialog(createDriveAction, ProgressBarStyle.Marquee))
- dlg.ShowDialog(this);
+ if (VM.IsHVM())
+ {
+ using (var dialog = new WarningDialog(
+ string.Format(Messages.NEW_DVD_DRIVE_CREATE_CONFIRMATION, VM.Name()),
+ new ThreeButtonDialog.TBDButton(Messages.NEW_DVD_DRIVE_CREATE_YES_BUTTON, DialogResult.Yes, ThreeButtonDialog.ButtonType.ACCEPT, true),
+ ThreeButtonDialog.ButtonNo))
+ if (dialog.ShowDialog(Program.MainWindow) != DialogResult.Yes)
+ return;
}
+
+ var createDriveAction = new CreateCdDriveAction(VM);
+ createDriveAction.ShowUserInstruction += CreateDriveAction_ShowUserInstruction;
+
+ using (var dlg = new ActionProgressDialog(createDriveAction, ProgressBarStyle.Marquee))
+ dlg.ShowDialog(this);
}
private void CreateDriveAction_ShowUserInstruction(string message)
@@ -272,7 +266,7 @@ private void CreateDriveAction_ShowUserInstruction(string message)
});
}
- private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
+ private void linkLabelEject_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
if (cdChanger1.Drive != null)
cdChanger1.ChangeCD(null);
diff --git a/XenAdmin/Controls/MultipleDvdIsoList.resx b/XenAdmin/Controls/MultipleDvdIsoList.resx
index c0590c8d7..455c813df 100644
--- a/XenAdmin/Controls/MultipleDvdIsoList.resx
+++ b/XenAdmin/Controls/MultipleDvdIsoList.resx
@@ -117,39 +117,30 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Left
+
True
-
-
- Fill
-
NoControl
- 3, 8
-
-
- 3, 8, 3, 5
-
-
- 100, 23
+ 3, 7
- 61, 15
+ 61, 13
- 1
+ 0
DVD Dr&ive:
-
- TopRight
-
labelSingleDvd
@@ -162,65 +153,29 @@
0
+
+ Left, Right
+
True
-
- Fill
-
-
- Microsoft Sans Serif, 8.25pt, style=Bold, Underline
-
-
- NoControl
-
-
- 173, 30
-
-
- 0, 2, 2, 0
-
-
- 942, 47
-
-
- 3
-
-
- Click here to create a DVD drive
-
-
- MiddleLeft
-
-
- False
-
-
- newCDLabel
-
-
- System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ True
-
- tableLayoutPanel1
+
+ GrowAndShrink
-
- 2
+
+ 4
- 70, 4
-
-
- 3, 4, 3, 3
-
-
- 120, 0
+ 70, 3
100, 21
- 2
+ 1
False
@@ -237,17 +192,8 @@
1
-
- 4
-
-
- True
-
-
- GrowAndShrink
-
-
- Fill
+
+ Left, Right
False
@@ -256,93 +202,57 @@
15
- 0, 5
+ 176, 3
- 907, 21
+ 456, 21
- 0
+ 2
cdChanger1
- XenAdmin.Controls.CDChanger, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
+ XenAdmin.Controls.CDChanger, [XenCenter], Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
- panel1
+ tableLayoutPanel1
- 0
+ 2
-
- True
+
+ Left
-
- Right
+
+ True
-
+
NoControl
-
- 907, 5
-
-
- 3, 3, 3, 3
-
-
- 3, 5, 3, 3
+
+ 638, 7
-
- 37, 21
+
+ 31, 13
-
- 1
+
+ 3
-
+
Eject
-
- linkLabel1
+
+ linkLabelEject
-
+
System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- panel1
-
-
- 1
-
-
- Fill
-
-
- 173, 0
-
-
- 0, 0, 0, 0
-
-
- 0, 5, 0, 5
-
-
- 944, 28
-
-
- 40
-
-
- panel1
-
-
- System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
+
tableLayoutPanel1
-
+
3
@@ -355,10 +265,10 @@
2
- 1117, 77
+ 672, 64
- 40
+ 0
tableLayoutPanel1
@@ -373,7 +283,46 @@
0
- <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="labelSingleDvd" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="comboBoxDrive" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="newCDLabel" Row="1" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="panel1" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,AutoSize,0,Percent,100,AutoSize,0" /><Rows Styles="AutoSize,0,Percent,100" /></TableLayoutSettings>
+ <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="labelSingleDvd" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="comboBoxDrive" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="cdChanger1" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="linkLabelEject" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="newCDLabel" Row="1" RowSpan="1" Column="0" ColumnSpan="4" /></Controls><Columns Styles="AutoSize,0,AutoSize,0,Percent,100,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0" /></TableLayoutSettings>
+
+
+ Microsoft Sans Serif, 8.25pt, style=Bold, Underline
+
+
+ NoControl
+
+
+ 3, 39
+
+
+ 3, 12, 3, 12
+
+
+ 666, 13
+
+
+ 4
+
+
+ Click here to create a DVD drive
+
+
+ TopCenter
+
+
+ False
+
+
+ newCDLabel
+
+
+ System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ tableLayoutPanel1
+
+
+ 4
True
@@ -381,8 +330,14 @@
96, 96
+
+ True
+
+
+ GrowAndShrink
+
- 1117, 77
+ 672, 64
MultipleDvdIsoList
diff --git a/XenModel/Actions/VBD/VbdCreateAndPlugAction.cs b/XenModel/Actions/VBD/VbdCreateAndPlugAction.cs
index a54320365..7d33de954 100644
--- a/XenModel/Actions/VBD/VbdCreateAndPlugAction.cs
+++ b/XenModel/Actions/VBD/VbdCreateAndPlugAction.cs
@@ -62,7 +62,7 @@ public VbdCreateAndPlugAction(VM vm, VBD vbd, string vdiName, bool suppress)
protected override void Run()
{
- string vbdServerRef = VBD.create(Session, vbd);
+ string vbdRef = VBD.create(Session, vbd);
if (!VM.IsHVM() && vbd.empty)
{
@@ -71,12 +71,12 @@ protected override void Run()
}
// Then if we can plug the vbd in, do so...
- if (vbdServerRef != null &&
- VBD.get_allowed_operations(Session, vbdServerRef).Contains(vbd_operations.plug))
+ if (vbdRef != null &&
+ VBD.get_allowed_operations(Session, vbdRef).Contains(vbd_operations.plug))
{
log.DebugFormat("Attempting to hot plug VBD {0}.", vbd.uuid);
- RelatedTask = VBD.async_plug(Session, vbdServerRef);
+ RelatedTask = VBD.async_plug(Session, vbdRef);
PollToCompletion();
Description = Messages.ATTACHDISKWIZARD_ATTACHED;
}
diff --git a/XenModel/Messages.Designer.cs b/XenModel/Messages.Designer.cs
index c0853ba24..2b57f37d1 100755
--- a/XenModel/Messages.Designer.cs
+++ b/XenModel/Messages.Designer.cs
@@ -26209,6 +26209,17 @@ public static string NEVER {
}
}
+ ///
+ /// Looks up a localized string similar to Are you sure you want to create a new DVD drive on VM '{0}'?
+ ///
+ ///This action will create a new Virtual Block Device (VBD) that cannot be hot-unplugged..
+ ///
+ public static string NEW_DVD_DRIVE_CREATE_CONFIRMATION {
+ get {
+ return ResourceManager.GetString("NEW_DVD_DRIVE_CREATE_CONFIRMATION", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Creating new DVD drive on VM {0}.
///
@@ -26218,6 +26229,15 @@ public static string NEW_DVD_DRIVE_CREATE_TITLE {
}
}
+ ///
+ /// Looks up a localized string similar to &Yes, Create.
+ ///
+ public static string NEW_DVD_DRIVE_CREATE_YES_BUTTON {
+ get {
+ return ResourceManager.GetString("NEW_DVD_DRIVE_CREATE_YES_BUTTON", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Creating new DVD drive.
///
diff --git a/XenModel/Messages.resx b/XenModel/Messages.resx
index 7ed952b91..a800a4825 100755
--- a/XenModel/Messages.resx
+++ b/XenModel/Messages.resx
@@ -9101,9 +9101,17 @@ You should only proceed if you have verified that these settings are correct.
Never
+
+ Are you sure you want to create a new DVD drive on VM '{0}'?
+
+This action will create a new Virtual Block Device (VBD) that cannot be hot-unplugged.
+
Creating new DVD drive on VM {0}
+
+ &Yes, Create
+
Creating new DVD drive