CA-271775: Showing an info message if XC falls back to an earlier RDP version

Eg. Windows 7 users (pre-updates)

Signed-off-by: Gabor Apati-Nagy <gabor.apati-nagy@citrix.com>
This commit is contained in:
Gabor Apati-Nagy 2017-11-13 16:51:56 +00:00
parent 74cf3d03b3
commit 5b2ef0e7eb
5 changed files with 172 additions and 53 deletions

View File

@ -50,6 +50,8 @@ namespace XenAdmin.ConsoleView
private readonly ContainerControl parent;
public bool needsRdpVersionWarning = false;
/// <summary>
/// http://msdn2.microsoft.com/en-us/library/aa383022(VS.85).aspx
/// </summary>
@ -81,15 +83,18 @@ namespace XenAdmin.ConsoleView
// MsRdpClient8 control cannot be created (there is no appropriate version of dll present)
parent.Controls.Add(rdpControl);
allowDisplayUpdate = true;
needsRdpVersionWarning = false;
}
catch
{
//any problems: fall back without thinking too much
if (parent.Controls.Contains(rdpControl))
parent.Controls.Remove(rdpControl);
rdpClient9 = null;
rdpControl = rdpClient6 = new MsRdpClient6();
RDPConfigure(size);
parent.Controls.Add(rdpControl);
needsRdpVersionWarning = true;
}
rdpControl.Resize += resizeHandler;
}

View File

@ -50,6 +50,8 @@ namespace XenAdmin.ConsoleView
this.sendCAD = new System.Windows.Forms.Button();
this.contentPanel = new System.Windows.Forms.Panel();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.labelGeneralInformationMessage = new System.Windows.Forms.Label();
this.pictureBoxGeneralInformationMessage = new System.Windows.Forms.PictureBox();
this.scaleCheckBox = new System.Windows.Forms.CheckBox();
this.fullscreenButton = new System.Windows.Forms.Button();
this.dockButton = new System.Windows.Forms.Button();
@ -65,6 +67,7 @@ namespace XenAdmin.ConsoleView
this.multipleDvdIsoList1 = new XenAdmin.Controls.MultipleDvdIsoList();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.tableLayoutPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxGeneralInformationMessage)).BeginInit();
this.gradientPanel1.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
@ -85,12 +88,27 @@ namespace XenAdmin.ConsoleView
// tableLayoutPanel1
//
resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1");
this.tableLayoutPanel1.Controls.Add(this.labelGeneralInformationMessage, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.pictureBoxGeneralInformationMessage, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.sendCAD, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.scaleCheckBox, 2, 0);
this.tableLayoutPanel1.Controls.Add(this.fullscreenButton, 4, 0);
this.tableLayoutPanel1.Controls.Add(this.dockButton, 3, 0);
this.tableLayoutPanel1.Controls.Add(this.scaleCheckBox, 3, 0);
this.tableLayoutPanel1.Controls.Add(this.fullscreenButton, 5, 0);
this.tableLayoutPanel1.Controls.Add(this.dockButton, 4, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
//
// labelGeneralInformationMessage
//
resources.ApplyResources(this.labelGeneralInformationMessage, "labelGeneralInformationMessage");
this.labelGeneralInformationMessage.AutoEllipsis = true;
this.labelGeneralInformationMessage.Name = "labelGeneralInformationMessage";
//
// pictureBoxGeneralInformationMessage
//
resources.ApplyResources(this.pictureBoxGeneralInformationMessage, "pictureBoxGeneralInformationMessage");
this.pictureBoxGeneralInformationMessage.Image = global::XenAdmin.Properties.Resources._000_Info3_h32bit_16;
this.pictureBoxGeneralInformationMessage.Name = "pictureBoxGeneralInformationMessage";
this.pictureBoxGeneralInformationMessage.TabStop = false;
//
// scaleCheckBox
//
resources.ApplyResources(this.scaleCheckBox, "scaleCheckBox");
@ -215,6 +233,7 @@ namespace XenAdmin.ConsoleView
this.Name = "VNCTabView";
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxGeneralInformationMessage)).EndInit();
this.gradientPanel1.ResumeLayout(false);
this.tableLayoutPanel2.ResumeLayout(false);
this.tableLayoutPanel2.PerformLayout();
@ -243,5 +262,7 @@ namespace XenAdmin.ConsoleView
private System.Windows.Forms.Label powerStateLabel;
private System.Windows.Forms.Label dedicatedGpuWarning;
private System.Windows.Forms.Button buttonSSH;
private System.Windows.Forms.PictureBox pictureBoxGeneralInformationMessage;
private System.Windows.Forms.Label labelGeneralInformationMessage;
}
}

