Frank Kobzik has uploaded a new change for review.

Change subject: webadmin,userportal: RFE: allow to define deletion protection 
per vm
......................................................................

webadmin,userportal: RFE: allow to define deletion protection per vm

This patch introduces protection from unwanted deletion of VMs/Templates.

On frontend it affects
 - checkbox "prevent deletion" on each new/edit popup dialog for
   vm/template/vm pool
 - if the "prevent deletion" protection is enabled and the administrator
  intends to delete a vm/template, then the webadmin/(power)userportal
  displays a popup dialog and prevents deletion of the entity

Change-Id: I837ea8f2247dd2b859e31b95ee32faa7b0a51226
Signed-off-by: Frantisek Kobzik <fkob...@redhat.com>
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=871371
---
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolListModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewTemplateVmModelBehavior.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewVmModelBehavior.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/PoolModelBehaviorBase.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/TemplateVmModelBehavior.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmSnapshotListModel.java
M 
frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/Constants.java
15 files changed, 83 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/05/9405/1

diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java
index 7c8ec1f..fb30dda 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/CommonApplicationConstants.java
@@ -328,6 +328,9 @@
     @DefaultStringValue("Stateless")
     String statelessVmPopup();
 
+    @DefaultStringValue("Prevent deletion")
+    String preventDeletionPopup();
+
     @DefaultStringValue("Smartcard enabled")
     String smartcardVmPopup();
 
diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java
index 5b3e45d..fb0289b 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.java
@@ -161,6 +161,11 @@
     @WithElementId("osType")
     public ListModelListBoxEditor<Object> oSTypeEditor;
 
+    @UiField(provided = true)
+    @Path(value = "preventDeletion.entity")
+    @WithElementId("preventDeletion")
+    public EntityModelCheckBoxEditor preventDeletionEditor;
+
     @UiField
     @Ignore
     Label generalWarningMessage;
@@ -456,6 +461,7 @@
         dontMigrateVMEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
         isHighlyAvailableEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
         isStatelessEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
+        preventDeletionEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
         isSmartcardEnabledEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
         cdAttachedEditor = new EntityModelCheckBoxEditor(Align.LEFT);
         allowConsoleReconnectEditor = new 
EntityModelCheckBoxEditor(Align.RIGHT);
@@ -670,6 +676,7 @@
 
         oSTypeEditor.setLabel(constants.osVmPopup());
         isStatelessEditor.setLabel(constants.statelessVmPopup());
+        preventDeletionEditor.setLabel(constants.preventDeletionPopup());
         isSmartcardEnabledEditor.setLabel(constants.smartcardVmPopup());
 
         // Pools Tab
diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml
index 4e4bdcd..a37988b 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/AbstractVmPopupWidget.ui.xml
@@ -275,6 +275,7 @@
                                                <g:FlowPanel 
addStyleNames="{style.sectionPanel}">
                                                        
<e:ListModelListBoxEditor ui:field="oSTypeEditor" />
                                                        
<e:EntityModelCheckBoxEditor ui:field="isStatelessEditor" 
addStyleNames="{style.checkbox}" />
+                                                       
<e:EntityModelCheckBoxEditor ui:field="preventDeletionEditor" 
addStyleNames="{style.checkbox}" />
                                                </g:FlowPanel>
                                                <g:FlowPanel 
addStyleNames="{style.sectionPanel}">
                                                        
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolListModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolListModel.java
index 3e26b60..1778167 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolListModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolListModel.java
@@ -644,6 +644,7 @@
                         desktop.setvmt_guid(((VmTemplate) 
model.getTemplate().getSelectedItem()).getId());
                         desktop.setvm_name(name);
                         desktop.setvm_os((VmOsType) 
model.getOSType().getSelectedItem());
+                        desktop.setPreventDeletion((Boolean) 
model.getPreventDeletion().getEntity());
                         desktop.setSmartcardEnabled((Boolean) 
model.getIsSmartcardEnabled().getEntity());
                         desktop.setnum_of_monitors((Integer) 
model.getNumOfMonitors().getSelectedItem());
                         
