VirtualBox

Changeset 91365 in vbox


Ignore:
Timestamp:
Sep 24, 2021 2:42:48 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
147035
Message:

FE/Qt: bugref:9340. Selecting the current medium as medium selector starts.

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

Legend:

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

    r91363 r91365  
    18501850}
    18511851
    1852 int UICommon::openMediumSelectorDialog(QWidget *pParent, UIMediumDeviceType  enmMediumType, QUuid &outUuid,
     1852int UICommon::openMediumSelectorDialog(QWidget *pParent, UIMediumDeviceType  enmMediumType, QUuid &inOutUuid,
    18531853                                       const QString &strMachineFolder, const QString &strMachineName,
    18541854                                       const QString &strMachineGuestOSTypeId, bool fEnableCreate, const QUuid &uMachineID /* = QUuid() */)
     
    18571857
    18581858    QWidget *pDialogParent = windowManager().realParentWindow(pParent);
    1859     QPointer<UIMediumSelector> pSelector = new UIMediumSelector(enmMediumType, strMachineName,
     1859    QPointer<UIMediumSelector> pSelector = new UIMediumSelector(inOutUuid, enmMediumType, strMachineName,
    18601860                                                                strMachineFolder, strMachineGuestOSTypeId,
    18611861                                                                uMachineOrGlobalId, pDialogParent);
     
    18831883        else
    18841884        {
    1885             outUuid = selectedMediumIds[0];
    1886             updateRecentlyUsedMediumListAndFolder(enmMediumType, medium(outUuid).location());
     1885            inOutUuid = selectedMediumIds[0];
     1886            updateRecentlyUsedMediumListAndFolder(enmMediumType, medium(inOutUuid).location());
    18871887        }
    18881888    }
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h

    r91341 r91365  
    407407          * @param  parent                   Passes the parent of the dialog,
    408408          * @param  enmMediumType            Passes the medium type.
     409          * @param  inOutUuid                Passes the currently selected medium id if there is one.
     410          * @param  strMachineFolder         Passes the machine folder,
    409411          * @param  strMachineName           Passes the name of the machine,
    410           * @param  strMachineFolder         Passes the machine folder,
    411412          * @param  strMachineGuestOSTypeId  Passes the type ID of machine's guest os,
    412413          * @param  fEnableCreate            Passes whether to show/enable create action in the medium selector dialog,
    413414          * @param  uMachineID               Passes the machine UUID,
    414415          * returns the return code of the UIMediumSelector::ReturnCode as int. In case of a medium selection
    415           *         UUID of the selected medium is stored in @param outUuid.*/
    416         int openMediumSelectorDialog(QWidget *pParent, UIMediumDeviceType  enmMediumType, QUuid &outUuid,
     416          *         UUID of the selected medium is stored in @param inOutUuid.*/
     417        int openMediumSelectorDialog(QWidget *pParent, UIMediumDeviceType  enmMediumType, QUuid &inOutUuid,
    417418                                     const QString &strMachineFolder, const QString &strMachineName,
    418419                                     const QString &strMachineGuestOSTypeId, bool fEnableCreate, const QUuid &uMachineID = QUuid());
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.cpp

    r91353 r91365  
    5353
    5454
    55 UIMediumSelector::UIMediumSelector(UIMediumDeviceType enmMediumType, const QString &machineName,
     55UIMediumSelector::UIMediumSelector(const QUuid &uCurrentMediumId, UIMediumDeviceType enmMediumType, const QString &machineName,
    5656                                   const QString &machineSettingsFilePath, const QString &strMachineGuestOSTypeId,
    5757                                   const QUuid &uMachineID, QWidget *pParent)
     
    8585    configure();
    8686    finalize();
     87    selectMedium(uCurrentMediumId);
    8788}
    8889
     
    554555void UIMediumSelector::selectMedium(const QUuid &uMediumID)
    555556{
    556     if (!m_pTreeWidget)
     557    if (!m_pTreeWidget || uMediumID.isNull())
    557558        return;
    558559    UIMediumItem *pMediumItem = searchItem(0, uMediumID);
     
    618619    if (m_pParent)
    619620        UIDesktopWidgetWatchdog::centerWidget(this, m_pParent, false);
     621
     622    if (m_pTreeWidget)
     623        m_pTreeWidget->setFocus();
    620624}
    621625
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.h

    r90326 r91365  
    5151public:
    5252
    53     UIMediumSelector(UIMediumDeviceType enmMediumType, const QString &machineName,
     53    UIMediumSelector(const QUuid &uCurrentMediumId, UIMediumDeviceType enmMediumType, const QString &machineName,
    5454                     const QString &machineSettingsFilePath, const QString &strMachineGuestOSTypeId,
    5555                     const QUuid &uMachineID, QWidget *pParent);
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp

    r88447 r91365  
    40034003
    40044004    QUuid uMediumId;
    4005     int iResult = uiCommon().openMediumSelectorDialog(this, m_pMediumIdHolder->type(), uMediumId,
     4005    if (m_pMediumIdHolder)
     4006        uMediumId = m_pMediumIdHolder->id();
     4007
     4008    int iResult = uiCommon().openMediumSelectorDialog(this, m_pMediumIdHolder->type(), uMediumId /* in/out parameter */,
    40064009                                                      strMachineFolder, m_strMachineName,
    40074010                                                      m_strMachineGuestOSTypeId,
Note: See TracChangeset for help on using the changeset viewer.

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