summaryrefslogtreecommitdiffstats
path: root/js/phpvirtualbox.js
diff options
context:
space:
mode:
authorIan Moore <imoore76@yahoo.com>2015-09-09 08:51:46 -0400
committerIan Moore <imoore76@yahoo.com>2015-09-09 08:51:46 -0400
commitb43db21f8963d49890531354ec3a3151b249be0e (patch)
tree1a1fdea61550778cfb1b9fd2386d4d0497a70d9e /js/phpvirtualbox.js
parentcfae402eee8881fcb5cce0e45d2b67ee25335254 (diff)
downloadphpvirtualbox-b43db21f8963d49890531354ec3a3151b249be0e.zip
phpvirtualbox-b43db21f8963d49890531354ec3a3151b249be0e.tar.gz
phpvirtualbox-b43db21f8963d49890531354ec3a3151b249be0e.tar.bz2
See Changelog
Diffstat (limited to 'js/phpvirtualbox.js')
-rw-r--r--js/phpvirtualbox.js19
1 files changed, 13 insertions, 6 deletions
diff --git a/js/phpvirtualbox.js b/js/phpvirtualbox.js
index 1b7225e..f6f818a 100644
--- a/js/phpvirtualbox.js
+++ b/js/phpvirtualbox.js
@@ -1602,7 +1602,8 @@ var vboxVMActions = {
},
/* Start a single VM */
_startVM: function(vm) {
-
+
+ var reqPromise = $.Deferred();
$.when(vm,vboxAjaxRequest('machineSetState',{'vm':vm.id,'state':'powerUp'}))
// VM started and / or progress op returned
@@ -1613,10 +1614,15 @@ var vboxVMActions = {
if(vboxVMStates.isSaved(evm)) icon = 'progress_state_restore_90px.png';
else icon = 'progress_start_90px.png';
+ reqPromise.resolve();
+
vboxProgress({'progress':d.responseData.progress,'persist':d.persist}, function(){return;},
- icon, trans('Start selected virtual machines','UIActionPool'),evm.name);
+ icon, trans('Start selected virtual machines','UIActionPool'), evm.name);
+ } else {
+ reqPromise.reject();
}
});
+ return reqPromise;
},
click: function (btn) {
@@ -1689,10 +1695,11 @@ var vboxVMActions = {
// Save the fact that we started this VM
vboxVMActions.start._startedVMs[vm.id] = true;
- vboxVMActions.start._startVM(vm);
+ $.when(vboxVMActions.start._startVM(vm)).done(function() {
+ // Loop
+ runVMsToStart(vms);
+ });
- // Loop
- runVMsToStart(vms);
}));
})(vmsToStart);
@@ -3132,7 +3139,7 @@ function vboxWizard() {
function vboxToolbar(options) {
var self = this;
- this.buttons = options.buttons;
+ this.buttons = options.buttons ? options.buttons : [];
this.size = options.size ? options.size : 22;
this.addHeight = 24;
this.lastItem = null;