Changeset 34822 in vbox
- Timestamp:
- Dec 8, 2010 9:19:56 AM (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
r34811 r34822 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, const QString &strDefaultFolder) const 2565 QString VBoxGlobal::openMediumWithFileOpenDialog(VBoxDefs::MediumType mediumType, QWidget *pParent, 2566 const QString &strDefaultFolder /* = QString() */, 2567 bool fUseLastFolder /* = false */) const 2566 2568 { 2567 2569 /* Initialize variables: */ 2568 2570 CVirtualBox vbox = vboxGlobal().virtualBox(); 2569 QString strHomeFolder = strDefaultFolder.isEmpty() ? vbox.GetHomeFolder() : strDefaultFolder; 2571 QString strHomeFolder = fUseLastFolder && !m_strLastFolder.isEmpty() ? m_strLastFolder : 2572 strDefaultFolder.isEmpty() ? vbox.GetHomeFolder() : strDefaultFolder; 2570 2573 QList < QPair <QString, QString> > filters; 2571 2574 QStringList backends; … … 2626 2629 /* Get location: */ 2627 2630 QString strLocation = files[0]; 2631 2632 /* Remember absolute path: */ 2633 m_strLastFolder = QFileInfo(strLocation).absolutePath(); 2628 2634 2629 2635 /* Open corresponding medium: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r34740 r34822 590 590 } 591 591 592 QString openMediumWithFileOpenDialog(VBoxDefs::MediumType mediumType, QWidget *pParent = 0, const QString &strDefaultFolder = QString()) const; 592 QString openMediumWithFileOpenDialog(VBoxDefs::MediumType mediumType, QWidget *pParent = 0, 593 const QString &strDefaultFolder = QString(), bool fUseLastFolder = false) const; 593 594 594 595 /* Returns the number of current running Fe/Qt4 main windows. */ … … 851 852 QString mUserDefinedPortName; 852 853 854 mutable QString m_strLastFolder; 855 853 856 QPixmap mWarningIcon, mErrorIcon; 854 857 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r34728 r34822 1292 1292 usedImages << medium.GetId(); 1293 1293 } 1294 /* Open VMM Dialog: */ 1295 QString strMediumId = vboxGlobal().openMediumWithFileOpenDialog(target.type, defaultMachineWindow()->machineWindow()); 1294 /* Call for file-open window: */ 1295 QString strMediumId = vboxGlobal().openMediumWithFileOpenDialog(target.type, defaultMachineWindow()->machineWindow(), 1296 QString(), true); 1296 1297 defaultMachineWindow()->machineView()->setFocus(); 1297 1298 if (!strMediumId.isNull())
Note:
See TracChangeset
for help on using the changeset viewer.