VirtualBox

Changeset 98607 in vbox


Ignore:
Timestamp:
Feb 16, 2023 4:02:34 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
155899
Message:

FE/Qt: bugref:10322: Runtime UI: Reworking CConsole wrapper usage step-by-step; Stuff related to ACPI shutdown.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp

    r98605 r98607  
    646646}
    647647#endif /* VBOX_WITH_DEBUGGER_GUI */
     648
     649bool UIMachine::acquireWhetherGuestEnteredACPIMode(bool &fEntered)
     650{
     651    return uisession()->acquireWhetherGuestEnteredACPIMode(fEntered);
     652}
    648653
    649654void UIMachine::detachUi()
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h

    r98605 r98607  
    490490        MachineCloseAction restrictedCloseActions() const { return m_restrictedCloseActions; }
    491491
     492        /** Acquires whether guest @a fEntered ACPI mode. */
     493        bool acquireWhetherGuestEnteredACPIMode(bool &fEntered);
     494
    492495        /** Detaches and closes Runtime UI. */
    493496        void detachUi();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp

    r98605 r98607  
    5454
    5555/* COM includes: */
    56 #include "CConsole.h"
    5756#include "CGraphicsAdapter.h"
    5857#include "CSnapshot.h"
     
    227226}
    228227
    229 CConsole& UIMachineWindow::console() const
    230 {
    231     return uisession()->console();
    232 }
    233 
    234228QString UIMachineWindow::machineName() const
    235229{
     
    430424        /* Prepare close-dialog: */
    431425        QWidget *pParentDlg = windowManager().realParentWindow(this);
     426        bool fInACPIMode = false;
     427        uimachine()->acquireWhetherGuestEnteredACPIMode(fInACPIMode);
    432428        QPointer<UIVMCloseDialog> pCloseDlg = new UIVMCloseDialog(pParentDlg, machine(),
    433                                                                   console().GetGuestEnteredACPIMode(),
     429                                                                  fInACPIMode,
    434430                                                                  restrictedCloseActions);
    435431        /* Configure close-dialog: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.h

    r98517 r98607  
    9696    /** Returns the session's machine reference. */
    9797    CMachine& machine() const;
    98     /** Returns the session's console reference. */
    99     CConsole& console() const;
    10098
    10199    /** Returns the machine name. */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r98605 r98607  
    792792#endif /* VBOX_WITH_DEBUGGER_GUI */
    793793
     794bool UISession::acquireWhetherGuestEnteredACPIMode(bool &fEntered)
     795{
     796    CConsole comConsole = console();
     797    const BOOL fGuestEntered = comConsole.GetGuestEnteredACPIMode();
     798    const bool fSuccess = comConsole.isOk();
     799    if (!fSuccess)
     800        UINotificationMessage::cannotAcquireConsoleParameter(comConsole);
     801    else
     802        fEntered = fGuestEntered == TRUE;
     803    return fSuccess;
     804}
     805
    794806bool UISession::prepareToBeSaved()
    795807{
     
    800812bool UISession::prepareToBeShutdowned()
    801813{
    802     const bool fValidMode = console().GetGuestEnteredACPIMode();
     814    bool fValidMode = false;
     815    acquireWhetherGuestEnteredACPIMode(fValidMode);
    803816    if (!fValidMode)
    804817        UINotificationMessage::cannotSendACPIToMachine();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r98605 r98607  
    392392    /** @name Close stuff.
    393393     ** @{ */
     394        /** Acquires whether guest @a fEntered ACPI mode. */
     395        bool acquireWhetherGuestEnteredACPIMode(bool &fEntered);
     396
    394397        /** Prepares VM to be saved. */
    395398        bool prepareToBeSaved();
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette