CP-6094: Moved the New Search button outside the Search panel and the Default search

under the saved Searches drop down. Also minor layout tweaks and test update.

Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
Konstantina Chremmou 2013-09-24 15:47:38 +01:00
parent 5d48859a4b
commit 2a21608e13
14 changed files with 211 additions and 205 deletions

View File

@ -51,7 +51,6 @@ namespace XenAdmin.Controls.XenSearch
public static event EventHandler CustomFieldRemoved;
private const int MAX_GROUPS = 5;
private const int leftGutter = 23;
private const int innerGutter = 6;
static GroupingControl()
@ -264,7 +263,7 @@ namespace XenAdmin.Controls.XenSearch
SuspendLayout();
bool folderSeen = false;
int offset = leftGutter;
int offset = 0;
foreach (Button button in groups.ToArray())
{
@ -441,7 +440,7 @@ namespace XenAdmin.Controls.XenSearch
int draggedButtonRight = draggedButton.Left + draggedButton.Width;
int draggedButtonIndex = groups.IndexOf(draggedButton);
int offset = leftGutter;
int offset = 0;
int leftBarrier = -1;
int swapWith = -1;
int rightBarrier = -1;
@ -485,7 +484,7 @@ namespace XenAdmin.Controls.XenSearch
bool movedNeither = !movedLeft && !movedRight;
if (movedRight || movedNeither)
{
int maxRight;
int maxRight = 0;
if (rightBarrier >= 0)
{
if (swapWith >= 0 && swapWith >= rightBarrier)
@ -494,22 +493,20 @@ namespace XenAdmin.Controls.XenSearch
}
else if (groupsArray.Length >= 2)
maxRight = groupsArray[groupsArray.Length - 2].Right + innerGutter;
else
maxRight = leftGutter;
if (potentialLocation > maxRight)
potentialLocation = maxRight;
}
if (movedLeft || movedNeither)
{
int maxLeft;
int maxLeft = 0;
if (leftBarrier >= 0)
{
if (swapWith >= 0 && swapWith <= leftBarrier)
swapWith = leftBarrier + 1;
maxLeft = groupsArray[leftBarrier].Right + innerGutter;
}
else
maxLeft = leftGutter;
if (potentialLocation < maxLeft)
potentialLocation = maxLeft;
}

View File

@ -93,10 +93,10 @@ namespace XenAdmin.Controls.XenSearch
this.queryTypeComboButton.BeforeItemSelected += new System.EventHandler(this.queryTypeComboButton_BeforeItemSelected);
this.queryTypeComboButton.ItemSelected += new System.EventHandler(this.queryTypeComboButton_ItemSelected);
//
// folderComboButton
// resourceSelectButton
//
resources.ApplyResources(this.resourceSelectButton, "folderComboButton");
this.resourceSelectButton.Name = "folderComboButton";
resources.ApplyResources(this.resourceSelectButton, "resourceSelectButton");
this.resourceSelectButton.Name = "resourceSelectButton";
this.resourceSelectButton.SelectedItem = null;
this.resourceSelectButton.UseMnemonic = false;
this.resourceSelectButton.UseVisualStyleBackColor = true;
@ -104,6 +104,7 @@ namespace XenAdmin.Controls.XenSearch
//
// QueryElement
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.Controls.Add(this.unitsLabel);
this.Controls.Add(this.numericUpDown);
@ -114,7 +115,6 @@ namespace XenAdmin.Controls.XenSearch
this.Controls.Add(this.removeButton);
this.Controls.Add(this.textBox);
this.Controls.Add(this.resourceSelectButton);
resources.ApplyResources(this, "$this");
this.Name = "QueryElement";
((System.ComponentModel.ISupportInitialize)(this.numericUpDown)).EndInit();
this.ResumeLayout(false);

View File

@ -310,7 +310,7 @@ namespace XenAdmin.Controls.XenSearch
}
}
private void SelectDefaultQueryType()
public void SelectDefaultQueryType()
{
CurrentQueryType = DefaultQueryType;
}

View File

