Fixed regression introduced in previous commit. Also, the MultipleDvdIsoList on the

VMstorage page uses the default colours of the controls, hence we only need to set
them on the VNCTabView and the linklabel does not need to be public.
This commit is contained in:
Konstantina Chremmou 2016-07-06 08:55:28 +01:00
parent e1462e34db
commit 336681fc6a
5 changed files with 133 additions and 101 deletions

View File

@ -96,6 +96,9 @@ namespace XenAdmin.ConsoleView
HostLabel.Font = Program.HeaderGradientFont;
HostLabel.ForeColor = Program.HeaderGradientForeColor;
multipleDvdIsoList1.LabelSingleDvdForeColor = Program.HeaderGradientForeColor;
multipleDvdIsoList1.LabelNewCdForeColor = Program.HeaderGradientForeColor;
multipleDvdIsoList1.LinkLabelLinkColor = Color.White;
#pragma warning disable 0219
// Force the handle to be created, because resize events

View File

@ -31,92 +31,89 @@ namespace XenAdmin.Controls
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MultipleDvdIsoList));
this.labelSingleDvd = new System.Windows.Forms.Label();
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.tableLayoutPanel1.SuspendLayout();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// labelSingleDvd
//
resources.ApplyResources(this.labelSingleDvd, "labelSingleDvd");
this.labelSingleDvd.MaximumSize = new System.Drawing.Size(100, 23);
this.labelSingleDvd.Name = "labelSingleDvd";
//
// newCDLabel
//
resources.ApplyResources(this.newCDLabel, "newCDLabel");
this.newCDLabel.Cursor = System.Windows.Forms.Cursors.Hand;
this.newCDLabel.ForeColor = System.Drawing.SystemColors.HotTrack;
this.newCDLabel.Name = "newCDLabel";
this.newCDLabel.Click += new System.EventHandler(this.newCDLabel_Click);
//
// comboBoxDrive
//
this.comboBoxDrive.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxDrive.FormattingEnabled = true;
resources.ApplyResources(this.comboBoxDrive, "comboBoxDrive");
this.comboBoxDrive.MaximumSize = new System.Drawing.Size(120, 0);
this.comboBoxDrive.Name = "comboBoxDrive";
this.comboBoxDrive.SelectedIndexChanged += new System.EventHandler(this.comboBoxDrive_SelectedIndexChanged);
//
// tableLayoutPanel1
//
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.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.Drive = null;
this.cdChanger1.DropDownHeight = 500;
this.cdChanger1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cdChanger1.Empty = true;
this.cdChanger1.FormattingEnabled = true;
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MultipleDvdIsoList));
this.labelSingleDvd = new System.Windows.Forms.Label();
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.tableLayoutPanel1.SuspendLayout();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// labelSingleDvd
//
resources.ApplyResources(this.labelSingleDvd, "labelSingleDvd");
this.labelSingleDvd.Name = "labelSingleDvd";
//
// newCDLabel
//
resources.ApplyResources(this.newCDLabel, "newCDLabel");
this.newCDLabel.Cursor = System.Windows.Forms.Cursors.Hand;
this.newCDLabel.ForeColor = System.Drawing.SystemColors.HotTrack;
this.newCDLabel.Name = "newCDLabel";
this.newCDLabel.Click += new System.EventHandler(this.newCDLabel_Click);
//
// comboBoxDrive
//
this.comboBoxDrive.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxDrive.FormattingEnabled = true;
resources.ApplyResources(this.comboBoxDrive, "comboBoxDrive");
this.comboBoxDrive.Name = "comboBoxDrive";
this.comboBoxDrive.SelectedIndexChanged += new System.EventHandler(this.comboBoxDrive_SelectedIndexChanged);
//
// tableLayoutPanel1
//
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.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;
this.cdChanger1.DisplayISO = false;
this.cdChanger1.Name = "cdChanger1";
this.cdChanger1.DisplayPhysical = false;
this.cdChanger1.SelectedCD = null;
this.cdChanger1.TheVM = null;
//
// linkLabel1
//
resources.ApplyResources(this.linkLabel1, "linkLabel1");
this.linkLabel1.LinkColor = System.Drawing.Color.White;
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.TabStop = true;
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
//
// MultipleDvdIsoList
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.Controls.Add(this.tableLayoutPanel1);
this.Name = "MultipleDvdIsoList";
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.ResumeLayout(false);
resources.ApplyResources(this.cdChanger1, "cdChanger1");
this.cdChanger1.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
this.cdChanger1.Drive = null;
this.cdChanger1.DropDownHeight = 500;
this.cdChanger1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cdChanger1.Empty = true;
this.cdChanger1.FormattingEnabled = true;
this.cdChanger1.Name = "cdChanger1";
this.cdChanger1.SelectedCD = null;
this.cdChanger1.TheVM = null;
//
// linkLabel1
//
resources.ApplyResources(this.linkLabel1, "linkLabel1");
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.TabStop = true;
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
//
// MultipleDvdIsoList
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.Controls.Add(this.tableLayoutPanel1);
this.Name = "MultipleDvdIsoList";
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.ResumeLayout(false);
}
@ -128,6 +125,6 @@ namespace XenAdmin.Controls
private System.Windows.Forms.Label newCDLabel;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Panel panel1;
internal System.Windows.Forms.LinkLabel linkLabel1;
private System.Windows.Forms.LinkLabel linkLabel1;
}
}

