VirtualBox

Changeset 34735 in vbox


Ignore:
Timestamp:
Dec 6, 2010 11:18:06 AM (14 years ago)
Author:
vboxsync
Message:

FE/Qt: Some little logic fix in settings save procedure.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp

    r34596 r34735  
    718718    /* Get updated machine: */
    719719    m_machine = pMachineSettingsSaver->data().value<UISettingsDataMachine>().m_machine;
    720     /* If machine is not OK => show the error: */
    721     if (!m_machine.isOk())
     720    /* If machine is ok => perform final operations: */
     721    if (m_machine.isOk())
     722    {
     723        /* Guest OS type & VT-x/AMD-V option correlation auto-fix: */
     724        UIMachineSettingsGeneral *pGeneralPage =
     725            qobject_cast<UIMachineSettingsGeneral*>(m_pSelector->idToPage(VMSettingsPage_General));
     726        UIMachineSettingsSystem *pSystemPage =
     727            qobject_cast<UIMachineSettingsSystem*>(m_pSelector->idToPage(VMSettingsPage_System));
     728        if (pGeneralPage && pSystemPage &&
     729            pGeneralPage->is64BitOSTypeSelected() && !pSystemPage->isHWVirtExEnabled())
     730            m_machine.SetHWVirtExProperty(KHWVirtExPropertyType_Enabled, true);
     731
     732#ifdef VBOX_WITH_VIDEOHWACCEL
     733        /* Disable 2D Video Acceleration for non-Windows guests: */
     734        if (pGeneralPage && !pGeneralPage->isWindowsOSTypeSelected())
     735        {
     736            UIMachineSettingsDisplay *pDisplayPage =
     737                qobject_cast<UIMachineSettingsDisplay*>(m_pSelector->idToPage(VMSettingsPage_Display));
     738            if (pDisplayPage && pDisplayPage->isAcceleration2DVideoSelected())
     739                m_machine.SetAccelerate2DVideoEnabled(false);
     740        }
     741#endif /* VBOX_WITH_VIDEOHWACCEL */
     742
     743#ifndef VBOX_OSE
     744        /* Enable OHCI controller if HID is enabled: */
     745        if (pSystemPage && pSystemPage->isHIDEnabled())
     746        {
     747            CUSBController controller = m_machine.GetUSBController();
     748            if (!controller.isNull())
     749                controller.SetEnabled(true);
     750        }
     751#endif /* !VBOX_OSE */
     752
     753        /* Clear the "GUI_FirstRun" extra data key in case if
     754         * the boot order or disk configuration were changed: */
     755        if (m_fResetFirstRunFlag)
     756            m_machine.SetExtraData(VBoxDefs::GUI_FirstRun, QString::null);
     757    }
     758    /* If machine is NOT ok => show error message: */
     759    else
     760    {
     761        /* Show final error message: */
    722762        vboxProblem().cannotSaveMachineSettings(m_machine);
    723 
    724     /* Guest OS type & VT-x/AMD-V option correlation auto-fix: */
    725     UIMachineSettingsGeneral *pGeneralPage =
    726         qobject_cast<UIMachineSettingsGeneral*>(m_pSelector->idToPage(VMSettingsPage_General));
    727     UIMachineSettingsSystem *pSystemPage =
    728         qobject_cast<UIMachineSettingsSystem*>(m_pSelector->idToPage(VMSettingsPage_System));
    729     if (pGeneralPage && pSystemPage &&
    730         pGeneralPage->is64BitOSTypeSelected() && !pSystemPage->isHWVirtExEnabled())
    731         m_machine.SetHWVirtExProperty(KHWVirtExPropertyType_Enabled, true);
    732 
    733 #ifdef VBOX_WITH_VIDEOHWACCEL
    734     /* Disable 2D Video Acceleration for non-Windows guests: */
    735     if (pGeneralPage && !pGeneralPage->isWindowsOSTypeSelected())
    736     {
    737         UIMachineSettingsDisplay *pDisplayPage =
    738             qobject_cast<UIMachineSettingsDisplay*>(m_pSelector->idToPage(VMSettingsPage_Display));
    739         if (pDisplayPage && pDisplayPage->isAcceleration2DVideoSelected())
    740             m_machine.SetAccelerate2DVideoEnabled(false);
    741     }
    742 #endif /* VBOX_WITH_VIDEOHWACCEL */
    743 
    744 #ifndef VBOX_OSE
    745     /* Enable OHCI controller if HID is enabled: */
    746     if (pSystemPage && pSystemPage->isHIDEnabled())
    747     {
    748         CUSBController controller = m_machine.GetUSBController();
    749         if (!controller.isNull())
    750             controller.SetEnabled(true);
    751     }
    752 #endif /* !VBOX_OSE */
    753 
    754     /* Clear the "GUI_FirstRun" extra data key in case if
    755      * the boot order or disk configuration were changed: */
    756     if (m_fResetFirstRunFlag)
    757         m_machine.SetExtraData(VBoxDefs::GUI_FirstRun, QString::null);
     763    }
    758764}
    759765
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