Changeset 90856 in vbox
- Timestamp:
- Aug 24, 2021 6:08:54 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 146491
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp
r90855 r90856 966 966 if (m_comSession.isNotNull()) 967 967 m_comSession.UnlockMachine(); 968 969 /* Notifies listeners: */ 970 emit sigMachineStateSaved(error().isEmpty()); 968 971 } 969 972 -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h
r90855 r90856 523 523 Q_OBJECT; 524 524 525 signals: 526 527 /** Notifies listeners about machine state saved. 528 * @param fSuccess Brings whether state was saved successfully. */ 529 void sigMachineStateSaved(bool fSuccess); 530 525 531 public: 526 532 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r90695 r90856 404 404 void UIMachineLogic::saveState() 405 405 { 406 /* Enable 'manual-override', 407 * preventing automatic Runtime UI closing: */ 408 setManualOverrideMode(true); 409 410 /* Was the step successful? */ 411 bool fSuccess = true; 412 /* If VM is not paused, we should pause it: */ 413 bool fWasPaused = uisession()->isPaused(); 414 if (fSuccess && !fWasPaused) 415 fSuccess = uisession()->pause(); 416 /* Save-state: */ 417 if (fSuccess) 418 { 406 /* Do we save state? */ 407 bool fSaveState = true; 408 409 /* If VM is not paused, we should pause it first: */ 410 if (!uisession()->isPaused()) 411 fSaveState = uisession()->pause(); 412 413 /* Saving state: */ 414 if (fSaveState) 415 { 416 /* Enable 'manual-override', 417 * preventing automatic Runtime UI closing: */ 418 setManualOverrideMode(true); 419 420 /* Saving VM state: */ 419 421 LogRel(("GUI: Passing request to save VM state from machine-logic to UI session.\n")); 420 fSuccess = uisession()->saveState(); 421 } 422 423 /* Disable 'manual-override' finally: */ 424 setManualOverrideMode(false); 425 426 /* Manually close Runtime UI: */ 427 if (fSuccess) 428 closeRuntimeUI(); 422 UINotificationProgressMachineSaveState *pNotification = new UINotificationProgressMachineSaveState(machine()); 423 connect(pNotification, &UINotificationProgressMachineSaveState::sigMachineStateSaved, 424 this, &UIMachineLogic::sltHandleMachineStateSaved); 425 gpNotificationCenter->append(pNotification); 426 } 429 427 } 430 428 … … 1943 1941 } 1944 1942 1943 void UIMachineLogic::sltHandleMachineStateSaved(bool fSuccess) 1944 { 1945 /* Disable 'manual-override' finally: */ 1946 setManualOverrideMode(false); 1947 1948 /* Close Runtime UI if state was saved: */ 1949 if (fSuccess) 1950 closeRuntimeUI(); 1951 } 1952 1945 1953 void UIMachineLogic::sltShutdown() 1946 1954 { -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r90024 r90856 294 294 void sltDetach(); 295 295 void sltSaveState(); 296 /** Handles machine state saved. */ 297 void sltHandleMachineStateSaved(bool fSuccess); 296 298 void sltShutdown(); 297 299 void sltPowerOff(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r90695 r90856 325 325 { 326 326 /* Nothing here for now: */ 327 return true;328 }329 330 bool UISession::saveState()331 {332 /* Prepare the saving progress: */333 CProgress progress = machine().SaveState();334 if (machine().isOk())335 {336 /* Show the saving progress: */337 msgCenter().showModalProgressDialog(progress, machineName(), ":/progress_state_save_90px.png");338 if (!progress.isOk() || progress.GetResultCode() != 0)339 {340 /* Failed in progress: */341 msgCenter().cannotSaveMachineState(progress, machineName());342 return false;343 }344 }345 else346 {347 /* Failed in console: */348 msgCenter().cannotSaveMachineState(machine());349 return false;350 }351 /* Passed: */352 327 return true; 353 328 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r90663 r90856 77 77 bool powerUp(); 78 78 bool detach(); 79 bool saveState();80 79 bool shutdown(); 81 80 bool powerOff(bool fIncludingDiscard, bool &fServerCrashed);
Note:
See TracChangeset
for help on using the changeset viewer.