View File

@ -32,6 +32,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
@ -49,8 +50,6 @@ namespace XenAdmin.Controls
public MultipleDvdIsoList()
{
InitializeComponent();
labelSingleDvd.ForeColor = Program.HeaderGradientForeColor;
newCDLabel.ForeColor = Program.HeaderGradientForeColor;
}
private VM vm = null;
@ -73,6 +72,34 @@ namespace XenAdmin.Controls
}
}
#region Designer browsable properties
[Browsable(true)]
[Category("Appearance")]
public Color LabelSingleDvdForeColor
{
get { return labelSingleDvd.ForeColor; }
set { labelSingleDvd.ForeColor = value; }
}
[Browsable(true)]
[Category("Appearance")]
public Color LabelNewCdForeColor
{
get { return newCDLabel.ForeColor; }
set { newCDLabel.ForeColor = value; }
}
[Browsable(true)]
[Category("Appearance")]
public Color LinkLabelLinkColor
{
get { return linkLabel1.LinkColor; }
set { linkLabel1.LinkColor = value; }
}
#endregion
protected virtual void DeregisterEvents()
{
if (vm == null)

View File

@ -112,29 +112,32 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="labelSingleDvd.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="labelSingleDvd.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="labelSingleDvd.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="labelSingleDvd.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 8</value>
</data>
<data name="labelSingleDvd.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 8, 3, 5</value>
</data>
<data name="labelSingleDvd.MaximumSize" type="System.Drawing.Size, System.Drawing">
<value>100, 23</value>
</data>
<data name="labelSingleDvd.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 15</value>
</data>
@ -151,7 +154,7 @@
<value>labelSingleDvd</value>
</data>
<data name="&gt;&gt;labelSingleDvd.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;labelSingleDvd.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
@ -196,7 +199,7 @@
<value>newCDLabel</value>
</data>
<data name="&gt;&gt;newCDLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;newCDLabel.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
@ -210,6 +213,9 @@
<data name="comboBoxDrive.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 4, 3, 3</value>
</data>
<data name="comboBoxDrive.MaximumSize" type="System.Drawing.Size, System.Drawing">
<value>120, 0</value>
</data>
<data name="comboBoxDrive.Size" type="System.Drawing.Size, System.Drawing">
<value>100, 21</value>
</data>
@ -223,7 +229,7 @@
<value>comboBoxDrive</value>
</data>
<data name="&gt;&gt;comboBoxDrive.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;comboBoxDrive.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
@ -301,7 +307,7 @@
<value>linkLabel1</value>
</data>
<data name="&gt;&gt;linkLabel1.Type" xml:space="preserve">
<value>System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;linkLabel1.Parent" xml:space="preserve">
<value>panel1</value>
@ -331,7 +337,7 @@
<value>panel1</value>
</data>
<data name="&gt;&gt;panel1.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panel1.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
@ -358,7 +364,7 @@
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;tableLayoutPanel1.Type" xml:space="preserve">
<value>System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tableLayoutPanel1.Parent" xml:space="preserve">
<value>$this</value>
@ -369,7 +375,7 @@
<data name="tableLayoutPanel1.LayoutSettings" type="System.Windows.Forms.TableLayoutSettings, System.Windows.Forms">
<value>&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;TableLayoutSettings&gt;&lt;Controls&gt;&lt;Control Name="labelSingleDvd" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="comboBoxDrive" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="newCDLabel" Row="1" RowSpan="1" Column="2" ColumnSpan="1" /&gt;&lt;Control Name="panel1" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /&gt;&lt;/Controls&gt;&lt;Columns Styles="AutoSize,0,AutoSize,0,Percent,100,AutoSize,0" /&gt;&lt;Rows Styles="AutoSize,0,Percent,100" /&gt;&lt;/TableLayoutSettings&gt;</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
@ -382,6 +388,6 @@
<value>MultipleDvdIsoList</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>

View File

@ -67,7 +67,6 @@ namespace XenAdmin.TabPages
TitleLabel.ForeColor = Program.HeaderGradientForeColor;
TitleLabel.Font = Program.HeaderGradientFont;
multipleDvdIsoList1.linkLabel1.LinkColor = Color.FromArgb(0, 0, 255);
dataGridViewStorage.SortCompare += new DataGridViewSortCompareEventHandler(dataGridViewStorage_SortCompare);
dataGridViewStorage.Sort(ColumnDevicePosition, ListSortDirection.Ascending);
}