VirtualBox

Ignore:
Timestamp:
Mar 24, 2011 11:43:18 AM (14 years ago)
Author:
vboxsync
Message:

FE/Qt: 5605: Display the GUI warning in VM settings if USB 2.0 option is enabled but extension pack isn't installed.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.cpp

    r36011 r36393  
    26582658}
    26592659
     2660void VBoxProblemReporter::remindAboutUnsupportedUSB2(const QString &strExtPackName, QWidget *pParent)
     2661{
     2662    emit sigRemindAboutUnsupportedUSB2(strExtPackName, pParent);
     2663}
     2664
    26602665void VBoxProblemReporter::showHelpWebDialog()
    26612666{
     
    28882893               .arg(uWantedBPP).arg(uRealBPP).arg(uWantedBPP).arg(uWantedBPP),
    28892894            kName);
     2895}
     2896
     2897void VBoxProblemReporter::sltRemindAboutUnsupportedUSB2(const QString &strExtPackName, QWidget *pParent)
     2898{
     2899    if (isAlreadyShown("sltRemindAboutUnsupportedUSB2"))
     2900        return;
     2901    setShownStatus("sltRemindAboutUnsupportedUSB2");
     2902
     2903    message(pParent ? pParent : mainMachineWindowShown(), Warning,
     2904            tr("<p>USB 2.0 is currently enabled for this virtual machine. "
     2905               "However this requires the <b><nobr>%1</nobr></b> to be installed.</p>"
     2906               "<p>Please install the Extension Pack from the VirtualBox download site. "
     2907               "After this you will be able to re-enable USB 2.0. "
     2908               "It will be disabled in the meantime unless you cancel the current settings changes.</p>")
     2909               .arg(strExtPackName));
     2910
     2911    clearShownStatus("sltRemindAboutUnsupportedUSB2");
    28902912}
    28912913
     
    29312953    connect(this, SIGNAL(sigRemindAboutWrongColorDepth(ulong, ulong)),
    29322954            this, SLOT(sltRemindAboutWrongColorDepth(ulong, ulong)), Qt::QueuedConnection);
     2955    connect(this, SIGNAL(sigRemindAboutUnsupportedUSB2(const QString&, QWidget*)),
     2956            this, SLOT(sltRemindAboutUnsupportedUSB2(const QString&, QWidget*)), Qt::QueuedConnection);
    29332957}
    29342958
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxProblemReporter.h

    r36011 r36393  
    411411                                  const QString &strPath, QWidget *pParent = 0);
    412412    void remindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP);
     413    void remindAboutUnsupportedUSB2(const QString &strExtPackName, QWidget *pParent = 0);
    413414
    414415signals:
     
    433434                                     const QString &strPath, QWidget *pParent);
    434435    void sigRemindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP);
     436    void sigRemindAboutUnsupportedUSB2(const QString &strExtPackName, QWidget *pParent);
    435437
    436438public slots:
     
    460462                                     const QString &strPath, QWidget *pParent);
    461463    void sltRemindAboutWrongColorDepth(ulong uRealBPP, ulong uWantedBPP);
     464    void sltRemindAboutUnsupportedUSB2(const QString &strExtPackName, QWidget *pParent);
    462465
    463466private:
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.cpp

    r36357 r36393  
    2222#include "UIIconPool.h"
    2323#include "VBoxGlobal.h"
     24#include "VBoxProblemReporter.h"
    2425#include "UIToolBar.h"
    2526#include "UIMachineSettingsUSB.h"
     
    280281        {
    281282            /* Gather internal variables data from QWidget(s): */
     283            /* USB 1.0 (OHCI): */
    282284            m_cache.m_fUSBEnabled = mGbUSB->isChecked();
    283             m_cache.m_fEHCIEnabled = mCbUSB2->isChecked();
     285            /* USB 2.0 (EHCI): */
     286            QString strExtPackName = "Oracle VM VirtualBox Extension Pack";
     287            CExtPack extPack = vboxGlobal().virtualBox().GetExtensionPackManager().Find(strExtPackName);
     288            m_cache.m_fEHCIEnabled = extPack.isNull() ? false : mCbUSB2->isChecked();
    284289            break;
    285290        }
     
    408413    mValidator = aVal;
    409414    connect (mGbUSB, SIGNAL (stateChanged (int)), mValidator, SLOT (revalidate()));
     415    connect(mCbUSB2, SIGNAL(stateChanged(int)), mValidator, SLOT(revalidate()));
     416}
     417
     418bool UIMachineSettingsUSB::revalidate(QString &strWarningText, QString& /* strTitle */)
     419{
     420    /* USB 2.0 Extension Pack presence test: */
     421    QString strExtPackName = "Oracle VM VirtualBox Extension Pack";
     422    CExtPack extPack = vboxGlobal().virtualBox().GetExtensionPackManager().Find(strExtPackName);
     423    if (mCbUSB2->isChecked() && extPack.isNull())
     424    {
     425        strWarningText = tr("USB 2.0 is currently enabled for this virtual machine. "
     426                            "However this requires the <b>%1</b> to be installed. "
     427                            "Please install the Extension Pack from the VirtualBox download site. "
     428                            "After this you will be able to re-enable USB 2.0. "
     429                            "It will be disabled in the meantime unless you cancel the current settings changes.")
     430                            .arg(strExtPackName);
     431        vboxProblem().remindAboutUnsupportedUSB2(strExtPackName, this);
     432        return true;
     433    }
     434    return true;
    410435}
    411436
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.h

    r36357 r36393  
    9191
    9292    void setValidator (QIWidgetValidator *aVal);
     93    bool revalidate(QString &strWarningText, QString &strTitle);
    9394
    9495    void setOrderAfter (QWidget *aWidget);
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