Daniel Erez has uploaded a new change for review. Change subject: webadmin: fix Save Memory visibility on create snapshot ......................................................................
webadmin: fix Save Memory visibility on create snapshot Create Snapshot dialog: 'Save Memory' checkbox should be visible only when VM is running. Following the fix in change I21de53a8f9092085beee28124ef2321538e76669, setVm should be invoked after setWindow (as VM PropertyChangedEvent listener is added on edit method of VmSnapshotCreatePopupWidget). Change-Id: I732132f1f9132e47451fcf02e793d0a2ffc6d11f Bug-Url: https://bugzilla.redhat.com/1056651 Signed-off-by: Daniel Erez <[email protected]> --- M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SnapshotModel.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 3 files changed, 7 insertions(+), 6 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/08/23708/1 diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SnapshotModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SnapshotModel.java index eb8311d..15895b0 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SnapshotModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/SnapshotModel.java @@ -169,18 +169,15 @@ setSnapshotDisks(new ListModel()); } - public static SnapshotModel createNewSnapshotModel(VM vm, ICommandTarget cancelCommandTarget) { + public static SnapshotModel createNewSnapshotModel(ICommandTarget cancelCommandTarget) { SnapshotModel model = new SnapshotModel(); model.setTitle(ConstantsManager.getInstance().getConstants().createSnapshotTitle()); model.setHashName("create_snapshot"); //$NON-NLS-1$ - model.setVm(vm); // the cancel command has to be created be before the call to initialize to avoid race condition model.setCancelCommand(new UICommand("Cancel", cancelCommandTarget) //$NON-NLS-1$ .setTitle(ConstantsManager.getInstance().getConstants().cancel()) .setIsCancel(true)); - - model.initialize(); return model; } 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 02291a0..3b47a8a 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 @@ -886,9 +886,11 @@ return; } - SnapshotModel model = SnapshotModel.createNewSnapshotModel(vm, this); + SnapshotModel model = SnapshotModel.createNewSnapshotModel(this); model.setValidateByVmSnapshots(true); setWindow(model); + model.setVm(vm); + model.initialize(); } @Override 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 de837c0..8a6852a 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 @@ -497,8 +497,10 @@ return; } - SnapshotModel model = SnapshotModel.createNewSnapshotModel(vm, this); + SnapshotModel model = SnapshotModel.createNewSnapshotModel(this); setWindow(model); + model.setVm(vm); + model.initialize(); } public void postOnNew(List<VdcReturnValueBase> returnValues) { -- To view, visit http://gerrit.ovirt.org/23708 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I732132f1f9132e47451fcf02e793d0a2ffc6d11f Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Daniel Erez <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
