VirtualBox

Changeset 26893 in vbox for trunk/src


Ignore:
Timestamp:
Feb 28, 2010 5:43:39 PM (15 years ago)
Author:
vboxsync
Message:

FE/Qt4: New running VM core: bug fix in handling required features.

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

Legend:

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

    r26889 r26893  
    2626#include <QFileInfo>
    2727#include <QDesktopWidget>
     28#include <QTimer>
    2829
    2930/* Local includes */
     
    373374    , m_pRunningActions(0)
    374375    , m_pRunningOrPausedActions(0)
     376    , m_fIsPreventAutoStart(false)
    375377    , m_fIsPreventAutoClose(false)
    376378{
     
    540542    CConsole console = session().GetConsole();
    541543
    542     /* Check if the virtualization feature is required. */
    543     bool fIs64BitsGuest = vboxGlobal().virtualBox().GetGuestOSType(console.GetGuest().GetOSTypeId()).GetIs64Bit();
    544     bool fRecommendVirtEx = vboxGlobal().virtualBox().GetGuestOSType(console.GetGuest().GetOSTypeId()).GetRecommendedVirtEx();
    545     AssertMsg(!fIs64BitsGuest || fRecommendVirtEx, ("Virtualization support missed for 64bit guest!\n"));
    546     bool fIsVirtEnabled = console.GetDebugger().GetHWVirtExEnabled();
    547     if (fRecommendVirtEx && !fIsVirtEnabled)
    548     {
    549         bool fResult;
    550 
    551         uisession()->pause();
    552 
    553         bool fVTxAMDVSupported = vboxGlobal().virtualBox().GetHost().GetProcessorFeature(KProcessorFeature_HWVirtEx);
    554 
    555         if (fIs64BitsGuest)
    556             fResult = vboxProblem().warnAboutVirtNotEnabled64BitsGuest(fVTxAMDVSupported);
    557         else
    558             fResult = vboxProblem().warnAboutVirtNotEnabledGuestRequired(fVTxAMDVSupported);
    559 
    560         if (fResult == true)
    561             sltClose();
    562         else
    563             uisession()->unpause();
     544    /* Check if the required virtualization features are ready: */
     545    if (!isPreventAutoStart())
     546    {
     547        bool fIs64BitsGuest = vboxGlobal().virtualBox().GetGuestOSType(console.GetGuest().GetOSTypeId()).GetIs64Bit();
     548        bool fRecommendVirtEx = vboxGlobal().virtualBox().GetGuestOSType(console.GetGuest().GetOSTypeId()).GetRecommendedVirtEx();
     549        AssertMsg(!fIs64BitsGuest || fRecommendVirtEx, ("Virtualization support missed for 64bit guest!\n"));
     550        bool fIsVirtEnabled = console.GetDebugger().GetHWVirtExEnabled();
     551        if (fRecommendVirtEx && !fIsVirtEnabled)
     552        {
     553            bool fShouldWeClose;
     554
     555            bool fVTxAMDVSupported = vboxGlobal().virtualBox().GetHost().GetProcessorFeature(KProcessorFeature_HWVirtEx);
     556
     557            if (fIs64BitsGuest)
     558                fShouldWeClose = vboxProblem().warnAboutVirtNotEnabled64BitsGuest(fVTxAMDVSupported);
     559            else
     560                fShouldWeClose = vboxProblem().warnAboutVirtNotEnabledGuestRequired(fVTxAMDVSupported);
     561
     562            if (fShouldWeClose == true)
     563                setPreventAutoStart(true);
     564        }
    564565    }
    565566
    566567#ifdef Q_WS_MAC
    567568# ifdef VBOX_WITH_ICHAT_THEATER
    568     initSharedAVManager();
     569    /* Init shared AV manager: */
     570    if (!isPreventAutoStart())
     571        initSharedAVManager();
    569572# endif
    570573#endif
     574
     575    /* Close request in case of features are not ready and user wish to close: */
     576    if (isPreventAutoStart())
     577        QTimer::singleShot(0, uisession(), SLOT(sltCloseVirtualSession()));
    571578}
    572579
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h

    r26815 r26893  
    6565
    6666    /* Maintenance getters/setters: */
     67    bool isPreventAutoStart() const { return m_fIsPreventAutoStart; }
    6768    bool isPreventAutoClose() const { return m_fIsPreventAutoClose; }
     69    void setPreventAutoStart(bool fIsPreventAutoStart) { m_fIsPreventAutoStart = fIsPreventAutoStart; }
    6870    void setPreventAutoClose(bool fIsPreventAutoClose) { m_fIsPreventAutoClose = fIsPreventAutoClose; }
    6971
     
    155157    QActionGroup *m_pRunningOrPausedActions;
    156158
     159    bool m_fIsPreventAutoStart : 1;
    157160    bool m_fIsPreventAutoClose : 1;
    158161
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp

    r26815 r26893  
    4444    : UIMachineLogic(pParent, pSession, pActionsPool, UIVisualStateType_Normal)
    4545{
    46     /* Prepare console connections: */
    47     prepareConsoleConnections();
    48 
    49     /* Prepare action groups: */
    50     prepareActionGroups();
    51 
    52     /* Prepare action connections: */
    53     prepareActionConnections();
    54 
    5546    /* Check the status of required features: */
    5647    prepareRequiredFeatures();
    5748
    58     /* Prepare normal machine window: */
    59     prepareMachineWindow();
    60 
    61     /* Initialization: */
    62     sltMachineStateChanged();
    63     sltAdditionsStateChanged();
    64     sltMouseCapabilityChanged();
     49    /* If required features are ready: */
     50    if (!isPreventAutoStart())
     51    {
     52        /* Prepare console connections: */
     53        prepareConsoleConnections();
     54
     55        /* Prepare action groups: */
     56        prepareActionGroups();
     57
     58        /* Prepare action connections: */
     59        prepareActionConnections();
     60
     61        /* Prepare normal machine window: */
     62        prepareMachineWindow();
     63
     64        /* Initialization: */
     65        sltMachineStateChanged();
     66        sltAdditionsStateChanged();
     67        sltMouseCapabilityChanged();
     68    }
    6569}
    6670
Note: See TracChangeset for help on using the changeset viewer.

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