@ -123,7 +123,7 @@
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="textBox.Location" type="System.Drawing.Point, System.Drawing">
<value>328, 2</value>
<value>303, 2</value>
</data>
<data name="textBox.Size" type="System.Drawing.Size, System.Drawing">
<value>203, 20</value>
@ -151,7 +151,7 @@
<value>NoControl</value>
</data>
<data name="removeButton.Location" type="System.Drawing.Point, System.Drawing">
<value>534, 1</value>
<value>519, 1</value>
</data>
<data name="removeButton.Size" type="System.Drawing.Size, System.Drawing">
<value>23, 23</value>
@ -175,7 +175,7 @@
<value>Top, Left, Right</value>
</data>
<data name="dateTimePicker.Location" type="System.Drawing.Point, System.Drawing">
<value>328, 2</value>
<value>303, 2</value>
</data>
<data name="dateTimePicker.Size" type="System.Drawing.Size, System.Drawing">
<value>203, 20</value>
@ -199,7 +199,7 @@
<value>Top, Left, Right</value>
</data>
<data name="numericUpDown.Location" type="System.Drawing.Point, System.Drawing">
<value>328, 2</value>
<value>303, 2</value>
</data>
<data name="numericUpDown.Size" type="System.Drawing.Size, System.Drawing">
<value>159, 20</value>
@ -229,7 +229,7 @@
<value>NoControl</value>
</data>
<data name="unitsLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>495, 5</value>
<value>470, 5</value>
</data>
<data name="unitsLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>0, 13</value>
@ -255,9 +255,9 @@
<data name="ComboButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAAcAAAAFCAYAAACJmvbYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAOxAAA
DsQBlSsOGwAAAEpJREFUGFdjZGBg6AFiGyCWAWJRIH4LxM+B+AgQM0QD8X8sOAYkyQjEZ9AkLwH5TAz/
/4M0gY28DVXwEEgrgMVBBJKC/UAJJZgYAIbFI8X9mrxkAAAAAElFTkSuQmCC
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAOwwAA
DsMBx2+oZAAAAE9JREFUGFdjAIIeID4BxE+A+CcQPwPis0A8EYgZooH4PxYcA8QMjEB8BioAw5eAmInh
/38Qm0EGiG8DMYjzEIgVwOIgAknBfiBWgoj9ZwAAhPclqFvZLCsAAAAASUVORK5CYII=
</value>
</data>
<data name="ComboButton.ImageAlign" type="System.Drawing.ContentAlignment, System.Drawing">
@ -267,7 +267,7 @@
<value>NoControl</value>
</data>
<data name="ComboButton.Location" type="System.Drawing.Point, System.Drawing">
<value>327, 1</value>
<value>302, 1</value>
</data>
<data name="ComboButton.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>1, 1, 1, 1</value>
@ -302,9 +302,9 @@
<data name="matchTypeComboButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAAcAAAAFCAYAAACJmvbYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAOxAAA
DsQBlSsOGwAAAEpJREFUGFdjZGBg6AFiGyCWAWJRIH4LxM+B+AgQM0QD8X8sOAYkyQjEZ9AkLwH5TAz/
/4M0gY28DVXwEEgrgMVBBJKC/UAJJZgYAIbFI8X9mrxkAAAAAElFTkSuQmCC
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAOwwAA
DsMBx2+oZAAAAE9JREFUGFdjAIIeID4BxE+A+CcQPwPis0A8EYgZooH4PxYcA8QMjEB8BioAw5eAmInh
/38Qm0EGiG8DMYjzEIgVwOIgAknBfiBWgoj9ZwAAhPclqFvZLCsAAAAASUVORK5CYII=
</value>
</data>
<data name="matchTypeComboButton.ImageAlign" type="System.Drawing.ContentAlignment, System.Drawing">
@ -314,7 +314,7 @@
<value>NoControl</value>
</data>
<data name="matchTypeComboButton.Location" type="System.Drawing.Point, System.Drawing">
<value>176, 1</value>
<value>151, 1</value>
</data>
<data name="matchTypeComboButton.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>1, 1, 1, 1</value>
@ -349,9 +349,9 @@
<data name="queryTypeComboButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAAcAAAAFCAYAAACJmvbYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAOxAAA
DsQBlSsOGwAAAEpJREFUGFdjZGBg6AFiGyCWAWJRIH4LxM+B+AgQM0QD8X8sOAYkyQjEZ9AkLwH5TAz/
/4M0gY28DVXwEEgrgMVBBJKC/UAJJZgYAIbFI8X9mrxkAAAAAElFTkSuQmCC
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAOwwAA
DsMBx2+oZAAAAE9JREFUGFdjAIIeID4BxE+A+CcQPwPis0A8EYgZooH4PxYcA8QMjEB8BioAw5eAmInh
/38Qm0EGiG8DMYjzEIgVwOIgAknBfiBWgoj9ZwAAhPclqFvZLCsAAAAASUVORK5CYII=
</value>
</data>
<data name="queryTypeComboButton.ImageAlign" type="System.Drawing.ContentAlignment, System.Drawing">
@ -361,7 +361,7 @@
<value>NoControl</value>
</data>
<data name="queryTypeComboButton.Location" type="System.Drawing.Point, System.Drawing">
<value>25, 1</value>
<value>0, 1</value>
</data>
<data name="queryTypeComboButton.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>1, 1, 1, 1</value>
@ -393,59 +393,59 @@
<data name="&gt;&gt;queryTypeComboButton.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="folderComboButton.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<data name="resourceSelectButton.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Left, Right</value>
</data>
<data name="folderComboButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<data name="resourceSelectButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAAcAAAAFCAYAAACJmvbYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAOxAAA
DsQBlSsOGwAAAEpJREFUGFdjZGBg6AFiGyCWAWJRIH4LxM+B+AgQM0QD8X8sOAYkyQjEZ9AkLwH5TAz/
/4M0gY28DVXwEEgrgMVBBJKC/UAJJZgYAIbFI8X9mrxkAAAAAElFTkSuQmCC
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAOwwAA
DsMBx2+oZAAAAE9JREFUGFdjAIIeID4BxE+A+CcQPwPis0A8EYgZooH4PxYcA8QMjEB8BioAw5eAmInh
/38Qm0EGiG8DMYjzEIgVwOIgAknBfiBWgoj9ZwAAhPclqFvZLCsAAAAASUVORK5CYII=
</value>
</data>
<data name="folderComboButton.ImageAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<data name="resourceSelectButton.ImageAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>MiddleRight</value>
</data>
<data name="folderComboButton.Location" type="System.Drawing.Point, System.Drawing">
<value>176, 1</value>
<data name="resourceSelectButton.Location" type="System.Drawing.Point, System.Drawing">
<value>151, 1</value>
</data>
<data name="folderComboButton.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<data name="resourceSelectButton.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>1, 1, 1, 1</value>
</data>
<data name="folderComboButton.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<data name="resourceSelectButton.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 0, 2, 0</value>
</data>
<data name="folderComboButton.Size" type="System.Drawing.Size, System.Drawing">
<data name="resourceSelectButton.Size" type="System.Drawing.Size, System.Drawing">
<value>356, 23</value>
</data>
<data name="folderComboButton.TabIndex" type="System.Int32, mscorlib">
<data name="resourceSelectButton.TabIndex" type="System.Int32, mscorlib">
<value>9</value>
</data>
<data name="folderComboButton.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<data name="resourceSelectButton.TextAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>MiddleLeft</value>
</data>
<data name="folderComboButton.TextImageRelation" type="System.Windows.Forms.TextImageRelation, System.Windows.Forms">
<data name="resourceSelectButton.TextImageRelation" type="System.Windows.Forms.TextImageRelation, System.Windows.Forms">
<value>TextBeforeImage</value>
</data>
<data name="&gt;&gt;folderComboButton.Name" xml:space="preserve">
<value>folderComboButton</value>
<data name="&gt;&gt;resourceSelectButton.Name" xml:space="preserve">
<value>resourceSelectButton</value>
</data>
<data name="&gt;&gt;folderComboButton.Type" xml:space="preserve">
<data name="&gt;&gt;resourceSelectButton.Type" xml:space="preserve">
<value>XenAdmin.Controls.XenSearch.ResourceSelectButton, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;folderComboButton.Parent" xml:space="preserve">
<data name="&gt;&gt;resourceSelectButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;folderComboButton.ZOrder" xml:space="preserve">
<data name="&gt;&gt;resourceSelectButton.ZOrder" xml:space="preserve">
<value>8</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>96, 96</value>
</data>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>96, 96</value>
</data>
<data name="$this.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 0, 0, 0</value>
</data>

