Lior Vernia has uploaded a new change for review.

Change subject: webadmin: Show Guide Me before vNIC creation
......................................................................

webadmin: Show Guide Me before vNIC creation

There's no real need to wait for the vNIC creation to finish before
showing the Guide Me dialog; if the creation succeeds then it could
happen asynchronously while the user deals with the Guide Me dialog
(I'm unaware of any interdependence between the operations), and if it
fails then an error dialog will popup up anyway (and on top of the
Guide Me dialog rather than under it).

Change-Id: If4bebb56613ebaed67377489448501ba9642adf6
Bug-Url: https://bugzilla.redhat.com/1066461
Signed-off-by: Lior Vernia <[email protected]>
---
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java
1 file changed, 20 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/36/25936/1

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 fc55e06..548facb 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
@@ -2044,20 +2044,14 @@
                         new VmInterfaceCreatingManager(new 
VmInterfaceCreatingManager.PostVnicCreatedCallback() {
                             @Override
                             public void vnicCreated(Guid vmId) {
-                                getWindow().stopProgress();
-                                cancel();
-                                setGuideContext(vmId);
-                                updateActionAvailability();
-                                getGuideCommand().execute();
+                                // do nothing
                             }
 
                             @Override
                             public void queryFailed() {
-                                getWindow().stopProgress();
-                                cancel();
+                                // do nothing
                             }
                         });
-
 
                 model.startProgress(null);
 
@@ -2071,7 +2065,24 @@
 
                 setVmWatchdogToParams(model, parameters);
 
-                
Frontend.getInstance().runAction(VdcActionType.AddVmFromScratch, parameters, 
new UnitVmModelNetworkAsyncCallback(model, addVmFromScratchNetworkManager), 
this);
+                
Frontend.getInstance().runAction(VdcActionType.AddVmFromScratch,
+                        parameters,
+                        new UnitVmModelNetworkAsyncCallback(model, 
addVmFromScratchNetworkManager) {
+                    @Override
+                    public void executed(FrontendActionAsyncResult result) {
+                        getWindow().stopProgress();
+                        VdcReturnValueBase returnValue = 
result.getReturnValue();
+                        if (returnValue != null && returnValue.getSucceeded()) 
{
+                            setWindow(null);
+                            
setGuideContext(returnValue.getActionReturnValue());
+                            updateActionAvailability();
+                            getGuideCommand().execute();
+                        } else {
+                            cancel();
+                        }
+                        super.executed(result);
+                    }
+                }, this);
             }
             else
             {


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If4bebb56613ebaed67377489448501ba9642adf6
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.4
Gerrit-Owner: Lior Vernia <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to