Changeset 52995 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Oct 8, 2014 1:55:16 PM (10 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r52991 r52995 4109 4109 m_fSeparateProcess = fSeparateProcess; 4110 4110 4111 /* Search for corresponding VM: */ 4111 4112 QUuid uuid = QUuid(vmNameOrUuid); 4113 const CMachine machine = mVBox.FindMachine(vmNameOrUuid); 4112 4114 if (!uuid.isNull()) 4113 4115 { 4114 vmUuid = vmNameOrUuid; 4116 if (machine.isNull() && showStartVMErrors()) 4117 return msgCenter().cannotFindMachineById(mVBox, vmNameOrUuid); 4115 4118 } 4116 4119 else 4117 4120 { 4118 CMachine m = mVBox.FindMachine (vmNameOrUuid); 4119 if (m.isNull()) 4120 { 4121 if (showStartVMErrors()) 4122 msgCenter().cannotFindMachineByName (mVBox, vmNameOrUuid); 4123 return; 4124 } 4125 vmUuid = m.GetId(); 4126 } 4121 if (machine.isNull() && showStartVMErrors()) 4122 return msgCenter().cannotFindMachineByName(mVBox, vmNameOrUuid); 4123 } 4124 vmUuid = machine.GetId(); 4127 4125 } 4128 4126 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r52991 r52995 115 115 116 116 /* Which VM we operate on? */ 117 CMachine machine 117 CMachine machine = session.GetMachine(); 118 118 /* Which snapshot we are restoring? */ 119 119 CSnapshot snapshot = machine.GetCurrentSnapshot(); … … 138 138 } 139 139 140 /* For separate process we should launch VM before UI: */ 141 if (vboxGlobal().isSeparateProcess()) 142 { 143 /* Get corresponding machine: */ 144 CMachine machine = vboxGlobal().virtualBox().FindMachine(vboxGlobal().managedVMUuid()); 145 AssertMsgReturn(!machine.isNull(), ("VBoxGlobal::managedVMUuid() should have filter that case before!\n"), false); 146 147 /* Try to launch corresponding machine: */ 148 if (!vboxGlobal().launchMachine(machine, VBoxGlobal::LaunchMode_Separate)) 149 return false; 150 } 151 140 152 /* Create machine UI: */ 141 153 new UIMachine; … … 217 229 bool UIMachine::prepare() 218 230 { 219 KLockType lockType;220 if (!vboxGlobal().isSeparateProcess())221 {222 lockType = KLockType_VM;223 }224 else225 {226 /* Try to find corresponding machine: */227 CVirtualBox virtualBox = vboxGlobal().virtualBox();228 CMachine machine = virtualBox.FindMachine(vboxGlobal().managedVMUuid());229 if (machine.isNull())230 {231 msgCenter().cannotFindMachineById(virtualBox, vboxGlobal().managedVMUuid());232 return false;233 }234 235 /* Try to launch corresponding machine: */236 if (!vboxGlobal().launchMachine(machine, VBoxGlobal::LaunchMode_Separate))237 return false;238 239 lockType = KLockType_Shared;240 }241 242 231 /* Create VM session: */ 243 m_session = vboxGlobal().openSession(vboxGlobal().managedVMUuid(), lockType); 232 m_session = vboxGlobal().openSession(vboxGlobal().managedVMUuid(), 233 vboxGlobal().isSeparateProcess() ? KLockType_Shared : KLockType_VM); 244 234 if (m_session.isNull()) 245 235 return false; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h
r52991 r52995 85 85 /** Prepare routine: Loading stuff. */ 86 86 void loadSettings(); 87 /** Prepareroutine: Saving stuff. */87 /** Cleanup routine: Saving stuff. */ 88 88 void saveSettings(); 89 89 /** Cleanup routine. */
Note:
See TracChangeset
for help on using the changeset viewer.