View File

@ -125,9 +125,9 @@
<data name="searchForComboButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAAcAAAAFCAYAAACJmvbYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAOxAAA
DsQBlSsOGwAAAEpJREFUGFdjZGBg6AFiGyCWAWJRIH4LxM+B+AgQM0QD8X8sOAYkyQjEZ9AkLwH5TAz/
/4M0gY28DVXwEEgrgMVBBJKC/UAJJZgYAIbFI8X9mrxkAAAAAElFTkSuQmCC
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAOvgAA
Dr4B6kKxwAAAAE9JREFUGFdjAIIeID4BxE+A+CcQPwPis0A8EYgZooH4PxYcA8QMjEB8BioAw5eAmInh
/38Qm0EGiG8DMYjzEIgVwOIgAknBfiBWgoj9ZwAAhPclqFvZLCsAAAAASUVORK5CYII=
</value>
</data>
<data name="searchForComboButton.ImageAlign" type="System.Drawing.ContentAlignment, System.Drawing">
@ -138,16 +138,16 @@
<value>NoControl</value>
</data>
<data name="searchForComboButton.Location" type="System.Drawing.Point, System.Drawing">
<value>23, 4</value>
<value>0, 0</value>
</data>
<data name="searchForComboButton.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>1, 1, 1, 1</value>
<value>0, 0, 0, 0</value>
</data>
<data name="searchForComboButton.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 0, 2, 0</value>
<value>0, 0, 5, 0</value>
</data>
<data name="searchForComboButton.Size" type="System.Drawing.Size, System.Drawing">
<value>250, 23</value>
<value>300, 23</value>
</data>
<data name="searchForComboButton.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
@ -176,8 +176,14 @@
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>96, 96</value>
</data>
<data name="$this.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="$this.AutoSizeMode" type="System.Windows.Forms.AutoSizeMode, System.Windows.Forms">
<value>GrowAndShrink</value>
</data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
<value>465, 31</value>
<value>300, 23</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>SearchFor</value>