desktop.setvm_domain(model.getDomain().getIsAvailable() ? (String) 
model.getDomain()
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java
index 4cd5181..2f5c5de 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java
@@ -520,6 +520,7 @@
         template.setusb_policy((UsbPolicy) 
model.getUsbPolicy().getSelectedItem());
         template.setis_auto_suspend(false);
         template.setis_stateless((Boolean) model.getIsStateless().getEntity());
+        template.setPreventDeletion((Boolean) 
model.getPreventDeletion().getEntity());
         template.setSmartcardEnabled((Boolean) 
model.getIsSmartcardEnabled().getEntity());
         template.setdefault_boot_sequence(model.getBootSequence());
         template.setiso_path(model.getCdImage().getIsChangable() ? (String) 
model.getCdImage().getSelectedItem() : ""); //$NON-NLS-1$
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java
index 9b3959c..bb5d6cd 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java
@@ -651,6 +651,7 @@
         tempVar.setusb_policy((UsbPolicy) 
model.getUsbPolicy().getSelectedItem());
         tempVar.setis_auto_suspend(false);
         tempVar.setis_stateless((Boolean) model.getIsStateless().getEntity());
+        tempVar.setPreventDeletion((Boolean) 
model.getPreventDeletion().getEntity());
         tempVar.setSmartcardEnabled((Boolean) 
model.getIsSmartcardEnabled().getEntity());
         tempVar.setdefault_boot_sequence(model.getBootSequence());
         tempVar.setauto_startup((Boolean) 
model.getIsHighlyAvailable().getEntity());
@@ -1076,8 +1077,14 @@
         {
             return;
         }
+
         UserPortalItemModel selectedItem = (UserPortalItemModel) 
getSelectedItem();
         VM vm = (VM) selectedItem.getEntity();
+
+        if (vm.getPreventDeletion()) {
+            displayPreventDeletionPopup();
+            return;
+        }
 
         ConfirmationModel confirmModel = new ConfirmationModel();
         setConfirmWindow(confirmModel);
@@ -1098,6 +1105,20 @@
         
tempVar2.setTitle(ConstantsManager.getInstance().getConstants().cancel());
         tempVar2.setIsCancel(true);
         getConfirmWindow().getCommands().add(tempVar2);
+    }
+
+    private void displayPreventDeletionPopup() {
+        ConfirmationModel errorModel = new ConfirmationModel();
+        
errorModel.setTitle(ConstantsManager.getInstance().getConstants().removeVirtualMachineTitle());
+        
errorModel.setMessage(ConstantsManager.getInstance().getConstants().removeVmPrevented());
+
+        UICommand cancelCommand = new UICommand("Cancel", this); //$NON-NLS-1$
+        
cancelCommand.setTitle(ConstantsManager.getInstance().getConstants().close());
+        cancelCommand.setIsDefault(true);
+        cancelCommand.setIsCancel(true);
+        errorModel.getCommands().add(cancelCommand);
+
+        setConfirmWindow(errorModel);
     }
 
     private void OnRemove()
