Changeset 27311 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Mar 12, 2010 2:09:30 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 58723
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r27300 r27311 361 361 } 362 362 else 363 { 363 364 /* Discard the temporary created new state: */ 364 365 delete pNewVisualState; 366 367 /* If there is no state currently created => we have to exit: */ 368 if (!m_pVisualState) 369 deleteLater(); 370 } 365 371 } 366 372 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r27310 r27311 363 363 } 364 364 365 bool UIMachineLogic::checkAvailability() 366 { 367 /* Get current console: */ 368 CConsole console = session().GetConsole(); 369 370 /* Check if the required virtualization features are active: */ 371 bool fIs64BitsGuest = vboxGlobal().virtualBox().GetGuestOSType(console.GetGuest().GetOSTypeId()).GetIs64Bit(); 372 bool fRecommendVirtEx = vboxGlobal().virtualBox().GetGuestOSType(console.GetGuest().GetOSTypeId()).GetRecommendedVirtEx(); 373 AssertMsg(!fIs64BitsGuest || fRecommendVirtEx, ("Virtualization support missed for 64bit guest!\n")); 374 bool fIsVirtEnabled = console.GetDebugger().GetHWVirtExEnabled(); 375 if (fRecommendVirtEx && !fIsVirtEnabled) 376 { 377 bool fShouldWeClose; 378 379 bool fVTxAMDVSupported = vboxGlobal().virtualBox().GetHost().GetProcessorFeature(KProcessorFeature_HWVirtEx); 380 381 if (fIs64BitsGuest) 382 fShouldWeClose = vboxProblem().warnAboutVirtNotEnabled64BitsGuest(fVTxAMDVSupported); 383 else 384 fShouldWeClose = vboxProblem().warnAboutVirtNotEnabledGuestRequired(fVTxAMDVSupported); 385 386 return !fShouldWeClose; 387 } 388 389 /* True to confirm success: */ 390 return true; 391 } 392 365 393 UIMachineWindow* UIMachineLogic::mainMachineWindow() 366 394 { … … 423 451 , m_pRunningOrPausedActions(0) 424 452 , m_fIsWindowsCreated(false) 425 , m_fIsPreventAutoStart(false)426 453 , m_fIsPreventAutoClose(false) 427 454 #ifdef Q_WS_MAC … … 702 729 void UIMachineLogic::prepareRequiredFeatures() 703 730 { 704 /* Get current console: */705 CConsole console = session().GetConsole();706 707 /* Check if the required virtualization features are ready: */708 if (!isPreventAutoStart())709 {710 bool fIs64BitsGuest = vboxGlobal().virtualBox().GetGuestOSType(console.GetGuest().GetOSTypeId()).GetIs64Bit();711 bool fRecommendVirtEx = vboxGlobal().virtualBox().GetGuestOSType(console.GetGuest().GetOSTypeId()).GetRecommendedVirtEx();712 AssertMsg(!fIs64BitsGuest || fRecommendVirtEx, ("Virtualization support missed for 64bit guest!\n"));713 bool fIsVirtEnabled = console.GetDebugger().GetHWVirtExEnabled();714 if (fRecommendVirtEx && !fIsVirtEnabled)715 {716 bool fShouldWeClose;717 718 bool fVTxAMDVSupported = vboxGlobal().virtualBox().GetHost().GetProcessorFeature(KProcessorFeature_HWVirtEx);719 720 if (fIs64BitsGuest)721 fShouldWeClose = vboxProblem().warnAboutVirtNotEnabled64BitsGuest(fVTxAMDVSupported);722 else723 fShouldWeClose = vboxProblem().warnAboutVirtNotEnabledGuestRequired(fVTxAMDVSupported);724 725 if (fShouldWeClose == true)726 setPreventAutoStart(true);727 }728 }729 730 731 #ifdef Q_WS_MAC 731 732 # ifdef VBOX_WITH_ICHAT_THEATER 732 733 /* Init shared AV manager: */ 733 if (!isPreventAutoStart()) 734 initSharedAVManager(); 734 initSharedAVManager(); 735 735 # endif 736 736 #endif 737 738 /* Close request in case of features are not ready and user wish to close: */739 if (isPreventAutoStart())740 QTimer::singleShot(0, uisession(), SLOT(sltCloseVirtualSession()));741 737 } 742 738 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r27310 r27311 59 59 UIVisualStateType visualStateType); 60 60 61 /* Check if this mode is available */62 virtual bool checkAvailability() { return true; }63 64 /* Do the real initialization of the object */65 virtual void initialize() {}61 /* Check if this mode is available: */ 62 virtual bool checkAvailability(); 63 64 /* Do the real initialization of the object: */ 65 virtual void initialize() = 0; 66 66 67 67 /* Main getters/setters: */ … … 74 74 75 75 /* Maintenance getters/setters: */ 76 bool isPreventAutoStart() const { return m_fIsPreventAutoStart; }77 76 bool isPreventAutoClose() const { return m_fIsPreventAutoClose; } 78 void setPreventAutoStart(bool fIsPreventAutoStart) { m_fIsPreventAutoStart = fIsPreventAutoStart; }79 77 void setPreventAutoClose(bool fIsPreventAutoClose) { m_fIsPreventAutoClose = fIsPreventAutoClose; } 80 78 … … 196 194 197 195 bool m_fIsWindowsCreated : 1; 198 bool m_fIsPreventAutoStart : 1;199 196 bool m_fIsPreventAutoClose : 1; 200 197 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp
r27310 r27311 59 59 bool UIMachineLogicFullscreen::checkAvailability() 60 60 { 61 /* Base class availability: */ 62 if (!UIMachineLogic::checkAvailability()) 63 return false; 64 61 65 /* Temporary get a machine object: */ 62 66 const CMachine &machine = uisession()->session().GetMachine(); … … 126 130 void UIMachineLogicFullscreen::initialize() 127 131 { 128 /* Check the status ofrequired features: */132 /* Prepare required features: */ 129 133 prepareRequiredFeatures(); 130 134 131 /* If required features are ready: */ 132 if (!isPreventAutoStart()) 133 { 134 #ifdef Q_WS_MAC 135 /* Prepare common connections: */ 136 prepareCommonConnections(); 137 #endif /* Q_WS_MAC */ 138 139 /* Prepare console connections: */ 140 prepareSessionConnections(); 141 142 /* Prepare action connections: */ 143 prepareActionConnections(); 144 145 /* Prepare action groups: */ 146 prepareActionGroups(); 147 148 /* Prepare machine window: */ 149 prepareMachineWindows(); 150 151 #ifdef Q_WS_MAC 152 /* Prepare dock: */ 153 prepareDock(); 154 #endif /* Q_WS_MAC */ 155 156 /* Power up machine: */ 157 uisession()->powerUp(); 158 159 /* Initialization: */ 160 sltMachineStateChanged(); 161 sltAdditionsStateChanged(); 162 sltMouseCapabilityChanged(); 163 164 /* Retranslate logic part: */ 165 retranslateUi(); 166 } 135 #ifdef Q_WS_MAC 136 /* Prepare common connections: */ 137 prepareCommonConnections(); 138 #endif /* Q_WS_MAC */ 139 140 /* Prepare console connections: */ 141 prepareSessionConnections(); 142 143 /* Prepare action connections: */ 144 prepareActionConnections(); 145 146 /* Prepare action groups: */ 147 prepareActionGroups(); 148 149 /* Prepare machine window: */ 150 prepareMachineWindows(); 151 152 #ifdef Q_WS_MAC 153 /* Prepare dock: */ 154 prepareDock(); 155 #endif /* Q_WS_MAC */ 156 157 /* Power up machine: */ 158 uisession()->powerUp(); 159 160 /* Initialization: */ 161 sltMachineStateChanged(); 162 sltAdditionsStateChanged(); 163 sltMouseCapabilityChanged(); 164 165 /* Retranslate logic part: */ 166 retranslateUi(); 167 167 } 168 168 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp
r27310 r27311 51 51 void UIMachineLogicNormal::initialize() 52 52 { 53 /* Check the status ofrequired features: */53 /* Prepare required features: */ 54 54 prepareRequiredFeatures(); 55 55 56 /* If required features are ready: */ 57 if (!isPreventAutoStart()) 58 { 59 /* Prepare session connections: */ 60 prepareSessionConnections(); 56 /* Prepare session connections: */ 57 prepareSessionConnections(); 61 58 62 63 59 /* Prepare action connections: */ 60 prepareActionConnections(); 64 61 65 66 62 /* Prepare action groups: */ 63 prepareActionGroups(); 67 64 68 69 65 /* Prepare normal machine window: */ 66 prepareMachineWindows(); 70 67 71 68 #ifdef Q_WS_MAC 72 73 69 /* Prepare dock: */ 70 prepareDock(); 74 71 #endif /* Q_WS_MAC */ 75 72 76 77 73 /* Power up machine: */ 74 uisession()->powerUp(); 78 75 79 80 81 82 76 /* Initialization: */ 77 sltMachineStateChanged(); 78 sltAdditionsStateChanged(); 79 sltMouseCapabilityChanged(); 83 80 84 /* Retranslate logic part: */ 85 retranslateUi(); 86 } 81 /* Retranslate logic part: */ 82 retranslateUi(); 87 83 } 88 84 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp
r27310 r27311 53 53 bool UIMachineLogicSeamless::checkAvailability() 54 54 { 55 /* Base class availability: */ 56 if (!UIMachineLogic::checkAvailability()) 57 return false; 58 55 59 /* Temporary get a machine object: */ 56 60 const CMachine &machine = uisession()->session().GetMachine(); … … 119 123 void UIMachineLogicSeamless::initialize() 120 124 { 121 /* Check the status ofrequired features: */125 /* Prepare required features: */ 122 126 prepareRequiredFeatures(); 123 127 124 /* If required features are ready: */ 125 if (!isPreventAutoStart()) 126 { 127 /* Prepare console connections: */ 128 prepareSessionConnections(); 129 130 /* Prepare action connections: */ 131 prepareActionConnections(); 132 133 /* Prepare action groups: */ 134 prepareActionGroups(); 135 136 /* Prepare normal machine window: */ 137 prepareMachineWindows(); 128 /* Prepare console connections: */ 129 prepareSessionConnections(); 130 131 /* Prepare action connections: */ 132 prepareActionConnections(); 133 134 /* Prepare action groups: */ 135 prepareActionGroups(); 136 137 /* Prepare normal machine window: */ 138 prepareMachineWindows(); 138 139 139 140 #ifdef Q_WS_MAC 140 141 141 /* Prepare dock: */ 142 prepareDock(); 142 143 #endif /* Q_WS_MAC */ 143 144 144 /* Power up machine: */ 145 uisession()->powerUp(); 146 147 /* Initialization: */ 148 sltMachineStateChanged(); 149 sltAdditionsStateChanged(); 150 sltMouseCapabilityChanged(); 151 152 /* Retranslate logic part: */ 153 retranslateUi(); 154 } 145 /* Power up machine: */ 146 uisession()->powerUp(); 147 148 /* Initialization: */ 149 sltMachineStateChanged(); 150 sltAdditionsStateChanged(); 151 sltMouseCapabilityChanged(); 152 153 /* Retranslate logic part: */ 154 retranslateUi(); 155 155 } 156 156
Note:
See TracChangeset
for help on using the changeset viewer.