View File

@ -35,10 +35,9 @@ namespace XenAdmin.Controls.XenSearch
this.SearchLabel = new System.Windows.Forms.Label();
this.buttonSave = new System.Windows.Forms.Button();
this.buttonClose = new System.Windows.Forms.Button();
this.buttonNewSearch = new System.Windows.Forms.Button();
this.searchFor = new XenAdmin.Controls.XenSearch.SearchFor();
this.GroupingControl = new XenAdmin.Controls.XenSearch.GroupingControl();
this.QueryElement = new XenAdmin.Controls.XenSearch.QueryElement();
this.GroupingControl = new XenAdmin.Controls.XenSearch.GroupingControl();
this.SuspendLayout();
//
// GroupsLabel
@ -71,25 +70,11 @@ namespace XenAdmin.Controls.XenSearch
this.buttonClose.UseVisualStyleBackColor = true;
this.buttonClose.Click += new System.EventHandler(this.buttonClose_Click);
//
// buttonNewSearch
//
resources.ApplyResources(this.buttonNewSearch, "buttonNewSearch");
this.buttonNewSearch.Name = "buttonNewSearch";
this.buttonNewSearch.UseVisualStyleBackColor = true;
this.buttonNewSearch.Click += new System.EventHandler(this.buttonNewSearch_Click);
//
// searchFor
//
resources.ApplyResources(this.searchFor, "searchFor");
this.searchFor.Name = "searchFor";
//
// GroupingControl
//
resources.ApplyResources(this.GroupingControl, "GroupingControl");
this.GroupingControl.BackColor = System.Drawing.Color.Transparent;
this.GroupingControl.Name = "GroupingControl";
this.GroupingControl.Searcher = null;
//
// QueryElement
//
resources.ApplyResources(this.QueryElement, "QueryElement");
@ -99,12 +84,18 @@ namespace XenAdmin.Controls.XenSearch
this.QueryElement.Searcher = null;
this.QueryElement.Resize += new System.EventHandler(this.QueryElement_Resize);
//
// GroupingControl
//
resources.ApplyResources(this.GroupingControl, "GroupingControl");
this.GroupingControl.BackColor = System.Drawing.Color.Transparent;
this.GroupingControl.Name = "GroupingControl";
this.GroupingControl.Searcher = null;
//
// Searcher
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.BackColor = System.Drawing.SystemColors.Control;
this.Controls.Add(this.buttonNewSearch);
this.Controls.Add(this.buttonClose);
this.Controls.Add(this.buttonSave);
this.Controls.Add(this.SearchLabel);
@ -129,6 +120,5 @@ namespace XenAdmin.Controls.XenSearch
private SearchFor searchFor;
private System.Windows.Forms.Button buttonSave;
private System.Windows.Forms.Button buttonClose;
private System.Windows.Forms.Button buttonNewSearch;
}
}