View File

@ -95,6 +95,9 @@ namespace XenAdmin.ConsoleView
InitializeComponent();
var tooltipForGeneralInformationMessage = new ToolTip();
tooltipForGeneralInformationMessage.SetToolTip(labelGeneralInformationMessage, labelGeneralInformationMessage.Text);
HostLabel.Font = Program.HeaderGradientFont;
HostLabel.ForeColor = Program.HeaderGradientForeColor;
multipleDvdIsoList1.LabelSingleDvdForeColor = Program.HeaderGradientForeColor;
@ -212,6 +215,11 @@ namespace XenAdmin.ConsoleView
vncScreen.AutoSwitchRDPLater = true;
}
void ShowOrHideRdpVersionWarning()
{
pictureBoxGeneralInformationMessage.Visible = labelGeneralInformationMessage.Visible = vncScreen.RdpVersionWarningNeeded;
}
public bool IsScaled
{
get { return scaleCheckBox.Checked; }
@ -1229,6 +1237,8 @@ namespace XenAdmin.ConsoleView
}
ignoreScaleChange = false;
scaleCheckBox_CheckedChanged(null, null); // make sure scale setting is now correct: CA-84324
ShowOrHideRdpVersionWarning();
}
private void UpdateTooltipOfToogleButton()

View File

