- Timestamp:
- Feb 1, 2023 2:58:03 PM (2 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo
-
old new 19 19 /branches/dsen/gui2:79224,79228,79233,79235,79258,79262-79263,79273,79341,79345,79354,79357,79387-79388,79559-79569,79572-79573,79578,79581-79582,79590-79591,79598-79599,79602-79603,79605-79606,79632,79635,79637,79644 20 20 /branches/dsen/gui3:79645-79692 21 /branches/dsen/gui4:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288,155311,155316,155336,155342,155344 21 /branches/dsen/gui4:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288,155311,155316,155336,155342,155344,155437-155438 22 22 /trunk/src:92342,154921
-
- Property svn:mergeinfo
-
trunk/src/VBox
- Property svn:mergeinfo
-
old new 19 19 /branches/dsen/gui2/src/VBox:79224,79228,79233,79235,79258,79262-79263,79273,79341,79345,79354,79357,79387-79388,79559-79569,79572-79573,79578,79581-79582,79590-79591,79598-79599,79602-79603,79605-79606,79632,79635,79637,79644 20 20 /branches/dsen/gui3/src/VBox:79645-79692 21 /branches/dsen/gui4/src/VBox:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288,155311,155316,155336,155342,155344 21 /branches/dsen/gui4/src/VBox:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288,155311,155316,155336,155342,155344,155437-155438
-
- Property svn:mergeinfo
-
trunk/src/VBox/Frontends
- Property svn:mergeinfo
-
old new 16 16 /branches/dsen/gui2/src/VBox/Frontends:79224,79228,79233,79235,79258,79262-79263,79273,79341,79345,79354,79357,79387-79388,79559-79569,79572-79573,79578,79581-79582,79590-79591,79598-79599,79602-79603,79605-79606,79632,79635,79637,79644 17 17 /branches/dsen/gui3/src/VBox/Frontends:79645-79692 18 /branches/dsen/gui4/src/VBox/Frontends:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288,155311,155316,155336,155342,155344 18 /branches/dsen/gui4/src/VBox/Frontends:155183-155185,155187,155198,155200-155201,155205,155228,155235,155243,155248,155282,155285,155287-155288,155311,155316,155336,155342,155344,155437-155438
-
- Property svn:mergeinfo
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r98401 r98402 108 108 109 109 /* static */ 110 UIMachine *UIMachine:: m_spInstance = 0;110 UIMachine *UIMachine::s_pInstance = 0; 111 111 112 112 /* static */ … … 114 114 { 115 115 /* Make sure machine is not created: */ 116 AssertReturn(! m_spInstance, false);116 AssertReturn(!s_pInstance, false); 117 117 118 118 /* Restore current snapshot if requested: */ … … 166 166 { 167 167 /* Make sure machine is not created: */ 168 AssertReturn(! m_spInstance, false);168 AssertReturn(!s_pInstance, false); 169 169 170 170 /* Create machine UI: */ 171 171 new UIMachine; 172 172 /* Make sure it's prepared: */ 173 if (! m_spInstance->prepare())173 if (!s_pInstance->prepare()) 174 174 { 175 175 /* Destroy machine UI otherwise: */ … … 186 186 { 187 187 /* Make sure machine is created: */ 188 if (! m_spInstance)188 if (!s_pInstance) 189 189 return; 190 190 191 191 /* Protect versus recursive call: */ 192 UIMachine *pInstance = m_spInstance;193 m_spInstance = 0;192 UIMachine *pInstance = s_pInstance; 193 s_pInstance = 0; 194 194 /* Cleanup machine UI: */ 195 195 pInstance->cleanup(); … … 371 371 { 372 372 /* Create new machine-logic: */ 373 UIMachineLogic *pMachineLogic = UIMachineLogic::create(this, m_pSession, visualState);373 UIMachineLogic *pMachineLogic = UIMachineLogic::create(this, uisession(), visualState); 374 374 375 375 /* First we have to check if the selected machine-logic is available at all. … … 714 714 , m_restrictedCloseActions(MachineCloseAction_Invalid) 715 715 { 716 m_spInstance = this;716 s_pInstance = this; 717 717 } 718 718 719 719 UIMachine::~UIMachine() 720 720 { 721 m_spInstance = 0;721 s_pInstance = 0; 722 722 } 723 723 … … 727 727 if (!UISession::create(m_pSession, this)) 728 728 return false; 729 AssertPtrReturn( m_pSession, false);729 AssertPtrReturn(uisession(), false); 730 730 731 731 /* Cache media data early if necessary: */ 732 732 if (uiCommon().agressiveCaching()) 733 uiCommon().enumerateMedia( m_pSession->machineMedia());733 uiCommon().enumerateMedia(uisession()->machineMedia()); 734 734 735 735 /* Prepare stuff: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h
r98401 r98402 152 152 static void destroy(); 153 153 /** Static instance. */ 154 static UIMachine * instance() { return m_spInstance; }154 static UIMachine *instance() { return s_pInstance; } 155 155 156 156 /** Returns session UI instance. */ … … 296 296 /** @} */ 297 297 298 /** @name Close configurationstuff.298 /** @name Close stuff. 299 299 * @{ */ 300 300 /** Returns default close action. */ … … 318 318 /** @} */ 319 319 320 /** Closes Runtime UI. */ 321 void closeRuntimeUI(); 320 /** @name Close stuff. 321 * @{ */ 322 /** Closes Runtime UI. */ 323 void closeRuntimeUI(); 324 /** @} */ 322 325 323 326 private slots: … … 499 502 /** @} */ 500 503 501 /** Static instance. */502 static UIMachine * m_spInstance;504 /** Holds the static instance. */ 505 static UIMachine *s_pInstance; 503 506 504 507 /** Holds the session UI instance. */ … … 624 627 /** @} */ 625 628 626 /** @name Close configurationstuff.629 /** @name Close stuff. 627 630 * @{ */ 628 631 /** Default close action. */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r98401 r98402 249 249 void UISession::detachUi() 250 250 { 251 /* Manually close Runtime UI: */ 252 LogRel(("GUI: Detaching UI..\n")); 253 closeRuntimeUI(); 254 } 255 256 void UISession::saveState() 257 { 258 /* Prepare VM to be saved: */ 259 if (!prepareToBeSaved()) 260 return; 261 251 262 /* Enable 'manual-override', 252 263 * preventing automatic Runtime UI closing: */ 253 264 setManualOverrideMode(true); 254 265 255 /* Manually close Runtime UI: */ 256 LogRel(("GUI: Detaching UI..\n")); 257 closeRuntimeUI(); 258 } 259 260 void UISession::saveState() 261 { 262 /* Saving state? */ 263 bool fSaveState = true; 264 265 /* If VM is not paused, we should pause it first: */ 266 if (!isPaused()) 267 fSaveState = pause(); 268 269 /* Save state: */ 270 if (fSaveState) 271 { 272 /* Enable 'manual-override', 273 * preventing automatic Runtime UI closing: */ 274 setManualOverrideMode(true); 275 276 /* Now, do the magic: */ 277 LogRel(("GUI: Saving VM state..\n")); 278 UINotificationProgressMachineSaveState *pNotification = new UINotificationProgressMachineSaveState(machine()); 279 connect(pNotification, &UINotificationProgressMachineSaveState::sigMachineStateSaved, 280 this, &UISession::sltHandleMachineStateSaved); 281 gpNotificationCenter->append(pNotification); 282 } 266 /* Now, do the magic: */ 267 LogRel(("GUI: Saving VM state..\n")); 268 UINotificationProgressMachineSaveState *pNotification = 269 new UINotificationProgressMachineSaveState(machine()); 270 connect(pNotification, &UINotificationProgressMachineSaveState::sigMachineStateSaved, 271 this, &UISession::sltHandleMachineStateSaved); 272 gpNotificationCenter->append(pNotification); 283 273 } 284 274 285 275 void UISession::shutdown() 286 276 { 287 /* Warn the user about ACPI is not available if so: */288 if (! console().GetGuestEnteredACPIMode())289 return UINotificationMessage::cannotSendACPIToMachine();290 291 /* Send ACPI shutdown signal if possible: */277 /* Prepare VM to be shutdowned: */ 278 if (!prepareToBeShutdowned()) 279 return; 280 281 /* Now, do the magic: */ 292 282 LogRel(("GUI: Sending ACPI shutdown signal..\n")); 293 console().PowerButton(); 294 if (!console().isOk()) 283 CConsole comConsole = console(); 284 comConsole.PowerButton(); 285 if (!comConsole.isOk()) 295 286 UINotificationMessage::cannotACPIShutdownMachine(console()); 296 287 } … … 305 296 LogRel(("GUI: Powering VM off..\n")); 306 297 UINotificationProgressMachinePowerOff *pNotification = 307 new UINotificationProgressMachinePowerOff(machine(), console(), fIncludingDiscard); 298 new UINotificationProgressMachinePowerOff(machine(), 299 console(), 300 fIncludingDiscard); 308 301 connect(pNotification, &UINotificationProgressMachinePowerOff::sigMachinePoweredOff, 309 302 this, &UISession::sltHandleMachinePoweredOff); … … 333 326 bool UISession::isVisualStateAllowed(UIVisualStateType state) const 334 327 { 335 return m_pMachine->isVisualStateAllowed(state);328 return uimachine()->isVisualStateAllowed(state); 336 329 } 337 330 338 331 void UISession::changeVisualState(UIVisualStateType visualStateType) 339 332 { 340 m_pMachine->asyncChangeVisualState(visualStateType);333 uimachine()->asyncChangeVisualState(visualStateType); 341 334 } 342 335 343 336 void UISession::setRequestedVisualState(UIVisualStateType visualStateType) 344 337 { 345 m_pMachine->setRequestedVisualState(visualStateType);338 uimachine()->setRequestedVisualState(visualStateType); 346 339 } 347 340 348 341 UIVisualStateType UISession::requestedVisualState() const 349 342 { 350 return m_pMachine->requestedVisualState();343 return uimachine()->requestedVisualState(); 351 344 } 352 345 … … 998 991 } 999 992 993 bool UISession::prepareToBeSaved() 994 { 995 return isPaused() 996 || (isRunning() && pause()); 997 } 998 999 bool UISession::prepareToBeShutdowned() 1000 { 1001 const bool fValidMode = console().GetGuestEnteredACPIMode(); 1002 if (!fValidMode) 1003 UINotificationMessage::cannotSendACPIToMachine(); 1004 return fValidMode; 1005 } 1006 1000 1007 void UISession::loadVMSettings() 1001 1008 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r98401 r98402 266 266 CMediumVector machineMedia() const; 267 267 268 /** Prepares VM to be saved. */ 269 bool prepareToBeSaved(); 270 /** Returns whether VM can be shutdowned. */ 271 bool prepareToBeShutdowned(); 272 268 273 public slots: 269 274
Note:
See TracChangeset
for help on using the changeset viewer.