View File

@ -178,9 +178,10 @@ namespace XenAdmin.Controls.XenSearch
ToggleExpandedState(false);
}
private void buttonNewSearch_Click(object sender, EventArgs e)
public void BlankSearch()
{
searchFor.BlankSearch();
QueryElement.SelectDefaultQueryType();
}
}
}

View File

@ -130,7 +130,10 @@
<value>NoControl</value>
</data>
<data name="GroupsLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>19, 153</value>
<value>9, 124</value>
</data>
<data name="GroupsLabel.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>9, 6, 3, 3</value>
</data>
<data name="GroupsLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>74, 20</value>
@ -151,7 +154,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;GroupsLabel.ZOrder" xml:space="preserve">
<value>7</value>
<value>6</value>
</data>
<data name="FiltersLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -163,7 +166,10 @@
<value>NoControl</value>
</data>
<data name="FiltersLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>19, 94</value>
<value>9, 64</value>
</data>
<data name="FiltersLabel.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>9, 6, 3, 3</value>
</data>
<data name="FiltersLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>52, 20</value>
@ -184,7 +190,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;FiltersLabel.ZOrder" xml:space="preserve">
<value>5</value>
<value>4</value>
</data>
<data name="SearchLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -196,7 +202,10 @@
<value>NoControl</value>
</data>
<data name="SearchLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>19, 40</value>
<value>9, 6</value>
</data>
<data name="SearchLabel.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>9, 6, 3, 3</value>
</data>
<data name="SearchLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>83, 20</value>
@ -217,7 +226,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;SearchLabel.ZOrder" xml:space="preserve">
<value>3</value>
<value>2</value>
</data>
<data name="buttonSave.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
@ -226,7 +235,7 @@
<value>NoControl</value>
</data>
<data name="buttonSave.Location" type="System.Drawing.Point, System.Drawing">
<value>374, 6</value>
<value>432, 6</value>
</data>
<data name="buttonSave.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 6, 3, 6</value>
@ -250,7 +259,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;buttonSave.ZOrder" xml:space="preserve">
<value>2</value>
<value>1</value>
</data>
<data name="buttonClose.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
@ -259,7 +268,7 @@
<value>NoControl</value>
</data>
<data name="buttonClose.Location" type="System.Drawing.Point, System.Drawing">
<value>455, 6</value>
<value>513, 6</value>
</data>
<data name="buttonClose.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 6, 3, 6</value>
@ -280,43 +289,22 @@
<value>$this</value>
</data>
<data name="&gt;&gt;buttonClose.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="buttonNewSearch.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="buttonNewSearch.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 6</value>
</data>
<data name="buttonNewSearch.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 6, 3, 6</value>
</data>
<data name="buttonNewSearch.Size" type="System.Drawing.Size, System.Drawing">
<value>81, 23</value>
</data>
<data name="buttonNewSearch.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="buttonNewSearch.Text" xml:space="preserve">
<value>New Search</value>
<data name="searchFor.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;buttonNewSearch.Name" xml:space="preserve">
<value>buttonNewSearch</value>
</data>
<data name="&gt;&gt;buttonNewSearch.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;buttonNewSearch.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;buttonNewSearch.ZOrder" xml:space="preserve">
<value>0</value>
<data name="searchFor.AutoSizeMode" type="System.Windows.Forms.AutoSizeMode, System.Windows.Forms">
<value>GrowAndShrink</value>
</data>
<data name="searchFor.Location" type="System.Drawing.Point, System.Drawing">
<value>18, 62</value>
<value>24, 32</value>
</data>
<data name="searchFor.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>24, 3, 3, 3</value>
</data>
<data name="searchFor.Size" type="System.Drawing.Size, System.Drawing">
<value>429, 31</value>
<value>300, 23</value>
</data>
<data name="searchFor.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
@ -331,46 +319,19 @@
<value>$this</value>
</data>
<data name="&gt;&gt;searchFor.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="GroupingControl.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Left, Right</value>
</data>
<data name="GroupingControl.Location" type="System.Drawing.Point, System.Drawing">
<value>18, 176</value>
</data>
<data name="GroupingControl.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 0, 2, 1</value>
</data>
<data name="GroupingControl.Size" type="System.Drawing.Size, System.Drawing">
<value>447, 29</value>
</data>
<data name="GroupingControl.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="&gt;&gt;GroupingControl.Name" xml:space="preserve">
<value>GroupingControl</value>
</data>
<data name="&gt;&gt;GroupingControl.Type" xml:space="preserve">
<value>XenAdmin.Controls.XenSearch.GroupingControl, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;GroupingControl.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;GroupingControl.ZOrder" xml:space="preserve">
<value>8</value>
<value>3</value>
</data>
<data name="QueryElement.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Left, Right</value>
</data>
<data name="QueryElement.Location" type="System.Drawing.Point, System.Drawing">
<value>16, 119</value>
<value>24, 90</value>
</data>
<data name="QueryElement.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 2, 2, 0</value>
<value>24, 3, 3, 3</value>
</data>
<data name="QueryElement.Size" type="System.Drawing.Size, System.Drawing">
<value>448, 25</value>
<value>503, 25</value>
</data>
<data name="QueryElement.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
@ -385,8 +346,35 @@
<value>$this</value>
</data>
<data name="&gt;&gt;QueryElement.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="GroupingControl.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Left, Right</value>
</data>
<data name="GroupingControl.Location" type="System.Drawing.Point, System.Drawing">
<value>24, 150</value>
</data>
<data name="GroupingControl.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>24, 3, 3, 3</value>
</data>
<data name="GroupingControl.Size" type="System.Drawing.Size, System.Drawing">
<value>502, 29</value>
</data>
<data name="GroupingControl.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="&gt;&gt;GroupingControl.Name" xml:space="preserve">
<value>GroupingControl</value>
</data>
<data name="&gt;&gt;GroupingControl.Type" xml:space="preserve">
<value>XenAdmin.Controls.XenSearch.GroupingControl, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;GroupingControl.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;GroupingControl.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@ -400,7 +388,7 @@
<value>0, 8</value>
</data>
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
<value>484, 226</value>
<value>539, 188</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>Searcher</value>