@@ -1294,6 +1315,7 @@
         gettempVm().setusb_policy((UsbPolicy) 
model.getUsbPolicy().getSelectedItem());
         gettempVm().setis_auto_suspend(false);
         gettempVm().setis_stateless((Boolean) 
model.getIsStateless().getEntity());
+        gettempVm().setPreventDeletion((Boolean) 
model.getPreventDeletion().getEntity());
         gettempVm().setSmartcardEnabled((Boolean) 
model.getIsSmartcardEnabled().getEntity());
         gettempVm().setdefault_boot_sequence(model.getBootSequence());
         gettempVm().setiso_path(model.getCdImage().getIsChangable() ? (String) 
model.getCdImage()
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java
index 1a01a31..c2892eb 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/ExistingVmModelBehavior.java
@@ -131,6 +131,7 @@
         getModel().getIsStateless().setIsAvailable(vm.getVmPoolId() == null);
 
         getModel().getIsSmartcardEnabled().setEntity(vm.isSmartcardEnabled());
+        getModel().getPreventDeletion().setEntity(vm.getPreventDeletion());
 
         getModel().getNumOfSockets().setSelectedItem(vm.getnum_of_sockets());
         getModel().getNumOfSockets().setIsChangable(!vm.isStatusUp());
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewTemplateVmModelBehavior.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewTemplateVmModelBehavior.java
index 09ad6c5..3352ffa 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewTemplateVmModelBehavior.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewTemplateVmModelBehavior.java
@@ -202,6 +202,7 @@
         
getModel().getTotalCPUCores().setEntity(Integer.toString(this.vm.getnum_of_cpus()));
         
getModel().getNumOfSockets().setSelectedItem(this.vm.getnum_of_sockets());
         getModel().getIsStateless().setEntity(this.vm.getis_stateless());
+        
getModel().getPreventDeletion().setEntity(this.vm.getPreventDeletion());
         
getModel().getIsSmartcardEnabled().setEntity(this.vm.isSmartcardEnabled());
 
         if (!StringHelper.isNullOrEmpty(this.vm.gettime_zone()))
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewVmModelBehavior.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewVmModelBehavior.java
index 0b726e5..3adaa2f 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewVmModelBehavior.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewVmModelBehavior.java
@@ -98,6 +98,7 @@
             doChangeDefautlHost(template.getdedicated_vm_for_vds());
 
             
getModel().getIsSmartcardEnabled().setEntity(template.isSmartcardEnabled());
+            
getModel().getPreventDeletion().setEntity(template.getPreventDeletion());
 
             if (getModel().getVmType() == VmType.Desktop) {
                 
getModel().getIsStateless().setEntity(template.getis_stateless());
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/PoolModelBehaviorBase.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/PoolModelBehaviorBase.java
index 350ea2e..7dad55f 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/PoolModelBehaviorBase.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/PoolModelBehaviorBase.java
@@ -118,6 +118,7 @@
             getModel().getUsbPolicy().setSelectedItem(vmBase.getusb_policy());
             getModel().setBootSequence(vmBase.getdefault_boot_sequence());
             
getModel().getIsHighlyAvailable().setEntity(vmBase.getauto_startup());
+            
getModel().getPreventDeletion().setEntity(vmBase.getPreventDeletion());
             
getModel().getIsSmartcardEnabled().setEntity(vmBase.isSmartcardEnabled());
 
             boolean hasCd = !StringHelper.isNullOrEmpty(vmBase.getiso_path());
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/TemplateVmModelBehavior.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/TemplateVmModelBehavior.java
index 5a44b61..9d215ab 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/TemplateVmModelBehavior.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/TemplateVmModelBehavior.java
@@ -147,6 +147,7 @@
         
getModel().getTotalCPUCores().setEntity(Integer.toString(this.template.getnum_of_cpus()));
         
getModel().getNumOfSockets().setSelectedItem(this.template.getnum_of_sockets());
         getModel().getIsStateless().setEntity(this.template.getis_stateless());
+        
getModel().getPreventDeletion().setEntity(this.template.getPreventDeletion());
         
getModel().getIsSmartcardEnabled().setEntity(this.template.isSmartcardEnabled());
 
         
getModel().getKernel_parameters().setEntity(this.template.getkernel_params());
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java
index b694ae0..ccf9d58 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/UnitVmModel.java
@@ -535,6 +535,16 @@
         privateIsStateless = value;
     }
 
+    private EntityModel privatePreventDeletion;
+
+    public EntityModel getPreventDeletion() {
+        return privatePreventDeletion;
+    }
+
+    public void setPreventDeletion(EntityModel preventDeletion) {
+        this.privatePreventDeletion = preventDeletion;
+    }
+
     private ListModel privateDisplayProtocol;
 
     public ListModel getDisplayProtocol()
@@ -969,6 +979,7 @@
         setUsbPolicy(new ListModel());
         setIsStateless(new EntityModel());
         setIsSmartcardEnabled(new EntityModel());
+        setPreventDeletion(new EntityModel());
 
         setCdImage(new ListModel());
         getCdImage().setIsChangable(false);
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java
index b528f5d..ebb7594 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java
@@ -874,20 +874,25 @@
             return;
         }
 
-        ConfirmationModel model = new ConfirmationModel();
-        setWindow(model);
-        
model.setTitle(ConstantsManager.getInstance().getConstants().removeVirtualMachinesTitle());
-        model.setHashName("remove_virtual_machine"); //$NON-NLS-1$
-        
model.setMessage(ConstantsManager.getInstance().getConstants().virtualMachinesMsg());
-
         // model.Items = SelectedItems.Cast<VM>().Select(a => a.vm_name);
         ArrayList<String> list = new ArrayList<String>();
         for (Object selectedItem : getSelectedItems())
         {
             VM a = (VM) selectedItem;
             list.add(a.getvm_name());
+            if (a.getPreventDeletion()) {
+                displayPreventDeletionPopup();
+                return;
+            }
         }
+
+        ConfirmationModel model = new ConfirmationModel();
+        setWindow(model);
         model.setItems(list);
