Skip to content

Commit

Permalink
CP-46828: Added button to open the status report location when comple…
Browse files Browse the repository at this point in the history
…ted.

Signed-off-by: Konstantina Chremmou <[email protected]>
  • Loading branch information
kc284 committed Dec 4, 2023
1 parent 5c858be commit 57f31bf
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 44 deletions.
24 changes: 22 additions & 2 deletions XenAdmin/Wizards/BugToolWizard/BugToolPageRetrieveData.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 18 additions & 2 deletions XenAdmin/Wizards/BugToolWizard/BugToolPageRetrieveData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public partial class BugToolPageRetrieveData : XenTabPage
private static readonly log4net.ILog Log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

private const int MAX_DOWNLOADS_PER_CONNECTION = 3;
public string OutputFile { get; set; }
private bool _packagedReport;

public BugToolPageRetrieveData()
{
Expand Down Expand Up @@ -80,6 +80,8 @@ protected override void PageLoadedCore(PageLoadedDirection direction)
protected override void PageLeaveCore(PageLoadedDirection direction, ref bool cancel)
{
_packagedReport = false;
buttonOpenLocation.Visible = false;

if (direction == PageLoadedDirection.Forward)
return;

Expand All @@ -97,7 +99,7 @@ public override void PageCancelled(ref bool cancel)
public List<Host> SelectedHosts { private get; set; }
public List<Capability> CapabilityList { private get; set; }
public string OutputFolder { get; private set; }
private bool _packagedReport;
public string OutputFile { get; set; }
#endregion

/// <summary>
Expand Down Expand Up @@ -325,10 +327,12 @@ private void Row_RowStatusCompleted(StatusReportRow row)
else if (!failureExists)
{
labelError.Text = Messages.ACTION_SYSTEM_STATUS_COMPILE_SUCCESSFUL;
buttonOpenLocation.Visible = true;
}
else
{
labelError.Text = Messages.ACTION_SYSTEM_STATUS_COMPILE_PARTIAL;
buttonOpenLocation.Visible = true;
}

_packagedReport = false;
Expand Down Expand Up @@ -397,5 +401,17 @@ private void linkLabelBlurb_LinkClicked(object sender, LinkLabelLinkClickedEvent
dlg.ShowDialog(Program.MainWindow);
}
}

private void buttonOpenLocation_Click(object sender, EventArgs e)
{
try
{
Process.Start("explorer.exe", $"/select, \"{OutputFile}\"");
}
catch (Exception ex)
{
Log.Debug(ex);
}
}
}
}
146 changes: 106 additions & 40 deletions XenAdmin/Wizards/BugToolWizard/BugToolPageRetrieveData.resx
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,14 @@
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="labelError.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 407</value>
<value>3, 400</value>
</data>
<data name="labelError.Size" type="System.Drawing.Size, System.Drawing">
<value>677, 13</value>
</data>
<data name="labelError.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="labelError.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>MiddleLeft</value>
</data>
<data name="&gt;&gt;labelError.Name" xml:space="preserve">
<value>labelError</value>
</data>
Expand All @@ -156,33 +153,6 @@
<data name="&gt;&gt;labelError.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="progressBar1.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Left, Right</value>
</data>
<data name="progressBar1.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="progressBar1.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 423</value>
</data>
<data name="progressBar1.Size" type="System.Drawing.Size, System.Drawing">
<value>677, 16</value>
</data>
<data name="progressBar1.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="&gt;&gt;progressBar1.Name" xml:space="preserve">
<value>progressBar1</value>
</data>
<data name="&gt;&gt;progressBar1.Type" xml:space="preserve">
<value>System.Windows.Forms.ProgressBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;progressBar1.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;progressBar1.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<metadata name="columnHostImage.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
Expand Down Expand Up @@ -254,13 +224,13 @@
<value>Fill</value>
</data>
<data name="dataGridViewEx1.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 61</value>
<value>3, 56</value>
</data>
<data name="dataGridViewEx1.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 10, 3, 10</value>
<value>3, 12, 3, 10</value>
</data>
<data name="dataGridViewEx1.Size" type="System.Drawing.Size, System.Drawing">
<value>677, 336</value>
<value>677, 334</value>
</data>
<data name="dataGridViewEx1.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
Expand All @@ -269,13 +239,13 @@
<value>dataGridViewEx1</value>
</data>
<data name="&gt;&gt;dataGridViewEx1.Type" xml:space="preserve">
<value>XenAdmin.Controls.DataGridViewEx.DataGridViewEx, [XenCenter_No_Space], Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
<value>XenAdmin.Controls.DataGridViewEx.DataGridViewEx, [XenCenter], Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;dataGridViewEx1.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;dataGridViewEx1.ZOrder" xml:space="preserve">
<value>2</value>
<value>1</value>
</data>
<data name="labelBlurb.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
Expand Down Expand Up @@ -308,7 +278,7 @@
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;labelBlurb.ZOrder" xml:space="preserve">
<value>3</value>
<value>2</value>
</data>
<data name="linkLabelBlurb.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
Expand Down Expand Up @@ -338,7 +308,7 @@
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;linkLabelBlurb.ZOrder" xml:space="preserve">
<value>4</value>
<value>3</value>
</data>
<data name="labelBlurbCis.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
Expand Down Expand Up @@ -368,8 +338,104 @@
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;labelBlurbCis.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="tableLayoutPanel2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="tableLayoutPanel2.AutoSizeMode" type="System.Windows.Forms.AutoSizeMode, System.Windows.Forms">
<value>GrowAndShrink</value>
</data>
<data name="tableLayoutPanel2.ColumnCount" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="buttonOpenLocation.Location" type="System.Drawing.Point, System.Drawing">
<value>540, 3</value>
</data>
<data name="buttonOpenLocation.Size" type="System.Drawing.Size, System.Drawing">
<value>140, 23</value>
</data>
<data name="buttonOpenLocation.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="buttonOpenLocation.Text" xml:space="preserve">
<value>&amp;Open report location</value>
</data>
<data name="buttonOpenLocation.Visible" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="&gt;&gt;buttonOpenLocation.Name" xml:space="preserve">
<value>buttonOpenLocation</value>
</data>
<data name="&gt;&gt;buttonOpenLocation.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;buttonOpenLocation.Parent" xml:space="preserve">
<value>tableLayoutPanel2</value>
</data>
<data name="&gt;&gt;buttonOpenLocation.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="progressBar1.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Left, Right</value>
</data>
<data name="progressBar1.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="progressBar1.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 4</value>
</data>
<data name="progressBar1.Size" type="System.Drawing.Size, System.Drawing">
<value>531, 21</value>
</data>
<data name="progressBar1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;progressBar1.Name" xml:space="preserve">
<value>progressBar1</value>
</data>
<data name="&gt;&gt;progressBar1.Type" xml:space="preserve">
<value>System.Windows.Forms.ProgressBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;progressBar1.Parent" xml:space="preserve">
<value>tableLayoutPanel2</value>
</data>
<data name="&gt;&gt;progressBar1.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="tableLayoutPanel2.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
<data name="tableLayoutPanel2.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 413</value>
</data>
<data name="tableLayoutPanel2.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 0, 0, 0</value>
</data>
<data name="tableLayoutPanel2.RowCount" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="tableLayoutPanel2.Size" type="System.Drawing.Size, System.Drawing">
<value>683, 29</value>
</data>
<data name="tableLayoutPanel2.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="&gt;&gt;tableLayoutPanel2.Name" xml:space="preserve">
<value>tableLayoutPanel2</value>
</data>
<data name="&gt;&gt;tableLayoutPanel2.Type" xml:space="preserve">
<value>System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;tableLayoutPanel2.Parent" xml:space="preserve">
<value>tableLayoutPanel1</value>
</data>
<data name="&gt;&gt;tableLayoutPanel2.ZOrder" xml:space="preserve">
<value>5</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="buttonOpenLocation" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="progressBar1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;/Controls&gt;&lt;Columns Styles="Percent,100,AutoSize,0" /&gt;&lt;Rows Styles="AutoSize,0" /&gt;&lt;/TableLayoutSettings&gt;</value>
</data>
<data name="tableLayoutPanel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
Expand Down Expand Up @@ -401,7 +467,7 @@
<value>0</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="labelError" Row="3" RowSpan="1" Column="0" ColumnSpan="2" /&gt;&lt;Control Name="progressBar1" Row="4" RowSpan="1" Column="0" ColumnSpan="2" /&gt;&lt;Control Name="dataGridViewEx1" Row="2" RowSpan="1" Column="0" ColumnSpan="2" /&gt;&lt;Control Name="labelBlurb" Row="0" RowSpan="1" Column="0" ColumnSpan="2" /&gt;&lt;Control Name="linkLabelBlurb" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="labelBlurbCis" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;/Controls&gt;&lt;Columns Styles="AutoSize,0,Percent,100" /&gt;&lt;Rows Styles="AutoSize,0,Absolute,20,Percent,100,AutoSize,0,AutoSize,0" /&gt;&lt;/TableLayoutSettings&gt;</value>
<value>&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;TableLayoutSettings&gt;&lt;Controls&gt;&lt;Control Name="labelError" Row="3" RowSpan="1" Column="0" ColumnSpan="2" /&gt;&lt;Control Name="dataGridViewEx1" Row="2" RowSpan="1" Column="0" ColumnSpan="2" /&gt;&lt;Control Name="labelBlurb" Row="0" RowSpan="1" Column="0" ColumnSpan="2" /&gt;&lt;Control Name="linkLabelBlurb" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /&gt;&lt;Control Name="labelBlurbCis" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /&gt;&lt;Control Name="tableLayoutPanel2" Row="4" RowSpan="1" Column="0" ColumnSpan="2" /&gt;&lt;/Controls&gt;&lt;Columns Styles="AutoSize,0,Percent,100,Absolute,20" /&gt;&lt;Rows Styles="AutoSize,0,AutoSize,0,Percent,100,AutoSize,0,AutoSize,0" /&gt;&lt;/TableLayoutSettings&gt;</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
Expand Down Expand Up @@ -437,6 +503,6 @@
<value>BugToolPageRetrieveData</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>XenAdmin.Controls.XenTabPage, [XenCenter_No_Space], Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
<value>XenAdmin.Controls.XenTabPage, [XenCenter], Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
</root>

0 comments on commit 57f31bf

Please sign in to comment.