2017-01-16 20:59:50 +01:00
|
|
|
|
/* Copyright (c) Citrix Systems, Inc.
|
2016-07-13 14:36:49 +02:00
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* 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.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
using XenAdmin.Network;
|
2016-07-25 16:26:08 +02:00
|
|
|
|
using XenAdmin.Dialogs;
|
2016-07-13 14:36:49 +02:00
|
|
|
|
using XenAPI;
|
CP-16922: Implement GUI for enabling PVS read caching (#1179)
* CP-16922: UI changes to PvsPage to replace the single configure button with a separate enable and disable one, per the design doc
* CP-16922: Intermediate checkin - command + dialog implemented, but PVS page has some layout problems.
* CP-16922: Implement GUI for enabling PVS read caching and marking/unmarking VMs for prepopulation
Fix the broken layout by reverting MainWindow.resx (which shouldn't have changed) back to the previous commit. Also removed duplicate properties button code.
* CP-16922: PVS Page changes, to properly display all VMs (not just ones with proxy), only populating proxy columns if there is a proxy set.
* CP-16922: Use a CommandButton for the enable button, connected to the same command as the VM main menu button, and using the table selection as its selection manager.
* CP-16922: Delete the old enable button click behaviour (because it now has a proper command), was causing the dialog to show up twice
* CP-16922: Properly list VMs by hiding those that should be hidden (in addition to non-VMs, also hide the __gui__ prefix and others covered by Show function). Also fixes a bug in NewVMGroupVMsPage discovered when fixing this - it would show VMs that should be hidden if you used the search bar.
* CP-16922: Use ButtonText on the Command to set the text on the PVS enable button
* CP-16922: Add the disable PVS read-caching command, and its associated proxy destroy action. Both based off enable equivalents (main difference is no dialog for now). Not used yet but will be in main window menu + disable button
* CP-16922: Add disable PVS read-caching to the main window menu (under enable), with the disable command attached to it
* CP-16922: Add support for disabling PVS read-caching for selected hosts via the PVS tab page by converting the disable button into a CommandButton in the same way as the enable button, using its own command + selection manager (because Selection Managers only bind to one control)
* CP-16922: Design - adding the "read caching enabled" column from the design, so that we display both whether caching is enabled and whether the VM is currently cached. If it's disabled all other values are missing.
* CP-16922: Add the PVS site column per the design to show the site a VM's PVS Proxy is on if it has a proxy
* CP-16922: Add an event handler for VMs changing so that newly provisioned VMs immediately show up in the PVS tab page
* CP-16922: Support for properly remembering the selection when the VM list is refreshed. A new method returns the list of VMs for the selected rows, and we can then check if the VM for the row being added is in this list. If there was no previous selection then we still select the first row by default.
* CP-16922: Remove prepopulate, which is being removed from the design. The next XAPI version will remove it, so just pass False as prepopulate for now, and remove the option from the dialog and PVS tab page.
* CP-16922: Improve UI appearance for a missing Storage Repository. Per the design, if there is no SR show the message None (memory only) instead of an empty cell
* CP-16922: Improved sorting behaviour. All columns (except VM name, which always uses it) use the VM tag as a sorting fallback (since they all have duplicates). New default sort which sorts by caching enabled first (yes before no), and then VM tag as a tiebreaker. Support for remembering the current sort on refresh, ie when a value changes.
* CP-16922: Refactoring to use a VM extension method to get the PVSProxy (or null if none exists) for a VM. This was used in the PVS Page + commands which are now much simpler.
* CP-16922: Move where the SelectionChanged event handler is set when refreshing the PVS table, so that the command buttons are updated correctly.
* CP-16922: Improvements to PVS read-caching dialog. Set accept/cancel buttons properly + adjust tab values, so focus acts as expected
* CP-16922: Remove the images from the menu for Enable/Disable PVS read-caching, most commands in the menu don't have one
* CP-16922: Sorting out the strings for the actions + ParallelAction calls, and moving them into the resx. Also reverting wrong MainWindow.resx changes.
* CAR-2184: XAPI changes. I've made the minimal possible changes to PvsPage to ensure it compiles, but it's had a lot of feature work (CP-16922) that supersedes this, these small changes should keep that merge painless.
* CAR-2184 XAPI: Reverse the unrelated changes, only keep the PVS ones.
* CP-16922: Merge latest XAPI changes, notably changes to Pvs_site.create
* CP-16922: Change tab show/hide logic for PVS tab, show it even if there are no PVS sites.
* CP-16922: Implement GUI for enabling PVS read caching
Design changes - remove the storage repo column and replace it with status, which is populated with a friendly version of the pvs_proxy_status enum. Also populate site list using site.name_label
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* CP-16922: Implement GUI for enabling PVS read caching
Adjusting the CanExecute of Enable PVS read-caching command to require at least one PVS site to be created. Since the PVS tab can show up without any sites, we need this because we can't create a proxy without a site.
* CP-16922: Code review changes.
Tidied up messages, and ensured actions run async properly, and without exiting before their task.
* CP-16922: Code review changes.
Update dialog resx, wider combobox on dialog, update action descriptions before setting RelatedTask, add friendly message body for PVS error notifications.
2016-09-22 16:08:15 +02:00
|
|
|
|
using XenAdmin.Commands;
|
[CA-233454] PVS tab doesn't show a new VM when it's created (#1314)
* [CA-233454] PVS tab doesn't show a new VM when it's created
Refined the rules for not adding a VM to the table, if it is a template (thus not_a_real_vm), and it has the __gui__ prefix (thus hidden), we still add it, but hide it.
When its name is changed (to remove the __gui__ prefix), we update its name and re-calculate whether it should be visible (in the case of a new VM this will be true once the __gui__ prefix is gone). Also resort the table if a node changes from hidden to visible, because it appears as an addition to the table.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update criteria for VM visibility to include is_a_real_vm
is_a_template is changed before the name_label removes the __gui__ prefix, so this works with no other changes to the vm property changed event.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update when the VMs are shown in the PVS list
New observable property IsBeingCreated for VMs, set to true when they're made a hidden object, and false when they're removed from hidden objects (both in CreateVMAction). In the PVS Page when this is set to false, we re-evaluate whether a VM can be shown. This means that new VMs show here at the same time they're added to the tree (only different is tree refresh time), instead of far earlier (and before their networks were added).
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Set IsbeingCreated in the CreateVMFastAction
* [CA-233454] Properly support the VM Fast Create action
Further changes to CreateVMFastAction, to ensure it works with PVS tab - use the __gui__ prefix when the VM is created and then change it back just before showing.
* [CA-233454] Small logic adjustments/tidying up
2016-11-30 13:24:02 +01:00
|
|
|
|
using XenAdmin.Core;
|
2016-07-13 14:36:49 +02:00
|
|
|
|
|
|
|
|
|
namespace XenAdmin.TabPages
|
|
|
|
|
{
|
|
|
|
|
public partial class PvsPage : BaseTabPage
|
|
|
|
|
{
|
|
|
|
|
private IXenConnection connection;
|
CP-16922: Implement GUI for enabling PVS read caching (#1179)
* CP-16922: UI changes to PvsPage to replace the single configure button with a separate enable and disable one, per the design doc
* CP-16922: Intermediate checkin - command + dialog implemented, but PVS page has some layout problems.
* CP-16922: Implement GUI for enabling PVS read caching and marking/unmarking VMs for prepopulation
Fix the broken layout by reverting MainWindow.resx (which shouldn't have changed) back to the previous commit. Also removed duplicate properties button code.
* CP-16922: PVS Page changes, to properly display all VMs (not just ones with proxy), only populating proxy columns if there is a proxy set.
* CP-16922: Use a CommandButton for the enable button, connected to the same command as the VM main menu button, and using the table selection as its selection manager.
* CP-16922: Delete the old enable button click behaviour (because it now has a proper command), was causing the dialog to show up twice
* CP-16922: Properly list VMs by hiding those that should be hidden (in addition to non-VMs, also hide the __gui__ prefix and others covered by Show function). Also fixes a bug in NewVMGroupVMsPage discovered when fixing this - it would show VMs that should be hidden if you used the search bar.
* CP-16922: Use ButtonText on the Command to set the text on the PVS enable button
* CP-16922: Add the disable PVS read-caching command, and its associated proxy destroy action. Both based off enable equivalents (main difference is no dialog for now). Not used yet but will be in main window menu + disable button
* CP-16922: Add disable PVS read-caching to the main window menu (under enable), with the disable command attached to it
* CP-16922: Add support for disabling PVS read-caching for selected hosts via the PVS tab page by converting the disable button into a CommandButton in the same way as the enable button, using its own command + selection manager (because Selection Managers only bind to one control)
* CP-16922: Design - adding the "read caching enabled" column from the design, so that we display both whether caching is enabled and whether the VM is currently cached. If it's disabled all other values are missing.
* CP-16922: Add the PVS site column per the design to show the site a VM's PVS Proxy is on if it has a proxy
* CP-16922: Add an event handler for VMs changing so that newly provisioned VMs immediately show up in the PVS tab page
* CP-16922: Support for properly remembering the selection when the VM list is refreshed. A new method returns the list of VMs for the selected rows, and we can then check if the VM for the row being added is in this list. If there was no previous selection then we still select the first row by default.
* CP-16922: Remove prepopulate, which is being removed from the design. The next XAPI version will remove it, so just pass False as prepopulate for now, and remove the option from the dialog and PVS tab page.
* CP-16922: Improve UI appearance for a missing Storage Repository. Per the design, if there is no SR show the message None (memory only) instead of an empty cell
* CP-16922: Improved sorting behaviour. All columns (except VM name, which always uses it) use the VM tag as a sorting fallback (since they all have duplicates). New default sort which sorts by caching enabled first (yes before no), and then VM tag as a tiebreaker. Support for remembering the current sort on refresh, ie when a value changes.
* CP-16922: Refactoring to use a VM extension method to get the PVSProxy (or null if none exists) for a VM. This was used in the PVS Page + commands which are now much simpler.
* CP-16922: Move where the SelectionChanged event handler is set when refreshing the PVS table, so that the command buttons are updated correctly.
* CP-16922: Improvements to PVS read-caching dialog. Set accept/cancel buttons properly + adjust tab values, so focus acts as expected
* CP-16922: Remove the images from the menu for Enable/Disable PVS read-caching, most commands in the menu don't have one
* CP-16922: Sorting out the strings for the actions + ParallelAction calls, and moving them into the resx. Also reverting wrong MainWindow.resx changes.
* CAR-2184: XAPI changes. I've made the minimal possible changes to PvsPage to ensure it compiles, but it's had a lot of feature work (CP-16922) that supersedes this, these small changes should keep that merge painless.
* CAR-2184 XAPI: Reverse the unrelated changes, only keep the PVS ones.
* CP-16922: Merge latest XAPI changes, notably changes to Pvs_site.create
* CP-16922: Change tab show/hide logic for PVS tab, show it even if there are no PVS sites.
* CP-16922: Implement GUI for enabling PVS read caching
Design changes - remove the storage repo column and replace it with status, which is populated with a friendly version of the pvs_proxy_status enum. Also populate site list using site.name_label
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* CP-16922: Implement GUI for enabling PVS read caching
Adjusting the CanExecute of Enable PVS read-caching command to require at least one PVS site to be created. Since the PVS tab can show up without any sites, we need this because we can't create a proxy without a site.
* CP-16922: Code review changes.
Tidied up messages, and ensured actions run async properly, and without exiting before their task.
* CP-16922: Code review changes.
Update dialog resx, wider combobox on dialog, update action descriptions before setting RelatedTask, add friendly message body for PVS error notifications.
2016-09-22 16:08:15 +02:00
|
|
|
|
private SelectionManager enableSelectionManager;
|
|
|
|
|
private SelectionManager disableSelectionManager;
|
|
|
|
|
|
|
|
|
|
private DataGridViewVms_DefaultSort vmDefaultSort;
|
2016-11-24 17:51:48 +01:00
|
|
|
|
|
|
|
|
|
private readonly CollectionChangeEventHandler PvsProxy_CollectionChangedWithInvoke;
|
2016-07-13 14:36:49 +02:00
|
|
|
|
|
|
|
|
|
public PvsPage()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
CP-16922: Implement GUI for enabling PVS read caching (#1179)
* CP-16922: UI changes to PvsPage to replace the single configure button with a separate enable and disable one, per the design doc
* CP-16922: Intermediate checkin - command + dialog implemented, but PVS page has some layout problems.
* CP-16922: Implement GUI for enabling PVS read caching and marking/unmarking VMs for prepopulation
Fix the broken layout by reverting MainWindow.resx (which shouldn't have changed) back to the previous commit. Also removed duplicate properties button code.
* CP-16922: PVS Page changes, to properly display all VMs (not just ones with proxy), only populating proxy columns if there is a proxy set.
* CP-16922: Use a CommandButton for the enable button, connected to the same command as the VM main menu button, and using the table selection as its selection manager.
* CP-16922: Delete the old enable button click behaviour (because it now has a proper command), was causing the dialog to show up twice
* CP-16922: Properly list VMs by hiding those that should be hidden (in addition to non-VMs, also hide the __gui__ prefix and others covered by Show function). Also fixes a bug in NewVMGroupVMsPage discovered when fixing this - it would show VMs that should be hidden if you used the search bar.
* CP-16922: Use ButtonText on the Command to set the text on the PVS enable button
* CP-16922: Add the disable PVS read-caching command, and its associated proxy destroy action. Both based off enable equivalents (main difference is no dialog for now). Not used yet but will be in main window menu + disable button
* CP-16922: Add disable PVS read-caching to the main window menu (under enable), with the disable command attached to it
* CP-16922: Add support for disabling PVS read-caching for selected hosts via the PVS tab page by converting the disable button into a CommandButton in the same way as the enable button, using its own command + selection manager (because Selection Managers only bind to one control)
* CP-16922: Design - adding the "read caching enabled" column from the design, so that we display both whether caching is enabled and whether the VM is currently cached. If it's disabled all other values are missing.
* CP-16922: Add the PVS site column per the design to show the site a VM's PVS Proxy is on if it has a proxy
* CP-16922: Add an event handler for VMs changing so that newly provisioned VMs immediately show up in the PVS tab page
* CP-16922: Support for properly remembering the selection when the VM list is refreshed. A new method returns the list of VMs for the selected rows, and we can then check if the VM for the row being added is in this list. If there was no previous selection then we still select the first row by default.
* CP-16922: Remove prepopulate, which is being removed from the design. The next XAPI version will remove it, so just pass False as prepopulate for now, and remove the option from the dialog and PVS tab page.
* CP-16922: Improve UI appearance for a missing Storage Repository. Per the design, if there is no SR show the message None (memory only) instead of an empty cell
* CP-16922: Improved sorting behaviour. All columns (except VM name, which always uses it) use the VM tag as a sorting fallback (since they all have duplicates). New default sort which sorts by caching enabled first (yes before no), and then VM tag as a tiebreaker. Support for remembering the current sort on refresh, ie when a value changes.
* CP-16922: Refactoring to use a VM extension method to get the PVSProxy (or null if none exists) for a VM. This was used in the PVS Page + commands which are now much simpler.
* CP-16922: Move where the SelectionChanged event handler is set when refreshing the PVS table, so that the command buttons are updated correctly.
* CP-16922: Improvements to PVS read-caching dialog. Set accept/cancel buttons properly + adjust tab values, so focus acts as expected
* CP-16922: Remove the images from the menu for Enable/Disable PVS read-caching, most commands in the menu don't have one
* CP-16922: Sorting out the strings for the actions + ParallelAction calls, and moving them into the resx. Also reverting wrong MainWindow.resx changes.
* CAR-2184: XAPI changes. I've made the minimal possible changes to PvsPage to ensure it compiles, but it's had a lot of feature work (CP-16922) that supersedes this, these small changes should keep that merge painless.
* CAR-2184 XAPI: Reverse the unrelated changes, only keep the PVS ones.
* CP-16922: Merge latest XAPI changes, notably changes to Pvs_site.create
* CP-16922: Change tab show/hide logic for PVS tab, show it even if there are no PVS sites.
* CP-16922: Implement GUI for enabling PVS read caching
Design changes - remove the storage repo column and replace it with status, which is populated with a friendly version of the pvs_proxy_status enum. Also populate site list using site.name_label
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* CP-16922: Implement GUI for enabling PVS read caching
Adjusting the CanExecute of Enable PVS read-caching command to require at least one PVS site to be created. Since the PVS tab can show up without any sites, we need this because we can't create a proxy without a site.
* CP-16922: Code review changes.
Tidied up messages, and ensured actions run async properly, and without exiting before their task.
* CP-16922: Code review changes.
Update dialog resx, wider combobox on dialog, update action descriptions before setting RelatedTask, add friendly message body for PVS error notifications.
2016-09-22 16:08:15 +02:00
|
|
|
|
|
|
|
|
|
enableButton.Command = new EnablePvsReadCachingCommand();
|
|
|
|
|
disableButton.Command = new DisablePvsReadCachingCommand();
|
|
|
|
|
|
|
|
|
|
enableSelectionManager = new SelectionManager();
|
|
|
|
|
disableSelectionManager = new SelectionManager();
|
|
|
|
|
|
|
|
|
|
vmDefaultSort = new DataGridViewVms_DefaultSort();
|
2016-11-24 17:51:48 +01:00
|
|
|
|
|
|
|
|
|
PvsProxy_CollectionChangedWithInvoke = Program.ProgramInvokeHandler(PvsProxyCollectionChanged);
|
|
|
|
|
|
2016-07-13 14:36:49 +02:00
|
|
|
|
base.Text = Messages.PVS_TAB_TITLE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IXenConnection Connection
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return connection;
|
|
|
|
|
}
|
|
|
|
|
set
|
|
|
|
|
{
|
2017-01-25 13:38:33 +01:00
|
|
|
|
UnregisterHandlers();
|
2016-07-13 14:36:49 +02:00
|
|
|
|
|
|
|
|
|
connection = value;
|
|
|
|
|
|
|
|
|
|
if (connection != null)
|
|
|
|
|
{
|
2016-11-24 17:51:48 +01:00
|
|
|
|
connection.Cache.RegisterCollectionChanged<PVS_proxy>(PvsProxy_CollectionChangedWithInvoke);
|
|
|
|
|
connection.Cache.RegisterCollectionChanged<VM>(PvsProxy_CollectionChangedWithInvoke);
|
2016-07-13 14:36:49 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LoadVMs();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-09-26 18:44:17 +02:00
|
|
|
|
#region VMs
|
|
|
|
|
|
[CA-233454] PVS tab doesn't show a new VM when it's created (#1314)
* [CA-233454] PVS tab doesn't show a new VM when it's created
Refined the rules for not adding a VM to the table, if it is a template (thus not_a_real_vm), and it has the __gui__ prefix (thus hidden), we still add it, but hide it.
When its name is changed (to remove the __gui__ prefix), we update its name and re-calculate whether it should be visible (in the case of a new VM this will be true once the __gui__ prefix is gone). Also resort the table if a node changes from hidden to visible, because it appears as an addition to the table.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update criteria for VM visibility to include is_a_real_vm
is_a_template is changed before the name_label removes the __gui__ prefix, so this works with no other changes to the vm property changed event.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update when the VMs are shown in the PVS list
New observable property IsBeingCreated for VMs, set to true when they're made a hidden object, and false when they're removed from hidden objects (both in CreateVMAction). In the PVS Page when this is set to false, we re-evaluate whether a VM can be shown. This means that new VMs show here at the same time they're added to the tree (only different is tree refresh time), instead of far earlier (and before their networks were added).
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Set IsbeingCreated in the CreateVMFastAction
* [CA-233454] Properly support the VM Fast Create action
Further changes to CreateVMFastAction, to ensure it works with PVS tab - use the __gui__ prefix when the VM is created and then change it back just before showing.
* [CA-233454] Small logic adjustments/tidying up
2016-11-30 13:24:02 +01:00
|
|
|
|
private static bool VmShouldBeVisible(VM vm)
|
|
|
|
|
{
|
|
|
|
|
if (XenAdminConfigManager.Provider.ObjectIsHidden(vm.opaque_ref))
|
|
|
|
|
return false;
|
|
|
|
|
|
2017-09-03 04:33:29 +02:00
|
|
|
|
return vm.is_a_real_vm() && vm.Show(Properties.Settings.Default.ShowHiddenVMs) && !vm.IsBeingCreated;
|
[CA-233454] PVS tab doesn't show a new VM when it's created (#1314)
* [CA-233454] PVS tab doesn't show a new VM when it's created
Refined the rules for not adding a VM to the table, if it is a template (thus not_a_real_vm), and it has the __gui__ prefix (thus hidden), we still add it, but hide it.
When its name is changed (to remove the __gui__ prefix), we update its name and re-calculate whether it should be visible (in the case of a new VM this will be true once the __gui__ prefix is gone). Also resort the table if a node changes from hidden to visible, because it appears as an addition to the table.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update criteria for VM visibility to include is_a_real_vm
is_a_template is changed before the name_label removes the __gui__ prefix, so this works with no other changes to the vm property changed event.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update when the VMs are shown in the PVS list
New observable property IsBeingCreated for VMs, set to true when they're made a hidden object, and false when they're removed from hidden objects (both in CreateVMAction). In the PVS Page when this is set to false, we re-evaluate whether a VM can be shown. This means that new VMs show here at the same time they're added to the tree (only different is tree refresh time), instead of far earlier (and before their networks were added).
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Set IsbeingCreated in the CreateVMFastAction
* [CA-233454] Properly support the VM Fast Create action
Further changes to CreateVMFastAction, to ensure it works with PVS tab - use the __gui__ prefix when the VM is created and then change it back just before showing.
* [CA-233454] Small logic adjustments/tidying up
2016-11-30 13:24:02 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static bool VmIsJustAdded(VM vm)
|
|
|
|
|
{
|
|
|
|
|
return vm.is_a_template && vm.name_label.StartsWith(Helpers.GuiTempObjectPrefix);
|
|
|
|
|
}
|
|
|
|
|
|
2016-07-13 14:36:49 +02:00
|
|
|
|
private void LoadVMs()
|
|
|
|
|
{
|
|
|
|
|
Program.AssertOnEventThread();
|
|
|
|
|
|
|
|
|
|
if (!Visible)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
dataGridViewVms.SuspendLayout();
|
CP-16922: Implement GUI for enabling PVS read caching (#1179)
* CP-16922: UI changes to PvsPage to replace the single configure button with a separate enable and disable one, per the design doc
* CP-16922: Intermediate checkin - command + dialog implemented, but PVS page has some layout problems.
* CP-16922: Implement GUI for enabling PVS read caching and marking/unmarking VMs for prepopulation
Fix the broken layout by reverting MainWindow.resx (which shouldn't have changed) back to the previous commit. Also removed duplicate properties button code.
* CP-16922: PVS Page changes, to properly display all VMs (not just ones with proxy), only populating proxy columns if there is a proxy set.
* CP-16922: Use a CommandButton for the enable button, connected to the same command as the VM main menu button, and using the table selection as its selection manager.
* CP-16922: Delete the old enable button click behaviour (because it now has a proper command), was causing the dialog to show up twice
* CP-16922: Properly list VMs by hiding those that should be hidden (in addition to non-VMs, also hide the __gui__ prefix and others covered by Show function). Also fixes a bug in NewVMGroupVMsPage discovered when fixing this - it would show VMs that should be hidden if you used the search bar.
* CP-16922: Use ButtonText on the Command to set the text on the PVS enable button
* CP-16922: Add the disable PVS read-caching command, and its associated proxy destroy action. Both based off enable equivalents (main difference is no dialog for now). Not used yet but will be in main window menu + disable button
* CP-16922: Add disable PVS read-caching to the main window menu (under enable), with the disable command attached to it
* CP-16922: Add support for disabling PVS read-caching for selected hosts via the PVS tab page by converting the disable button into a CommandButton in the same way as the enable button, using its own command + selection manager (because Selection Managers only bind to one control)
* CP-16922: Design - adding the "read caching enabled" column from the design, so that we display both whether caching is enabled and whether the VM is currently cached. If it's disabled all other values are missing.
* CP-16922: Add the PVS site column per the design to show the site a VM's PVS Proxy is on if it has a proxy
* CP-16922: Add an event handler for VMs changing so that newly provisioned VMs immediately show up in the PVS tab page
* CP-16922: Support for properly remembering the selection when the VM list is refreshed. A new method returns the list of VMs for the selected rows, and we can then check if the VM for the row being added is in this list. If there was no previous selection then we still select the first row by default.
* CP-16922: Remove prepopulate, which is being removed from the design. The next XAPI version will remove it, so just pass False as prepopulate for now, and remove the option from the dialog and PVS tab page.
* CP-16922: Improve UI appearance for a missing Storage Repository. Per the design, if there is no SR show the message None (memory only) instead of an empty cell
* CP-16922: Improved sorting behaviour. All columns (except VM name, which always uses it) use the VM tag as a sorting fallback (since they all have duplicates). New default sort which sorts by caching enabled first (yes before no), and then VM tag as a tiebreaker. Support for remembering the current sort on refresh, ie when a value changes.
* CP-16922: Refactoring to use a VM extension method to get the PVSProxy (or null if none exists) for a VM. This was used in the PVS Page + commands which are now much simpler.
* CP-16922: Move where the SelectionChanged event handler is set when refreshing the PVS table, so that the command buttons are updated correctly.
* CP-16922: Improvements to PVS read-caching dialog. Set accept/cancel buttons properly + adjust tab values, so focus acts as expected
* CP-16922: Remove the images from the menu for Enable/Disable PVS read-caching, most commands in the menu don't have one
* CP-16922: Sorting out the strings for the actions + ParallelAction calls, and moving them into the resx. Also reverting wrong MainWindow.resx changes.
* CAR-2184: XAPI changes. I've made the minimal possible changes to PvsPage to ensure it compiles, but it's had a lot of feature work (CP-16922) that supersedes this, these small changes should keep that merge painless.
* CAR-2184 XAPI: Reverse the unrelated changes, only keep the PVS ones.
* CP-16922: Merge latest XAPI changes, notably changes to Pvs_site.create
* CP-16922: Change tab show/hide logic for PVS tab, show it even if there are no PVS sites.
* CP-16922: Implement GUI for enabling PVS read caching
Design changes - remove the storage repo column and replace it with status, which is populated with a friendly version of the pvs_proxy_status enum. Also populate site list using site.name_label
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* CP-16922: Implement GUI for enabling PVS read caching
Adjusting the CanExecute of Enable PVS read-caching command to require at least one PVS site to be created. Since the PVS tab can show up without any sites, we need this because we can't create a proxy without a site.
* CP-16922: Code review changes.
Tidied up messages, and ensured actions run async properly, and without exiting before their task.
* CP-16922: Code review changes.
Update dialog resx, wider combobox on dialog, update action descriptions before setting RelatedTask, add friendly message body for PVS error notifications.
2016-09-22 16:08:15 +02:00
|
|
|
|
|
|
|
|
|
var previousSelection = GetSelectedVMs();
|
2016-09-26 18:44:17 +02:00
|
|
|
|
|
2017-01-25 13:38:33 +01:00
|
|
|
|
UnregisterVmEventHandlers();
|
CP-16922: Implement GUI for enabling PVS read caching (#1179)
* CP-16922: UI changes to PvsPage to replace the single configure button with a separate enable and disable one, per the design doc
* CP-16922: Intermediate checkin - command + dialog implemented, but PVS page has some layout problems.
* CP-16922: Implement GUI for enabling PVS read caching and marking/unmarking VMs for prepopulation
Fix the broken layout by reverting MainWindow.resx (which shouldn't have changed) back to the previous commit. Also removed duplicate properties button code.
* CP-16922: PVS Page changes, to properly display all VMs (not just ones with proxy), only populating proxy columns if there is a proxy set.
* CP-16922: Use a CommandButton for the enable button, connected to the same command as the VM main menu button, and using the table selection as its selection manager.
* CP-16922: Delete the old enable button click behaviour (because it now has a proper command), was causing the dialog to show up twice
* CP-16922: Properly list VMs by hiding those that should be hidden (in addition to non-VMs, also hide the __gui__ prefix and others covered by Show function). Also fixes a bug in NewVMGroupVMsPage discovered when fixing this - it would show VMs that should be hidden if you used the search bar.
* CP-16922: Use ButtonText on the Command to set the text on the PVS enable button
* CP-16922: Add the disable PVS read-caching command, and its associated proxy destroy action. Both based off enable equivalents (main difference is no dialog for now). Not used yet but will be in main window menu + disable button
* CP-16922: Add disable PVS read-caching to the main window menu (under enable), with the disable command attached to it
* CP-16922: Add support for disabling PVS read-caching for selected hosts via the PVS tab page by converting the disable button into a CommandButton in the same way as the enable button, using its own command + selection manager (because Selection Managers only bind to one control)
* CP-16922: Design - adding the "read caching enabled" column from the design, so that we display both whether caching is enabled and whether the VM is currently cached. If it's disabled all other values are missing.
* CP-16922: Add the PVS site column per the design to show the site a VM's PVS Proxy is on if it has a proxy
* CP-16922: Add an event handler for VMs changing so that newly provisioned VMs immediately show up in the PVS tab page
* CP-16922: Support for properly remembering the selection when the VM list is refreshed. A new method returns the list of VMs for the selected rows, and we can then check if the VM for the row being added is in this list. If there was no previous selection then we still select the first row by default.
* CP-16922: Remove prepopulate, which is being removed from the design. The next XAPI version will remove it, so just pass False as prepopulate for now, and remove the option from the dialog and PVS tab page.
* CP-16922: Improve UI appearance for a missing Storage Repository. Per the design, if there is no SR show the message None (memory only) instead of an empty cell
* CP-16922: Improved sorting behaviour. All columns (except VM name, which always uses it) use the VM tag as a sorting fallback (since they all have duplicates). New default sort which sorts by caching enabled first (yes before no), and then VM tag as a tiebreaker. Support for remembering the current sort on refresh, ie when a value changes.
* CP-16922: Refactoring to use a VM extension method to get the PVSProxy (or null if none exists) for a VM. This was used in the PVS Page + commands which are now much simpler.
* CP-16922: Move where the SelectionChanged event handler is set when refreshing the PVS table, so that the command buttons are updated correctly.
* CP-16922: Improvements to PVS read-caching dialog. Set accept/cancel buttons properly + adjust tab values, so focus acts as expected
* CP-16922: Remove the images from the menu for Enable/Disable PVS read-caching, most commands in the menu don't have one
* CP-16922: Sorting out the strings for the actions + ParallelAction calls, and moving them into the resx. Also reverting wrong MainWindow.resx changes.
* CAR-2184: XAPI changes. I've made the minimal possible changes to PvsPage to ensure it compiles, but it's had a lot of feature work (CP-16922) that supersedes this, these small changes should keep that merge painless.
* CAR-2184 XAPI: Reverse the unrelated changes, only keep the PVS ones.
* CP-16922: Merge latest XAPI changes, notably changes to Pvs_site.create
* CP-16922: Change tab show/hide logic for PVS tab, show it even if there are no PVS sites.
* CP-16922: Implement GUI for enabling PVS read caching
Design changes - remove the storage repo column and replace it with status, which is populated with a friendly version of the pvs_proxy_status enum. Also populate site list using site.name_label
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* CP-16922: Implement GUI for enabling PVS read caching
Adjusting the CanExecute of Enable PVS read-caching command to require at least one PVS site to be created. Since the PVS tab can show up without any sites, we need this because we can't create a proxy without a site.
* CP-16922: Code review changes.
Tidied up messages, and ensured actions run async properly, and without exiting before their task.
* CP-16922: Code review changes.
Update dialog resx, wider combobox on dialog, update action descriptions before setting RelatedTask, add friendly message body for PVS error notifications.
2016-09-22 16:08:15 +02:00
|
|
|
|
|
|
|
|
|
dataGridViewVms.SortCompare += dataGridViewVms_SortCompare;
|
|
|
|
|
|
2016-07-13 14:36:49 +02:00
|
|
|
|
dataGridViewVms.Rows.Clear();
|
|
|
|
|
|
CP-16922: Implement GUI for enabling PVS read caching (#1179)
* CP-16922: UI changes to PvsPage to replace the single configure button with a separate enable and disable one, per the design doc
* CP-16922: Intermediate checkin - command + dialog implemented, but PVS page has some layout problems.
* CP-16922: Implement GUI for enabling PVS read caching and marking/unmarking VMs for prepopulation
Fix the broken layout by reverting MainWindow.resx (which shouldn't have changed) back to the previous commit. Also removed duplicate properties button code.
* CP-16922: PVS Page changes, to properly display all VMs (not just ones with proxy), only populating proxy columns if there is a proxy set.
* CP-16922: Use a CommandButton for the enable button, connected to the same command as the VM main menu button, and using the table selection as its selection manager.
* CP-16922: Delete the old enable button click behaviour (because it now has a proper command), was causing the dialog to show up twice
* CP-16922: Properly list VMs by hiding those that should be hidden (in addition to non-VMs, also hide the __gui__ prefix and others covered by Show function). Also fixes a bug in NewVMGroupVMsPage discovered when fixing this - it would show VMs that should be hidden if you used the search bar.
* CP-16922: Use ButtonText on the Command to set the text on the PVS enable button
* CP-16922: Add the disable PVS read-caching command, and its associated proxy destroy action. Both based off enable equivalents (main difference is no dialog for now). Not used yet but will be in main window menu + disable button
* CP-16922: Add disable PVS read-caching to the main window menu (under enable), with the disable command attached to it
* CP-16922: Add support for disabling PVS read-caching for selected hosts via the PVS tab page by converting the disable button into a CommandButton in the same way as the enable button, using its own command + selection manager (because Selection Managers only bind to one control)
* CP-16922: Design - adding the "read caching enabled" column from the design, so that we display both whether caching is enabled and whether the VM is currently cached. If it's disabled all other values are missing.
* CP-16922: Add the PVS site column per the design to show the site a VM's PVS Proxy is on if it has a proxy
* CP-16922: Add an event handler for VMs changing so that newly provisioned VMs immediately show up in the PVS tab page
* CP-16922: Support for properly remembering the selection when the VM list is refreshed. A new method returns the list of VMs for the selected rows, and we can then check if the VM for the row being added is in this list. If there was no previous selection then we still select the first row by default.
* CP-16922: Remove prepopulate, which is being removed from the design. The next XAPI version will remove it, so just pass False as prepopulate for now, and remove the option from the dialog and PVS tab page.
* CP-16922: Improve UI appearance for a missing Storage Repository. Per the design, if there is no SR show the message None (memory only) instead of an empty cell
* CP-16922: Improved sorting behaviour. All columns (except VM name, which always uses it) use the VM tag as a sorting fallback (since they all have duplicates). New default sort which sorts by caching enabled first (yes before no), and then VM tag as a tiebreaker. Support for remembering the current sort on refresh, ie when a value changes.
* CP-16922: Refactoring to use a VM extension method to get the PVSProxy (or null if none exists) for a VM. This was used in the PVS Page + commands which are now much simpler.
* CP-16922: Move where the SelectionChanged event handler is set when refreshing the PVS table, so that the command buttons are updated correctly.
* CP-16922: Improvements to PVS read-caching dialog. Set accept/cancel buttons properly + adjust tab values, so focus acts as expected
* CP-16922: Remove the images from the menu for Enable/Disable PVS read-caching, most commands in the menu don't have one
* CP-16922: Sorting out the strings for the actions + ParallelAction calls, and moving them into the resx. Also reverting wrong MainWindow.resx changes.
* CAR-2184: XAPI changes. I've made the minimal possible changes to PvsPage to ensure it compiles, but it's had a lot of feature work (CP-16922) that supersedes this, these small changes should keep that merge painless.
* CAR-2184 XAPI: Reverse the unrelated changes, only keep the PVS ones.
* CP-16922: Merge latest XAPI changes, notably changes to Pvs_site.create
* CP-16922: Change tab show/hide logic for PVS tab, show it even if there are no PVS sites.
* CP-16922: Implement GUI for enabling PVS read caching
Design changes - remove the storage repo column and replace it with status, which is populated with a friendly version of the pvs_proxy_status enum. Also populate site list using site.name_label
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* CP-16922: Implement GUI for enabling PVS read caching
Adjusting the CanExecute of Enable PVS read-caching command to require at least one PVS site to be created. Since the PVS tab can show up without any sites, we need this because we can't create a proxy without a site.
* CP-16922: Code review changes.
Tidied up messages, and ensured actions run async properly, and without exiting before their task.
* CP-16922: Code review changes.
Update dialog resx, wider combobox on dialog, update action descriptions before setting RelatedTask, add friendly message body for PVS error notifications.
2016-09-22 16:08:15 +02:00
|
|
|
|
enableSelectionManager.BindTo(enableButton, Program.MainWindow);
|
|
|
|
|
disableSelectionManager.BindTo(disableButton, Program.MainWindow);
|
2016-09-26 18:44:17 +02:00
|
|
|
|
|
|
|
|
|
//clear selection
|
|
|
|
|
enableSelectionManager.SetSelection(new SelectedItemCollection());
|
|
|
|
|
disableSelectionManager.SetSelection(new SelectedItemCollection());
|
|
|
|
|
|
[CA-233454] PVS tab doesn't show a new VM when it's created (#1314)
* [CA-233454] PVS tab doesn't show a new VM when it's created
Refined the rules for not adding a VM to the table, if it is a template (thus not_a_real_vm), and it has the __gui__ prefix (thus hidden), we still add it, but hide it.
When its name is changed (to remove the __gui__ prefix), we update its name and re-calculate whether it should be visible (in the case of a new VM this will be true once the __gui__ prefix is gone). Also resort the table if a node changes from hidden to visible, because it appears as an addition to the table.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update criteria for VM visibility to include is_a_real_vm
is_a_template is changed before the name_label removes the __gui__ prefix, so this works with no other changes to the vm property changed event.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update when the VMs are shown in the PVS list
New observable property IsBeingCreated for VMs, set to true when they're made a hidden object, and false when they're removed from hidden objects (both in CreateVMAction). In the PVS Page when this is set to false, we re-evaluate whether a VM can be shown. This means that new VMs show here at the same time they're added to the tree (only different is tree refresh time), instead of far earlier (and before their networks were added).
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Set IsbeingCreated in the CreateVMFastAction
* [CA-233454] Properly support the VM Fast Create action
Further changes to CreateVMFastAction, to ensure it works with PVS tab - use the __gui__ prefix when the VM is created and then change it back just before showing.
* [CA-233454] Small logic adjustments/tidying up
2016-11-30 13:24:02 +01:00
|
|
|
|
foreach (var vm in Connection.Cache.VMs)
|
CP-16922: Implement GUI for enabling PVS read caching (#1179)
* CP-16922: UI changes to PvsPage to replace the single configure button with a separate enable and disable one, per the design doc
* CP-16922: Intermediate checkin - command + dialog implemented, but PVS page has some layout problems.
* CP-16922: Implement GUI for enabling PVS read caching and marking/unmarking VMs for prepopulation
Fix the broken layout by reverting MainWindow.resx (which shouldn't have changed) back to the previous commit. Also removed duplicate properties button code.
* CP-16922: PVS Page changes, to properly display all VMs (not just ones with proxy), only populating proxy columns if there is a proxy set.
* CP-16922: Use a CommandButton for the enable button, connected to the same command as the VM main menu button, and using the table selection as its selection manager.
* CP-16922: Delete the old enable button click behaviour (because it now has a proper command), was causing the dialog to show up twice
* CP-16922: Properly list VMs by hiding those that should be hidden (in addition to non-VMs, also hide the __gui__ prefix and others covered by Show function). Also fixes a bug in NewVMGroupVMsPage discovered when fixing this - it would show VMs that should be hidden if you used the search bar.
* CP-16922: Use ButtonText on the Command to set the text on the PVS enable button
* CP-16922: Add the disable PVS read-caching command, and its associated proxy destroy action. Both based off enable equivalents (main difference is no dialog for now). Not used yet but will be in main window menu + disable button
* CP-16922: Add disable PVS read-caching to the main window menu (under enable), with the disable command attached to it
* CP-16922: Add support for disabling PVS read-caching for selected hosts via the PVS tab page by converting the disable button into a CommandButton in the same way as the enable button, using its own command + selection manager (because Selection Managers only bind to one control)
* CP-16922: Design - adding the "read caching enabled" column from the design, so that we display both whether caching is enabled and whether the VM is currently cached. If it's disabled all other values are missing.
* CP-16922: Add the PVS site column per the design to show the site a VM's PVS Proxy is on if it has a proxy
* CP-16922: Add an event handler for VMs changing so that newly provisioned VMs immediately show up in the PVS tab page
* CP-16922: Support for properly remembering the selection when the VM list is refreshed. A new method returns the list of VMs for the selected rows, and we can then check if the VM for the row being added is in this list. If there was no previous selection then we still select the first row by default.
* CP-16922: Remove prepopulate, which is being removed from the design. The next XAPI version will remove it, so just pass False as prepopulate for now, and remove the option from the dialog and PVS tab page.
* CP-16922: Improve UI appearance for a missing Storage Repository. Per the design, if there is no SR show the message None (memory only) instead of an empty cell
* CP-16922: Improved sorting behaviour. All columns (except VM name, which always uses it) use the VM tag as a sorting fallback (since they all have duplicates). New default sort which sorts by caching enabled first (yes before no), and then VM tag as a tiebreaker. Support for remembering the current sort on refresh, ie when a value changes.
* CP-16922: Refactoring to use a VM extension method to get the PVSProxy (or null if none exists) for a VM. This was used in the PVS Page + commands which are now much simpler.
* CP-16922: Move where the SelectionChanged event handler is set when refreshing the PVS table, so that the command buttons are updated correctly.
* CP-16922: Improvements to PVS read-caching dialog. Set accept/cancel buttons properly + adjust tab values, so focus acts as expected
* CP-16922: Remove the images from the menu for Enable/Disable PVS read-caching, most commands in the menu don't have one
* CP-16922: Sorting out the strings for the actions + ParallelAction calls, and moving them into the resx. Also reverting wrong MainWindow.resx changes.
* CAR-2184: XAPI changes. I've made the minimal possible changes to PvsPage to ensure it compiles, but it's had a lot of feature work (CP-16922) that supersedes this, these small changes should keep that merge painless.
* CAR-2184 XAPI: Reverse the unrelated changes, only keep the PVS ones.
* CP-16922: Merge latest XAPI changes, notably changes to Pvs_site.create
* CP-16922: Change tab show/hide logic for PVS tab, show it even if there are no PVS sites.
* CP-16922: Implement GUI for enabling PVS read caching
Design changes - remove the storage repo column and replace it with status, which is populated with a friendly version of the pvs_proxy_status enum. Also populate site list using site.name_label
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* CP-16922: Implement GUI for enabling PVS read caching
Adjusting the CanExecute of Enable PVS read-caching command to require at least one PVS site to be created. Since the PVS tab can show up without any sites, we need this because we can't create a proxy without a site.
* CP-16922: Code review changes.
Tidied up messages, and ensured actions run async properly, and without exiting before their task.
* CP-16922: Code review changes.
Update dialog resx, wider combobox on dialog, update action descriptions before setting RelatedTask, add friendly message body for PVS error notifications.
2016-09-22 16:08:15 +02:00
|
|
|
|
{
|
[CA-233454] PVS tab doesn't show a new VM when it's created (#1314)
* [CA-233454] PVS tab doesn't show a new VM when it's created
Refined the rules for not adding a VM to the table, if it is a template (thus not_a_real_vm), and it has the __gui__ prefix (thus hidden), we still add it, but hide it.
When its name is changed (to remove the __gui__ prefix), we update its name and re-calculate whether it should be visible (in the case of a new VM this will be true once the __gui__ prefix is gone). Also resort the table if a node changes from hidden to visible, because it appears as an addition to the table.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update criteria for VM visibility to include is_a_real_vm
is_a_template is changed before the name_label removes the __gui__ prefix, so this works with no other changes to the vm property changed event.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update when the VMs are shown in the PVS list
New observable property IsBeingCreated for VMs, set to true when they're made a hidden object, and false when they're removed from hidden objects (both in CreateVMAction). In the PVS Page when this is set to false, we re-evaluate whether a VM can be shown. This means that new VMs show here at the same time they're added to the tree (only different is tree refresh time), instead of far earlier (and before their networks were added).
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Set IsbeingCreated in the CreateVMFastAction
* [CA-233454] Properly support the VM Fast Create action
Further changes to CreateVMFastAction, to ensure it works with PVS tab - use the __gui__ prefix when the VM is created and then change it back just before showing.
* [CA-233454] Small logic adjustments/tidying up
2016-11-30 13:24:02 +01:00
|
|
|
|
// Add all real VMs and templates that begin with __gui__ (because this may be a new VM)
|
2017-09-03 04:33:29 +02:00
|
|
|
|
var addVm = vm.is_a_real_vm() || VmIsJustAdded(vm) || vm.IsBeingCreated;
|
CP-16922: Implement GUI for enabling PVS read caching (#1179)
* CP-16922: UI changes to PvsPage to replace the single configure button with a separate enable and disable one, per the design doc
* CP-16922: Intermediate checkin - command + dialog implemented, but PVS page has some layout problems.
* CP-16922: Implement GUI for enabling PVS read caching and marking/unmarking VMs for prepopulation
Fix the broken layout by reverting MainWindow.resx (which shouldn't have changed) back to the previous commit. Also removed duplicate properties button code.
* CP-16922: PVS Page changes, to properly display all VMs (not just ones with proxy), only populating proxy columns if there is a proxy set.
* CP-16922: Use a CommandButton for the enable button, connected to the same command as the VM main menu button, and using the table selection as its selection manager.
* CP-16922: Delete the old enable button click behaviour (because it now has a proper command), was causing the dialog to show up twice
* CP-16922: Properly list VMs by hiding those that should be hidden (in addition to non-VMs, also hide the __gui__ prefix and others covered by Show function). Also fixes a bug in NewVMGroupVMsPage discovered when fixing this - it would show VMs that should be hidden if you used the search bar.
* CP-16922: Use ButtonText on the Command to set the text on the PVS enable button
* CP-16922: Add the disable PVS read-caching command, and its associated proxy destroy action. Both based off enable equivalents (main difference is no dialog for now). Not used yet but will be in main window menu + disable button
* CP-16922: Add disable PVS read-caching to the main window menu (under enable), with the disable command attached to it
* CP-16922: Add support for disabling PVS read-caching for selected hosts via the PVS tab page by converting the disable button into a CommandButton in the same way as the enable button, using its own command + selection manager (because Selection Managers only bind to one control)
* CP-16922: Design - adding the "read caching enabled" column from the design, so that we display both whether caching is enabled and whether the VM is currently cached. If it's disabled all other values are missing.
* CP-16922: Add the PVS site column per the design to show the site a VM's PVS Proxy is on if it has a proxy
* CP-16922: Add an event handler for VMs changing so that newly provisioned VMs immediately show up in the PVS tab page
* CP-16922: Support for properly remembering the selection when the VM list is refreshed. A new method returns the list of VMs for the selected rows, and we can then check if the VM for the row being added is in this list. If there was no previous selection then we still select the first row by default.
* CP-16922: Remove prepopulate, which is being removed from the design. The next XAPI version will remove it, so just pass False as prepopulate for now, and remove the option from the dialog and PVS tab page.
* CP-16922: Improve UI appearance for a missing Storage Repository. Per the design, if there is no SR show the message None (memory only) instead of an empty cell
* CP-16922: Improved sorting behaviour. All columns (except VM name, which always uses it) use the VM tag as a sorting fallback (since they all have duplicates). New default sort which sorts by caching enabled first (yes before no), and then VM tag as a tiebreaker. Support for remembering the current sort on refresh, ie when a value changes.
* CP-16922: Refactoring to use a VM extension method to get the PVSProxy (or null if none exists) for a VM. This was used in the PVS Page + commands which are now much simpler.
* CP-16922: Move where the SelectionChanged event handler is set when refreshing the PVS table, so that the command buttons are updated correctly.
* CP-16922: Improvements to PVS read-caching dialog. Set accept/cancel buttons properly + adjust tab values, so focus acts as expected
* CP-16922: Remove the images from the menu for Enable/Disable PVS read-caching, most commands in the menu don't have one
* CP-16922: Sorting out the strings for the actions + ParallelAction calls, and moving them into the resx. Also reverting wrong MainWindow.resx changes.
* CAR-2184: XAPI changes. I've made the minimal possible changes to PvsPage to ensure it compiles, but it's had a lot of feature work (CP-16922) that supersedes this, these small changes should keep that merge painless.
* CAR-2184 XAPI: Reverse the unrelated changes, only keep the PVS ones.
* CP-16922: Merge latest XAPI changes, notably changes to Pvs_site.create
* CP-16922: Change tab show/hide logic for PVS tab, show it even if there are no PVS sites.
* CP-16922: Implement GUI for enabling PVS read caching
Design changes - remove the storage repo column and replace it with status, which is populated with a friendly version of the pvs_proxy_status enum. Also populate site list using site.name_label
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* CP-16922: Implement GUI for enabling PVS read caching
Adjusting the CanExecute of Enable PVS read-caching command to require at least one PVS site to be created. Since the PVS tab can show up without any sites, we need this because we can't create a proxy without a site.
* CP-16922: Code review changes.
Tidied up messages, and ensured actions run async properly, and without exiting before their task.
* CP-16922: Code review changes.
Update dialog resx, wider combobox on dialog, update action descriptions before setting RelatedTask, add friendly message body for PVS error notifications.
2016-09-22 16:08:15 +02:00
|
|
|
|
|
[CA-233454] PVS tab doesn't show a new VM when it's created (#1314)
* [CA-233454] PVS tab doesn't show a new VM when it's created
Refined the rules for not adding a VM to the table, if it is a template (thus not_a_real_vm), and it has the __gui__ prefix (thus hidden), we still add it, but hide it.
When its name is changed (to remove the __gui__ prefix), we update its name and re-calculate whether it should be visible (in the case of a new VM this will be true once the __gui__ prefix is gone). Also resort the table if a node changes from hidden to visible, because it appears as an addition to the table.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update criteria for VM visibility to include is_a_real_vm
is_a_template is changed before the name_label removes the __gui__ prefix, so this works with no other changes to the vm property changed event.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update when the VMs are shown in the PVS list
New observable property IsBeingCreated for VMs, set to true when they're made a hidden object, and false when they're removed from hidden objects (both in CreateVMAction). In the PVS Page when this is set to false, we re-evaluate whether a VM can be shown. This means that new VMs show here at the same time they're added to the tree (only different is tree refresh time), instead of far earlier (and before their networks were added).
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Set IsbeingCreated in the CreateVMFastAction
* [CA-233454] Properly support the VM Fast Create action
Further changes to CreateVMFastAction, to ensure it works with PVS tab - use the __gui__ prefix when the VM is created and then change it back just before showing.
* [CA-233454] Small logic adjustments/tidying up
2016-11-30 13:24:02 +01:00
|
|
|
|
if (!addVm)
|
|
|
|
|
continue;
|
CP-16922: Implement GUI for enabling PVS read caching (#1179)
* CP-16922: UI changes to PvsPage to replace the single configure button with a separate enable and disable one, per the design doc
* CP-16922: Intermediate checkin - command + dialog implemented, but PVS page has some layout problems.
* CP-16922: Implement GUI for enabling PVS read caching and marking/unmarking VMs for prepopulation
Fix the broken layout by reverting MainWindow.resx (which shouldn't have changed) back to the previous commit. Also removed duplicate properties button code.
* CP-16922: PVS Page changes, to properly display all VMs (not just ones with proxy), only populating proxy columns if there is a proxy set.
* CP-16922: Use a CommandButton for the enable button, connected to the same command as the VM main menu button, and using the table selection as its selection manager.
* CP-16922: Delete the old enable button click behaviour (because it now has a proper command), was causing the dialog to show up twice
* CP-16922: Properly list VMs by hiding those that should be hidden (in addition to non-VMs, also hide the __gui__ prefix and others covered by Show function). Also fixes a bug in NewVMGroupVMsPage discovered when fixing this - it would show VMs that should be hidden if you used the search bar.
* CP-16922: Use ButtonText on the Command to set the text on the PVS enable button
* CP-16922: Add the disable PVS read-caching command, and its associated proxy destroy action. Both based off enable equivalents (main difference is no dialog for now). Not used yet but will be in main window menu + disable button
* CP-16922: Add disable PVS read-caching to the main window menu (under enable), with the disable command attached to it
* CP-16922: Add support for disabling PVS read-caching for selected hosts via the PVS tab page by converting the disable button into a CommandButton in the same way as the enable button, using its own command + selection manager (because Selection Managers only bind to one control)
* CP-16922: Design - adding the "read caching enabled" column from the design, so that we display both whether caching is enabled and whether the VM is currently cached. If it's disabled all other values are missing.
* CP-16922: Add the PVS site column per the design to show the site a VM's PVS Proxy is on if it has a proxy
* CP-16922: Add an event handler for VMs changing so that newly provisioned VMs immediately show up in the PVS tab page
* CP-16922: Support for properly remembering the selection when the VM list is refreshed. A new method returns the list of VMs for the selected rows, and we can then check if the VM for the row being added is in this list. If there was no previous selection then we still select the first row by default.
* CP-16922: Remove prepopulate, which is being removed from the design. The next XAPI version will remove it, so just pass False as prepopulate for now, and remove the option from the dialog and PVS tab page.
* CP-16922: Improve UI appearance for a missing Storage Repository. Per the design, if there is no SR show the message None (memory only) instead of an empty cell
* CP-16922: Improved sorting behaviour. All columns (except VM name, which always uses it) use the VM tag as a sorting fallback (since they all have duplicates). New default sort which sorts by caching enabled first (yes before no), and then VM tag as a tiebreaker. Support for remembering the current sort on refresh, ie when a value changes.
* CP-16922: Refactoring to use a VM extension method to get the PVSProxy (or null if none exists) for a VM. This was used in the PVS Page + commands which are now much simpler.
* CP-16922: Move where the SelectionChanged event handler is set when refreshing the PVS table, so that the command buttons are updated correctly.
* CP-16922: Improvements to PVS read-caching dialog. Set accept/cancel buttons properly + adjust tab values, so focus acts as expected
* CP-16922: Remove the images from the menu for Enable/Disable PVS read-caching, most commands in the menu don't have one
* CP-16922: Sorting out the strings for the actions + ParallelAction calls, and moving them into the resx. Also reverting wrong MainWindow.resx changes.
* CAR-2184: XAPI changes. I've made the minimal possible changes to PvsPage to ensure it compiles, but it's had a lot of feature work (CP-16922) that supersedes this, these small changes should keep that merge painless.
* CAR-2184 XAPI: Reverse the unrelated changes, only keep the PVS ones.
* CP-16922: Merge latest XAPI changes, notably changes to Pvs_site.create
* CP-16922: Change tab show/hide logic for PVS tab, show it even if there are no PVS sites.
* CP-16922: Implement GUI for enabling PVS read caching
Design changes - remove the storage repo column and replace it with status, which is populated with a friendly version of the pvs_proxy_status enum. Also populate site list using site.name_label
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* CP-16922: Implement GUI for enabling PVS read caching
Adjusting the CanExecute of Enable PVS read-caching command to require at least one PVS site to be created. Since the PVS tab can show up without any sites, we need this because we can't create a proxy without a site.
* CP-16922: Code review changes.
Tidied up messages, and ensured actions run async properly, and without exiting before their task.
* CP-16922: Code review changes.
Update dialog resx, wider combobox on dialog, update action descriptions before setting RelatedTask, add friendly message body for PVS error notifications.
2016-09-22 16:08:15 +02:00
|
|
|
|
|
[CA-233454] PVS tab doesn't show a new VM when it's created (#1314)
* [CA-233454] PVS tab doesn't show a new VM when it's created
Refined the rules for not adding a VM to the table, if it is a template (thus not_a_real_vm), and it has the __gui__ prefix (thus hidden), we still add it, but hide it.
When its name is changed (to remove the __gui__ prefix), we update its name and re-calculate whether it should be visible (in the case of a new VM this will be true once the __gui__ prefix is gone). Also resort the table if a node changes from hidden to visible, because it appears as an addition to the table.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update criteria for VM visibility to include is_a_real_vm
is_a_template is changed before the name_label removes the __gui__ prefix, so this works with no other changes to the vm property changed event.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update when the VMs are shown in the PVS list
New observable property IsBeingCreated for VMs, set to true when they're made a hidden object, and false when they're removed from hidden objects (both in CreateVMAction). In the PVS Page when this is set to false, we re-evaluate whether a VM can be shown. This means that new VMs show here at the same time they're added to the tree (only different is tree refresh time), instead of far earlier (and before their networks were added).
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Set IsbeingCreated in the CreateVMFastAction
* [CA-233454] Properly support the VM Fast Create action
Further changes to CreateVMFastAction, to ensure it works with PVS tab - use the __gui__ prefix when the VM is created and then change it back just before showing.
* [CA-233454] Small logic adjustments/tidying up
2016-11-30 13:24:02 +01:00
|
|
|
|
var show = VmShouldBeVisible(vm);
|
|
|
|
|
|
|
|
|
|
dataGridViewVms.Rows.Add(NewVmRow(vm, show));
|
CP-16922: Implement GUI for enabling PVS read caching (#1179)
* CP-16922: UI changes to PvsPage to replace the single configure button with a separate enable and disable one, per the design doc
* CP-16922: Intermediate checkin - command + dialog implemented, but PVS page has some layout problems.
* CP-16922: Implement GUI for enabling PVS read caching and marking/unmarking VMs for prepopulation
Fix the broken layout by reverting MainWindow.resx (which shouldn't have changed) back to the previous commit. Also removed duplicate properties button code.
* CP-16922: PVS Page changes, to properly display all VMs (not just ones with proxy), only populating proxy columns if there is a proxy set.
* CP-16922: Use a CommandButton for the enable button, connected to the same command as the VM main menu button, and using the table selection as its selection manager.
* CP-16922: Delete the old enable button click behaviour (because it now has a proper command), was causing the dialog to show up twice
* CP-16922: Properly list VMs by hiding those that should be hidden (in addition to non-VMs, also hide the __gui__ prefix and others covered by Show function). Also fixes a bug in NewVMGroupVMsPage discovered when fixing this - it would show VMs that should be hidden if you used the search bar.
* CP-16922: Use ButtonText on the Command to set the text on the PVS enable button
* CP-16922: Add the disable PVS read-caching command, and its associated proxy destroy action. Both based off enable equivalents (main difference is no dialog for now). Not used yet but will be in main window menu + disable button
* CP-16922: Add disable PVS read-caching to the main window menu (under enable), with the disable command attached to it
* CP-16922: Add support for disabling PVS read-caching for selected hosts via the PVS tab page by converting the disable button into a CommandButton in the same way as the enable button, using its own command + selection manager (because Selection Managers only bind to one control)
* CP-16922: Design - adding the "read caching enabled" column from the design, so that we display both whether caching is enabled and whether the VM is currently cached. If it's disabled all other values are missing.
* CP-16922: Add the PVS site column per the design to show the site a VM's PVS Proxy is on if it has a proxy
* CP-16922: Add an event handler for VMs changing so that newly provisioned VMs immediately show up in the PVS tab page
* CP-16922: Support for properly remembering the selection when the VM list is refreshed. A new method returns the list of VMs for the selected rows, and we can then check if the VM for the row being added is in this list. If there was no previous selection then we still select the first row by default.
* CP-16922: Remove prepopulate, which is being removed from the design. The next XAPI version will remove it, so just pass False as prepopulate for now, and remove the option from the dialog and PVS tab page.
* CP-16922: Improve UI appearance for a missing Storage Repository. Per the design, if there is no SR show the message None (memory only) instead of an empty cell
* CP-16922: Improved sorting behaviour. All columns (except VM name, which always uses it) use the VM tag as a sorting fallback (since they all have duplicates). New default sort which sorts by caching enabled first (yes before no), and then VM tag as a tiebreaker. Support for remembering the current sort on refresh, ie when a value changes.
* CP-16922: Refactoring to use a VM extension method to get the PVSProxy (or null if none exists) for a VM. This was used in the PVS Page + commands which are now much simpler.
* CP-16922: Move where the SelectionChanged event handler is set when refreshing the PVS table, so that the command buttons are updated correctly.
* CP-16922: Improvements to PVS read-caching dialog. Set accept/cancel buttons properly + adjust tab values, so focus acts as expected
* CP-16922: Remove the images from the menu for Enable/Disable PVS read-caching, most commands in the menu don't have one
* CP-16922: Sorting out the strings for the actions + ParallelAction calls, and moving them into the resx. Also reverting wrong MainWindow.resx changes.
* CAR-2184: XAPI changes. I've made the minimal possible changes to PvsPage to ensure it compiles, but it's had a lot of feature work (CP-16922) that supersedes this, these small changes should keep that merge painless.
* CAR-2184 XAPI: Reverse the unrelated changes, only keep the PVS ones.
* CP-16922: Merge latest XAPI changes, notably changes to Pvs_site.create
* CP-16922: Change tab show/hide logic for PVS tab, show it even if there are no PVS sites.
* CP-16922: Implement GUI for enabling PVS read caching
Design changes - remove the storage repo column and replace it with status, which is populated with a friendly version of the pvs_proxy_status enum. Also populate site list using site.name_label
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* CP-16922: Implement GUI for enabling PVS read caching
Adjusting the CanExecute of Enable PVS read-caching command to require at least one PVS site to be created. Since the PVS tab can show up without any sites, we need this because we can't create a proxy without a site.
* CP-16922: Code review changes.
Tidied up messages, and ensured actions run async properly, and without exiting before their task.
* CP-16922: Code review changes.
Update dialog resx, wider combobox on dialog, update action descriptions before setting RelatedTask, add friendly message body for PVS error notifications.
2016-09-22 16:08:15 +02:00
|
|
|
|
}
|
|
|
|
|
|
[CA-233454] PVS tab doesn't show a new VM when it's created (#1314)
* [CA-233454] PVS tab doesn't show a new VM when it's created
Refined the rules for not adding a VM to the table, if it is a template (thus not_a_real_vm), and it has the __gui__ prefix (thus hidden), we still add it, but hide it.
When its name is changed (to remove the __gui__ prefix), we update its name and re-calculate whether it should be visible (in the case of a new VM this will be true once the __gui__ prefix is gone). Also resort the table if a node changes from hidden to visible, because it appears as an addition to the table.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update criteria for VM visibility to include is_a_real_vm
is_a_template is changed before the name_label removes the __gui__ prefix, so this works with no other changes to the vm property changed event.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update when the VMs are shown in the PVS list
New observable property IsBeingCreated for VMs, set to true when they're made a hidden object, and false when they're removed from hidden objects (both in CreateVMAction). In the PVS Page when this is set to false, we re-evaluate whether a VM can be shown. This means that new VMs show here at the same time they're added to the tree (only different is tree refresh time), instead of far earlier (and before their networks were added).
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Set IsbeingCreated in the CreateVMFastAction
* [CA-233454] Properly support the VM Fast Create action
Further changes to CreateVMFastAction, to ensure it works with PVS tab - use the __gui__ prefix when the VM is created and then change it back just before showing.
* [CA-233454] Small logic adjustments/tidying up
2016-11-30 13:24:02 +01:00
|
|
|
|
SortVmTable();
|
|
|
|
|
|
CP-16922: Implement GUI for enabling PVS read caching (#1179)
* CP-16922: UI changes to PvsPage to replace the single configure button with a separate enable and disable one, per the design doc
* CP-16922: Intermediate checkin - command + dialog implemented, but PVS page has some layout problems.
* CP-16922: Implement GUI for enabling PVS read caching and marking/unmarking VMs for prepopulation
Fix the broken layout by reverting MainWindow.resx (which shouldn't have changed) back to the previous commit. Also removed duplicate properties button code.
* CP-16922: PVS Page changes, to properly display all VMs (not just ones with proxy), only populating proxy columns if there is a proxy set.
* CP-16922: Use a CommandButton for the enable button, connected to the same command as the VM main menu button, and using the table selection as its selection manager.
* CP-16922: Delete the old enable button click behaviour (because it now has a proper command), was causing the dialog to show up twice
* CP-16922: Properly list VMs by hiding those that should be hidden (in addition to non-VMs, also hide the __gui__ prefix and others covered by Show function). Also fixes a bug in NewVMGroupVMsPage discovered when fixing this - it would show VMs that should be hidden if you used the search bar.
* CP-16922: Use ButtonText on the Command to set the text on the PVS enable button
* CP-16922: Add the disable PVS read-caching command, and its associated proxy destroy action. Both based off enable equivalents (main difference is no dialog for now). Not used yet but will be in main window menu + disable button
* CP-16922: Add disable PVS read-caching to the main window menu (under enable), with the disable command attached to it
* CP-16922: Add support for disabling PVS read-caching for selected hosts via the PVS tab page by converting the disable button into a CommandButton in the same way as the enable button, using its own command + selection manager (because Selection Managers only bind to one control)
* CP-16922: Design - adding the "read caching enabled" column from the design, so that we display both whether caching is enabled and whether the VM is currently cached. If it's disabled all other values are missing.
* CP-16922: Add the PVS site column per the design to show the site a VM's PVS Proxy is on if it has a proxy
* CP-16922: Add an event handler for VMs changing so that newly provisioned VMs immediately show up in the PVS tab page
* CP-16922: Support for properly remembering the selection when the VM list is refreshed. A new method returns the list of VMs for the selected rows, and we can then check if the VM for the row being added is in this list. If there was no previous selection then we still select the first row by default.
* CP-16922: Remove prepopulate, which is being removed from the design. The next XAPI version will remove it, so just pass False as prepopulate for now, and remove the option from the dialog and PVS tab page.
* CP-16922: Improve UI appearance for a missing Storage Repository. Per the design, if there is no SR show the message None (memory only) instead of an empty cell
* CP-16922: Improved sorting behaviour. All columns (except VM name, which always uses it) use the VM tag as a sorting fallback (since they all have duplicates). New default sort which sorts by caching enabled first (yes before no), and then VM tag as a tiebreaker. Support for remembering the current sort on refresh, ie when a value changes.
* CP-16922: Refactoring to use a VM extension method to get the PVSProxy (or null if none exists) for a VM. This was used in the PVS Page + commands which are now much simpler.
* CP-16922: Move where the SelectionChanged event handler is set when refreshing the PVS table, so that the command buttons are updated correctly.
* CP-16922: Improvements to PVS read-caching dialog. Set accept/cancel buttons properly + adjust tab values, so focus acts as expected
* CP-16922: Remove the images from the menu for Enable/Disable PVS read-caching, most commands in the menu don't have one
* CP-16922: Sorting out the strings for the actions + ParallelAction calls, and moving them into the resx. Also reverting wrong MainWindow.resx changes.
* CAR-2184: XAPI changes. I've made the minimal possible changes to PvsPage to ensure it compiles, but it's had a lot of feature work (CP-16922) that supersedes this, these small changes should keep that merge painless.
* CAR-2184 XAPI: Reverse the unrelated changes, only keep the PVS ones.
* CP-16922: Merge latest XAPI changes, notably changes to Pvs_site.create
* CP-16922: Change tab show/hide logic for PVS tab, show it even if there are no PVS sites.
* CP-16922: Implement GUI for enabling PVS read caching
Design changes - remove the storage repo column and replace it with status, which is populated with a friendly version of the pvs_proxy_status enum. Also populate site list using site.name_label
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* CP-16922: Implement GUI for enabling PVS read caching
Adjusting the CanExecute of Enable PVS read-caching command to require at least one PVS site to be created. Since the PVS tab can show up without any sites, we need this because we can't create a proxy without a site.
* CP-16922: Code review changes.
Tidied up messages, and ensured actions run async properly, and without exiting before their task.
* CP-16922: Code review changes.
Update dialog resx, wider combobox on dialog, update action descriptions before setting RelatedTask, add friendly message body for PVS error notifications.
2016-09-22 16:08:15 +02:00
|
|
|
|
if (dataGridViewVms.Rows.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
dataGridViewVms.SelectionChanged += VmSelectionChanged;
|
|
|
|
|
|
|
|
|
|
UnselectAllVMs(); // Component defaults the first row to selected
|
|
|
|
|
if (previousSelection.Any())
|
|
|
|
|
{
|
|
|
|
|
foreach (var row in dataGridViewVms.Rows.Cast<DataGridViewRow>())
|
|
|
|
|
{
|
|
|
|
|
if (previousSelection.Contains((VM)row.Tag))
|
|
|
|
|
{
|
|
|
|
|
row.Selected = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
dataGridViewVms.Rows[0].Selected = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-07-13 14:36:49 +02:00
|
|
|
|
}
|
|
|
|
|
finally
|
|
|
|
|
{
|
|
|
|
|
dataGridViewVms.ResumeLayout();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
CP-16922: Implement GUI for enabling PVS read caching (#1179)
* CP-16922: UI changes to PvsPage to replace the single configure button with a separate enable and disable one, per the design doc
* CP-16922: Intermediate checkin - command + dialog implemented, but PVS page has some layout problems.
* CP-16922: Implement GUI for enabling PVS read caching and marking/unmarking VMs for prepopulation
Fix the broken layout by reverting MainWindow.resx (which shouldn't have changed) back to the previous commit. Also removed duplicate properties button code.
* CP-16922: PVS Page changes, to properly display all VMs (not just ones with proxy), only populating proxy columns if there is a proxy set.
* CP-16922: Use a CommandButton for the enable button, connected to the same command as the VM main menu button, and using the table selection as its selection manager.
* CP-16922: Delete the old enable button click behaviour (because it now has a proper command), was causing the dialog to show up twice
* CP-16922: Properly list VMs by hiding those that should be hidden (in addition to non-VMs, also hide the __gui__ prefix and others covered by Show function). Also fixes a bug in NewVMGroupVMsPage discovered when fixing this - it would show VMs that should be hidden if you used the search bar.
* CP-16922: Use ButtonText on the Command to set the text on the PVS enable button
* CP-16922: Add the disable PVS read-caching command, and its associated proxy destroy action. Both based off enable equivalents (main difference is no dialog for now). Not used yet but will be in main window menu + disable button
* CP-16922: Add disable PVS read-caching to the main window menu (under enable), with the disable command attached to it
* CP-16922: Add support for disabling PVS read-caching for selected hosts via the PVS tab page by converting the disable button into a CommandButton in the same way as the enable button, using its own command + selection manager (because Selection Managers only bind to one control)
* CP-16922: Design - adding the "read caching enabled" column from the design, so that we display both whether caching is enabled and whether the VM is currently cached. If it's disabled all other values are missing.
* CP-16922: Add the PVS site column per the design to show the site a VM's PVS Proxy is on if it has a proxy
* CP-16922: Add an event handler for VMs changing so that newly provisioned VMs immediately show up in the PVS tab page
* CP-16922: Support for properly remembering the selection when the VM list is refreshed. A new method returns the list of VMs for the selected rows, and we can then check if the VM for the row being added is in this list. If there was no previous selection then we still select the first row by default.
* CP-16922: Remove prepopulate, which is being removed from the design. The next XAPI version will remove it, so just pass False as prepopulate for now, and remove the option from the dialog and PVS tab page.
* CP-16922: Improve UI appearance for a missing Storage Repository. Per the design, if there is no SR show the message None (memory only) instead of an empty cell
* CP-16922: Improved sorting behaviour. All columns (except VM name, which always uses it) use the VM tag as a sorting fallback (since they all have duplicates). New default sort which sorts by caching enabled first (yes before no), and then VM tag as a tiebreaker. Support for remembering the current sort on refresh, ie when a value changes.
* CP-16922: Refactoring to use a VM extension method to get the PVSProxy (or null if none exists) for a VM. This was used in the PVS Page + commands which are now much simpler.
* CP-16922: Move where the SelectionChanged event handler is set when refreshing the PVS table, so that the command buttons are updated correctly.
* CP-16922: Improvements to PVS read-caching dialog. Set accept/cancel buttons properly + adjust tab values, so focus acts as expected
* CP-16922: Remove the images from the menu for Enable/Disable PVS read-caching, most commands in the menu don't have one
* CP-16922: Sorting out the strings for the actions + ParallelAction calls, and moving them into the resx. Also reverting wrong MainWindow.resx changes.
* CAR-2184: XAPI changes. I've made the minimal possible changes to PvsPage to ensure it compiles, but it's had a lot of feature work (CP-16922) that supersedes this, these small changes should keep that merge painless.
* CAR-2184 XAPI: Reverse the unrelated changes, only keep the PVS ones.
* CP-16922: Merge latest XAPI changes, notably changes to Pvs_site.create
* CP-16922: Change tab show/hide logic for PVS tab, show it even if there are no PVS sites.
* CP-16922: Implement GUI for enabling PVS read caching
Design changes - remove the storage repo column and replace it with status, which is populated with a friendly version of the pvs_proxy_status enum. Also populate site list using site.name_label
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* CP-16922: Implement GUI for enabling PVS read caching
Adjusting the CanExecute of Enable PVS read-caching command to require at least one PVS site to be created. Since the PVS tab can show up without any sites, we need this because we can't create a proxy without a site.
* CP-16922: Code review changes.
Tidied up messages, and ensured actions run async properly, and without exiting before their task.
* CP-16922: Code review changes.
Update dialog resx, wider combobox on dialog, update action descriptions before setting RelatedTask, add friendly message body for PVS error notifications.
2016-09-22 16:08:15 +02:00
|
|
|
|
private void UnselectAllVMs()
|
|
|
|
|
{
|
|
|
|
|
foreach (var row in dataGridViewVms.SelectedRows.Cast<DataGridViewRow>())
|
|
|
|
|
{
|
|
|
|
|
row.Selected = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private IList<VM> GetSelectedVMs()
|
|
|
|
|
{
|
|
|
|
|
return dataGridViewVms.SelectedRows.Cast<DataGridViewRow>().Select(row => (VM)row.Tag).ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void VmSelectionChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
var selectedVMs = GetSelectedVMs().Select(vm => new SelectedItem(vm));
|
|
|
|
|
enableSelectionManager.SetSelection(selectedVMs);
|
|
|
|
|
disableSelectionManager.SetSelection(selectedVMs);
|
|
|
|
|
}
|
|
|
|
|
|
[CA-233454] PVS tab doesn't show a new VM when it's created (#1314)
* [CA-233454] PVS tab doesn't show a new VM when it's created
Refined the rules for not adding a VM to the table, if it is a template (thus not_a_real_vm), and it has the __gui__ prefix (thus hidden), we still add it, but hide it.
When its name is changed (to remove the __gui__ prefix), we update its name and re-calculate whether it should be visible (in the case of a new VM this will be true once the __gui__ prefix is gone). Also resort the table if a node changes from hidden to visible, because it appears as an addition to the table.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update criteria for VM visibility to include is_a_real_vm
is_a_template is changed before the name_label removes the __gui__ prefix, so this works with no other changes to the vm property changed event.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update when the VMs are shown in the PVS list
New observable property IsBeingCreated for VMs, set to true when they're made a hidden object, and false when they're removed from hidden objects (both in CreateVMAction). In the PVS Page when this is set to false, we re-evaluate whether a VM can be shown. This means that new VMs show here at the same time they're added to the tree (only different is tree refresh time), instead of far earlier (and before their networks were added).
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Set IsbeingCreated in the CreateVMFastAction
* [CA-233454] Properly support the VM Fast Create action
Further changes to CreateVMFastAction, to ensure it works with PVS tab - use the __gui__ prefix when the VM is created and then change it back just before showing.
* [CA-233454] Small logic adjustments/tidying up
2016-11-30 13:24:02 +01:00
|
|
|
|
private DataGridViewRow NewVmRow(VM vm, bool showRow)
|
2016-07-13 14:36:49 +02:00
|
|
|
|
{
|
|
|
|
|
System.Diagnostics.Trace.Assert(vm != null);
|
CP-16922: Implement GUI for enabling PVS read caching (#1179)
* CP-16922: UI changes to PvsPage to replace the single configure button with a separate enable and disable one, per the design doc
* CP-16922: Intermediate checkin - command + dialog implemented, but PVS page has some layout problems.
* CP-16922: Implement GUI for enabling PVS read caching and marking/unmarking VMs for prepopulation
Fix the broken layout by reverting MainWindow.resx (which shouldn't have changed) back to the previous commit. Also removed duplicate properties button code.
* CP-16922: PVS Page changes, to properly display all VMs (not just ones with proxy), only populating proxy columns if there is a proxy set.
* CP-16922: Use a CommandButton for the enable button, connected to the same command as the VM main menu button, and using the table selection as its selection manager.
* CP-16922: Delete the old enable button click behaviour (because it now has a proper command), was causing the dialog to show up twice
* CP-16922: Properly list VMs by hiding those that should be hidden (in addition to non-VMs, also hide the __gui__ prefix and others covered by Show function). Also fixes a bug in NewVMGroupVMsPage discovered when fixing this - it would show VMs that should be hidden if you used the search bar.
* CP-16922: Use ButtonText on the Command to set the text on the PVS enable button
* CP-16922: Add the disable PVS read-caching command, and its associated proxy destroy action. Both based off enable equivalents (main difference is no dialog for now). Not used yet but will be in main window menu + disable button
* CP-16922: Add disable PVS read-caching to the main window menu (under enable), with the disable command attached to it
* CP-16922: Add support for disabling PVS read-caching for selected hosts via the PVS tab page by converting the disable button into a CommandButton in the same way as the enable button, using its own command + selection manager (because Selection Managers only bind to one control)
* CP-16922: Design - adding the "read caching enabled" column from the design, so that we display both whether caching is enabled and whether the VM is currently cached. If it's disabled all other values are missing.
* CP-16922: Add the PVS site column per the design to show the site a VM's PVS Proxy is on if it has a proxy
* CP-16922: Add an event handler for VMs changing so that newly provisioned VMs immediately show up in the PVS tab page
* CP-16922: Support for properly remembering the selection when the VM list is refreshed. A new method returns the list of VMs for the selected rows, and we can then check if the VM for the row being added is in this list. If there was no previous selection then we still select the first row by default.
* CP-16922: Remove prepopulate, which is being removed from the design. The next XAPI version will remove it, so just pass False as prepopulate for now, and remove the option from the dialog and PVS tab page.
* CP-16922: Improve UI appearance for a missing Storage Repository. Per the design, if there is no SR show the message None (memory only) instead of an empty cell
* CP-16922: Improved sorting behaviour. All columns (except VM name, which always uses it) use the VM tag as a sorting fallback (since they all have duplicates). New default sort which sorts by caching enabled first (yes before no), and then VM tag as a tiebreaker. Support for remembering the current sort on refresh, ie when a value changes.
* CP-16922: Refactoring to use a VM extension method to get the PVSProxy (or null if none exists) for a VM. This was used in the PVS Page + commands which are now much simpler.
* CP-16922: Move where the SelectionChanged event handler is set when refreshing the PVS table, so that the command buttons are updated correctly.
* CP-16922: Improvements to PVS read-caching dialog. Set accept/cancel buttons properly + adjust tab values, so focus acts as expected
* CP-16922: Remove the images from the menu for Enable/Disable PVS read-caching, most commands in the menu don't have one
* CP-16922: Sorting out the strings for the actions + ParallelAction calls, and moving them into the resx. Also reverting wrong MainWindow.resx changes.
* CAR-2184: XAPI changes. I've made the minimal possible changes to PvsPage to ensure it compiles, but it's had a lot of feature work (CP-16922) that supersedes this, these small changes should keep that merge painless.
* CAR-2184 XAPI: Reverse the unrelated changes, only keep the PVS ones.
* CP-16922: Merge latest XAPI changes, notably changes to Pvs_site.create
* CP-16922: Change tab show/hide logic for PVS tab, show it even if there are no PVS sites.
* CP-16922: Implement GUI for enabling PVS read caching
Design changes - remove the storage repo column and replace it with status, which is populated with a friendly version of the pvs_proxy_status enum. Also populate site list using site.name_label
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* CP-16922: Implement GUI for enabling PVS read caching
Adjusting the CanExecute of Enable PVS read-caching command to require at least one PVS site to be created. Since the PVS tab can show up without any sites, we need this because we can't create a proxy without a site.
* CP-16922: Code review changes.
Tidied up messages, and ensured actions run async properly, and without exiting before their task.
* CP-16922: Code review changes.
Update dialog resx, wider combobox on dialog, update action descriptions before setting RelatedTask, add friendly message body for PVS error notifications.
2016-09-22 16:08:15 +02:00
|
|
|
|
|
2017-09-03 04:33:29 +02:00
|
|
|
|
var pvsProxy = vm.PvsProxy();
|
2016-10-12 17:59:46 +02:00
|
|
|
|
|
|
|
|
|
var vmCell = new DataGridViewTextBoxCell();
|
|
|
|
|
var cacheEnabledCell = new DataGridViewTextBoxCell();
|
|
|
|
|
var pvsSiteCell = new DataGridViewTextBoxCell();
|
|
|
|
|
var statusCell = new DataGridViewTextBoxCell();
|
CP-16922: Implement GUI for enabling PVS read caching (#1179)
* CP-16922: UI changes to PvsPage to replace the single configure button with a separate enable and disable one, per the design doc
* CP-16922: Intermediate checkin - command + dialog implemented, but PVS page has some layout problems.
* CP-16922: Implement GUI for enabling PVS read caching and marking/unmarking VMs for prepopulation
Fix the broken layout by reverting MainWindow.resx (which shouldn't have changed) back to the previous commit. Also removed duplicate properties button code.
* CP-16922: PVS Page changes, to properly display all VMs (not just ones with proxy), only populating proxy columns if there is a proxy set.
* CP-16922: Use a CommandButton for the enable button, connected to the same command as the VM main menu button, and using the table selection as its selection manager.
* CP-16922: Delete the old enable button click behaviour (because it now has a proper command), was causing the dialog to show up twice
* CP-16922: Properly list VMs by hiding those that should be hidden (in addition to non-VMs, also hide the __gui__ prefix and others covered by Show function). Also fixes a bug in NewVMGroupVMsPage discovered when fixing this - it would show VMs that should be hidden if you used the search bar.
* CP-16922: Use ButtonText on the Command to set the text on the PVS enable button
* CP-16922: Add the disable PVS read-caching command, and its associated proxy destroy action. Both based off enable equivalents (main difference is no dialog for now). Not used yet but will be in main window menu + disable button
* CP-16922: Add disable PVS read-caching to the main window menu (under enable), with the disable command attached to it
* CP-16922: Add support for disabling PVS read-caching for selected hosts via the PVS tab page by converting the disable button into a CommandButton in the same way as the enable button, using its own command + selection manager (because Selection Managers only bind to one control)
* CP-16922: Design - adding the "read caching enabled" column from the design, so that we display both whether caching is enabled and whether the VM is currently cached. If it's disabled all other values are missing.
* CP-16922: Add the PVS site column per the design to show the site a VM's PVS Proxy is on if it has a proxy
* CP-16922: Add an event handler for VMs changing so that newly provisioned VMs immediately show up in the PVS tab page
* CP-16922: Support for properly remembering the selection when the VM list is refreshed. A new method returns the list of VMs for the selected rows, and we can then check if the VM for the row being added is in this list. If there was no previous selection then we still select the first row by default.
* CP-16922: Remove prepopulate, which is being removed from the design. The next XAPI version will remove it, so just pass False as prepopulate for now, and remove the option from the dialog and PVS tab page.
* CP-16922: Improve UI appearance for a missing Storage Repository. Per the design, if there is no SR show the message None (memory only) instead of an empty cell
* CP-16922: Improved sorting behaviour. All columns (except VM name, which always uses it) use the VM tag as a sorting fallback (since they all have duplicates). New default sort which sorts by caching enabled first (yes before no), and then VM tag as a tiebreaker. Support for remembering the current sort on refresh, ie when a value changes.
* CP-16922: Refactoring to use a VM extension method to get the PVSProxy (or null if none exists) for a VM. This was used in the PVS Page + commands which are now much simpler.
* CP-16922: Move where the SelectionChanged event handler is set when refreshing the PVS table, so that the command buttons are updated correctly.
* CP-16922: Improvements to PVS read-caching dialog. Set accept/cancel buttons properly + adjust tab values, so focus acts as expected
* CP-16922: Remove the images from the menu for Enable/Disable PVS read-caching, most commands in the menu don't have one
* CP-16922: Sorting out the strings for the actions + ParallelAction calls, and moving them into the resx. Also reverting wrong MainWindow.resx changes.
* CAR-2184: XAPI changes. I've made the minimal possible changes to PvsPage to ensure it compiles, but it's had a lot of feature work (CP-16922) that supersedes this, these small changes should keep that merge painless.
* CAR-2184 XAPI: Reverse the unrelated changes, only keep the PVS ones.
* CP-16922: Merge latest XAPI changes, notably changes to Pvs_site.create
* CP-16922: Change tab show/hide logic for PVS tab, show it even if there are no PVS sites.
* CP-16922: Implement GUI for enabling PVS read caching
Design changes - remove the storage repo column and replace it with status, which is populated with a friendly version of the pvs_proxy_status enum. Also populate site list using site.name_label
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* CP-16922: Implement GUI for enabling PVS read caching
Adjusting the CanExecute of Enable PVS read-caching command to require at least one PVS site to be created. Since the PVS tab can show up without any sites, we need this because we can't create a proxy without a site.
* CP-16922: Code review changes.
Tidied up messages, and ensured actions run async properly, and without exiting before their task.
* CP-16922: Code review changes.
Update dialog resx, wider combobox on dialog, update action descriptions before setting RelatedTask, add friendly message body for PVS error notifications.
2016-09-22 16:08:15 +02:00
|
|
|
|
|
|
|
|
|
var newRow = new DataGridViewRow { Tag = vm };
|
2016-10-01 01:23:28 +02:00
|
|
|
|
newRow.Cells.AddRange(vmCell, cacheEnabledCell, pvsSiteCell, statusCell);
|
CP-16922: Implement GUI for enabling PVS read caching (#1179)
* CP-16922: UI changes to PvsPage to replace the single configure button with a separate enable and disable one, per the design doc
* CP-16922: Intermediate checkin - command + dialog implemented, but PVS page has some layout problems.
* CP-16922: Implement GUI for enabling PVS read caching and marking/unmarking VMs for prepopulation
Fix the broken layout by reverting MainWindow.resx (which shouldn't have changed) back to the previous commit. Also removed duplicate properties button code.
* CP-16922: PVS Page changes, to properly display all VMs (not just ones with proxy), only populating proxy columns if there is a proxy set.
* CP-16922: Use a CommandButton for the enable button, connected to the same command as the VM main menu button, and using the table selection as its selection manager.
* CP-16922: Delete the old enable button click behaviour (because it now has a proper command), was causing the dialog to show up twice
* CP-16922: Properly list VMs by hiding those that should be hidden (in addition to non-VMs, also hide the __gui__ prefix and others covered by Show function). Also fixes a bug in NewVMGroupVMsPage discovered when fixing this - it would show VMs that should be hidden if you used the search bar.
* CP-16922: Use ButtonText on the Command to set the text on the PVS enable button
* CP-16922: Add the disable PVS read-caching command, and its associated proxy destroy action. Both based off enable equivalents (main difference is no dialog for now). Not used yet but will be in main window menu + disable button
* CP-16922: Add disable PVS read-caching to the main window menu (under enable), with the disable command attached to it
* CP-16922: Add support for disabling PVS read-caching for selected hosts via the PVS tab page by converting the disable button into a CommandButton in the same way as the enable button, using its own command + selection manager (because Selection Managers only bind to one control)
* CP-16922: Design - adding the "read caching enabled" column from the design, so that we display both whether caching is enabled and whether the VM is currently cached. If it's disabled all other values are missing.
* CP-16922: Add the PVS site column per the design to show the site a VM's PVS Proxy is on if it has a proxy
* CP-16922: Add an event handler for VMs changing so that newly provisioned VMs immediately show up in the PVS tab page
* CP-16922: Support for properly remembering the selection when the VM list is refreshed. A new method returns the list of VMs for the selected rows, and we can then check if the VM for the row being added is in this list. If there was no previous selection then we still select the first row by default.
* CP-16922: Remove prepopulate, which is being removed from the design. The next XAPI version will remove it, so just pass False as prepopulate for now, and remove the option from the dialog and PVS tab page.
* CP-16922: Improve UI appearance for a missing Storage Repository. Per the design, if there is no SR show the message None (memory only) instead of an empty cell
* CP-16922: Improved sorting behaviour. All columns (except VM name, which always uses it) use the VM tag as a sorting fallback (since they all have duplicates). New default sort which sorts by caching enabled first (yes before no), and then VM tag as a tiebreaker. Support for remembering the current sort on refresh, ie when a value changes.
* CP-16922: Refactoring to use a VM extension method to get the PVSProxy (or null if none exists) for a VM. This was used in the PVS Page + commands which are now much simpler.
* CP-16922: Move where the SelectionChanged event handler is set when refreshing the PVS table, so that the command buttons are updated correctly.
* CP-16922: Improvements to PVS read-caching dialog. Set accept/cancel buttons properly + adjust tab values, so focus acts as expected
* CP-16922: Remove the images from the menu for Enable/Disable PVS read-caching, most commands in the menu don't have one
* CP-16922: Sorting out the strings for the actions + ParallelAction calls, and moving them into the resx. Also reverting wrong MainWindow.resx changes.
* CAR-2184: XAPI changes. I've made the minimal possible changes to PvsPage to ensure it compiles, but it's had a lot of feature work (CP-16922) that supersedes this, these small changes should keep that merge painless.
* CAR-2184 XAPI: Reverse the unrelated changes, only keep the PVS ones.
* CP-16922: Merge latest XAPI changes, notably changes to Pvs_site.create
* CP-16922: Change tab show/hide logic for PVS tab, show it even if there are no PVS sites.
* CP-16922: Implement GUI for enabling PVS read caching
Design changes - remove the storage repo column and replace it with status, which is populated with a friendly version of the pvs_proxy_status enum. Also populate site list using site.name_label
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* CP-16922: Implement GUI for enabling PVS read caching
Adjusting the CanExecute of Enable PVS read-caching command to require at least one PVS site to be created. Since the PVS tab can show up without any sites, we need this because we can't create a proxy without a site.
* CP-16922: Code review changes.
Tidied up messages, and ensured actions run async properly, and without exiting before their task.
* CP-16922: Code review changes.
Update dialog resx, wider combobox on dialog, update action descriptions before setting RelatedTask, add friendly message body for PVS error notifications.
2016-09-22 16:08:15 +02:00
|
|
|
|
|
[CA-233454] PVS tab doesn't show a new VM when it's created (#1314)
* [CA-233454] PVS tab doesn't show a new VM when it's created
Refined the rules for not adding a VM to the table, if it is a template (thus not_a_real_vm), and it has the __gui__ prefix (thus hidden), we still add it, but hide it.
When its name is changed (to remove the __gui__ prefix), we update its name and re-calculate whether it should be visible (in the case of a new VM this will be true once the __gui__ prefix is gone). Also resort the table if a node changes from hidden to visible, because it appears as an addition to the table.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update criteria for VM visibility to include is_a_real_vm
is_a_template is changed before the name_label removes the __gui__ prefix, so this works with no other changes to the vm property changed event.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update when the VMs are shown in the PVS list
New observable property IsBeingCreated for VMs, set to true when they're made a hidden object, and false when they're removed from hidden objects (both in CreateVMAction). In the PVS Page when this is set to false, we re-evaluate whether a VM can be shown. This means that new VMs show here at the same time they're added to the tree (only different is tree refresh time), instead of far earlier (and before their networks were added).
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Set IsbeingCreated in the CreateVMFastAction
* [CA-233454] Properly support the VM Fast Create action
Further changes to CreateVMFastAction, to ensure it works with PVS tab - use the __gui__ prefix when the VM is created and then change it back just before showing.
* [CA-233454] Small logic adjustments/tidying up
2016-11-30 13:24:02 +01:00
|
|
|
|
UpdateRow(newRow, vm, pvsProxy, showRow);
|
2017-01-25 13:38:33 +01:00
|
|
|
|
RegisterVmEventHandlers(vm, pvsProxy);
|
CP-16922: Implement GUI for enabling PVS read caching (#1179)
* CP-16922: UI changes to PvsPage to replace the single configure button with a separate enable and disable one, per the design doc
* CP-16922: Intermediate checkin - command + dialog implemented, but PVS page has some layout problems.
* CP-16922: Implement GUI for enabling PVS read caching and marking/unmarking VMs for prepopulation
Fix the broken layout by reverting MainWindow.resx (which shouldn't have changed) back to the previous commit. Also removed duplicate properties button code.
* CP-16922: PVS Page changes, to properly display all VMs (not just ones with proxy), only populating proxy columns if there is a proxy set.
* CP-16922: Use a CommandButton for the enable button, connected to the same command as the VM main menu button, and using the table selection as its selection manager.
* CP-16922: Delete the old enable button click behaviour (because it now has a proper command), was causing the dialog to show up twice
* CP-16922: Properly list VMs by hiding those that should be hidden (in addition to non-VMs, also hide the __gui__ prefix and others covered by Show function). Also fixes a bug in NewVMGroupVMsPage discovered when fixing this - it would show VMs that should be hidden if you used the search bar.
* CP-16922: Use ButtonText on the Command to set the text on the PVS enable button
* CP-16922: Add the disable PVS read-caching command, and its associated proxy destroy action. Both based off enable equivalents (main difference is no dialog for now). Not used yet but will be in main window menu + disable button
* CP-16922: Add disable PVS read-caching to the main window menu (under enable), with the disable command attached to it
* CP-16922: Add support for disabling PVS read-caching for selected hosts via the PVS tab page by converting the disable button into a CommandButton in the same way as the enable button, using its own command + selection manager (because Selection Managers only bind to one control)
* CP-16922: Design - adding the "read caching enabled" column from the design, so that we display both whether caching is enabled and whether the VM is currently cached. If it's disabled all other values are missing.
* CP-16922: Add the PVS site column per the design to show the site a VM's PVS Proxy is on if it has a proxy
* CP-16922: Add an event handler for VMs changing so that newly provisioned VMs immediately show up in the PVS tab page
* CP-16922: Support for properly remembering the selection when the VM list is refreshed. A new method returns the list of VMs for the selected rows, and we can then check if the VM for the row being added is in this list. If there was no previous selection then we still select the first row by default.
* CP-16922: Remove prepopulate, which is being removed from the design. The next XAPI version will remove it, so just pass False as prepopulate for now, and remove the option from the dialog and PVS tab page.
* CP-16922: Improve UI appearance for a missing Storage Repository. Per the design, if there is no SR show the message None (memory only) instead of an empty cell
* CP-16922: Improved sorting behaviour. All columns (except VM name, which always uses it) use the VM tag as a sorting fallback (since they all have duplicates). New default sort which sorts by caching enabled first (yes before no), and then VM tag as a tiebreaker. Support for remembering the current sort on refresh, ie when a value changes.
* CP-16922: Refactoring to use a VM extension method to get the PVSProxy (or null if none exists) for a VM. This was used in the PVS Page + commands which are now much simpler.
* CP-16922: Move where the SelectionChanged event handler is set when refreshing the PVS table, so that the command buttons are updated correctly.
* CP-16922: Improvements to PVS read-caching dialog. Set accept/cancel buttons properly + adjust tab values, so focus acts as expected
* CP-16922: Remove the images from the menu for Enable/Disable PVS read-caching, most commands in the menu don't have one
* CP-16922: Sorting out the strings for the actions + ParallelAction calls, and moving them into the resx. Also reverting wrong MainWindow.resx changes.
* CAR-2184: XAPI changes. I've made the minimal possible changes to PvsPage to ensure it compiles, but it's had a lot of feature work (CP-16922) that supersedes this, these small changes should keep that merge painless.
* CAR-2184 XAPI: Reverse the unrelated changes, only keep the PVS ones.
* CP-16922: Merge latest XAPI changes, notably changes to Pvs_site.create
* CP-16922: Change tab show/hide logic for PVS tab, show it even if there are no PVS sites.
* CP-16922: Implement GUI for enabling PVS read caching
Design changes - remove the storage repo column and replace it with status, which is populated with a friendly version of the pvs_proxy_status enum. Also populate site list using site.name_label
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* CP-16922: Implement GUI for enabling PVS read caching
Adjusting the CanExecute of Enable PVS read-caching command to require at least one PVS site to be created. Since the PVS tab can show up without any sites, we need this because we can't create a proxy without a site.
* CP-16922: Code review changes.
Tidied up messages, and ensured actions run async properly, and without exiting before their task.
* CP-16922: Code review changes.
Update dialog resx, wider combobox on dialog, update action descriptions before setting RelatedTask, add friendly message body for PVS error notifications.
2016-09-22 16:08:15 +02:00
|
|
|
|
return newRow;
|
|
|
|
|
}
|
|
|
|
|
|
[CA-233454] PVS tab doesn't show a new VM when it's created (#1314)
* [CA-233454] PVS tab doesn't show a new VM when it's created
Refined the rules for not adding a VM to the table, if it is a template (thus not_a_real_vm), and it has the __gui__ prefix (thus hidden), we still add it, but hide it.
When its name is changed (to remove the __gui__ prefix), we update its name and re-calculate whether it should be visible (in the case of a new VM this will be true once the __gui__ prefix is gone). Also resort the table if a node changes from hidden to visible, because it appears as an addition to the table.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update criteria for VM visibility to include is_a_real_vm
is_a_template is changed before the name_label removes the __gui__ prefix, so this works with no other changes to the vm property changed event.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update when the VMs are shown in the PVS list
New observable property IsBeingCreated for VMs, set to true when they're made a hidden object, and false when they're removed from hidden objects (both in CreateVMAction). In the PVS Page when this is set to false, we re-evaluate whether a VM can be shown. This means that new VMs show here at the same time they're added to the tree (only different is tree refresh time), instead of far earlier (and before their networks were added).
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Set IsbeingCreated in the CreateVMFastAction
* [CA-233454] Properly support the VM Fast Create action
Further changes to CreateVMFastAction, to ensure it works with PVS tab - use the __gui__ prefix when the VM is created and then change it back just before showing.
* [CA-233454] Small logic adjustments/tidying up
2016-11-30 13:24:02 +01:00
|
|
|
|
private void UpdateRow(DataGridViewRow row, VM vm, PVS_proxy pvsProxy, bool showRow=true)
|
CP-16922: Implement GUI for enabling PVS read caching (#1179)
* CP-16922: UI changes to PvsPage to replace the single configure button with a separate enable and disable one, per the design doc
* CP-16922: Intermediate checkin - command + dialog implemented, but PVS page has some layout problems.
* CP-16922: Implement GUI for enabling PVS read caching and marking/unmarking VMs for prepopulation
Fix the broken layout by reverting MainWindow.resx (which shouldn't have changed) back to the previous commit. Also removed duplicate properties button code.
* CP-16922: PVS Page changes, to properly display all VMs (not just ones with proxy), only populating proxy columns if there is a proxy set.
* CP-16922: Use a CommandButton for the enable button, connected to the same command as the VM main menu button, and using the table selection as its selection manager.
* CP-16922: Delete the old enable button click behaviour (because it now has a proper command), was causing the dialog to show up twice
* CP-16922: Properly list VMs by hiding those that should be hidden (in addition to non-VMs, also hide the __gui__ prefix and others covered by Show function). Also fixes a bug in NewVMGroupVMsPage discovered when fixing this - it would show VMs that should be hidden if you used the search bar.
* CP-16922: Use ButtonText on the Command to set the text on the PVS enable button
* CP-16922: Add the disable PVS read-caching command, and its associated proxy destroy action. Both based off enable equivalents (main difference is no dialog for now). Not used yet but will be in main window menu + disable button
* CP-16922: Add disable PVS read-caching to the main window menu (under enable), with the disable command attached to it
* CP-16922: Add support for disabling PVS read-caching for selected hosts via the PVS tab page by converting the disable button into a CommandButton in the same way as the enable button, using its own command + selection manager (because Selection Managers only bind to one control)
* CP-16922: Design - adding the "read caching enabled" column from the design, so that we display both whether caching is enabled and whether the VM is currently cached. If it's disabled all other values are missing.
* CP-16922: Add the PVS site column per the design to show the site a VM's PVS Proxy is on if it has a proxy
* CP-16922: Add an event handler for VMs changing so that newly provisioned VMs immediately show up in the PVS tab page
* CP-16922: Support for properly remembering the selection when the VM list is refreshed. A new method returns the list of VMs for the selected rows, and we can then check if the VM for the row being added is in this list. If there was no previous selection then we still select the first row by default.
* CP-16922: Remove prepopulate, which is being removed from the design. The next XAPI version will remove it, so just pass False as prepopulate for now, and remove the option from the dialog and PVS tab page.
* CP-16922: Improve UI appearance for a missing Storage Repository. Per the design, if there is no SR show the message None (memory only) instead of an empty cell
* CP-16922: Improved sorting behaviour. All columns (except VM name, which always uses it) use the VM tag as a sorting fallback (since they all have duplicates). New default sort which sorts by caching enabled first (yes before no), and then VM tag as a tiebreaker. Support for remembering the current sort on refresh, ie when a value changes.
* CP-16922: Refactoring to use a VM extension method to get the PVSProxy (or null if none exists) for a VM. This was used in the PVS Page + commands which are now much simpler.
* CP-16922: Move where the SelectionChanged event handler is set when refreshing the PVS table, so that the command buttons are updated correctly.
* CP-16922: Improvements to PVS read-caching dialog. Set accept/cancel buttons properly + adjust tab values, so focus acts as expected
* CP-16922: Remove the images from the menu for Enable/Disable PVS read-caching, most commands in the menu don't have one
* CP-16922: Sorting out the strings for the actions + ParallelAction calls, and moving them into the resx. Also reverting wrong MainWindow.resx changes.
* CAR-2184: XAPI changes. I've made the minimal possible changes to PvsPage to ensure it compiles, but it's had a lot of feature work (CP-16922) that supersedes this, these small changes should keep that merge painless.
* CAR-2184 XAPI: Reverse the unrelated changes, only keep the PVS ones.
* CP-16922: Merge latest XAPI changes, notably changes to Pvs_site.create
* CP-16922: Change tab show/hide logic for PVS tab, show it even if there are no PVS sites.
* CP-16922: Implement GUI for enabling PVS read caching
Design changes - remove the storage repo column and replace it with status, which is populated with a friendly version of the pvs_proxy_status enum. Also populate site list using site.name_label
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* CP-16922: Implement GUI for enabling PVS read caching
Adjusting the CanExecute of Enable PVS read-caching command to require at least one PVS site to be created. Since the PVS tab can show up without any sites, we need this because we can't create a proxy without a site.
* CP-16922: Code review changes.
Tidied up messages, and ensured actions run async properly, and without exiting before their task.
* CP-16922: Code review changes.
Update dialog resx, wider combobox on dialog, update action descriptions before setting RelatedTask, add friendly message body for PVS error notifications.
2016-09-22 16:08:15 +02:00
|
|
|
|
{
|
2016-10-12 17:59:46 +02:00
|
|
|
|
PVS_site pvsSite = pvsProxy == null ? null : Connection.Resolve(pvsProxy.site);
|
2017-09-03 04:33:29 +02:00
|
|
|
|
row.Cells[0].Value = vm.Name();
|
2016-10-12 17:59:46 +02:00
|
|
|
|
row.Cells[1].Value = pvsProxy == null ? Messages.NO : Messages.YES;
|
2017-09-03 04:33:29 +02:00
|
|
|
|
row.Cells[2].Value = pvsProxy == null || pvsSite == null ? Messages.NO_VALUE : pvsSite.NameWithWarning();
|
2016-10-12 17:59:46 +02:00
|
|
|
|
row.Cells[3].Value = pvsProxy == null ? Messages.NO_VALUE : pvs_proxy_status_extensions.ToFriendlyString(pvsProxy.status);
|
[CA-233454] PVS tab doesn't show a new VM when it's created (#1314)
* [CA-233454] PVS tab doesn't show a new VM when it's created
Refined the rules for not adding a VM to the table, if it is a template (thus not_a_real_vm), and it has the __gui__ prefix (thus hidden), we still add it, but hide it.
When its name is changed (to remove the __gui__ prefix), we update its name and re-calculate whether it should be visible (in the case of a new VM this will be true once the __gui__ prefix is gone). Also resort the table if a node changes from hidden to visible, because it appears as an addition to the table.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update criteria for VM visibility to include is_a_real_vm
is_a_template is changed before the name_label removes the __gui__ prefix, so this works with no other changes to the vm property changed event.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update when the VMs are shown in the PVS list
New observable property IsBeingCreated for VMs, set to true when they're made a hidden object, and false when they're removed from hidden objects (both in CreateVMAction). In the PVS Page when this is set to false, we re-evaluate whether a VM can be shown. This means that new VMs show here at the same time they're added to the tree (only different is tree refresh time), instead of far earlier (and before their networks were added).
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Set IsbeingCreated in the CreateVMFastAction
* [CA-233454] Properly support the VM Fast Create action
Further changes to CreateVMFastAction, to ensure it works with PVS tab - use the __gui__ prefix when the VM is created and then change it back just before showing.
* [CA-233454] Small logic adjustments/tidying up
2016-11-30 13:24:02 +01:00
|
|
|
|
|
|
|
|
|
row.Visible = showRow;
|
2016-10-12 17:59:46 +02:00
|
|
|
|
}
|
2016-07-13 14:36:49 +02:00
|
|
|
|
|
2017-01-25 13:38:33 +01:00
|
|
|
|
private void RegisterVmEventHandlers(VM vm, PVS_proxy pvsProxy)
|
2016-10-12 17:59:46 +02:00
|
|
|
|
{
|
|
|
|
|
vm.PropertyChanged -= VmPropertyChanged;
|
2016-07-13 14:36:49 +02:00
|
|
|
|
vm.PropertyChanged += VmPropertyChanged;
|
2016-10-12 17:59:46 +02:00
|
|
|
|
if (pvsProxy != null)
|
|
|
|
|
{
|
|
|
|
|
pvsProxy.PropertyChanged -= PvsProxyPropertyChanged;
|
|
|
|
|
pvsProxy.PropertyChanged += PvsProxyPropertyChanged;
|
|
|
|
|
PVS_site pvsSite = pvsProxy == null ? null : Connection.Resolve(pvsProxy.site);
|
|
|
|
|
if (pvsSite != null)
|
|
|
|
|
{
|
|
|
|
|
pvsSite.PropertyChanged -= PvsSitePropertyChanged;
|
|
|
|
|
pvsSite.PropertyChanged += PvsSitePropertyChanged;
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-07-13 14:36:49 +02:00
|
|
|
|
}
|
|
|
|
|
|
2017-01-25 13:38:33 +01:00
|
|
|
|
private void UnregisterVmEventHandlers()
|
2016-07-13 14:36:49 +02:00
|
|
|
|
{
|
CP-16922: Implement GUI for enabling PVS read caching (#1179)
* CP-16922: UI changes to PvsPage to replace the single configure button with a separate enable and disable one, per the design doc
* CP-16922: Intermediate checkin - command + dialog implemented, but PVS page has some layout problems.
* CP-16922: Implement GUI for enabling PVS read caching and marking/unmarking VMs for prepopulation
Fix the broken layout by reverting MainWindow.resx (which shouldn't have changed) back to the previous commit. Also removed duplicate properties button code.
* CP-16922: PVS Page changes, to properly display all VMs (not just ones with proxy), only populating proxy columns if there is a proxy set.
* CP-16922: Use a CommandButton for the enable button, connected to the same command as the VM main menu button, and using the table selection as its selection manager.
* CP-16922: Delete the old enable button click behaviour (because it now has a proper command), was causing the dialog to show up twice
* CP-16922: Properly list VMs by hiding those that should be hidden (in addition to non-VMs, also hide the __gui__ prefix and others covered by Show function). Also fixes a bug in NewVMGroupVMsPage discovered when fixing this - it would show VMs that should be hidden if you used the search bar.
* CP-16922: Use ButtonText on the Command to set the text on the PVS enable button
* CP-16922: Add the disable PVS read-caching command, and its associated proxy destroy action. Both based off enable equivalents (main difference is no dialog for now). Not used yet but will be in main window menu + disable button
* CP-16922: Add disable PVS read-caching to the main window menu (under enable), with the disable command attached to it
* CP-16922: Add support for disabling PVS read-caching for selected hosts via the PVS tab page by converting the disable button into a CommandButton in the same way as the enable button, using its own command + selection manager (because Selection Managers only bind to one control)
* CP-16922: Design - adding the "read caching enabled" column from the design, so that we display both whether caching is enabled and whether the VM is currently cached. If it's disabled all other values are missing.
* CP-16922: Add the PVS site column per the design to show the site a VM's PVS Proxy is on if it has a proxy
* CP-16922: Add an event handler for VMs changing so that newly provisioned VMs immediately show up in the PVS tab page
* CP-16922: Support for properly remembering the selection when the VM list is refreshed. A new method returns the list of VMs for the selected rows, and we can then check if the VM for the row being added is in this list. If there was no previous selection then we still select the first row by default.
* CP-16922: Remove prepopulate, which is being removed from the design. The next XAPI version will remove it, so just pass False as prepopulate for now, and remove the option from the dialog and PVS tab page.
* CP-16922: Improve UI appearance for a missing Storage Repository. Per the design, if there is no SR show the message None (memory only) instead of an empty cell
* CP-16922: Improved sorting behaviour. All columns (except VM name, which always uses it) use the VM tag as a sorting fallback (since they all have duplicates). New default sort which sorts by caching enabled first (yes before no), and then VM tag as a tiebreaker. Support for remembering the current sort on refresh, ie when a value changes.
* CP-16922: Refactoring to use a VM extension method to get the PVSProxy (or null if none exists) for a VM. This was used in the PVS Page + commands which are now much simpler.
* CP-16922: Move where the SelectionChanged event handler is set when refreshing the PVS table, so that the command buttons are updated correctly.
* CP-16922: Improvements to PVS read-caching dialog. Set accept/cancel buttons properly + adjust tab values, so focus acts as expected
* CP-16922: Remove the images from the menu for Enable/Disable PVS read-caching, most commands in the menu don't have one
* CP-16922: Sorting out the strings for the actions + ParallelAction calls, and moving them into the resx. Also reverting wrong MainWindow.resx changes.
* CAR-2184: XAPI changes. I've made the minimal possible changes to PvsPage to ensure it compiles, but it's had a lot of feature work (CP-16922) that supersedes this, these small changes should keep that merge painless.
* CAR-2184 XAPI: Reverse the unrelated changes, only keep the PVS ones.
* CP-16922: Merge latest XAPI changes, notably changes to Pvs_site.create
* CP-16922: Change tab show/hide logic for PVS tab, show it even if there are no PVS sites.
* CP-16922: Implement GUI for enabling PVS read caching
Design changes - remove the storage repo column and replace it with status, which is populated with a friendly version of the pvs_proxy_status enum. Also populate site list using site.name_label
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* CP-16922: Implement GUI for enabling PVS read caching
Adjusting the CanExecute of Enable PVS read-caching command to require at least one PVS site to be created. Since the PVS tab can show up without any sites, we need this because we can't create a proxy without a site.
* CP-16922: Code review changes.
Tidied up messages, and ensured actions run async properly, and without exiting before their task.
* CP-16922: Code review changes.
Update dialog resx, wider combobox on dialog, update action descriptions before setting RelatedTask, add friendly message body for PVS error notifications.
2016-09-22 16:08:15 +02:00
|
|
|
|
dataGridViewVms.SelectionChanged -= VmSelectionChanged;
|
|
|
|
|
dataGridViewVms.SortCompare -= dataGridViewVms_SortCompare;
|
|
|
|
|
|
2016-07-13 14:36:49 +02:00
|
|
|
|
foreach (DataGridViewRow row in dataGridViewVms.Rows)
|
|
|
|
|
{
|
|
|
|
|
var vm = row.Tag as VM;
|
2016-07-21 12:47:42 +02:00
|
|
|
|
System.Diagnostics.Trace.Assert(vm != null);
|
2016-07-13 14:36:49 +02:00
|
|
|
|
vm.PropertyChanged -= VmPropertyChanged;
|
2016-10-12 17:59:46 +02:00
|
|
|
|
|
2017-09-03 04:33:29 +02:00
|
|
|
|
var pvsProxy = vm.PvsProxy();
|
2016-10-12 17:59:46 +02:00
|
|
|
|
if (pvsProxy != null)
|
|
|
|
|
{
|
|
|
|
|
pvsProxy.PropertyChanged -= PvsProxyPropertyChanged;
|
|
|
|
|
var pvsSite = Connection.Resolve(pvsProxy.site);
|
|
|
|
|
if (pvsSite != null)
|
|
|
|
|
pvsSite.PropertyChanged -= PvsSitePropertyChanged;
|
|
|
|
|
}
|
2016-07-13 14:36:49 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-25 13:38:33 +01:00
|
|
|
|
private void UnregisterHandlers()
|
|
|
|
|
{
|
|
|
|
|
if (connection == null)
|
|
|
|
|
return;
|
|
|
|
|
connection.Cache.DeregisterCollectionChanged<PVS_proxy>(PvsProxy_CollectionChangedWithInvoke);
|
|
|
|
|
connection.Cache.DeregisterCollectionChanged<VM>(PvsProxy_CollectionChangedWithInvoke);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void PageHidden()
|
|
|
|
|
{
|
|
|
|
|
UnregisterHandlers();
|
|
|
|
|
}
|
|
|
|
|
|
CP-16922: Implement GUI for enabling PVS read caching (#1179)
* CP-16922: UI changes to PvsPage to replace the single configure button with a separate enable and disable one, per the design doc
* CP-16922: Intermediate checkin - command + dialog implemented, but PVS page has some layout problems.
* CP-16922: Implement GUI for enabling PVS read caching and marking/unmarking VMs for prepopulation
Fix the broken layout by reverting MainWindow.resx (which shouldn't have changed) back to the previous commit. Also removed duplicate properties button code.
* CP-16922: PVS Page changes, to properly display all VMs (not just ones with proxy), only populating proxy columns if there is a proxy set.
* CP-16922: Use a CommandButton for the enable button, connected to the same command as the VM main menu button, and using the table selection as its selection manager.
* CP-16922: Delete the old enable button click behaviour (because it now has a proper command), was causing the dialog to show up twice
* CP-16922: Properly list VMs by hiding those that should be hidden (in addition to non-VMs, also hide the __gui__ prefix and others covered by Show function). Also fixes a bug in NewVMGroupVMsPage discovered when fixing this - it would show VMs that should be hidden if you used the search bar.
* CP-16922: Use ButtonText on the Command to set the text on the PVS enable button
* CP-16922: Add the disable PVS read-caching command, and its associated proxy destroy action. Both based off enable equivalents (main difference is no dialog for now). Not used yet but will be in main window menu + disable button
* CP-16922: Add disable PVS read-caching to the main window menu (under enable), with the disable command attached to it
* CP-16922: Add support for disabling PVS read-caching for selected hosts via the PVS tab page by converting the disable button into a CommandButton in the same way as the enable button, using its own command + selection manager (because Selection Managers only bind to one control)
* CP-16922: Design - adding the "read caching enabled" column from the design, so that we display both whether caching is enabled and whether the VM is currently cached. If it's disabled all other values are missing.
* CP-16922: Add the PVS site column per the design to show the site a VM's PVS Proxy is on if it has a proxy
* CP-16922: Add an event handler for VMs changing so that newly provisioned VMs immediately show up in the PVS tab page
* CP-16922: Support for properly remembering the selection when the VM list is refreshed. A new method returns the list of VMs for the selected rows, and we can then check if the VM for the row being added is in this list. If there was no previous selection then we still select the first row by default.
* CP-16922: Remove prepopulate, which is being removed from the design. The next XAPI version will remove it, so just pass False as prepopulate for now, and remove the option from the dialog and PVS tab page.
* CP-16922: Improve UI appearance for a missing Storage Repository. Per the design, if there is no SR show the message None (memory only) instead of an empty cell
* CP-16922: Improved sorting behaviour. All columns (except VM name, which always uses it) use the VM tag as a sorting fallback (since they all have duplicates). New default sort which sorts by caching enabled first (yes before no), and then VM tag as a tiebreaker. Support for remembering the current sort on refresh, ie when a value changes.
* CP-16922: Refactoring to use a VM extension method to get the PVSProxy (or null if none exists) for a VM. This was used in the PVS Page + commands which are now much simpler.
* CP-16922: Move where the SelectionChanged event handler is set when refreshing the PVS table, so that the command buttons are updated correctly.
* CP-16922: Improvements to PVS read-caching dialog. Set accept/cancel buttons properly + adjust tab values, so focus acts as expected
* CP-16922: Remove the images from the menu for Enable/Disable PVS read-caching, most commands in the menu don't have one
* CP-16922: Sorting out the strings for the actions + ParallelAction calls, and moving them into the resx. Also reverting wrong MainWindow.resx changes.
* CAR-2184: XAPI changes. I've made the minimal possible changes to PvsPage to ensure it compiles, but it's had a lot of feature work (CP-16922) that supersedes this, these small changes should keep that merge painless.
* CAR-2184 XAPI: Reverse the unrelated changes, only keep the PVS ones.
* CP-16922: Merge latest XAPI changes, notably changes to Pvs_site.create
* CP-16922: Change tab show/hide logic for PVS tab, show it even if there are no PVS sites.
* CP-16922: Implement GUI for enabling PVS read caching
Design changes - remove the storage repo column and replace it with status, which is populated with a friendly version of the pvs_proxy_status enum. Also populate site list using site.name_label
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* CP-16922: Implement GUI for enabling PVS read caching
Adjusting the CanExecute of Enable PVS read-caching command to require at least one PVS site to be created. Since the PVS tab can show up without any sites, we need this because we can't create a proxy without a site.
* CP-16922: Code review changes.
Tidied up messages, and ensured actions run async properly, and without exiting before their task.
* CP-16922: Code review changes.
Update dialog resx, wider combobox on dialog, update action descriptions before setting RelatedTask, add friendly message body for PVS error notifications.
2016-09-22 16:08:15 +02:00
|
|
|
|
void dataGridViewVms_SortCompare(object sender, DataGridViewSortCompareEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
e.Handled = false;
|
|
|
|
|
|
|
|
|
|
if (!e.Column.Equals(columnVM))
|
|
|
|
|
{
|
|
|
|
|
// All columns in this table except VM name are likely to contain a lot of duplicates
|
|
|
|
|
// so always use VM as the tiebreaker for consistency
|
|
|
|
|
var cellValue1 = e.CellValue1.ToString();
|
|
|
|
|
var cellValue2 = e.CellValue2.ToString();
|
|
|
|
|
|
|
|
|
|
if (cellValue1 != cellValue2)
|
|
|
|
|
{
|
|
|
|
|
e.SortResult = cellValue1.CompareTo(cellValue2);
|
|
|
|
|
e.Handled = true;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// If we get here, either sorting by VM name column, or using it as tie breaker
|
|
|
|
|
// In order to sort by name, we actually use the built-in VM sort.
|
|
|
|
|
// This ensures we use the correct name sorting, and gives a consistent tie-breaker.
|
|
|
|
|
VM vm1 = (VM)dataGridViewVms.Rows[e.RowIndex1].Tag;
|
|
|
|
|
VM vm2 = (VM)dataGridViewVms.Rows[e.RowIndex2].Tag;
|
|
|
|
|
e.SortResult = vm1.CompareTo(vm2);
|
|
|
|
|
e.Handled = true;
|
|
|
|
|
}
|
2016-10-12 17:59:46 +02:00
|
|
|
|
|
2016-09-26 18:44:17 +02:00
|
|
|
|
#endregion
|
2016-07-13 14:36:49 +02:00
|
|
|
|
|
2016-10-12 17:59:46 +02:00
|
|
|
|
private void PvsProxyCollectionChanged(object sender, CollectionChangeEventArgs e)
|
2016-07-13 14:36:49 +02:00
|
|
|
|
{
|
2016-11-24 17:51:48 +01:00
|
|
|
|
LoadVMs();
|
2016-07-13 14:36:49 +02:00
|
|
|
|
}
|
|
|
|
|
|
[CA-233454] PVS tab doesn't show a new VM when it's created (#1314)
* [CA-233454] PVS tab doesn't show a new VM when it's created
Refined the rules for not adding a VM to the table, if it is a template (thus not_a_real_vm), and it has the __gui__ prefix (thus hidden), we still add it, but hide it.
When its name is changed (to remove the __gui__ prefix), we update its name and re-calculate whether it should be visible (in the case of a new VM this will be true once the __gui__ prefix is gone). Also resort the table if a node changes from hidden to visible, because it appears as an addition to the table.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update criteria for VM visibility to include is_a_real_vm
is_a_template is changed before the name_label removes the __gui__ prefix, so this works with no other changes to the vm property changed event.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update when the VMs are shown in the PVS list
New observable property IsBeingCreated for VMs, set to true when they're made a hidden object, and false when they're removed from hidden objects (both in CreateVMAction). In the PVS Page when this is set to false, we re-evaluate whether a VM can be shown. This means that new VMs show here at the same time they're added to the tree (only different is tree refresh time), instead of far earlier (and before their networks were added).
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Set IsbeingCreated in the CreateVMFastAction
* [CA-233454] Properly support the VM Fast Create action
Further changes to CreateVMFastAction, to ensure it works with PVS tab - use the __gui__ prefix when the VM is created and then change it back just before showing.
* [CA-233454] Small logic adjustments/tidying up
2016-11-30 13:24:02 +01:00
|
|
|
|
private void SortVmTable()
|
|
|
|
|
{
|
|
|
|
|
var sortedColumn = dataGridViewVms.SortedColumn;
|
|
|
|
|
var sortDirection = ListSortDirection.Ascending;
|
|
|
|
|
|
|
|
|
|
if (dataGridViewVms.SortOrder.Equals(SortOrder.Descending))
|
|
|
|
|
sortDirection = ListSortDirection.Descending;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (sortedColumn != null)
|
|
|
|
|
{
|
|
|
|
|
dataGridViewVms.Sort(sortedColumn, sortDirection);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
dataGridViewVms.Sort(vmDefaultSort);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-07-13 14:36:49 +02:00
|
|
|
|
private void VmPropertyChanged(object sender, PropertyChangedEventArgs e)
|
|
|
|
|
{
|
[CA-233454] PVS tab doesn't show a new VM when it's created (#1314)
* [CA-233454] PVS tab doesn't show a new VM when it's created
Refined the rules for not adding a VM to the table, if it is a template (thus not_a_real_vm), and it has the __gui__ prefix (thus hidden), we still add it, but hide it.
When its name is changed (to remove the __gui__ prefix), we update its name and re-calculate whether it should be visible (in the case of a new VM this will be true once the __gui__ prefix is gone). Also resort the table if a node changes from hidden to visible, because it appears as an addition to the table.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update criteria for VM visibility to include is_a_real_vm
is_a_template is changed before the name_label removes the __gui__ prefix, so this works with no other changes to the vm property changed event.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update when the VMs are shown in the PVS list
New observable property IsBeingCreated for VMs, set to true when they're made a hidden object, and false when they're removed from hidden objects (both in CreateVMAction). In the PVS Page when this is set to false, we re-evaluate whether a VM can be shown. This means that new VMs show here at the same time they're added to the tree (only different is tree refresh time), instead of far earlier (and before their networks were added).
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Set IsbeingCreated in the CreateVMFastAction
* [CA-233454] Properly support the VM Fast Create action
Further changes to CreateVMFastAction, to ensure it works with PVS tab - use the __gui__ prefix when the VM is created and then change it back just before showing.
* [CA-233454] Small logic adjustments/tidying up
2016-11-30 13:24:02 +01:00
|
|
|
|
if (e.PropertyName != "IsBeingCreated" && e.PropertyName != "name_label")
|
2016-07-13 14:36:49 +02:00
|
|
|
|
return;
|
|
|
|
|
|
[CA-233454] PVS tab doesn't show a new VM when it's created (#1314)
* [CA-233454] PVS tab doesn't show a new VM when it's created
Refined the rules for not adding a VM to the table, if it is a template (thus not_a_real_vm), and it has the __gui__ prefix (thus hidden), we still add it, but hide it.
When its name is changed (to remove the __gui__ prefix), we update its name and re-calculate whether it should be visible (in the case of a new VM this will be true once the __gui__ prefix is gone). Also resort the table if a node changes from hidden to visible, because it appears as an addition to the table.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update criteria for VM visibility to include is_a_real_vm
is_a_template is changed before the name_label removes the __gui__ prefix, so this works with no other changes to the vm property changed event.
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Update when the VMs are shown in the PVS list
New observable property IsBeingCreated for VMs, set to true when they're made a hidden object, and false when they're removed from hidden objects (both in CreateVMAction). In the PVS Page when this is set to false, we re-evaluate whether a VM can be shown. This means that new VMs show here at the same time they're added to the tree (only different is tree refresh time), instead of far earlier (and before their networks were added).
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* [CA-233454] Set IsbeingCreated in the CreateVMFastAction
* [CA-233454] Properly support the VM Fast Create action
Further changes to CreateVMFastAction, to ensure it works with PVS tab - use the __gui__ prefix when the VM is created and then change it back just before showing.
* [CA-233454] Small logic adjustments/tidying up
2016-11-30 13:24:02 +01:00
|
|
|
|
if (e.PropertyName.Equals("IsBeingCreated"))
|
|
|
|
|
{
|
|
|
|
|
var senderAsVm = sender as VM;
|
|
|
|
|
if (senderAsVm == null || senderAsVm.IsBeingCreated)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Program.Invoke(this, () =>
|
|
|
|
|
{
|
|
|
|
|
foreach (DataGridViewRow row in dataGridViewVms.Rows)
|
|
|
|
|
{
|
|
|
|
|
var vm = row.Tag as VM;
|
|
|
|
|
if (vm != null && vm.Equals(sender))
|
|
|
|
|
{
|
|
|
|
|
var wasHidden = !row.Visible;
|
|
|
|
|
|
|
|
|
|
dataGridViewVms.SuspendLayout();
|
|
|
|
|
|
|
|
|
|
if (VmShouldBeVisible(vm))
|
|
|
|
|
{
|
|
|
|
|
row.Visible = true;
|
|
|
|
|
|
|
|
|
|
if (wasHidden)
|
|
|
|
|
SortVmTable(); // This appears as an add to the user, so retain table sorting
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dataGridViewVms.ResumeLayout();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-12 17:59:46 +02:00
|
|
|
|
Program.Invoke(this, () =>
|
2016-07-13 14:36:49 +02:00
|
|
|
|
{
|
2016-10-12 17:59:46 +02:00
|
|
|
|
foreach (DataGridViewRow row in dataGridViewVms.Rows)
|
2016-07-21 12:47:42 +02:00
|
|
|
|
{
|
2016-10-12 17:59:46 +02:00
|
|
|
|
var vm = row.Tag as VM;
|
|
|
|
|
if (vm != null && vm.Equals(sender))
|
|
|
|
|
{
|
2017-09-03 04:33:29 +02:00
|
|
|
|
row.Cells["columnVM"].Value = vm.Name();
|
2016-10-12 17:59:46 +02:00
|
|
|
|
break;
|
|
|
|
|
}
|
2016-07-21 12:47:42 +02:00
|
|
|
|
}
|
2016-10-12 17:59:46 +02:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void PvsProxyPropertyChanged(object sender, PropertyChangedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (e.PropertyName != "status" && e.PropertyName != "site")
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
Program.Invoke(this, () =>
|
|
|
|
|
{
|
|
|
|
|
var pvsProxy = sender as PVS_proxy;
|
|
|
|
|
foreach (DataGridViewRow row in dataGridViewVms.Rows)
|
|
|
|
|
{
|
|
|
|
|
var vm = row.Tag as VM;
|
2017-09-03 04:33:29 +02:00
|
|
|
|
if (vm != null)
|
2016-10-12 17:59:46 +02:00
|
|
|
|
{
|
2017-09-03 04:33:29 +02:00
|
|
|
|
var pvsProxyVm = pvsProxy.VM();
|
|
|
|
|
if (vm.Equals(pvsProxyVm))
|
|
|
|
|
{
|
|
|
|
|
UpdateRow(row, pvsProxyVm, pvsProxy);
|
|
|
|
|
break;
|
|
|
|
|
}
|
2016-10-12 17:59:46 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void PvsSitePropertyChanged(object sender, PropertyChangedEventArgs e)
|
|
|
|
|
{
|
2016-11-11 15:04:16 +01:00
|
|
|
|
if (e.PropertyName != "name_label" && e.PropertyName != "cache_storage")
|
2016-10-12 17:59:46 +02:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
Program.Invoke(this, () =>
|
|
|
|
|
{
|
|
|
|
|
var pvsSite = sender as PVS_site;
|
|
|
|
|
foreach (DataGridViewRow row in dataGridViewVms.Rows)
|
|
|
|
|
{
|
|
|
|
|
var vm = row.Tag as VM;
|
|
|
|
|
if (vm == null)
|
|
|
|
|
continue;
|
2017-09-03 04:33:29 +02:00
|
|
|
|
var pvsProxy = vm.PvsProxy();
|
2016-10-12 17:59:46 +02:00
|
|
|
|
if (pvsProxy != null && pvsProxy.site != null && pvsProxy.site.opaque_ref == pvsSite.opaque_ref)
|
|
|
|
|
{
|
|
|
|
|
UpdateRow(row, vm, pvsProxy);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
2016-07-13 14:36:49 +02:00
|
|
|
|
}
|
2016-07-25 16:26:08 +02:00
|
|
|
|
|
2016-09-26 18:44:17 +02:00
|
|
|
|
private void ConfigureButton_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
using (var dialog = new PvsCacheConfigurationDialog(connection))
|
|
|
|
|
dialog.ShowDialog(this);
|
|
|
|
|
}
|
2016-07-13 14:36:49 +02:00
|
|
|
|
}
|
CP-16922: Implement GUI for enabling PVS read caching (#1179)
* CP-16922: UI changes to PvsPage to replace the single configure button with a separate enable and disable one, per the design doc
* CP-16922: Intermediate checkin - command + dialog implemented, but PVS page has some layout problems.
* CP-16922: Implement GUI for enabling PVS read caching and marking/unmarking VMs for prepopulation
Fix the broken layout by reverting MainWindow.resx (which shouldn't have changed) back to the previous commit. Also removed duplicate properties button code.
* CP-16922: PVS Page changes, to properly display all VMs (not just ones with proxy), only populating proxy columns if there is a proxy set.
* CP-16922: Use a CommandButton for the enable button, connected to the same command as the VM main menu button, and using the table selection as its selection manager.
* CP-16922: Delete the old enable button click behaviour (because it now has a proper command), was causing the dialog to show up twice
* CP-16922: Properly list VMs by hiding those that should be hidden (in addition to non-VMs, also hide the __gui__ prefix and others covered by Show function). Also fixes a bug in NewVMGroupVMsPage discovered when fixing this - it would show VMs that should be hidden if you used the search bar.
* CP-16922: Use ButtonText on the Command to set the text on the PVS enable button
* CP-16922: Add the disable PVS read-caching command, and its associated proxy destroy action. Both based off enable equivalents (main difference is no dialog for now). Not used yet but will be in main window menu + disable button
* CP-16922: Add disable PVS read-caching to the main window menu (under enable), with the disable command attached to it
* CP-16922: Add support for disabling PVS read-caching for selected hosts via the PVS tab page by converting the disable button into a CommandButton in the same way as the enable button, using its own command + selection manager (because Selection Managers only bind to one control)
* CP-16922: Design - adding the "read caching enabled" column from the design, so that we display both whether caching is enabled and whether the VM is currently cached. If it's disabled all other values are missing.
* CP-16922: Add the PVS site column per the design to show the site a VM's PVS Proxy is on if it has a proxy
* CP-16922: Add an event handler for VMs changing so that newly provisioned VMs immediately show up in the PVS tab page
* CP-16922: Support for properly remembering the selection when the VM list is refreshed. A new method returns the list of VMs for the selected rows, and we can then check if the VM for the row being added is in this list. If there was no previous selection then we still select the first row by default.
* CP-16922: Remove prepopulate, which is being removed from the design. The next XAPI version will remove it, so just pass False as prepopulate for now, and remove the option from the dialog and PVS tab page.
* CP-16922: Improve UI appearance for a missing Storage Repository. Per the design, if there is no SR show the message None (memory only) instead of an empty cell
* CP-16922: Improved sorting behaviour. All columns (except VM name, which always uses it) use the VM tag as a sorting fallback (since they all have duplicates). New default sort which sorts by caching enabled first (yes before no), and then VM tag as a tiebreaker. Support for remembering the current sort on refresh, ie when a value changes.
* CP-16922: Refactoring to use a VM extension method to get the PVSProxy (or null if none exists) for a VM. This was used in the PVS Page + commands which are now much simpler.
* CP-16922: Move where the SelectionChanged event handler is set when refreshing the PVS table, so that the command buttons are updated correctly.
* CP-16922: Improvements to PVS read-caching dialog. Set accept/cancel buttons properly + adjust tab values, so focus acts as expected
* CP-16922: Remove the images from the menu for Enable/Disable PVS read-caching, most commands in the menu don't have one
* CP-16922: Sorting out the strings for the actions + ParallelAction calls, and moving them into the resx. Also reverting wrong MainWindow.resx changes.
* CAR-2184: XAPI changes. I've made the minimal possible changes to PvsPage to ensure it compiles, but it's had a lot of feature work (CP-16922) that supersedes this, these small changes should keep that merge painless.
* CAR-2184 XAPI: Reverse the unrelated changes, only keep the PVS ones.
* CP-16922: Merge latest XAPI changes, notably changes to Pvs_site.create
* CP-16922: Change tab show/hide logic for PVS tab, show it even if there are no PVS sites.
* CP-16922: Implement GUI for enabling PVS read caching
Design changes - remove the storage repo column and replace it with status, which is populated with a friendly version of the pvs_proxy_status enum. Also populate site list using site.name_label
Signed-off-by: Callum McIntyre <callumiandavid.mcintyre@citrix.com>
* CP-16922: Implement GUI for enabling PVS read caching
Adjusting the CanExecute of Enable PVS read-caching command to require at least one PVS site to be created. Since the PVS tab can show up without any sites, we need this because we can't create a proxy without a site.
* CP-16922: Code review changes.
Tidied up messages, and ensured actions run async properly, and without exiting before their task.
* CP-16922: Code review changes.
Update dialog resx, wider combobox on dialog, update action descriptions before setting RelatedTask, add friendly message body for PVS error notifications.
2016-09-22 16:08:15 +02:00
|
|
|
|
|
|
|
|
|
class DataGridViewVms_DefaultSort : System.Collections.IComparer
|
|
|
|
|
{
|
|
|
|
|
public int Compare(object first, object second)
|
|
|
|
|
{
|
|
|
|
|
// Default sort: Sort by whether caching is enabled (yes before no), using VM name (asc) as tiebreaker
|
|
|
|
|
DataGridViewRow row1 = (DataGridViewRow)first;
|
|
|
|
|
DataGridViewRow row2 = (DataGridViewRow)second;
|
|
|
|
|
|
|
|
|
|
int cachingEnabled1 = row1.Cells[1].Value.ToString().Equals(Messages.YES) ? 0 : 1;
|
|
|
|
|
int cachingEnabled2 = row2.Cells[1].Value.ToString().Equals(Messages.YES) ? 0 : 1;
|
|
|
|
|
|
|
|
|
|
if (cachingEnabled1 != cachingEnabled2)
|
|
|
|
|
{
|
|
|
|
|
return cachingEnabled1.CompareTo(cachingEnabled2);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// VM name as tiebreaker
|
|
|
|
|
var vm1 = row1.Tag as VM;
|
|
|
|
|
var vm2 = row2.Tag as VM;
|
|
|
|
|
|
|
|
|
|
return vm1.CompareTo(vm2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-07-13 14:36:49 +02:00
|
|
|
|
}
|