VirtualBox

Changeset 77217 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Feb 8, 2019 1:32:34 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9340. Hide the create action from the medium selector when it is opened from the new vm wizard

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

Legend:

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

    r77212 r77217  
    27592759int VBoxGlobal::openMediumSelectorDialog(QWidget *pParent, UIMediumDeviceType  enmMediumType, QUuid &outUuid,
    27602760                                         const QString &strMachineName, const QString &strMachineFolder,
    2761                                          const QString &strMachineGuestOSTypeId  /* = QString() */)
     2761                                         const QString &strMachineGuestOSTypeId, bool fEnableCreate)
    27622762{
    27632763    QWidget *pDialogParent = windowManager().realParentWindow(pParent);
     
    27672767    if (!pSelector)
    27682768        return static_cast<int>(UIMediumSelector::ReturnCode_Rejected);
    2769 
     2769    pSelector->setEnableCreateAction(fEnableCreate);
    27702770    windowManager().registerNewParent(pSelector, pDialogParent);
    27712771
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r77186 r77217  
    518518          * @param  strMachineFolder         Passes the machine folder,
    519519          * @param  strMachineGuestOSTypeId  Passes the type ID of machine's guest os,
     520          * @param  fEnableCreate            Passes whether to show/enable create action in the medium selector dialog,
    520521          * returns the return code of the UIMediumSelector::ReturnCode as int. In case of a medium selection
    521522          *         UUID of the selected medium is stored in @param outUuid.*/
    522523        int openMediumSelectorDialog(QWidget *pParent, UIMediumDeviceType  enmMediumType, QUuid &outUuid,
    523                                        const QString &strMachineName, const QString &strMachineFolder,
    524                                        const QString &strMachineGuestOSTypeId = QString());
     524                                     const QString &strMachineName, const QString &strMachineFolder,
     525                                     const QString &strMachineGuestOSTypeId, bool fEnableCreate);
    525526
    526527        /** Creates and shows a UIWizardNewVD wizard.
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.cpp

    r77216 r77217  
    8484}
    8585
     86void UIMediumSelector::setEnableCreateAction(bool fEnable)
     87{
     88    if (!m_pActionCreate)
     89        return;
     90    m_pActionCreate->setEnabled(fEnable);
     91    m_pActionCreate->setVisible(fEnable);
     92}
     93
    8694QList<QUuid> UIMediumSelector::selectedMediumIds() const
    8795{
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.h

    r77216 r77217  
    5454                     const QString &machineSettingsFilePath = QString(), const QString &strMachineGuestOSTypeId = QString(),
    5555                     QWidget *pParent = 0);
    56 
     56    /** Disables/enables the create action and controls its visibility. */
     57    void         setEnableCreateAction(bool fEnable);
    5758    QList<QUuid> selectedMediumIds() const;
    5859
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp

    r77195 r77217  
    31003100    int iResult = vboxGlobal().openMediumSelectorDialog(this, m_pMediumIdHolder->type(), uMediumId,
    31013101                                                        m_strMachineName, strMachineFolder,
    3102                                                         m_strMachineGuestOSTypeId);
     3102                                                        m_strMachineGuestOSTypeId, true /* enable create action: */);
    31033103
    31043104    if (iResult == UIMediumSelector::ReturnCode_Rejected ||
     
    38123812    int iResult = vboxGlobal().openMediumSelectorDialog(this, UIMediumDefs::mediumTypeToLocal(enmDevice), uMediumId,
    38133813                                                        m_strMachineName, strMachineFolder,
    3814                                                         m_strMachineGuestOSTypeId);
     3814                                                        m_strMachineGuestOSTypeId, true /* enable cr1eate action: */);
    38153815
    38163816    /* Continue only if iResult is either UIMediumSelector::ReturnCode_Accepted or UIMediumSelector::ReturnCode_LeftEmpty: */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic3.cpp

    r77212 r77217  
    6969                                                           fieldImp("machineBaseName").toString(),
    7070                                                           fieldImp("machineFolder").toString(),
    71                                                            fieldImp("type").value<CGuestOSType>().GetId());
     71                                                           fieldImp("type").value<CGuestOSType>().GetId(),
     72                                                           false /* don't show/enable the create action: */);
    7273
    7374    if (returnCode == static_cast<int>(UIMediumSelector::ReturnCode_Accepted) && !uMediumId.isNull())
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