View File

@ -35,12 +35,12 @@ namespace XenAdmin.TabPages
this.buttonEditSearch = new System.Windows.Forms.Button();
this.ddButtonSavedSearches = new XenAdmin.Controls.DropDownButton();
this.contextMenuStripSearches = new System.Windows.Forms.ContextMenuStrip(this.components);
this.buttonReset = new System.Windows.Forms.Button();
this.buttonExport = new System.Windows.Forms.Button();
this.buttonImport = new System.Windows.Forms.Button();
this.panel4 = new System.Windows.Forms.Panel();
this.OutputPanel = new XenAdmin.Controls.XenSearch.SearchOutput();
this.Searcher = new XenAdmin.Controls.XenSearch.Searcher();
this.buttonNewSearch = new System.Windows.Forms.Button();
this.pageContainerPanel.SuspendLayout();
this.tableLayoutPanel.SuspendLayout();
this.panel2.SuspendLayout();
@ -64,9 +64,9 @@ namespace XenAdmin.TabPages
// panel2
//
this.panel2.BackColor = System.Drawing.Color.WhiteSmoke;
this.panel2.Controls.Add(this.buttonNewSearch);
this.panel2.Controls.Add(this.buttonEditSearch);
this.panel2.Controls.Add(this.ddButtonSavedSearches);
this.panel2.Controls.Add(this.buttonReset);
this.panel2.Controls.Add(this.buttonExport);
this.panel2.Controls.Add(this.buttonImport);
resources.ApplyResources(this.panel2, "panel2");
@ -92,13 +92,6 @@ namespace XenAdmin.TabPages
resources.ApplyResources(this.contextMenuStripSearches, "contextMenuStripSearches");
this.contextMenuStripSearches.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStripSearches_Opening);
//
// buttonReset
//
resources.ApplyResources(this.buttonReset, "buttonReset");
this.buttonReset.Name = "buttonReset";
this.buttonReset.UseVisualStyleBackColor = true;
this.buttonReset.Click += new System.EventHandler(this.buttonReset_Click);
//
// buttonExport
//
resources.ApplyResources(this.buttonExport, "buttonExport");
@ -132,6 +125,13 @@ namespace XenAdmin.TabPages
this.Searcher.MaxHeight = 400;
this.Searcher.Name = "Searcher";
//
// buttonNewSearch
//
resources.ApplyResources(this.buttonNewSearch, "buttonNewSearch");
this.buttonNewSearch.Name = "buttonNewSearch";
this.buttonNewSearch.UseVisualStyleBackColor = true;
this.buttonNewSearch.Click += new System.EventHandler(this.buttonNewSearch_Click);
//
// SearchPage
//
resources.ApplyResources(this, "$this");
@ -159,8 +159,8 @@ namespace XenAdmin.TabPages
private XenAdmin.Controls.DropDownButton ddButtonSavedSearches;
private System.Windows.Forms.Button buttonImport;
private System.Windows.Forms.Button buttonExport;
private System.Windows.Forms.Button buttonReset;
private System.Windows.Forms.Button buttonEditSearch;
private System.Windows.Forms.ContextMenuStrip contextMenuStripSearches;
private System.Windows.Forms.Button buttonNewSearch;
}
}

