VirtualBox

Changeset 87251 in vbox


Ignore:
Timestamp:
Jan 14, 2021 4:20:01 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: Eliminate any use of VBOX_WITH_EXTPACK conditional, and make all checks at runtime. If the extension pack manager is not there, assume that all features are available to avoid confusing messages.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r87219 r87251  
    114114        $(if $(VBOX_WITH_NETFLT)$(eq $(KBUILD_TARGET),freebsd),VBOX_WITH_NETFLT) \
    115115        $(if $(VBOX_WITH_VDE),VBOX_WITH_VDE) \
    116         $(if $(VBOX_WITH_EXTPACK),VBOX_WITH_EXTPACK) \
    117116        $(if $(VBOX_WITH_HARDENING),VBOXR3_HARDENED_DLL) \
    118117        $(if $(VBOX_WITH_DRAG_AND_DROP),VBOX_WITH_DRAG_AND_DROP) \
     
    172171        $(if $(VBOX_WITH_NETFLT)$(eq $(KBUILD_TARGET),freebsd),VBOX_WITH_NETFLT) \
    173172        $(if $(VBOX_WITH_VDE),VBOX_WITH_VDE) \
    174         $(if $(VBOX_WITH_EXTPACK),VBOX_WITH_EXTPACK) \
    175173        $(if $(VBOX_WITH_HARDENING),VBOXR3_HARDENED_DLL) \
    176174        $(if $(VBOX_WITH_DRAG_AND_DROP),VBOX_WITH_DRAG_AND_DROP) \
     
    225223        $(if $(VBOX_WITH_VDE),VBOX_WITH_VDE) \
    226224        $(if $(VBOX_WITH_KCHMVIEWER),VBOX_WITH_KCHMVIEWER) \
    227         $(if $(VBOX_WITH_EXTPACK),VBOX_WITH_EXTPACK) \
    228225        $(if $(VBOX_WITH_HARDENING),VBOXR3_HARDENED_DLL) \
    229226        $(if $(VBOX_WITH_DRAG_AND_DROP),VBOX_WITH_DRAG_AND_DROP) \
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolRuntime.cpp

    r85662 r87251  
    34443444
    34453445    /* Recache extension-pack related action restrictions: */
    3446 #ifdef VBOX_WITH_EXTPACK
    3447     CExtPack extPack = uiCommon().virtualBox().GetExtensionPackManager().Find(GUI_ExtPackName);
    3448 #else
    3449     CExtPack extPack;
    3450 #endif
    3451     bool fExtensionPackOperationsAllowed = !extPack.isNull() && extPack.GetUsable();
    3452     if (!fExtensionPackOperationsAllowed)
     3446    CExtPackManager extPackManager = uiCommon().virtualBox().GetExtensionPackManager();
     3447    if (!extPackManager.isNull() && !extPackManager.IsExtPackUsable(GUI_ExtPackName))
    34533448    {
    34543449        m_restrictedActionsMenuView[UIActionRestrictionLevel_Base] = (UIExtraDataMetaDefs::RuntimeMenuViewActionType)
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp

    r86996 r87251  
    36573657                                       QWidget *pParent, QString *pstrExtPackName) const
    36583658{
     3659    /* If the extension pack manager isn't available, skip any attempts to install: */
     3660    CExtPackManager extPackManager = virtualBox().GetExtensionPackManager();
     3661    if (extPackManager.isNull())
     3662        return;
    36593663    /* Open the extpack tarball via IExtPackManager: */
    3660     CExtPackManager comManager = virtualBox().GetExtensionPackManager();
    36613664    CExtPackFile comExtPackFile;
    36623665    if (strDigest.isEmpty())
    3663         comExtPackFile = comManager.OpenExtPackFile(strFilePath);
     3666        comExtPackFile = extPackManager.OpenExtPackFile(strFilePath);
    36643667    else
    36653668    {
    36663669        QString strFileAndHash = QString("%1::SHA-256=%2").arg(strFilePath).arg(strDigest);
    3667         comExtPackFile = comManager.OpenExtPackFile(strFileAndHash);
    3668     }
    3669     if (!comManager.isOk())
    3670     {
    3671         msgCenter().cannotOpenExtPack(strFilePath, comManager, pParent);
     3670        comExtPackFile = extPackManager.OpenExtPackFile(strFileAndHash);
     3671    }
     3672    if (!extPackManager.isOk())
     3673    {
     3674        msgCenter().cannotOpenExtPack(strFilePath, extPackManager, pParent);
    36723675        return;
    36733676    }
     
    36853688    /* Check if there is a version of the extension pack already
    36863689     * installed on the system and let the user decide what to do about it. */
    3687     CExtPack comExtPackCur = comManager.Find(strPackName);
     3690    CExtPack comExtPackCur = extPackManager.Find(strPackName);
    36883691    bool fReplaceIt = comExtPackCur.isOk();
    36893692    if (fReplaceIt)
  • trunk/src/VBox/Frontends/VirtualBox/src/networking/UIUpdateManager.cpp

    r86996 r87251  
    409409    }
    410410
     411    /* Get extension pack manager: */
     412    CExtPackManager extPackManager = uiCommon().virtualBox().GetExtensionPackManager();
     413    /* Return if extension pack manager is NOT available: */
     414    if (extPackManager.isNull())
     415    {
     416        emit sigStepComplete();
     417        return;
     418    }
     419
    411420    /* Get extension pack: */
    412     CExtPack extPack = uiCommon().virtualBox().GetExtensionPackManager().Find(GUI_ExtPackName);
     421    CExtPack extPack = extPackManager.Find(GUI_ExtPackName);
    413422    /* Return if extension pack is NOT installed: */
    414423    if (extPack.isNull())
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp

    r86986 r87251  
    5555
    5656/* COM includes: */
     57#include "CExtPackManager.h"
    5758#include "CGraphicsAdapter.h"
    5859#include "CUSBController.h"
     
    325326            break;
    326327        }
     328        case GlobalSettingsPageType_Extensions:
     329            return !uiCommon().virtualBox().GetExtensionPackManager().isNull();
    327330        default:
    328331            break;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp

    r86045 r87251  
    708708        message.first = UICommon::removeAccelMark(m_pTabWidget->tabText(1));
    709709
    710 #ifdef VBOX_WITH_EXTPACK
    711710        /* VRDE Extension Pack presence test: */
    712         CExtPack extPack = uiCommon().virtualBox().GetExtensionPackManager().Find(GUI_ExtPackName);
    713         if (m_pCheckboxRemoteDisplay->isChecked() && (extPack.isNull() || !extPack.GetUsable()))
     711        if (m_pCheckboxRemoteDisplay->isChecked())
    714712        {
    715             message.second << tr("Remote Display is currently enabled for this virtual machine. "
    716                                  "However, this requires the <i>%1</i> to be installed. "
    717                                  "Please install the Extension Pack from the VirtualBox download site as "
    718                                  "otherwise your VM will be started with Remote Display disabled.")
    719                                  .arg(GUI_ExtPackName);
     713            CExtPackManager extPackManager = uiCommon().virtualBox().GetExtensionPackManager();
     714            if (!extPackManager.isNull() && !extPackManager.IsExtPackUsable(GUI_ExtPackName))
     715            {
     716                message.second << tr("Remote Display is currently enabled for this virtual machine. "
     717                                    "However, this requires the <i>%1</i> to be installed. "
     718                                    "Please install the Extension Pack from the VirtualBox download site as "
     719                                    "otherwise your VM will be started with Remote Display disabled.")
     720                                    .arg(GUI_ExtPackName);
     721            }
    720722        }
    721 #endif /* VBOX_WITH_EXTPACK */
    722723
    723724        /* Check VRDE server port: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp

    r86772 r87251  
    414414    if (m_pCheckBoxEncryption->isChecked())
    415415    {
    416 #ifdef VBOX_WITH_EXTPACK
    417416        /* Encryption Extension Pack presence test: */
    418         const CExtPack extPack = uiCommon().virtualBox().GetExtensionPackManager().Find(GUI_ExtPackName);
    419         if (extPack.isNull() || !extPack.GetUsable())
     417        CExtPackManager extPackManager = uiCommon().virtualBox().GetExtensionPackManager();
     418        if (!extPackManager.isNull() && !extPackManager.IsExtPackUsable(GUI_ExtPackName))
    420419        {
    421420            message.second << tr("You are trying to enable disk encryption for this virtual machine. "
     
    425424            fPass = false;
    426425        }
    427 #endif /* VBOX_WITH_EXTPACK */
    428426
    429427        /* Cipher should be chosen if once changed: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.cpp

    r86233 r87251  
    524524    bool fPass = true;
    525525
    526 #ifdef VBOX_WITH_EXTPACK
    527526    /* USB 2.0/3.0 Extension Pack presence test: */
    528     const CExtPack extPack = uiCommon().virtualBox().GetExtensionPackManager().Find(GUI_ExtPackName);
    529527    if (   m_pCheckBoxUSB->isChecked()
    530         && (m_pRadioButtonUSB2->isChecked() || m_pRadioButtonUSB3->isChecked())
    531         && (extPack.isNull() || !extPack.GetUsable()))
    532     {
    533         /* Prepare message: */
    534         UIValidationMessage message;
    535         message.second << tr("USB 2.0/3.0 is currently enabled for this virtual machine. "
    536                              "However, this requires the <i>%1</i> to be installed. "
    537                              "Please install the Extension Pack from the VirtualBox download site "
    538                              "or disable USB 2.0/3.0 to be able to start the machine.")
    539                              .arg(GUI_ExtPackName);
    540         /* Serialize message: */
    541         if (!message.second.isEmpty())
    542             messages << message;
    543     }
    544 #endif /* VBOX_WITH_EXTPACK */
     528        && (m_pRadioButtonUSB2->isChecked() || m_pRadioButtonUSB3->isChecked()))
     529    {
     530        CExtPackManager extPackManager = uiCommon().virtualBox().GetExtensionPackManager();
     531        if (!extPackManager.isNull() && !extPackManager.IsExtPackUsable(GUI_ExtPackName))
     532        {
     533            /* Prepare message: */
     534            UIValidationMessage message;
     535            message.second << tr("USB 2.0/3.0 is currently enabled for this virtual machine. "
     536                                "However, this requires the <i>%1</i> to be installed. "
     537                                "Please install the Extension Pack from the VirtualBox download site "
     538                                "or disable USB 2.0/3.0 to be able to start the machine.")
     539                                .arg(GUI_ExtPackName);
     540            /* Serialize message: */
     541            if (!message.second.isEmpty())
     542                messages << message;
     543        }
     544    }
    545545
    546546    /* Return result: */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp

    r87249 r87251  
    193193    {
    194194        /* USB 3.0 is only available if the proper ExtPack is installed: */
    195         CExtPackManager manager = uiCommon().virtualBox().GetExtensionPackManager();
    196         if (manager.IsExtPackUsable(GUI_ExtPackName))
     195        CExtPackManager extPackManager = uiCommon().virtualBox().GetExtensionPackManager();
     196        if (extPackManager.isNull() || extPackManager.IsExtPackUsable(GUI_ExtPackName))
    197197        {
    198198            m_machine.AddUSBController("XHCI", KUSBControllerType_XHCI);
    199             /* xHci includes OHCI */
     199            /* xHCI includes OHCI */
    200200            fOhciEnabled = true;
    201201        }
     
    211211         * necessary evil to patch over legacy compatability issues
    212212         * introduced by the new distribution model. */
    213         CExtPackManager manager = uiCommon().virtualBox().GetExtensionPackManager();
    214         if (manager.IsExtPackUsable(GUI_ExtPackName))
     213        CExtPackManager extPackManager = uiCommon().virtualBox().GetExtensionPackManager();
     214        if (extPackManager.isNull() || extPackManager.IsExtPackUsable(GUI_ExtPackName))
    215215            m_machine.AddUSBController("EHCI", KUSBControllerType_EHCI);
    216216    }
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