@ -136,7 +136,7 @@
<value>123, 30</value>
</data>
<data name="sendCAD.Size" type="System.Drawing.Size, System.Drawing">
<value>209, 30</value>
<value>197, 30</value>
</data>
<data name="sendCAD.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@ -154,7 +154,7 @@
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;sendCAD.ZOrder" xml:space="preserve">
<value>0</value>
<value>2</value>
</data>
<data name="contentPanel.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
@ -187,8 +187,89 @@
<value>GrowAndShrink</value>
</data>
<data name="tableLayoutPanel1.ColumnCount" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="labelGeneralInformationMessage.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Left</value>
</data>
<data name="labelGeneralInformationMessage.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="labelGeneralInformationMessage.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="labelGeneralInformationMessage.Location" type="System.Drawing.Point, System.Drawing">
<value>223, 4</value>
</data>
<data name="labelGeneralInformationMessage.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 0, 3, 0</value>
</data>
<data name="labelGeneralInformationMessage.MaximumSize" type="System.Drawing.Size, System.Drawing">
<value>0, 30</value>
</data>
<data name="labelGeneralInformationMessage.Size" type="System.Drawing.Size, System.Drawing">
<value>207, 26</value>
</data>
<data name="labelGeneralInformationMessage.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="labelGeneralInformationMessage.Text" xml:space="preserve">
<value>Your RDP client is outdated. For better experience, please update it.</value>
</data>
<data name="labelGeneralInformationMessage.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>BottomLeft</value>
</data>
<data name="labelGeneralInformationMessage.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;labelGeneralInformationMessage.Name" xml:space="preserve">
<value>labelGeneralInformationMessage</value>
</data>
<data name="&gt;&gt;labelGeneralInformationMessage.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;labelGeneralInformationMessage.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;labelGeneralInformationMessage.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="pictureBoxGeneralInformationMessage.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="pictureBoxGeneralInformationMessage.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="pictureBoxGeneralInformationMessage.Location" type="System.Drawing.Point, System.Drawing">
<value>201, 0</value>
</data>
<data name="pictureBoxGeneralInformationMessage.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 0, 0, 0</value>
</data>
<data name="pictureBoxGeneralInformationMessage.Size" type="System.Drawing.Size, System.Drawing">
<value>22, 34</value>
</data>
<data name="pictureBoxGeneralInformationMessage.SizeMode" type="System.Windows.Forms.PictureBoxSizeMode, System.Windows.Forms">
<value>CenterImage</value>
</data>
<data name="pictureBoxGeneralInformationMessage.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="pictureBoxGeneralInformationMessage.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;pictureBoxGeneralInformationMessage.Name" xml:space="preserve">
<value>pictureBoxGeneralInformationMessage</value>
</data>
<data name="&gt;&gt;pictureBoxGeneralInformationMessage.Type" xml:space="preserve">
<value>System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;pictureBoxGeneralInformationMessage.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;pictureBoxGeneralInformationMessage.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="scaleCheckBox.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Left</value>
</data>
@ -199,7 +280,7 @@
<value>NoControl</value>
</data>
<data name="scaleCheckBox.Location" type="System.Drawing.Point, System.Drawing">
<value>433, 8</value>
<value>438, 8</value>
</data>
<data name="scaleCheckBox.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>2, 2, 2, 2</value>
@ -223,7 +304,7 @@
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;scaleCheckBox.ZOrder" xml:space="preserve">
<value>1</value>
<value>3</value>
</data>
<data name="fullscreenButton.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -232,7 +313,7 @@
<value>NoControl</value>
</data>
<data name="fullscreenButton.Location" type="System.Drawing.Point, System.Drawing">
<value>578, 2</value>
<value>583, 2</value>
</data>
<data name="fullscreenButton.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>2, 2, 2, 2</value>
@ -241,7 +322,7 @@
<value>114, 30</value>
</data>
<data name="fullscreenButton.Size" type="System.Drawing.Size, System.Drawing">
<value>123, 30</value>
<value>118, 30</value>
</data>
<data name="fullscreenButton.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
@ -259,7 +340,7 @@
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;fullscreenButton.ZOrder" xml:space="preserve">
<value>2</value>
<value>4</value>
</data>
<data name="dockButton.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -274,7 +355,7 @@
<value>NoControl</value>
</data>
<data name="dockButton.Location" type="System.Drawing.Point, System.Drawing">
<value>489, 2</value>
<value>494, 2</value>
</data>
<data name="dockButton.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>2, 2, 2, 2</value>
@ -307,7 +388,7 @@
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;dockButton.ZOrder" xml:space="preserve">
<value>3</value>
<value>5</value>
</data>
<data name="tableLayoutPanel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Bottom</value>
@ -343,50 +424,11 @@
<value>5</value>
</data>
<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="sendCAD" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="scaleCheckBox" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /&gt;&lt;Control Name="fullscreenButton" Row="0" RowSpan="1" Column="4" ColumnSpan="1" /&gt;&lt;Control Name="dockButton" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /&gt;&lt;/Controls&gt;&lt;Columns Styles="AutoSize,0,Percent,100,AutoSize,0,AutoSize,0,AutoSize,0,Absolute,16" /&gt;&lt;Rows Styles="Percent,100" /&gt;&lt;/TableLayoutSettings&gt;</value>
<value>&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;TableLayoutSettings&gt;&lt;Controls&gt;&lt;Control Name="labelGeneralInformationMessage" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="pictureBoxGeneralInformationMessage" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="sendCAD" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="scaleCheckBox" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /&gt;&lt;Control Name="fullscreenButton" Row="0" RowSpan="1" Column="5" ColumnSpan="1" /&gt;&lt;Control Name="dockButton" Row="0" RowSpan="1" Column="4" ColumnSpan="1" /&gt;&lt;/Controls&gt;&lt;Columns Styles="AutoSize,0,Absolute,22,Percent,100,AutoSize,0,AutoSize,0,AutoSize,0" /&gt;&lt;Rows Styles="Percent,100" /&gt;&lt;/TableLayoutSettings&gt;</value>
</data>
<metadata name="tip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="toggleConsoleButton.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
</data>
<data name="toggleConsoleButton.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="toggleConsoleButton.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="toggleConsoleButton.Location" type="System.Drawing.Point, System.Drawing">
<value>522, 6</value>
</data>
<data name="toggleConsoleButton.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 6, 6, 6</value>
</data>
<data name="toggleConsoleButton.Size" type="System.Drawing.Size, System.Drawing">
<value>175, 24</value>
</data>
<data name="toggleConsoleButton.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="toggleConsoleButton.Text" xml:space="preserve">
<value>Looking for guest console...</value>
</data>
<data name="toggleConsoleButton.ToolTip" xml:space="preserve">
<value>Remote access is not enabled on this guest</value>
</data>
<data name="&gt;&gt;toggleConsoleButton.Name" xml:space="preserve">
<value>toggleConsoleButton</value>
</data>
<data name="&gt;&gt;toggleConsoleButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toggleConsoleButton.Parent" xml:space="preserve">
<value>tableLayoutPanel2</value>
</data>
<data name="&gt;&gt;toggleConsoleButton.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<metadata name="LifeCycleMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>81, 17</value>
</metadata>
@ -549,6 +591,45 @@
<data name="&gt;&gt;buttonSSH.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="toggleConsoleButton.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
</data>
<data name="toggleConsoleButton.Enabled" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="toggleConsoleButton.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="toggleConsoleButton.Location" type="System.Drawing.Point, System.Drawing">
<value>522, 6</value>
</data>
<data name="toggleConsoleButton.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 6, 6, 6</value>
</data>
<data name="toggleConsoleButton.Size" type="System.Drawing.Size, System.Drawing">
<value>175, 24</value>
</data>
<data name="toggleConsoleButton.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="toggleConsoleButton.Text" xml:space="preserve">
<value>Looking for guest console...</value>
</data>
<data name="toggleConsoleButton.ToolTip" xml:space="preserve">
<value>Remote access is not enabled on this guest</value>
</data>
<data name="&gt;&gt;toggleConsoleButton.Name" xml:space="preserve">
<value>toggleConsoleButton</value>
</data>
<data name="&gt;&gt;toggleConsoleButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;toggleConsoleButton.Parent" xml:space="preserve">
<value>tableLayoutPanel2</value>
</data>
<data name="&gt;&gt;toggleConsoleButton.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="multipleDvdIsoList1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
@ -649,7 +730,7 @@
<value>0</value>
</data>
<data name="tableLayoutPanel2.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="HostLabel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="buttonSSH" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /&gt;&lt;Control Name="toggleConsoleButton" Row="0" RowSpan="1" Column="5" ColumnSpan="1" /&gt;&lt;Control Name="multipleDvdIsoList1" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /&gt;&lt;Control Name="pictureBox1" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;/Controls&gt;&lt;Columns Styles="AutoSize,0,AutoSize,0,Percent,100,AutoSize,0,AutoSize,0" /&gt;&lt;Rows Styles="Percent,100,Absolute,37" /&gt;&lt;/TableLayoutSettings&gt;</value>
<value>&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;TableLayoutSettings&gt;&lt;Controls&gt;&lt;Control Name="HostLabel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="buttonSSH" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /&gt;&lt;Control Name="toggleConsoleButton" Row="0" RowSpan="1" Column="5" ColumnSpan="1" /&gt;&lt;Control Name="multipleDvdIsoList1" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /&gt;&lt;Control Name="pictureBox1" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;/Controls&gt;&lt;Columns Styles="AutoSize,0,AutoSize,0,Percent,100,AutoSize,0,AutoSize,0" /&gt;&lt;Rows Styles="Percent,100,Absolute,100" /&gt;&lt;/TableLayoutSettings&gt;</value>
</data>
<data name="gradientPanel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>

View File

@ -117,6 +117,8 @@ namespace XenAdmin.ConsoleView
public event Action<bool> GpuStatusChanged;
public event Action<string> ConnectionNameChanged;
public bool RdpVersionWarningNeeded { get { return rdpClient != null && rdpClient.needsRdpVersionWarning; }}
internal readonly VNCTabView parentVNCTabView;
[DefaultValue(false)]