Changeset 53028 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Oct 10, 2014 12:14:37 PM (10 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r53001 r53028 58 58 59 59 /* COM includes: */ 60 # include "CConsole.h"61 60 # include "CSystemProperties.h" 62 # include "CMachineDebugger.h"63 # include "CGuest.h"64 61 # include "CStorageController.h" 65 62 # include "CMediumAttachment.h" 66 # include "CDisplay.h"67 # include "CMouse.h"68 63 # include "CNetworkAdapter.h" 69 64 # include "CHostNetworkInterface.h" … … 168 163 return; 169 164 170 /* Get current machine/console: */171 CMachine machine = session().GetMachine();172 CConsole console = session().GetConsole();173 174 165 /* Apply debug settings from the command line. */ 175 CMachineDebugger debugger = console.GetDebugger(); 176 if (debugger.isOk()) 166 if (debugger().isOk()) 177 167 { 178 168 if (vboxGlobal().isPatmDisabled()) 179 debugger .SetPATMEnabled(false);169 debugger().SetPATMEnabled(false); 180 170 if (vboxGlobal().isCsamDisabled()) 181 debugger .SetCSAMEnabled(false);171 debugger().SetCSAMEnabled(false); 182 172 if (vboxGlobal().isSupervisorCodeExecedRecompiled()) 183 debugger .SetRecompileSupervisor(true);173 debugger().SetRecompileSupervisor(true); 184 174 if (vboxGlobal().isUserCodeExecedRecompiled()) 185 debugger .SetRecompileUser(true);175 debugger().SetRecompileUser(true); 186 176 if (vboxGlobal().areWeToExecuteAllInIem()) 187 debugger .SetExecuteAllInIEM(true);177 debugger().SetExecuteAllInIEM(true); 188 178 if (!vboxGlobal().isDefaultWarpPct()) 189 debugger .SetVirtualTimeRate(vboxGlobal().getWarpPct());179 debugger().SetVirtualTimeRate(vboxGlobal().getWarpPct()); 190 180 } 191 181 … … 195 185 #ifdef VBOX_WITH_DEBUGGER_GUI 196 186 CProgress progress = vboxGlobal().isStartPausedEnabled() || vboxGlobal().isDebuggerAutoShowEnabled() ? 197 console .PowerUpPaused() : console.PowerUp();187 console().PowerUpPaused() : console().PowerUp(); 198 188 #else /* !VBOX_WITH_DEBUGGER_GUI */ 199 CProgress progress = console .PowerUp();189 CProgress progress = console().PowerUp(); 200 190 #endif /* !VBOX_WITH_DEBUGGER_GUI */ 201 191 202 192 /* Check for immediate failure: */ 203 if (!console .isOk())193 if (!console().isOk()) 204 194 { 205 195 if (vboxGlobal().showStartVMErrors()) 206 msgCenter().cannotStartMachine(console , machine.GetName());196 msgCenter().cannotStartMachine(console(), machineName()); 207 197 closeRuntimeUI(); 208 198 return; … … 216 206 if (isSaved()) 217 207 { 218 msgCenter().showModalProgressDialog(progress, machine .GetName(), ":/progress_state_restore_90px.png", 0, 0);208 msgCenter().showModalProgressDialog(progress, machineName(), ":/progress_state_restore_90px.png", 0, 0); 219 209 /* After restoring from 'saved' state, machine-window(s) geometry should be adjusted: */ 220 210 machineLogic()->adjustMachineWindowsGeometry(); 221 211 } 222 212 else 223 msgCenter().showModalProgressDialog(progress, machine .GetName(), ":/progress_start_90px.png");213 msgCenter().showModalProgressDialog(progress, machineName(), ":/progress_start_90px.png"); 224 214 225 215 /* Check for a progress failure: */ … … 227 217 { 228 218 if (vboxGlobal().showStartVMErrors()) 229 msgCenter().cannotStartMachine(progress, machine .GetName());219 msgCenter().cannotStartMachine(progress, machineName()); 230 220 closeRuntimeUI(); 231 221 return; … … 238 228 else 239 229 { 240 /* Fetch the current state: */ 241 CMouse mouse = console.GetMouse(); 242 m_fIsMouseSupportsAbsolute = mouse.GetAbsoluteSupported(); 243 m_fIsMouseSupportsRelative = mouse.GetRelativeSupported(); 244 m_fIsMouseSupportsMultiTouch = mouse.GetMultiTouchSupported(); 245 m_fIsMouseHostCursorNeeded = mouse.GetNeedsHostCursor(); 246 230 /* Fetch the current mouse state: */ 231 m_fIsMouseSupportsAbsolute = mouse().GetAbsoluteSupported(); 232 m_fIsMouseSupportsRelative = mouse().GetRelativeSupported(); 233 m_fIsMouseSupportsMultiTouch = mouse().GetMultiTouchSupported(); 234 m_fIsMouseHostCursorNeeded = mouse().GetNeedsHostCursor(); 235 /* Fetch the current guest additions state: */ 247 236 sltAdditionsChange(); 248 237 } … … 255 244 } 256 245 257 /* Check if the required virtualization features are active. We get this 258 * info only when the session is active. */ 259 bool fIs64BitsGuest = vboxGlobal().virtualBox().GetGuestOSType(console.GetGuest().GetOSTypeId()).GetIs64Bit(); 260 bool fRecommendVirtEx = vboxGlobal().virtualBox().GetGuestOSType(console.GetGuest().GetOSTypeId()).GetRecommendedVirtEx(); 246 /* Check if the required virtualization features are active. We get this info only when the session is active. */ 247 const bool fIs64BitsGuest = vboxGlobal().virtualBox().GetGuestOSType(guest().GetOSTypeId()).GetIs64Bit(); 248 const bool fRecommendVirtEx = vboxGlobal().virtualBox().GetGuestOSType(guest().GetOSTypeId()).GetRecommendedVirtEx(); 261 249 AssertMsg(!fIs64BitsGuest || fRecommendVirtEx, ("Virtualization support missed for 64bit guest!\n")); 262 bool fIsVirtEnabled = console.GetDebugger().GetHWVirtExEnabled();250 bool fIsVirtEnabled = debugger().GetHWVirtExEnabled(); 263 251 if (fRecommendVirtEx && !fIsVirtEnabled) 264 252 { … … 277 265 if (fShouldWeClose) 278 266 { 279 /* At this point the console is powered up. So we have to close280 * this session again. */281 CProgress progress = console .PowerDown();282 if (console .isOk())267 /* At this point the console is powered up. 268 * So we have to close this session again. */ 269 CProgress progress = console().PowerDown(); 270 if (console().isOk()) 283 271 { 284 272 /* Guard progressbar warnings from auto-closing: */ … … 286 274 uimachine()->machineLogic()->setPreventAutoClose(true); 287 275 /* Show the power down progress dialog */ 288 msgCenter().showModalProgressDialog(progress, machine .GetName(), ":/progress_poweroff_90px.png");276 msgCenter().showModalProgressDialog(progress, machineName(), ":/progress_poweroff_90px.png"); 289 277 if (!progress.isOk() || progress.GetResultCode() != 0) 290 msgCenter().cannotPowerDownMachine(progress, machine .GetName());278 msgCenter().cannotPowerDownMachine(progress, machineName()); 291 279 /* Allow further auto-closing: */ 292 280 if (uimachine()->machineLogic()) … … 294 282 } 295 283 else 296 msgCenter().cannotPowerDownMachine(console );284 msgCenter().cannotPowerDownMachine(console()); 297 285 closeRuntimeUI(); 298 286 return; … … 304 292 #ifdef VBOX_WITH_VIDEOHWACCEL 305 293 LogRel(("2D video acceleration is %s.\n", 306 machine .GetAccelerate2DVideoEnabled() && VBoxGlobal::isAcceleration2DVideoAvailable()294 machine().GetAccelerate2DVideoEnabled() && VBoxGlobal::isAcceleration2DVideoAvailable() 307 295 ? "enabled" 308 296 : "disabled")); 309 #endif 297 #endif /* VBOX_WITH_VIDEOHWACCEL */ 310 298 311 299 /* Check if HID LEDs sync is enabled and add a log message about it. */ … … 330 318 { 331 319 /* Prepare the saving progress: */ 332 CMachine machine = m_session.GetMachine(); 333 CConsole console = m_session.GetConsole(); 334 CProgress progress = console.SaveState(); 335 if (console.isOk()) 320 CProgress progress = console().SaveState(); 321 if (console().isOk()) 336 322 { 337 323 /* Show the saving progress: */ 338 msgCenter().showModalProgressDialog(progress, machine .GetName(), ":/progress_state_save_90px.png");324 msgCenter().showModalProgressDialog(progress, machineName(), ":/progress_state_save_90px.png"); 339 325 if (!progress.isOk() || progress.GetResultCode() != 0) 340 326 { 341 327 /* Failed in progress: */ 342 msgCenter().cannotSaveMachineState(progress, machine .GetName());328 msgCenter().cannotSaveMachineState(progress, machineName()); 343 329 return false; 344 330 } … … 347 333 { 348 334 /* Failed in console: */ 349 msgCenter().cannotSaveMachineState(console );335 msgCenter().cannotSaveMachineState(console()); 350 336 return false; 351 337 } … … 357 343 { 358 344 /* Send ACPI shutdown signal if possible: */ 359 CConsole console = m_session.GetConsole(); 360 console.PowerButton(); 361 if (!console.isOk()) 345 console().PowerButton(); 346 if (!console().isOk()) 362 347 { 363 348 /* Failed in console: */ 364 msgCenter().cannotACPIShutdownMachine(console );349 msgCenter().cannotACPIShutdownMachine(console()); 365 350 return false; 366 351 } … … 372 357 { 373 358 /* Prepare the power-off progress: */ 374 CMachine machine = m_session.GetMachine(); 375 CConsole console = m_session.GetConsole(); 376 CProgress progress = console.PowerDown(); 377 if (console.isOk()) 359 CProgress progress = console().PowerDown(); 360 if (console().isOk()) 378 361 { 379 362 /* Show the power-off progress: */ 380 msgCenter().showModalProgressDialog(progress, machine .GetName(), ":/progress_poweroff_90px.png");363 msgCenter().showModalProgressDialog(progress, machineName(), ":/progress_poweroff_90px.png"); 381 364 if (progress.isOk() && progress.GetResultCode() == 0) 382 365 { … … 385 368 { 386 369 /* Prepare the snapshot-discard progress: */ 387 CSnapshot snapshot = machine .GetCurrentSnapshot();388 CProgress progress = console .RestoreSnapshot(snapshot);389 if (!console .isOk())390 return msgCenter().cannotRestoreSnapshot(console , snapshot.GetName(), machine.GetName());370 CSnapshot snapshot = machine().GetCurrentSnapshot(); 371 CProgress progress = console().RestoreSnapshot(snapshot); 372 if (!console().isOk()) 373 return msgCenter().cannotRestoreSnapshot(console(), snapshot.GetName(), machineName()); 391 374 392 375 /* Show the snapshot-discard progress: */ 393 msgCenter().showModalProgressDialog(progress, machine .GetName(), ":/progress_snapshot_discard_90px.png");376 msgCenter().showModalProgressDialog(progress, machineName(), ":/progress_snapshot_discard_90px.png"); 394 377 if (progress.GetResultCode() != 0) 395 return msgCenter().cannotRestoreSnapshot(progress, snapshot.GetName(), machine .GetName());378 return msgCenter().cannotRestoreSnapshot(progress, snapshot.GetName(), machineName()); 396 379 } 397 380 } … … 399 382 { 400 383 /* Failed in progress: */ 401 msgCenter().cannotPowerDownMachine(progress, machine .GetName());384 msgCenter().cannotPowerDownMachine(progress, machineName()); 402 385 return false; 403 386 } … … 406 389 { 407 390 /* Check the machine state, it might be already gone: */ 408 if (!console .isNull())391 if (!console().isNull()) 409 392 { 410 393 /* Failed in console: */ 411 COMResult res(console );394 COMResult res(console()); 412 395 /* This can happen if VBoxSVC is not running: */ 413 396 if (FAILED_DEAD_INTERFACE(res.rc())) 414 397 fServerCrashed = true; 415 398 else 416 msgCenter().cannotPowerDownMachine(console );399 msgCenter().cannotPowerDownMachine(console()); 417 400 return false; 418 401 } … … 450 433 bool UISession::setPause(bool fOn) 451 434 { 452 CConsole console = session().GetConsole();453 if (console.isNull())454 return true;455 456 435 if (fOn) 457 console .Pause();436 console().Pause(); 458 437 else 459 console .Resume();460 461 bool ok = console .isOk();438 console().Resume(); 439 440 bool ok = console().isOk(); 462 441 if (!ok) 463 442 { 464 443 if (fOn) 465 msgCenter().cannotPauseMachine(console );444 msgCenter().cannotPauseMachine(console()); 466 445 else 467 msgCenter().cannotResumeMachine(console );446 msgCenter().cannotResumeMachine(console()); 468 447 } 469 448 … … 481 460 fDoMount = true; 482 461 #else /* VBOX_WITH_ADDITIONS_AUTOUPDATE_UI */ 483 CGuest guest = session().GetConsole().GetGuest();484 462 QVector<KAdditionsUpdateFlag> aFlagsUpdate; 485 463 QVector<QString> aArgs; 486 CProgress progressInstall = guest .UpdateGuestAdditions(strSource,487 aArgs, aFlagsUpdate);488 bool fResult = guest .isOk();464 CProgress progressInstall = guest().UpdateGuestAdditions(strSource, 465 aArgs, aFlagsUpdate); 466 bool fResult = guest().isOk(); 489 467 if (fResult) 490 468 { … … 535 513 AssertReturnVoid(!strMediumID.isNull()); 536 514 537 /* Get machine: */538 CMachine machine = session().GetMachine();539 540 515 /* Searching for the first suitable controller/slot: */ 541 516 QString strControllerName; 542 517 LONG iCntPort = -1, iCntDevice = -1; 543 foreach (const CStorageController &controller, machine .GetStorageControllers())544 { 545 foreach (const CMediumAttachment &attachment, machine .GetMediumAttachmentsOfController(controller.GetName()))518 foreach (const CStorageController &controller, machine().GetStorageControllers()) 519 { 520 foreach (const CMediumAttachment &attachment, machine().GetMediumAttachmentsOfController(controller.GetName())) 546 521 { 547 522 if (attachment.GetType() == KDeviceType_DVD) … … 560 535 if (strControllerName.isNull()) 561 536 { 562 msgCenter().cannotMountGuestAdditions(machine .GetName());537 msgCenter().cannotMountGuestAdditions(machineName()); 563 538 return; 564 539 } … … 574 549 575 550 /* Mount medium to corresponding controller/slot: */ 576 machine .MountMedium(strControllerName, iCntPort, iCntDevice, medium.medium(), false /* force */);577 if (!machine .isOk())551 machine().MountMedium(strControllerName, iCntPort, iCntDevice, medium.medium(), false /* force */); 552 if (!machine().isOk()) 578 553 { 579 554 /* Ask for force mounting: */ 580 if (msgCenter().cannotRemountMedium(machine , medium, true /* mount? */,555 if (msgCenter().cannotRemountMedium(machine(), medium, true /* mount? */, 581 556 true /* retry? */, mainMachineWindow())) 582 557 { 583 558 /* Force mount medium to the predefined port/device: */ 584 machine .MountMedium(strControllerName, iCntPort, iCntDevice, medium.medium(), true /* force */);585 if (!machine .isOk())586 msgCenter().cannotRemountMedium(machine , medium, true /* mount? */,559 machine().MountMedium(strControllerName, iCntPort, iCntDevice, medium.medium(), true /* force */); 560 if (!machine().isOk()) 561 msgCenter().cannotRemountMedium(machine(), medium, true /* mount? */, 587 562 false /* retry? */, mainMachineWindow()); 588 563 } … … 722 697 void UISession::sltVRDEChange() 723 698 { 724 /* Get machine: */725 const CMachine machine = session().GetMachine();726 699 /* Get VRDE server: */ 727 const CVRDEServer &server = machine .GetVRDEServer();700 const CVRDEServer &server = machine().GetVRDEServer(); 728 701 bool fIsVRDEServerAvailable = !server.isNull(); 729 702 /* Show/Hide VRDE action depending on VRDE server availability status: */ … … 740 713 void UISession::sltVideoCaptureChange() 741 714 { 742 /* Get machine: */743 const CMachine machine = session().GetMachine();744 715 /* Check/Uncheck Video Capture action depending on feature status: */ 745 actionPool()->action(UIActionIndexRT_M_Devices_M_VideoCapture_T_Start)->setChecked(machine .GetVideoCaptureEnabled());716 actionPool()->action(UIActionIndexRT_M_Devices_M_VideoCapture_T_Start)->setChecked(machine().GetVideoCaptureEnabled()); 746 717 /* Notify listeners about Video Capture change: */ 747 718 emit sigVideoCaptureChange(); … … 870 841 void UISession::sltAdditionsChange() 871 842 { 872 /* Get our guest: */873 CGuest guest = session().GetConsole().GetGuest();874 875 843 /* Variable flags: */ 876 ULONG ulGuestAdditionsRunLevel = guest .GetAdditionsRunLevel();844 ULONG ulGuestAdditionsRunLevel = guest().GetAdditionsRunLevel(); 877 845 LONG64 lLastUpdatedIgnored; 878 bool fIsGuestSupportsGraphics = guest .GetFacilityStatus(KAdditionsFacilityType_Graphics, lLastUpdatedIgnored)846 bool fIsGuestSupportsGraphics = guest().GetFacilityStatus(KAdditionsFacilityType_Graphics, lLastUpdatedIgnored) 879 847 == KAdditionsFacilityStatus_Active; 880 bool fIsGuestSupportsSeamless = guest .GetFacilityStatus(KAdditionsFacilityType_Seamless, lLastUpdatedIgnored)848 bool fIsGuestSupportsSeamless = guest().GetFacilityStatus(KAdditionsFacilityType_Seamless, lLastUpdatedIgnored) 881 849 == KAdditionsFacilityStatus_Active; 882 850 /* Check if something had changed: */ … … 998 966 return false; 999 967 968 /* Get machine: */ 969 m_machine = m_session.GetMachine(); 970 if (m_machine.isNull()) 971 return false; 972 973 /* Get console: */ 974 m_console = m_session.GetConsole(); 975 if (m_console.isNull()) 976 return false; 977 978 /* Get display: */ 979 m_display = m_console.GetDisplay(); 980 if (m_display.isNull()) 981 return false; 982 983 /* Get mouse: */ 984 m_mouse = m_console.GetMouse(); 985 if (m_mouse.isNull()) 986 return false; 987 988 /* Get guest: */ 989 m_guest = m_console.GetGuest(); 990 if (m_guest.isNull()) 991 return false; 992 993 /* Get debugger: */ 994 m_debugger = m_console.GetDebugger(); 995 if (m_debugger.isNull()) 996 return false; 997 1000 998 /* Update machine-state: */ 1001 m_machineState = m _session.GetMachine().GetState();999 m_machineState = machine().GetState(); 1002 1000 1003 1001 /* True by default: */ … … 1014 1012 actionPool()->toRuntime()->setSession(this); 1015 1013 1016 /* Get host /machine: */1014 /* Get host: */ 1017 1015 const CHost host = vboxGlobal().host(); 1018 const CMachine machine = session().GetConsole().GetMachine();1019 1016 UIExtraDataMetaDefs::RuntimeMenuDevicesActionType restriction = UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Invalid; 1020 1017 … … 1024 1021 int iDevicesCountCD = 0; 1025 1022 int iDevicesCountFD = 0; 1026 foreach (const CMediumAttachment &attachment, machine .GetMediumAttachments())1023 foreach (const CMediumAttachment &attachment, machine().GetMediumAttachments()) 1027 1024 { 1028 1025 if (attachment.GetType() == KDeviceType_DVD) … … 1045 1042 /* Initialize Network menu: */ 1046 1043 bool fAtLeastOneAdapterActive = false; 1047 const KChipsetType chipsetType = machine .GetChipsetType();1044 const KChipsetType chipsetType = machine().GetChipsetType(); 1048 1045 ULONG uSlots = vboxGlobal().virtualBox().GetSystemProperties().GetMaxNetworkAdapters(chipsetType); 1049 1046 for (ULONG uSlot = 0; uSlot < uSlots; ++uSlot) 1050 1047 { 1051 const CNetworkAdapter &adapter = machine .GetNetworkAdapter(uSlot);1048 const CNetworkAdapter &adapter = machine().GetNetworkAdapter(uSlot); 1052 1049 if (adapter.GetEnabled()) 1053 1050 { … … 1063 1060 { 1064 1061 /* Check whether there is at least one USB controller with an available proxy. */ 1065 const bool fUSBEnabled = !machine .GetUSBDeviceFilters().isNull()1066 && !machine .GetUSBControllers().isEmpty()1067 && machine .GetUSBProxyAvailable();1062 const bool fUSBEnabled = !machine().GetUSBDeviceFilters().isNull() 1063 && !machine().GetUSBControllers().isEmpty() 1064 && machine().GetUSBProxyAvailable(); 1068 1065 if (!fUSBEnabled) 1069 1066 restriction = (UIExtraDataMetaDefs::RuntimeMenuDevicesActionType)(restriction | UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_USBDevices); … … 1074 1071 /* Check whether there is an accessible video input devices pool: */ 1075 1072 host.GetVideoInputDevices(); 1076 const bool fWebCamsEnabled = host.isOk() && !machine .GetUSBControllers().isEmpty();1073 const bool fWebCamsEnabled = host.isOk() && !machine().GetUSBControllers().isEmpty(); 1077 1074 if (!fWebCamsEnabled) 1078 1075 restriction = (UIExtraDataMetaDefs::RuntimeMenuDevicesActionType)(restriction | UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_WebCams); … … 1189 1186 #endif /* Q_WS_MAC */ 1190 1187 1191 /* Get machine: */1192 CMachine machine = m_session.GetMachine();1193 1194 1188 /* Prepare initial screen visibility status: */ 1195 m_monitorVisibilityVector.resize(machine .GetMonitorCount());1189 m_monitorVisibilityVector.resize(machine().GetMonitorCount()); 1196 1190 m_monitorVisibilityVector.fill(false); 1197 1191 m_monitorVisibilityVector[0] = true; … … 1205 1199 BOOL fEnabled = true; 1206 1200 ULONG guestOriginX = 0, guestOriginY = 0, guestWidth = 0, guestHeight = 0; 1207 machine .QuerySavedGuestScreenInfo(i, guestOriginX, guestOriginY, guestWidth, guestHeight, fEnabled);1201 machine().QuerySavedGuestScreenInfo(i, guestOriginX, guestOriginY, guestWidth, guestHeight, fEnabled); 1208 1202 m_monitorVisibilityVector[i] = fEnabled; 1209 1203 } … … 1217 1211 { 1218 1212 /* Each framebuffer will be really prepared on first UIMachineView creation: */ 1219 m_frameBufferVector.resize(m _session.GetMachine().GetMonitorCount());1213 m_frameBufferVector.resize(machine().GetMonitorCount()); 1220 1214 } 1221 1215 … … 1326 1320 pFrameBuffer->setMarkAsUnused(true); 1327 1321 /* Detach framebuffer from Display: */ 1328 CDisplay display = session().GetConsole().GetDisplay(); 1329 if (!display.isNull()) 1330 display.DetachFramebuffer(i); 1322 display().DetachFramebuffer(i); 1331 1323 /* Release framebuffer reference: */ 1332 1324 m_frameBufferVector[i].setNull(); … … 1366 1358 void UISession::cleanupSession() 1367 1359 { 1360 /* Detach debugger: */ 1361 if (!m_debugger.isNull()) 1362 m_debugger.detach(); 1363 1364 /* Detach guest: */ 1365 if (!m_guest.isNull()) 1366 m_guest.detach(); 1367 1368 /* Detach mouse: */ 1369 if (!m_mouse.isNull()) 1370 m_mouse.detach(); 1371 1372 /* Detach display: */ 1373 if (!m_display.isNull()) 1374 m_display.detach(); 1375 1376 /* Detach console: */ 1377 if (!m_console.isNull()) 1378 m_console.detach(); 1379 1380 /* Detach machine: */ 1381 if (!m_machine.isNull()) 1382 m_machine.detach(); 1383 1368 1384 /* Close session: */ 1369 1385 if (!m_session.isNull()) … … 1663 1679 popupCenter().remindAboutAutoCapture(machineLogic()->activeMachineWindow()); 1664 1680 1665 /* Shows First Run wizard if necessary: */1666 const CMachine &machine = session().GetMachine();1667 1681 /* Check if we are in teleportation waiting mode. 1668 1682 * In that case no first run wizard is necessary. */ 1669 m_machineState = machine .GetState();1683 m_machineState = machine().GetState(); 1670 1684 if ( isFirstTimeStarted() 1671 1685 && !(( m_machineState == KMachineState_PoweredOff 1672 1686 || m_machineState == KMachineState_Aborted 1673 1687 || m_machineState == KMachineState_Teleported) 1674 && machine .GetTeleporterEnabled()))1675 { 1676 UISafePointerWizard pWizard = new UIWizardFirstRun(mainMachineWindow(), session().GetMachine());1688 && machine().GetTeleporterEnabled())) 1689 { 1690 UISafePointerWizard pWizard = new UIWizardFirstRun(mainMachineWindow(), machine()); 1677 1691 pWizard->prepare(); 1678 1692 pWizard->exec(); … … 1682 1696 1683 1697 #ifdef VBOX_WITH_NETFLT 1684 1685 1698 /* Skip further checks if VM in saved state */ 1686 1699 if (isSaved()) … … 1703 1716 } 1704 1717 1705 ulong cCount = vboxGlobal().virtualBox().GetSystemProperties().GetMaxNetworkAdapters(machine .GetChipsetType());1718 ulong cCount = vboxGlobal().virtualBox().GetSystemProperties().GetMaxNetworkAdapters(machine().GetChipsetType()); 1706 1719 for (ulong uAdapterIndex = 0; uAdapterIndex < cCount; ++uAdapterIndex) 1707 1720 { 1708 CNetworkAdapter na = machine .GetNetworkAdapter(uAdapterIndex);1721 CNetworkAdapter na = machine().GetNetworkAdapter(uAdapterIndex); 1709 1722 1710 1723 if (na.GetEnabled()) … … 1736 1749 if (!failedInterfaceNames.isEmpty()) 1737 1750 { 1738 if (msgCenter().UIMessageCenter::cannotStartWithoutNetworkIf(machine .GetName(), failedInterfaceNames.join(", ")))1751 if (msgCenter().UIMessageCenter::cannotStartWithoutNetworkIf(machineName(), failedInterfaceNames.join(", "))) 1739 1752 machineLogic()->openNetworkSettingsDialog(); 1740 1753 else … … 1744 1757 } 1745 1758 } 1746 1747 #endif 1759 #endif /* VBOX_WITH_NETFLT */ 1748 1760 1749 1761 return true; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r53000 r53028 30 30 #include "COMEnums.h" 31 31 #include "CSession.h" 32 #include "CMachine.h" 33 #include "CConsole.h" 34 #include "CDisplay.h" 35 #include "CMouse.h" 36 #include "CGuest.h" 37 #include "CMachineDebugger.h" 32 38 33 39 /* Forward declarations: */ … … 89 95 void closeRuntimeUI(); 90 96 91 /* Common getters:*/97 /** Returns the session instance. */ 92 98 CSession& session() { return m_session; } 99 /** Returns the session's machine instance. */ 100 CMachine& machine() { return m_machine; } 101 /** Returns the session's console instance. */ 102 CConsole& console() { return m_console; } 103 /** Returns the console's display instance. */ 104 CDisplay& display() { return m_display; } 105 /** Returns the console's mouse instance. */ 106 CMouse& mouse() { return m_mouse; } 107 /** Returns the console's guest instance. */ 108 CGuest& guest() { return m_guest; } 109 /** Returns the console's debugger instance. */ 110 CMachineDebugger& debugger() { return m_debugger; } 111 112 /** Returns the machine name. */ 113 const QString& machineName() const { return m_strMachineName; } 114 93 115 UIActionPool* actionPool() const { return m_pActionPool; } 94 116 KMachineState machineStatePrevious() const { return m_machineStatePrevious; } … … 357 379 /** Holds the session instance. */ 358 380 CSession m_session; 381 /** Holds the session's machine instance. */ 382 CMachine m_machine; 383 /** Holds the session's console instance. */ 384 CConsole m_console; 385 /** Holds the console's display instance. */ 386 CDisplay m_display; 387 /** Holds the console's mouse instance. */ 388 CMouse m_mouse; 389 /** Holds the console's guest instance. */ 390 CGuest m_guest; 391 /** Holds the console's debugger instance. */ 392 CMachineDebugger m_debugger; 393 394 /** Holds the machine name. */ 395 QString m_strMachineName; 359 396 360 397 /** Holds the action-pool instance. */
Note:
See TracChangeset
for help on using the changeset viewer.