Changeset 98432 in vbox for trunk/src/VBox
- Timestamp:
- Feb 2, 2023 12:15:11 PM (23 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp
r98424 r98432 522 522 void sltHandleMachineStateChange() 523 523 { 524 if (m_p Session->machineState() == KMachineState_Running)524 if (m_pMachine->machineState() == KMachineState_Running) 525 525 { 526 526 /* Start auto-update timer otherwise: */ … … 1068 1068 void sltHandleMachineStateChange() 1069 1069 { 1070 if (m_p Session->machineState() == KMachineState_Running)1070 if (m_pMachine->machineState() == KMachineState_Running) 1071 1071 { 1072 1072 /* Start auto-update timer otherwise: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIKeyboardHandler.cpp
r98425 r98432 911 911 { 912 912 /* Get machine state: */ 913 KMachineState state = ui session()->machineState();913 KMachineState state = uimachine()->machineState(); 914 914 /* Handle particular machine states: */ 915 915 switch (state) … … 1254 1254 { 1255 1255 /* Show a possible warning on key release which seems to be more expected by the end user: */ 1256 if (ui session()->isPaused())1256 if (uimachine()->isPaused()) 1257 1257 UINotificationMessage::remindAboutPausedVMInput(); 1258 1258 } … … 1745 1745 1746 1746 /* If the VM is NOT paused: */ 1747 if (!ui session()->isPaused())1747 if (!uimachine()->isPaused()) 1748 1748 { 1749 1749 /* If there are scan-codes to send: */ … … 1971 1971 bool UIKeyboardHandler::isSessionRunning() 1972 1972 { 1973 return ui session()->isRunning();1973 return uimachine()->isRunning(); 1974 1974 } 1975 1975 1976 1976 bool UIKeyboardHandler::isSessionStuck() 1977 1977 { 1978 return ui session()->isStuck();1978 return uimachine()->isStuck(); 1979 1979 } 1980 1980 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r98427 r98432 283 283 actionPool()->action(UIActionIndexRT_M_View_T_VRDEServer)->setChecked(comServer.GetEnabled()); 284 284 actionPool()->action(UIActionIndexRT_M_View_T_VRDEServer)->blockSignals(false); 285 } 286 287 KMachineState UIMachine::machineState() const 288 { 289 return uisession()->machineState(); 290 } 291 292 void UIMachine::forgetPreviousMachineState() 293 { 294 uisession()->forgetPreviousMachineState(); 295 } 296 297 bool UIMachine::isTurnedOff() const 298 { 299 return uisession()->isTurnedOff(); 300 } 301 302 bool UIMachine::isPaused() const 303 { 304 return uisession()->isPaused(); 305 } 306 307 bool UIMachine::wasPaused() const 308 { 309 return uisession()->wasPaused(); 310 } 311 312 bool UIMachine::isRunning() const 313 { 314 return uisession()->isRunning(); 315 } 316 317 bool UIMachine::isStuck() const 318 { 319 return uisession()->isStuck(); 320 } 321 322 bool UIMachine::isGuestScreenUnDrawable() const 323 { 324 return uisession()->isGuestScreenUnDrawable(); 325 } 326 327 bool UIMachine::pause() 328 { 329 return uisession()->pause(); 330 } 331 332 bool UIMachine::unpause() 333 { 334 return uisession()->unpause(); 335 } 336 337 bool UIMachine::setPause(bool fPause) 338 { 339 return uisession()->setPause(fPause); 285 340 } 286 341 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h
r98427 r98432 209 209 /** @} */ 210 210 211 /** @name Machine-state stuff. 212 ** @{ */ 213 /** Returns machine state. */ 214 KMachineState machineState() const; 215 216 /** Resets previous state to be the same as current one. */ 217 void forgetPreviousMachineState(); 218 219 /** Returns whether VM is in one of turned off states. */ 220 bool isTurnedOff() const; 221 /** Returns whether VM is in one of paused states. */ 222 bool isPaused() const; 223 /** Returns whether VM was in one of paused states. */ 224 bool wasPaused() const; 225 /** Returns whether VM is in one of running states. */ 226 bool isRunning() const; 227 /** Returns whether VM is in one of stuck states. */ 228 bool isStuck() const; 229 /** Returns whether VM is one of states where guest-screen is undrawable. */ 230 bool isGuestScreenUnDrawable() const; 231 232 /** Performes VM pausing. */ 233 bool pause(); 234 /** Performes VM resuming. */ 235 bool unpause(); 236 /** Performes VM pausing/resuming depending on @a fPause state. */ 237 bool setPause(bool fPause); 238 /** @} */ 239 211 240 /** @name Host-screen stuff. 212 241 ** @{ */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r98425 r98432 447 447 { 448 448 /* Get machine state: */ 449 KMachineState state = ui session()->machineState();449 KMachineState state = uimachine()->machineState(); 450 450 451 451 /* Update action groups: */ 452 m_pRunningActions->setEnabled(ui session()->isRunning());453 m_pRunningOrPausedActions->setEnabled(ui session()->isRunning() || uisession()->isPaused());454 m_pRunningOrPausedOrStackedActions->setEnabled(ui session()->isRunning() || uisession()->isPaused() || uisession()->isStuck());452 m_pRunningActions->setEnabled(uimachine()->isRunning()); 453 m_pRunningOrPausedActions->setEnabled(uimachine()->isRunning() || uimachine()->isPaused()); 454 m_pRunningOrPausedOrStackedActions->setEnabled(uimachine()->isRunning() || uimachine()->isPaused() || uimachine()->isStuck()); 455 455 456 456 switch (state) … … 851 851 * & we are in an state where the framebuffer is likely valid. Otherwise to 852 852 * the overlay stuff only. */ 853 KMachineState state = ui session()->machineState();853 KMachineState state = uimachine()->machineState(); 854 854 if (m_fIsDockIconEnabled && 855 855 (state == KMachineState_Running || … … 1737 1737 void UIMachineLogic::sltPause(bool fOn) 1738 1738 { 1739 ui session()->setPause(fOn);1739 uimachine()->setPause(fOn); 1740 1740 } 1741 1741 … … 1748 1748 { 1749 1749 /* Make sure machine is in one of the allowed states: */ 1750 if (!ui session()->isRunning() && !uisession()->isPaused())1750 if (!uimachine()->isRunning() && !uimachine()->isPaused()) 1751 1751 { 1752 1752 AssertMsgFailed(("Invalid machine-state. Action should be prohibited!")); … … 1761 1761 { 1762 1762 /* Make sure machine is in one of the allowed states: */ 1763 if (!ui session()->isRunning() && !uisession()->isPaused())1763 if (!uimachine()->isRunning() && !uimachine()->isPaused()) 1764 1764 { 1765 1765 AssertMsgFailed(("Invalid machine-state. Action should be prohibited!")); … … 1774 1774 { 1775 1775 /* Make sure machine is in one of the allowed states: */ 1776 if (!ui session()->isRunning())1776 if (!uimachine()->isRunning()) 1777 1777 { 1778 1778 AssertMsgFailed(("Invalid machine-state. Action should be prohibited!")); … … 1787 1787 { 1788 1788 /* Make sure machine is in one of the allowed states: */ 1789 if (!ui session()->isRunning() && !uisession()->isPaused() && !uisession()->isStuck())1789 if (!uimachine()->isRunning() && !uimachine()->isPaused() && !uimachine()->isStuck()) 1790 1790 { 1791 1791 AssertMsgFailed(("Invalid machine-state. Action should be prohibited!")); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r98425 r98432 603 603 604 604 /* In some situations especially in some VM states, guest-screen is not drawable: */ 605 if (ui session()->isGuestScreenUnDrawable())605 if (uimachine()->isGuestScreenUnDrawable()) 606 606 return; 607 607 … … 1053 1053 { 1054 1054 /* Get machine state: */ 1055 KMachineState state = ui session()->machineState();1055 KMachineState state = uimachine()->machineState(); 1056 1056 switch (state) 1057 1057 { … … 1990 1990 #ifdef VBOX_WS_MAC 1991 1991 /* Update the dock icon if we are in the running state: */ 1992 if (ui session()->isRunning())1992 if (uimachine()->isRunning()) 1993 1993 updateDockIcon(); 1994 1994 #endif /* VBOX_WS_MAC */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp
r98422 r98432 275 275 { 276 276 /* Make sure machine state is one of valid: */ 277 const KMachineState enmState = ui session()->machineState();277 const KMachineState enmState = uimachine()->machineState(); 278 278 if (enmState == KMachineState_Null) 279 279 return; … … 381 381 382 382 /* Make sure machine is in one of the allowed states: */ 383 if (!ui session()->isRunning() && !uisession()->isPaused() && !uisession()->isStuck())383 if (!uimachine()->isRunning() && !uimachine()->isPaused() && !uimachine()->isStuck()) 384 384 { 385 385 #if defined(VBOX_IS_QT6_OR_LATER) && defined(VBOX_WS_MAC) /** @todo qt6 ... */ … … 390 390 /** @todo qt6: This could easily be caused by something else, but needs to be 391 391 * looked at by a proper GUI expert. */ 392 if (ui session()->isTurnedOff()) /** @todo qt6: Better state check here? */392 if (uimachine()->isTurnedOff()) /** @todo qt6: Better state check here? */ 393 393 pCloseEvent->accept(); 394 394 #endif … … 421 421 case MachineCloseAction_SaveState: 422 422 case MachineCloseAction_Shutdown: 423 closeAction = ui session()->isStuck() ? MachineCloseAction_Invalid : defaultCloseAction;423 closeAction = uimachine()->isStuck() ? MachineCloseAction_Invalid : defaultCloseAction; 424 424 break; 425 425 /* Otherwise we just use what we have: */ … … 448 448 bool fShowCloseDialog = true; 449 449 /* Check if VM is paused or stuck: */ 450 const bool fWasPaused = ui session()->isPaused();451 const bool fIsStuck = ui session()->isStuck();450 const bool fWasPaused = uimachine()->isPaused(); 451 const bool fIsStuck = uimachine()->isStuck(); 452 452 /* If VM is NOT paused and NOT stuck: */ 453 453 if (!fWasPaused && !fIsStuck) 454 454 { 455 455 /* We should pause it first: */ 456 const bool fIsPaused = ui session()->pause();456 const bool fIsPaused = uimachine()->pause(); 457 457 /* If we were unable to pause VM: */ 458 458 if (!fIsPaused) … … 488 488 /* If VM was not paused before but paused now, 489 489 * we should resume it if user canceled dialog or chosen shutdown: */ 490 if (!fWasPaused && ui session()->isPaused() &&490 if (!fWasPaused && uimachine()->isPaused() && 491 491 (closeAction == MachineCloseAction_Invalid || 492 492 closeAction == MachineCloseAction_Detach || … … 494 494 { 495 495 /* If we unable to resume VM, cancel closing: */ 496 if (!ui session()->unpause())496 if (!uimachine()->unpause()) 497 497 closeAction = MachineCloseAction_Invalid; 498 498 } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp
r98425 r98432 373 373 { 374 374 /* Get machine state: */ 375 KMachineState machineState = ui session()->machineState();375 KMachineState machineState = uimachine()->machineState(); 376 376 /* Handle particular machine states: */ 377 377 switch (machineState) … … 447 447 { 448 448 /* Do not annoy user while restoring VM: */ 449 if (ui session()->machineState() != KMachineState_Restoring)449 if (uimachine()->machineState() != KMachineState_Restoring) 450 450 UINotificationMessage::remindAboutMouseIntegration(uimachine()->isMouseSupportsAbsolute()); 451 451 } … … 463 463 * 2. machine is NOT 'paused' and mouse is NOT 'captured' and 'integrated' and 'absolute' but host pointer is 'hidden' by the guest. */ 464 464 if (uimachine()->isMouseCaptured() || 465 (!ui session()->isPaused() &&465 (!uimachine()->isPaused() && 466 466 uimachine()->isMouseIntegrated() && 467 467 uimachine()->isMouseSupportsAbsolute() && … … 477 477 /* Otherwise we should show host pointer with guest shape assigned to it if: 478 478 * machine is NOT 'paused', mouse is 'integrated' and 'absolute' and valid pointer shape is present. */ 479 if (!ui session()->isPaused() &&479 if (!uimachine()->isPaused() && 480 480 uimachine()->isMouseIntegrated() && 481 481 uimachine()->isMouseSupportsAbsolute() && … … 927 927 928 928 /* Check if machine is still running: */ 929 if (!ui session()->isRunning())929 if (!uimachine()->isRunning()) 930 930 return true; 931 931 … … 1164 1164 if (m_views[uScreenId]->hasFocus() && (iEventType == QEvent::MouseButtonRelease && mouseButtons == Qt::NoButton)) 1165 1165 { 1166 if (ui session()->isPaused())1166 if (uimachine()->isPaused()) 1167 1167 UINotificationMessage::remindAboutPausedVMInput(); 1168 else if (ui session()->isRunning())1168 else if (uimachine()->isRunning()) 1169 1169 { 1170 1170 /* Temporarily disable auto capture that will take place after this dialog is dismissed because … … 1200 1200 { 1201 1201 /* Eat if machine isn't running: */ 1202 if (!ui session()->isRunning())1202 if (!uimachine()->isRunning()) 1203 1203 return true; 1204 1204 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r98427 r98432 871 871 if (sig == SIGUSR1) 872 872 if (gpMachine) 873 gpMachine-> uisession()->machineLogic()->keyboardHandler()->releaseAllPressedKeys();873 gpMachine->machineLogic()->keyboardHandler()->releaseAllPressedKeys(); 874 874 } 875 875 #endif /* VBOX_GUI_WITH_KEYS_RESET_HANDLER */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp
r98423 r98432 342 342 { 343 343 LogRel(("GUI: UIMachineLogicFullscreen::sltCheckForRequestedVisualStateType: Requested-state=%d, Machine-state=%d\n", 344 uimachine()->requestedVisualState(), ui session()->machineState()));344 uimachine()->requestedVisualState(), uimachine()->machineState())); 345 345 346 346 /* Do not try to change visual-state type if machine was not started yet: */ 347 if (!ui session()->isRunning() && !uisession()->isPaused())347 if (!uimachine()->isRunning() && !uimachine()->isPaused()) 348 348 return; 349 349 … … 376 376 377 377 /* If machine-state changed from 'paused' to 'running': */ 378 if (ui session()->isRunning() && uisession()->wasPaused())378 if (uimachine()->isRunning() && uimachine()->wasPaused()) 379 379 { 380 380 LogRel(("GUI: UIMachineLogicFullscreen::sltMachineStateChanged:" … … 383 383 384 384 /* Make sure further code will be called just once: */ 385 ui session()->forgetPreviousMachineState();385 uimachine()->forgetPreviousMachineState(); 386 386 /* Adjust machine-window geometry if necessary: */ 387 387 adjustMachineWindowsGeometry(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp
r98419 r98432 73 73 { 74 74 LogRel(("GUI: UIMachineLogicNormal::sltCheckForRequestedVisualStateType: Requested-state=%d, Machine-state=%d\n", 75 uimachine()->requestedVisualState(), ui session()->machineState()));75 uimachine()->requestedVisualState(), uimachine()->machineState())); 76 76 77 77 /* Do not try to change visual-state type if machine was not started yet: */ 78 if (!ui session()->isRunning() && !uisession()->isPaused())78 if (!uimachine()->isRunning() && !uimachine()->isPaused()) 79 79 return; 80 80 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
r98423 r98432 203 203 /* Update status-bar indicators-pool: */ 204 204 if (m_pIndicatorsPool) 205 m_pIndicatorsPool->setAutoUpdateIndicatorStates(statusBar()->isVisible() && ui session()->isRunning());205 m_pIndicatorsPool->setAutoUpdateIndicatorStates(statusBar()->isVisible() && uimachine()->isRunning()); 206 206 207 207 /* Normalize geometry without moving: */ … … 391 391 statusBar()->setVisible(actionPool()->action(UIActionIndexRT_M_View_M_StatusBar_T_Visibility)->isChecked()); 392 392 if (m_pIndicatorsPool) 393 m_pIndicatorsPool->setAutoUpdateIndicatorStates(statusBar()->isVisible() && ui session()->isRunning());393 m_pIndicatorsPool->setAutoUpdateIndicatorStates(statusBar()->isVisible() && uimachine()->isRunning()); 394 394 } 395 395 … … 731 731 if ( m_pIndicatorsPool 732 732 && iElement & UIVisualElement_IndicatorPoolStuff) 733 m_pIndicatorsPool->setAutoUpdateIndicatorStates(statusBar()->isVisible() && ui session()->isRunning());733 m_pIndicatorsPool->setAutoUpdateIndicatorStates(statusBar()->isVisible() && uimachine()->isRunning()); 734 734 /* Update status-bar indicator-pool appearance only when status-bar is visible: */ 735 735 if ( m_pIndicatorsPool … … 737 737 { 738 738 /* If VM is running: */ 739 if (ui session()->isRunning())739 if (uimachine()->isRunning()) 740 740 { 741 741 if (iElement & UIVisualElement_HDStuff) … … 759 759 } 760 760 /* If VM is running or paused: */ 761 if (ui session()->isRunning() || uisession()->isPaused())761 if (uimachine()->isRunning() || uimachine()->isPaused()) 762 762 { 763 763 if (iElement & UIVisualElement_Recording) -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp
r98419 r98432 118 118 { 119 119 LogRel(("GUI: UIMachineLogicSeamless::sltCheckForRequestedVisualStateType: Requested-state=%d, Machine-state=%d\n", 120 uimachine()->requestedVisualState(), ui session()->machineState()));120 uimachine()->requestedVisualState(), uimachine()->machineState())); 121 121 122 122 /* Do not try to change visual-state type if machine was not started yet: */ 123 if (!ui session()->isRunning() && !uisession()->isPaused())123 if (!uimachine()->isRunning() && !uimachine()->isPaused()) 124 124 return; 125 125 … … 144 144 145 145 /* If machine-state changed from 'paused' to 'running': */ 146 if (ui session()->isRunning() && uisession()->wasPaused())146 if (uimachine()->isRunning() && uimachine()->wasPaused()) 147 147 { 148 148 LogRel(("GUI: UIMachineLogicSeamless::sltMachineStateChanged:" … … 151 151 152 152 /* Make sure further code will be called just once: */ 153 ui session()->forgetPreviousMachineState();153 uimachine()->forgetPreviousMachineState(); 154 154 /* Adjust machine-window geometry if necessary: */ 155 155 adjustMachineWindowsGeometry(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp
r98386 r98432 142 142 { 143 143 /* Reset seamless feature flag if possible: */ 144 if (ui session()->isRunning())144 if (uimachine()->isRunning()) 145 145 display().SetSeamlessMode(false); 146 146 }
Note:
See TracChangeset
for help on using the changeset viewer.