+        
model.setTitle(ConstantsManager.getInstance().getConstants().removeVirtualMachinesTitle());
+        model.setHashName("remove_virtual_machine"); //$NON-NLS-1$
+        
model.setMessage(ConstantsManager.getInstance().getConstants().virtualMachinesMsg());
+
 
         UICommand tempVar = new UICommand("OnRemove", this); //$NON-NLS-1$
         tempVar.setTitle(ConstantsManager.getInstance().getConstants().ok());
@@ -897,6 +902,20 @@
         
tempVar2.setTitle(ConstantsManager.getInstance().getConstants().cancel());
         tempVar2.setIsCancel(true);
         model.getCommands().add(tempVar2);
+    }
+
+    private void displayPreventDeletionPopup() {
+        ConfirmationModel errorModel = new ConfirmationModel();
+        
errorModel.setTitle(ConstantsManager.getInstance().getConstants().removeVirtualMachineTitle());
+        
errorModel.setMessage(ConstantsManager.getInstance().getConstants().removeVmPrevented());
+
+        UICommand cancelCommand = new UICommand("CancelConfirmation", this); 
//$NON-NLS-1$
+        
cancelCommand.setTitle(ConstantsManager.getInstance().getConstants().close());
+        cancelCommand.setIsDefault(true);
+        cancelCommand.setIsCancel(true);
+        errorModel.getCommands().add(cancelCommand);
+
+        setConfirmWindow(errorModel);
     }
 
     private void Move()
@@ -1622,6 +1641,7 @@
         tempVar.setis_auto_suspend(false);
         tempVar.setis_stateless((Boolean) model.getIsStateless().getEntity());
         tempVar.setSmartcardEnabled((Boolean) 
model.getIsSmartcardEnabled().getEntity());
+        tempVar.setPreventDeletion((Boolean) 
model.getPreventDeletion().getEntity());
         tempVar.setdefault_boot_sequence(model.getBootSequence());
         tempVar.setauto_startup((Boolean) 
model.getIsHighlyAvailable().getEntity());
         tempVar.setiso_path(model.getCdImage().getIsChangable() ? (String) 
model.getCdImage().getSelectedItem() : ""); //$NON-NLS-1$
@@ -2183,6 +2203,7 @@
         getcurrentVm().setis_auto_suspend(false);
         getcurrentVm().setis_stateless((Boolean) 
model.getIsStateless().getEntity());
         getcurrentVm().setSmartcardEnabled((Boolean) 
model.getIsSmartcardEnabled().getEntity());
+        getcurrentVm().setPreventDeletion((Boolean) 
model.getPreventDeletion().getEntity());
         getcurrentVm().setdefault_boot_sequence(model.getBootSequence());
         getcurrentVm().setiso_path(model.getCdImage().getIsChangable() ? 
(String) model.getCdImage().getSelectedItem()
                 : ""); //$NON-NLS-1$
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmSnapshotListModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmSnapshotListModel.java
index 1e72c87..4d9fbde 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmSnapshotListModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmSnapshotListModel.java
@@ -649,6 +649,7 @@
         getcurrentVm().setis_auto_suspend(false);
         getcurrentVm().setis_stateless((Boolean) 
model.getIsStateless().getEntity());
         getcurrentVm().setSmartcardEnabled((Boolean) 
model.getIsSmartcardEnabled().getEntity());
+        getcurrentVm().setPreventDeletion((Boolean) 
model.getPreventDeletion().getEntity());
         getcurrentVm().setdefault_boot_sequence(model.getBootSequence());
         getcurrentVm().setiso_path(model.getCdImage().getIsChangable() ?
                 (String) model.getCdImage().getSelectedItem() : ""); 
//$NON-NLS-1$
diff --git 
a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/Constants.java
 
b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/Constants.java
index 8d22841..a428f2d 100644
--- 
a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/Constants.java
+++ 
b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/Constants.java
@@ -414,6 +414,10 @@
     @DefaultStringValue("Remove Virtual Machine")
     String removeVirtualMachineTitle();
 
+    @DefaultStringValue("The selected virtual machine(s) can't be removed" +
+               " because the prevent deletion option is enabled.")
+    String removeVmPrevented();
+
     @DefaultStringValue("Remove Tag(s)")
     String removeTagsTitle();
 


--
To view, visit http://gerrit.ovirt.org/9405
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I837ea8f2247dd2b859e31b95ee32faa7b0a51226
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Frank Kobzik <fkob...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to