View File

@ -218,6 +218,8 @@ namespace XenAdmin.TabPages
private void contextMenuStripSearches_Opening(object sender, CancelEventArgs e)
{
var theDefaultSearch = new ToolStripMenuItem(Messages.DEFAULT_SEARCH, null, applyDefaultSearch_Click);
var defaultSearches = Search.Searches.Where(s => s.DefaultSearch).OrderBy(s => s);
var customSearches = Search.Searches.Where(s => !s.DefaultSearch).OrderBy(s => s);
@ -238,11 +240,10 @@ namespace XenAdmin.TabPages
}
contextMenuStripSearches.Items.Clear();
contextMenuStripSearches.Items.Add(theDefaultSearch);
contextMenuStripSearches.Items.AddRange(customItems.ToArray());
contextMenuStripSearches.Items.AddRange(defaultItems.ToArray());
if (contextMenuStripSearches.Items.Count > 0)
contextMenuStripSearches.Items.Add(new ToolStripSeparator());
contextMenuStripSearches.Items.Add(new ToolStripSeparator());
var deleteItem = new ToolStripMenuItem(Messages.DELETE_SEARCH_MENU_ITEM);
@ -269,10 +270,15 @@ namespace XenAdmin.TabPages
private void buttonEditSearch_Click(object sender, EventArgs e)
{
Searcher.ToggleExpandedState(true);
OnSearchChanged();
}
private void buttonReset_Click(object sender, EventArgs e)
private void buttonNewSearch_Click(object sender, EventArgs e)
{
Searcher.ToggleExpandedState(true);
Searcher.BlankSearch();
}
private void applyDefaultSearch_Click(object sender, EventArgs e)
{
Search search = Search.SearchFor(xenObjects);
search.ShowSearch = Searcher.Visible;

View File

@ -121,11 +121,41 @@
<data name="tableLayoutPanel.ColumnCount" type="System.Int32, mscorlib">
<value>1</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="buttonNewSearch.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" />
<data name="buttonEditSearch.Location" type="System.Drawing.Point, System.Drawing">
<data name="buttonNewSearch.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 6</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="buttonNewSearch.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 6, 3, 6</value>
</data>
<data name="buttonNewSearch.Size" type="System.Drawing.Size, System.Drawing">
<value>81, 23</value>
</data>
<data name="buttonNewSearch.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="buttonNewSearch.Text" xml:space="preserve">
<value>New Search</value>
</data>
<data name="&gt;&gt;buttonNewSearch.Name" xml:space="preserve">
<value>buttonNewSearch</value>
</data>
<data name="&gt;&gt;buttonNewSearch.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;buttonNewSearch.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;buttonNewSearch.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="buttonEditSearch.Location" type="System.Drawing.Point, System.Drawing">
<value>90, 6</value>
</data>
<data name="buttonEditSearch.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 6, 3, 6</value>
</data>
@ -148,7 +178,7 @@
<value>panel2</value>
</data>
<data name="&gt;&gt;buttonEditSearch.ZOrder" xml:space="preserve">
<value>0</value>
<value>1</value>
</data>
<metadata name="contextMenuStripSearches.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>31, 21</value>
@ -163,13 +193,13 @@
<value>System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="ddButtonSavedSearches.Location" type="System.Drawing.Point, System.Drawing">
<value>99, 6</value>
<value>186, 6</value>
</data>
<data name="ddButtonSavedSearches.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 6, 3, 6</value>
</data>
<data name="ddButtonSavedSearches.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 0, 3, 0</value>
<value>0, 0, 5, 0</value>
</data>
<data name="ddButtonSavedSearches.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 23</value>
@ -180,6 +210,9 @@
<data name="ddButtonSavedSearches.Text" xml:space="preserve">
<value>S&amp;aved Searches</value>
</data>
<data name="ddButtonSavedSearches.TextImageRelation" type="System.Windows.Forms.TextImageRelation, System.Windows.Forms">
<value>TextBeforeImage</value>
</data>
<data name="&gt;&gt;ddButtonSavedSearches.Name" xml:space="preserve">
<value>ddButtonSavedSearches</value>
</data>
@ -190,37 +223,10 @@
<value>panel2</value>
</data>
<data name="&gt;&gt;ddButtonSavedSearches.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="buttonReset.Location" type="System.Drawing.Point, System.Drawing">
<value>225, 6</value>
</data>
<data name="buttonReset.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 6, 3, 6</value>
</data>
<data name="buttonReset.Size" type="System.Drawing.Size, System.Drawing">
<value>107, 23</value>
</data>
<data name="buttonReset.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="buttonReset.Text" xml:space="preserve">
<value>Default Sea&amp;rch</value>
</data>
<data name="&gt;&gt;buttonReset.Name" xml:space="preserve">
<value>buttonReset</value>
</data>
<data name="&gt;&gt;buttonReset.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;buttonReset.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;buttonReset.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="buttonExport.Location" type="System.Drawing.Point, System.Drawing">
<value>338, 6</value>
<value>312, 5</value>
</data>
<data name="buttonExport.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 6, 3, 6</value>
@ -247,7 +253,7 @@
<value>3</value>
</data>
<data name="buttonImport.Location" type="System.Drawing.Point, System.Drawing">
<value>419, 6</value>
<value>393, 5</value>
</data>
<data name="buttonImport.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>3, 6, 3, 6</value>

View File

@ -55,9 +55,9 @@ namespace XenAdminTests.SearchTests
"Couldn't select all-folders");
}
private Button NewSearchButton
private Button EditSearchButton
{
get { return TestUtils.GetButton(MainWindowWrapper.Item, "SearchPage.buttonNewSearch"); }
get { return TestUtils.GetButton(MainWindowWrapper.Item, "SearchPage.buttonEditSearch"); }
}
private Searcher SearcherPanel
@ -104,7 +104,7 @@ namespace XenAdminTests.SearchTests
[Ignore]
public void TestSearcherUpdatesWhenTagsChange()
{
MW(() => NewSearchButton.PerformClick());
MW(() => EditSearchButton.PerformClick());
// now test that the filter-value combo updates when the tags change for each of these objects.
foreach (IXenObject xenObject in new IXenObject[] { GetAnyHost(), GetAnyNetwork(), GetAnyPool(), GetAnySR(), GetAnyVM() })
@ -127,7 +127,7 @@ namespace XenAdminTests.SearchTests
[Test]
public void TestSearcherDoesntUpdateWhenTagsChangeOnUnsearchableObject()
{
MW(() => NewSearchButton.PerformClick());
MW(() => EditSearchButton.PerformClick());
// select Tags for the query type
MWWaitFor(() => QueryTypeComboButton.SelectItem<QueryElement.QueryType>(qt => qt.ToString() == "Tags"),
@ -147,7 +147,7 @@ namespace XenAdminTests.SearchTests
[Ignore]
public void TestSearcherUpdatesWhenCustomFieldsChange()
{
MW(() => NewSearchButton.PerformClick());
MW(() => EditSearchButton.PerformClick());
// create a new custom field
string newCustomField = Guid.NewGuid().ToString();

View File

@ -8634,6 +8634,15 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to Default Search.
/// </summary>
public static string DEFAULT_SEARCH {
get {
return ResourceManager.GetString("DEFAULT_SEARCH", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Resources by Tag.
/// </summary>

View File

@ -3101,6 +3101,9 @@ Please reconnect the host and try again.</value>
<data name="DEFAULT_INSTALL_OF_XENSERVER" xml:space="preserve">
<value>Default install of XenServer</value>
</data>
<data name="DEFAULT_SEARCH" xml:space="preserve">
<value>Default Search</value>
</data>
<data name="DEFAULT_SEARCH_OBJECTS_BY_TAG" xml:space="preserve">
<value>Resources by Tag</value>
</data>