mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-21 17:11:29 +01:00
Merge pull request #3223 from kc284/master
Random corrections and enhancements
This commit is contained in:
commit
0f4d105518
@ -28,6 +28,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using XenAPI;
|
||||
@ -39,6 +40,9 @@ namespace XenAdmin.Controls
|
||||
public partial class LoggedInLabel : UserControl
|
||||
{
|
||||
private IXenConnection connection;
|
||||
|
||||
[Browsable(false)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public IXenConnection Connection
|
||||
{
|
||||
get
|
||||
|
63
XenAdmin/Controls/StatusStripEx.cs
Normal file
63
XenAdmin/Controls/StatusStripEx.cs
Normal file
@ -0,0 +1,63 @@
|
||||
/* Copyright (c) Cloud Software Group, Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms,
|
||||
* with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
||||
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace XenAdmin.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// A System.Windows.Forms.StatusStrip with the option of click-through
|
||||
/// (see https://learn.microsoft.com/en-us/archive/blogs/rickbrew/how-to-enable-click-through-for-net-2-0-toolstrip-and-menustrip)
|
||||
/// </summary>
|
||||
public class StatusStripEx : StatusStrip
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets whether the StatusStripEx honors item clicks when its containing form does
|
||||
/// not have input focus.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Default value is false, which is the same behavior provided by the base StatusStrip class.
|
||||
/// </remarks>
|
||||
public bool ClickThrough { get; set; }
|
||||
|
||||
protected override void WndProc(ref Message m)
|
||||
{
|
||||
base.WndProc(ref m);
|
||||
|
||||
if (ClickThrough &&
|
||||
m.Msg == NativeConstants.WM_MOUSEACTIVATE &&
|
||||
m.Result == (IntPtr)NativeConstants.MA_ACTIVATEANDEAT)
|
||||
{
|
||||
m.Result = (IntPtr)NativeConstants.MA_ACTIVATE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -35,12 +35,10 @@ namespace XenAdmin.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// A System.Windows.Forms.ToolStrip with the option of click-through
|
||||
/// (see http://blogs.msdn.com/rickbrew/archive/2006/01/09/511003.aspx)
|
||||
/// (see https://learn.microsoft.com/en-us/archive/blogs/rickbrew/how-to-enable-click-through-for-net-2-0-toolstrip-and-menustrip)
|
||||
/// </summary>
|
||||
public class ToolStripEx : ToolStrip
|
||||
{
|
||||
private bool clickThrough = false;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether the ToolStripEx honors item clicks when its containing form does
|
||||
/// not have input focus.
|
||||
@ -48,22 +46,13 @@ namespace XenAdmin.Controls
|
||||
/// <remarks>
|
||||
/// Default value is false, which is the same behavior provided by the base ToolStrip class.
|
||||
/// </remarks>
|
||||
public bool ClickThrough
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.clickThrough;
|
||||
}
|
||||
set
|
||||
{
|
||||
this.clickThrough = value;
|
||||
}
|
||||
}
|
||||
public bool ClickThrough { get; set; }
|
||||
|
||||
protected override void WndProc(ref Message m)
|
||||
{
|
||||
base.WndProc(ref m);
|
||||
if (this.clickThrough &&
|
||||
|
||||
if (ClickThrough &&
|
||||
m.Msg == NativeConstants.WM_MOUSEACTIVATE &&
|
||||
m.Result == (IntPtr)NativeConstants.MA_ACTIVATEANDEAT)
|
||||
{
|
||||
|
@ -45,10 +45,10 @@ namespace XenAdmin.Controls
|
||||
public UpsellPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.LearnMoreButton.Visible = !HiddenFeatures.LearnMoreButtonHidden;
|
||||
LearnMoreButton.Visible = !HiddenFeatures.LearnMoreButtonHidden;
|
||||
}
|
||||
|
||||
public void enableOkButton()
|
||||
public void EnableOkButton()
|
||||
{
|
||||
OKButton.Visible = true;
|
||||
}
|
||||
@ -60,11 +60,9 @@ namespace XenAdmin.Controls
|
||||
: value + string.Format(Messages.UPSELL_BLURB_TRIAL, BrandManager.ProductBrand);
|
||||
}
|
||||
|
||||
public string LearnMoreUrl { private get; set; } = InvisibleMessages.UPSELL_LEARNMOREURL_TRIAL;
|
||||
|
||||
private void LearnMoreButton_Clicked(object sender, EventArgs e)
|
||||
{
|
||||
NavigateTo(LearnMoreUrl);
|
||||
NavigateTo(InvisibleMessages.UPSELL_LEARNMOREURL_TRIAL);
|
||||
}
|
||||
|
||||
private void NavigateTo(string url)
|
||||
|
@ -41,7 +41,7 @@ namespace XenAdmin.Dialogs
|
||||
{
|
||||
InitializeComponent();
|
||||
upsellPage1.BlurbText = blurb;
|
||||
upsellPage1.enableOkButton();
|
||||
upsellPage1.EnableOkButton();
|
||||
CancelButton = upsellPage1.OKButton;
|
||||
Height = upsellPage1.Height;
|
||||
}
|
||||
@ -54,9 +54,7 @@ namespace XenAdmin.Dialogs
|
||||
|
||||
public static void ShowUpsellDialog(string message, IWin32Window parent)
|
||||
{
|
||||
using (var upsellDialog = new UpsellDialog(HiddenFeatures.LinkLabelHidden
|
||||
? message
|
||||
: message + string.Format(Messages.UPSELL_BLURB_TRIAL, BrandManager.ProductBrand)))
|
||||
using (var upsellDialog = new UpsellDialog(message))
|
||||
upsellDialog.ShowDialog(parent);
|
||||
}
|
||||
}
|
||||
|
37
XenAdmin/MainWindow.Designer.cs
generated
37
XenAdmin/MainWindow.Designer.cs
generated
@ -65,7 +65,6 @@ namespace XenAdmin
|
||||
this.TabPageHA = new System.Windows.Forms.TabPage();
|
||||
this.TabPageHAUpsell = new System.Windows.Forms.TabPage();
|
||||
this.TabPageSnapshots = new System.Windows.Forms.TabPage();
|
||||
this.snapshotPage = new XenAdmin.TabPages.SnapshotsPage();
|
||||
this.TabPageWLB = new System.Windows.Forms.TabPage();
|
||||
this.TabPageWLBUpsell = new System.Windows.Forms.TabPage();
|
||||
this.TabPageAD = new System.Windows.Forms.TabPage();
|
||||
@ -287,20 +286,19 @@ namespace XenAdmin
|
||||
this.relNotesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.securityGroupsToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem();
|
||||
this.MenuPanel = new System.Windows.Forms.Panel();
|
||||
this.StatusStrip = new System.Windows.Forms.StatusStrip();
|
||||
this.StatusStrip = new XenAdmin.Controls.StatusStripEx();
|
||||
this.statusProgressBar = new System.Windows.Forms.ToolStripProgressBar();
|
||||
this.statusLabel = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.statusButtonProgress = new System.Windows.Forms.ToolStripSplitButton();
|
||||
this.statusButtonErrors = new System.Windows.Forms.ToolStripSplitButton();
|
||||
this.statusButtonCdnUpdates = new System.Windows.Forms.ToolStripSplitButton();
|
||||
this.statusButtonUpdates = new System.Windows.Forms.ToolStripSplitButton();
|
||||
this.statusButtonCdnUpdates = new System.Windows.Forms.ToolStripSplitButton();
|
||||
this.statusButtonAlerts = new System.Windows.Forms.ToolStripSplitButton();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
this.TheTabControl.SuspendLayout();
|
||||
this.TabPageSnapshots.SuspendLayout();
|
||||
this.TitleBackPanel.SuspendLayout();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.TitleIcon)).BeginInit();
|
||||
@ -460,17 +458,10 @@ namespace XenAdmin
|
||||
//
|
||||
// TabPageSnapshots
|
||||
//
|
||||
this.TabPageSnapshots.Controls.Add(this.snapshotPage);
|
||||
resources.ApplyResources(this.TabPageSnapshots, "TabPageSnapshots");
|
||||
this.TabPageSnapshots.Name = "TabPageSnapshots";
|
||||
this.TabPageSnapshots.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// snapshotPage
|
||||
//
|
||||
resources.ApplyResources(this.snapshotPage, "snapshotPage");
|
||||
this.snapshotPage.Name = "snapshotPage";
|
||||
this.snapshotPage.VM = null;
|
||||
//
|
||||
// TabPageWLB
|
||||
//
|
||||
resources.ApplyResources(this.TabPageWLB, "TabPageWLB");
|
||||
@ -597,7 +588,6 @@ namespace XenAdmin
|
||||
//
|
||||
resources.ApplyResources(this.loggedInLabel1, "loggedInLabel1");
|
||||
this.loggedInLabel1.BackColor = System.Drawing.Color.Transparent;
|
||||
this.loggedInLabel1.Connection = null;
|
||||
this.loggedInLabel1.Name = "loggedInLabel1";
|
||||
//
|
||||
// labelFiltersOnOff
|
||||
@ -2002,6 +1992,7 @@ namespace XenAdmin
|
||||
// StatusStrip
|
||||
//
|
||||
resources.ApplyResources(this.StatusStrip, "StatusStrip");
|
||||
this.StatusStrip.ClickThrough = true;
|
||||
this.StatusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.statusProgressBar,
|
||||
this.statusLabel,
|
||||
@ -2046,15 +2037,6 @@ namespace XenAdmin
|
||||
this.statusButtonErrors.Name = "statusButtonErrors";
|
||||
this.statusButtonErrors.Click += new System.EventHandler(this.statusButtonErrors_Click);
|
||||
//
|
||||
// statusButtonCdnUpdates
|
||||
//
|
||||
this.statusButtonCdnUpdates.DropDownButtonWidth = 0;
|
||||
this.statusButtonCdnUpdates.ForeColor = System.Drawing.SystemColors.ControlDarkDark;
|
||||
this.statusButtonCdnUpdates.Image = global::XenAdmin.Properties.Resources.notif_updates_16;
|
||||
resources.ApplyResources(this.statusButtonCdnUpdates, "statusButtonCdnUpdates");
|
||||
this.statusButtonCdnUpdates.Name = "statusButtonCdnUpdates";
|
||||
this.statusButtonCdnUpdates.Click += new System.EventHandler(this.statusButtonCdnUpdates_Click);
|
||||
//
|
||||
// statusButtonUpdates
|
||||
//
|
||||
this.statusButtonUpdates.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
|
||||
@ -2065,6 +2047,15 @@ namespace XenAdmin
|
||||
this.statusButtonUpdates.Name = "statusButtonUpdates";
|
||||
this.statusButtonUpdates.Click += new System.EventHandler(this.statusButtonUpdates_Click);
|
||||
//
|
||||
// statusButtonCdnUpdates
|
||||
//
|
||||
this.statusButtonCdnUpdates.DropDownButtonWidth = 0;
|
||||
this.statusButtonCdnUpdates.ForeColor = System.Drawing.SystemColors.ControlDarkDark;
|
||||
this.statusButtonCdnUpdates.Image = global::XenAdmin.Properties.Resources.notif_updates_16;
|
||||
resources.ApplyResources(this.statusButtonCdnUpdates, "statusButtonCdnUpdates");
|
||||
this.statusButtonCdnUpdates.Name = "statusButtonCdnUpdates";
|
||||
this.statusButtonCdnUpdates.Click += new System.EventHandler(this.statusButtonCdnUpdates_Click);
|
||||
//
|
||||
// statusButtonAlerts
|
||||
//
|
||||
this.statusButtonAlerts.DropDownButtonWidth = 0;
|
||||
@ -2097,7 +2088,6 @@ namespace XenAdmin
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
|
||||
this.splitContainer1.ResumeLayout(false);
|
||||
this.TheTabControl.ResumeLayout(false);
|
||||
this.TabPageSnapshots.ResumeLayout(false);
|
||||
this.TitleBackPanel.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
@ -2243,7 +2233,6 @@ namespace XenAdmin
|
||||
private System.Windows.Forms.TabPage TabPageSnapshots;
|
||||
private System.Windows.Forms.TabPage TabPageDockerProcess;
|
||||
internal System.Windows.Forms.TabPage TabPageDockerDetails;
|
||||
private XenAdmin.TabPages.SnapshotsPage snapshotPage;
|
||||
private System.Windows.Forms.ToolStripMenuItem connectDisconnectToolStripMenuItem;
|
||||
private XenAdmin.Commands.CommandToolStripMenuItem connectAllToolStripMenuItem;
|
||||
private XenAdmin.Commands.CommandToolStripMenuItem DisconnectToolStripMenuItem;
|
||||
@ -2318,7 +2307,7 @@ namespace XenAdmin
|
||||
private System.Windows.Forms.ToolStripMenuItem customTemplatesToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem templatesToolStripMenuItem1;
|
||||
private System.Windows.Forms.ToolStripMenuItem localStorageToolStripMenuItem;
|
||||
private System.Windows.Forms.StatusStrip StatusStrip;
|
||||
private XenAdmin.Controls.StatusStripEx StatusStrip;
|
||||
private System.Windows.Forms.ToolStripStatusLabel statusLabel;
|
||||
private System.Windows.Forms.ToolStripProgressBar statusProgressBar;
|
||||
private XenAdmin.Commands.CommandToolStripMenuItem reclaimFreedSpacetripMenuItem;
|
||||
|
@ -104,6 +104,7 @@ namespace XenAdmin
|
||||
internal readonly DockerProcessPage DockerProcessPage = new DockerProcessPage();
|
||||
internal readonly DockerDetailsPage DockerDetailsPage = new DockerDetailsPage();
|
||||
internal readonly UsbPage UsbPage = new UsbPage();
|
||||
private readonly SnapshotsPage snapshotPage = new SnapshotsPage();
|
||||
|
||||
private readonly NotificationsBasePage[] _notificationPages;
|
||||
|
||||
@ -188,6 +189,7 @@ namespace XenAdmin
|
||||
components.Add(DockerProcessPage);
|
||||
components.Add(DockerDetailsPage);
|
||||
components.Add(UsbPage);
|
||||
components.Add(snapshotPage);
|
||||
|
||||
AddTabContents(VMStoragePage, TabPageStorage);
|
||||
AddTabContents(SrStoragePage, TabPageSR);
|
||||
@ -212,6 +214,7 @@ namespace XenAdmin
|
||||
AddTabContents(DockerProcessPage, TabPageDockerProcess);
|
||||
AddTabContents(DockerDetailsPage, TabPageDockerDetails);
|
||||
AddTabContents(UsbPage, TabPageUSB);
|
||||
AddTabContents(snapshotPage, TabPageSnapshots);
|
||||
|
||||
#endregion
|
||||
|
||||
@ -1570,9 +1573,8 @@ namespace XenAdmin
|
||||
if(!multi && !SearchMode && isRealVMSelected)
|
||||
newTabs.Add(TabPageSnapshots);
|
||||
|
||||
//Any Clearwater XenServer, or WLB is not licensed on XenServer, the WLB tab and any WLB menu items disappear completely.
|
||||
if (!wlb_upsell && !multi && !SearchMode && isPoolSelected)
|
||||
newTabs.Add(TabPageWLB);
|
||||
if (!multi && !SearchMode && isPoolSelected)
|
||||
newTabs.Add(wlb_upsell ? TabPageWLBUpsell : TabPageWLB);
|
||||
|
||||
if (!multi && !SearchMode && (isPoolSelected || isPoolOrLiveStandaloneHost))
|
||||
newTabs.Add(ad_upsell ? TabPageADUpsell : TabPageAD);
|
||||
|
@ -555,36 +555,6 @@
|
||||
<data name=">>TabPageHAUpsell.ZOrder" xml:space="preserve">
|
||||
<value>12</value>
|
||||
</data>
|
||||
<data name="snapshotPage.AutoScroll" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="snapshotPage.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Fill</value>
|
||||
</data>
|
||||
<data name="snapshotPage.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>0, 0</value>
|
||||
</data>
|
||||
<data name="snapshotPage.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>0, 0, 0, 0</value>
|
||||
</data>
|
||||
<data name="snapshotPage.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>753, 592</value>
|
||||
</data>
|
||||
<data name="snapshotPage.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>snapshotPage.Name" xml:space="preserve">
|
||||
<value>snapshotPage</value>
|
||||
</data>
|
||||
<data name=">>snapshotPage.Type" xml:space="preserve">
|
||||
<value>XenAdmin.TabPages.SnapshotsPage, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>snapshotPage.Parent" xml:space="preserve">
|
||||
<value>TabPageSnapshots</value>
|
||||
</data>
|
||||
<data name=">>snapshotPage.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="TabPageSnapshots.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>4, 22</value>
|
||||
</data>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -555,36 +555,6 @@
|
||||
<data name=">>TabPageHAUpsell.ZOrder" xml:space="preserve">
|
||||
<value>12</value>
|
||||
</data>
|
||||
<data name="snapshotPage.AutoScroll" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="snapshotPage.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Fill</value>
|
||||
</data>
|
||||
<data name="snapshotPage.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>0, 0</value>
|
||||
</data>
|
||||
<data name="snapshotPage.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>0, 0, 0, 0</value>
|
||||
</data>
|
||||
<data name="snapshotPage.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>753, 592</value>
|
||||
</data>
|
||||
<data name="snapshotPage.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>snapshotPage.Name" xml:space="preserve">
|
||||
<value>snapshotPage</value>
|
||||
</data>
|
||||
<data name=">>snapshotPage.Type" xml:space="preserve">
|
||||
<value>XenAdmin.TabPages.SnapshotsPage, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>snapshotPage.Parent" xml:space="preserve">
|
||||
<value>TabPageSnapshots</value>
|
||||
</data>
|
||||
<data name=">>snapshotPage.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="TabPageSnapshots.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>4, 22</value>
|
||||
</data>
|
||||
|
@ -144,8 +144,11 @@ namespace XenAdmin
|
||||
[STAThread]
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
string appGuid = ((GuidAttribute)Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(GuidAttribute), false).GetValue(0)).Value;
|
||||
_pipePath = string.Format(PIPE_PATH_PATTERN, BrandManager.BrandConsole, Process.GetCurrentProcess().SessionId, Environment.UserName, appGuid);
|
||||
_pipePath = string.Format(PIPE_PATH_PATTERN,
|
||||
BrandManager.BrandConsole,
|
||||
Process.GetCurrentProcess().SessionId,
|
||||
Environment.UserName,
|
||||
Assembly.GetExecutingAssembly().Location.Replace('\\', '-'));
|
||||
|
||||
if (NamedPipes.Pipe.ExistsPipe(_pipePath))
|
||||
{
|
||||
|
@ -37,6 +37,7 @@ using XenAPI;
|
||||
using XenAdmin.Model;
|
||||
using System.Xml;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace XenAdmin.TabPages
|
||||
{
|
||||
@ -49,6 +50,8 @@ namespace XenAdmin.TabPages
|
||||
private Host host;
|
||||
private string cachedResult;
|
||||
|
||||
[Browsable(false)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public DockerContainer DockerContainer
|
||||
{
|
||||
get
|
||||
|
@ -30,6 +30,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Xml;
|
||||
using System.Windows.Forms;
|
||||
using XenAdmin.Actions;
|
||||
@ -61,6 +62,8 @@ namespace XenAdmin.TabPages
|
||||
|
||||
public override string HelpID => "TabPageDockerProcess";
|
||||
|
||||
[Browsable(false)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public DockerContainer DockerContainer
|
||||
{
|
||||
get
|
||||
|
@ -57,6 +57,8 @@ namespace XenAdmin.TabPages
|
||||
|
||||
private readonly CollectionChangeEventHandler PIF_CollectionChangedWithInvoke;
|
||||
|
||||
[Browsable(false)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public Host Host
|
||||
{
|
||||
get
|
||||
|
@ -30,6 +30,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using XenAPI;
|
||||
@ -44,9 +45,12 @@ namespace XenAdmin.TabPages
|
||||
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
// We don't rebuild the controls while the tab is not visible, but instead queue it up later for when the page is displayed.
|
||||
private bool refreshNeeded = false;
|
||||
private bool refreshNeeded;
|
||||
|
||||
private IXenObject _xenObject;
|
||||
|
||||
[Browsable(false)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public IXenObject XenObject
|
||||
{
|
||||
get
|
||||
|
@ -71,6 +71,8 @@ namespace XenAdmin.TabPages
|
||||
|
||||
public override string HelpID => "TabPagePvs";
|
||||
|
||||
[Browsable(false)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public IXenConnection Connection
|
||||
{
|
||||
get
|
||||
|
@ -115,6 +115,8 @@ namespace XenAdmin.TabPages
|
||||
}
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
[Browsable(false)]
|
||||
public VM VM
|
||||
{
|
||||
set
|
||||
|
@ -28,6 +28,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System.ComponentModel;
|
||||
using XenAdmin.Core;
|
||||
|
||||
|
||||
@ -35,31 +36,28 @@ namespace XenAdmin.TabPages
|
||||
{
|
||||
public partial class UpsellTabPage : BaseTabPage
|
||||
{
|
||||
protected UpsellTabPage(string title, string blurb)
|
||||
protected UpsellTabPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
base.Text = title;
|
||||
|
||||
BlurbText = blurb;
|
||||
LearnMoreUrl = InvisibleMessages.UPSELL_LEARNMOREURL_TRIAL;
|
||||
}
|
||||
|
||||
public string BlurbText
|
||||
protected string BlurbText
|
||||
{
|
||||
set => upsellPage1.BlurbText = value;
|
||||
}
|
||||
|
||||
public string LearnMoreUrl
|
||||
protected string Title
|
||||
{
|
||||
set => upsellPage1.LearnMoreUrl = value;
|
||||
set => Text = value;
|
||||
}
|
||||
}
|
||||
|
||||
public class ADUpsellPage : UpsellTabPage
|
||||
{
|
||||
public ADUpsellPage()
|
||||
: base(Messages.ACTIVE_DIRECTORY_TAB_TITLE, string.Format(Messages.UPSELL_BLURB_AD, BrandManager.ProductBrand))
|
||||
{
|
||||
Title = Messages.ACTIVE_DIRECTORY_TAB_TITLE;
|
||||
BlurbText = string.Format(Messages.UPSELL_BLURB_AD, BrandManager.ProductBrand);
|
||||
}
|
||||
|
||||
public override string HelpID => "TabPageADUpsell";
|
||||
@ -68,8 +66,10 @@ namespace XenAdmin.TabPages
|
||||
public class HAUpsellPage : UpsellTabPage
|
||||
{
|
||||
public HAUpsellPage()
|
||||
: base(Messages.HIGH_AVAILABILITY, Messages.UPSELL_BLURB_HA)
|
||||
{ }
|
||||
{
|
||||
Title = Messages.HIGH_AVAILABILITY;
|
||||
BlurbText = Messages.UPSELL_BLURB_HA;
|
||||
}
|
||||
|
||||
public override string HelpID => "TabPageHAUpsell";
|
||||
}
|
||||
@ -77,8 +77,10 @@ namespace XenAdmin.TabPages
|
||||
public class WLBUpsellPage : UpsellTabPage
|
||||
{
|
||||
public WLBUpsellPage()
|
||||
: base(Messages.WORKLOAD_BALANCING, Messages.UPSELL_BLURB_WLB)
|
||||
{ }
|
||||
{
|
||||
Title = Messages.WORKLOAD_BALANCING;
|
||||
BlurbText = Messages.UPSELL_BLURB_WLB;
|
||||
}
|
||||
|
||||
public override string HelpID => "TabPageWLBUpsell";
|
||||
}
|
||||
|
@ -43,6 +43,8 @@ namespace XenAdmin.TabPages
|
||||
public partial class UsbPage : BaseTabPage
|
||||
{
|
||||
private Host _host;
|
||||
private HostUsbRow selectedRow;
|
||||
private bool InBuildList;
|
||||
|
||||
public UsbPage()
|
||||
{
|
||||
@ -56,6 +58,8 @@ namespace XenAdmin.TabPages
|
||||
|
||||
public override string HelpID => "TabPageUSB";
|
||||
|
||||
[Browsable(false)]
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public IXenObject XenObject
|
||||
{
|
||||
get
|
||||
@ -80,7 +84,6 @@ namespace XenAdmin.TabPages
|
||||
}
|
||||
}
|
||||
|
||||
public bool InBuildList = false;
|
||||
private void BuildList()
|
||||
{
|
||||
Program.AssertOnEventThread();
|
||||
@ -121,11 +124,6 @@ namespace XenAdmin.TabPages
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnVisibleChanged(EventArgs e)
|
||||
{
|
||||
base.OnVisibleChanged(e);
|
||||
}
|
||||
|
||||
public override void PageHidden()
|
||||
{
|
||||
UnregisterHandlers();
|
||||
@ -133,12 +131,12 @@ namespace XenAdmin.TabPages
|
||||
base.PageHidden();
|
||||
}
|
||||
|
||||
void Host_PropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||
private void Host_PropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
RefreshAllItems();
|
||||
}
|
||||
|
||||
void UsbCollectionChanged(object sender, EventArgs e)
|
||||
private void UsbCollectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
BuildList();
|
||||
}
|
||||
@ -153,7 +151,7 @@ namespace XenAdmin.TabPages
|
||||
}
|
||||
}
|
||||
|
||||
internal void UnregisterHandlers()
|
||||
private void UnregisterHandlers()
|
||||
{
|
||||
if (_host != null)
|
||||
{
|
||||
@ -169,7 +167,6 @@ namespace XenAdmin.TabPages
|
||||
}
|
||||
}
|
||||
|
||||
private HostUsbRow selectedRow = null;
|
||||
private void dataGridViewUsbList_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
selectedRow = null;
|
||||
|
@ -199,6 +199,9 @@
|
||||
<Compile Include="Controls\DiskSpinner.Designer.cs">
|
||||
<DependentUpon>DiskSpinner.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\StatusStripEx.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Controls\TreeViews\FolderChangeDialogTreeView.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
|
Loading…
Reference in New Issue
Block a user