Changeset 34334 in vbox
- Timestamp:
- Nov 24, 2010 5:32:43 PM (14 years ago)
- 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 2563 2563 /* Open some external medium using file open dialog 2564 2564 * and temporary cache (enumerate) it in GUI inner mediums cache: */ 2565 QString VBoxGlobal::openMediumWithFileOpenDialog(VBoxDefs::MediumType mediumType, QWidget *pParent ) const2565 QString VBoxGlobal::openMediumWithFileOpenDialog(VBoxDefs::MediumType mediumType, QWidget *pParent, const QString &strDefaultFolder) const 2566 2566 { 2567 2567 /* Initialize variables: */ 2568 2568 CVirtualBox vbox = vboxGlobal().virtualBox(); 2569 QString strHomeFolder = vbox.GetHomeFolder();2569 QString strHomeFolder = strDefaultFolder.isEmpty() ? vbox.GetHomeFolder() : strDefaultFolder; 2570 2570 QList < QPair <QString, QString> > filters; 2571 2571 QStringList backends; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r34275 r34334 590 590 } 591 591 592 QString openMediumWithFileOpenDialog(VBoxDefs::MediumType mediumType, QWidget *pParent = 0 ) const;592 QString openMediumWithFileOpenDialog(VBoxDefs::MediumType mediumType, QWidget *pParent = 0, const QString &strDefaultFolder = QString()) const; 593 593 594 594 /* Returns the number of current running Fe/Qt4 main windows. */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp
r34329 r34334 2475 2475 void UIMachineSettingsStorage::sltChooseExistingMedium() 2476 2476 { 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); 2478 2479 if (!strMediumId.isNull()) 2479 2480 m_pMediumIdHolder->setId(strMediumId); … … 2807 2808 Assert(mStorageModel->data(index, StorageModel::R_IsMoreAttachmentsPossible).toBool()); 2808 2809 QString strControllerName(mStorageModel->data(index, StorageModel::R_CtrName).toString()); 2810 QString strMachineFolder(QFileInfo(m_machine.GetSettingsFilePath()).absolutePath()); 2809 2811 2810 2812 QString strMediumId; … … 2817 2819 strMediumId = getWithNewHDWizard(); 2818 2820 else if (iAnswer == QIMessageBox::No) 2819 strMediumId = vboxGlobal().openMediumWithFileOpenDialog(VBoxDefs::MediumType_HardDisk, this );2821 strMediumId = vboxGlobal().openMediumWithFileOpenDialog(VBoxDefs::MediumType_HardDisk, this, strMachineFolder); 2820 2822 break; 2821 2823 } … … 2824 2826 int iAnswer = vboxProblem().askAboutOpticalAttachmentCreation(this, strControllerName); 2825 2827 if (iAnswer == QIMessageBox::Yes) 2826 strMediumId = vboxGlobal().openMediumWithFileOpenDialog(VBoxDefs::MediumType_DVD, this );2828 strMediumId = vboxGlobal().openMediumWithFileOpenDialog(VBoxDefs::MediumType_DVD, this, strMachineFolder); 2827 2829 else if (iAnswer == QIMessageBox::No) 2828 2830 strMediumId = vboxGlobal().findMedium(strMediumId).id(); … … 2833 2835 int iAnswer = vboxProblem().askAboutFloppyAttachmentCreation(this, strControllerName); 2834 2836 if (iAnswer == QIMessageBox::Yes) 2835 strMediumId = vboxGlobal().openMediumWithFileOpenDialog(VBoxDefs::MediumType_Floppy, this );2837 strMediumId = vboxGlobal().openMediumWithFileOpenDialog(VBoxDefs::MediumType_Floppy, this, strMachineFolder); 2836 2838 else if (iAnswer == QIMessageBox::No) 2837 2839 strMediumId = vboxGlobal().findMedium(strMediumId).id();
Note:
See TracChangeset
for help on using the changeset viewer.