VirtualBox

Changeset 34334 in vbox


Ignore:
Timestamp:
Nov 24, 2010 5:32:43 PM (14 years ago)
Author:
vboxsync
Message:

FE/Qt: Fix for r68089 - Initial path for "existing mediums" set to machine's folder.

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

Legend:

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

    r34276 r34334  
    25632563/* Open some external medium using file open dialog
    25642564 * and temporary cache (enumerate) it in GUI inner mediums cache: */
    2565 QString VBoxGlobal::openMediumWithFileOpenDialog(VBoxDefs::MediumType mediumType, QWidget *pParent) const
     2565QString VBoxGlobal::openMediumWithFileOpenDialog(VBoxDefs::MediumType mediumType, QWidget *pParent, const QString &strDefaultFolder) const
    25662566{
    25672567    /* Initialize variables: */
    25682568    CVirtualBox vbox = vboxGlobal().virtualBox();
    2569     QString strHomeFolder = vbox.GetHomeFolder();
     2569    QString strHomeFolder = strDefaultFolder.isEmpty() ? vbox.GetHomeFolder() : strDefaultFolder;
    25702570    QList < QPair <QString, QString> > filters;
    25712571    QStringList backends;
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r34275 r34334  
    590590    }
    591591
    592     QString openMediumWithFileOpenDialog(VBoxDefs::MediumType mediumType, QWidget *pParent = 0) const;
     592    QString openMediumWithFileOpenDialog(VBoxDefs::MediumType mediumType, QWidget *pParent = 0, const QString &strDefaultFolder = QString()) const;
    593593
    594594    /* Returns the number of current running Fe/Qt4 main windows. */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp

    r34329 r34334  
    24752475void UIMachineSettingsStorage::sltChooseExistingMedium()
    24762476{
    2477     QString strMediumId = vboxGlobal().openMediumWithFileOpenDialog(m_pMediumIdHolder->type(), this);
     2477        QString strMachineFolder(QFileInfo(m_machine.GetSettingsFilePath()).absolutePath());
     2478    QString strMediumId = vboxGlobal().openMediumWithFileOpenDialog(m_pMediumIdHolder->type(), this, strMachineFolder);
    24782479    if (!strMediumId.isNull())
    24792480        m_pMediumIdHolder->setId(strMediumId);
     
    28072808    Assert(mStorageModel->data(index, StorageModel::R_IsMoreAttachmentsPossible).toBool());
    28082809    QString strControllerName(mStorageModel->data(index, StorageModel::R_CtrName).toString());
     2810    QString strMachineFolder(QFileInfo(m_machine.GetSettingsFilePath()).absolutePath());
    28092811
    28102812    QString strMediumId;
     
    28172819                strMediumId = getWithNewHDWizard();
    28182820            else if (iAnswer == QIMessageBox::No)
    2819                 strMediumId = vboxGlobal().openMediumWithFileOpenDialog(VBoxDefs::MediumType_HardDisk, this);
     2821                strMediumId = vboxGlobal().openMediumWithFileOpenDialog(VBoxDefs::MediumType_HardDisk, this, strMachineFolder);
    28202822            break;
    28212823        }
     
    28242826            int iAnswer = vboxProblem().askAboutOpticalAttachmentCreation(this, strControllerName);
    28252827            if (iAnswer == QIMessageBox::Yes)
    2826                 strMediumId = vboxGlobal().openMediumWithFileOpenDialog(VBoxDefs::MediumType_DVD, this);
     2828                strMediumId = vboxGlobal().openMediumWithFileOpenDialog(VBoxDefs::MediumType_DVD, this, strMachineFolder);
    28272829            else if (iAnswer == QIMessageBox::No)
    28282830                strMediumId = vboxGlobal().findMedium(strMediumId).id();
     
    28332835            int iAnswer = vboxProblem().askAboutFloppyAttachmentCreation(this, strControllerName);
    28342836            if (iAnswer == QIMessageBox::Yes)
    2835                 strMediumId = vboxGlobal().openMediumWithFileOpenDialog(VBoxDefs::MediumType_Floppy, this);
     2837                strMediumId = vboxGlobal().openMediumWithFileOpenDialog(VBoxDefs::MediumType_Floppy, this, strMachineFolder);
    28362838            else if (iAnswer == QIMessageBox::No)
    28372839                strMediumId = vboxGlobal().findMedium(strMediumId).id();
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