Changeset 70113 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Dec 13, 2017 3:02:26 PM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp
r69722 r70113 75 75 const char* UIExtraDataDefs::GUI_RecentFolderCD = "GUI/RecentFolderCD"; 76 76 const char* UIExtraDataDefs::GUI_RecentFolderFD = "GUI/RecentFolderFD"; 77 const char* UIExtraDataDefs::GUI_RecentFolderVISOContent = "GUI/RecentFolderVISOContent"; 77 78 const char* UIExtraDataDefs::GUI_RecentListHD = "GUI/RecentListHD"; 78 79 const char* UIExtraDataDefs::GUI_RecentListCD = "GUI/RecentListCD"; -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r69722 r70113 124 124 /** Holds recent folder for floppy-disks. */ 125 125 extern const char* GUI_RecentFolderFD; 126 /** Holds recent folder for VISO creation content. */ 127 extern const char* GUI_RecentFolderVISOContent; 126 128 /** Holds the list of recently used hard-drives. */ 127 129 extern const char* GUI_RecentListHD; -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r69726 r70113 1950 1950 << GUI_ActivateHoveredMachineWindow 1951 1951 << GUI_Input_SelectorShortcuts << GUI_Input_MachineShortcuts 1952 << GUI_RecentFolderHD << GUI_RecentFolderCD << GUI_RecentFolderFD 1952 << GUI_RecentFolderHD << GUI_RecentFolderCD << GUI_RecentFolderFD << GUI_RecentFolderVISOContent 1953 1953 << GUI_RecentListHD << GUI_RecentListCD << GUI_RecentListFD 1954 1954 << GUI_LastSelectorWindowPosition << GUI_SplitterSizes … … 2536 2536 } 2537 2537 2538 QString UIExtraDataManager::recentFolderForVISOContent() 2539 { 2540 return extraDataString(GUI_RecentFolderVISOContent); 2541 } 2542 2538 2543 void UIExtraDataManager::setRecentFolderForHardDrives(const QString &strValue) 2539 2544 { … … 2549 2554 { 2550 2555 setExtraDataString(GUI_RecentFolderFD, strValue); 2556 } 2557 2558 void UIExtraDataManager::setRecentFolderForVISOContent(const QString &strValue) 2559 { 2560 setExtraDataString(GUI_RecentFolderVISOContent, strValue); 2551 2561 } 2552 2562 -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r69722 r70113 263 263 /** Returns recent folder for floppy-disks. */ 264 264 QString recentFolderForFloppyDisks(); 265 /** Returns recent folder for VISO creation content. */ 266 QString recentFolderForVISOContent(); 265 267 /** Defines recent folder for hard-drives as @a strValue. */ 266 268 void setRecentFolderForHardDrives(const QString &strValue); … … 269 271 /** Defines recent folder for floppy-disk as @a strValue. */ 270 272 void setRecentFolderForFloppyDisks(const QString &strValue); 273 /** Defines recent folder for VISO creation content as @a strValue. */ 274 void setRecentFolderForVISOContent(const QString &strValue); 271 275 272 276 /** Returns the list of recently used hard-drives. */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r70111 r70113 1042 1042 * @returns Medium ID string, empty on abort. 1043 1043 */ 1044 QString VBoxGlobal::createVisoMediumWithFileOpenDialog(QWidget *pParent, const QString &strMachineFolder , bool fUseLastFolder)1044 QString VBoxGlobal::createVisoMediumWithFileOpenDialog(QWidget *pParent, const QString &strMachineFolder) 1045 1045 { 1046 1046 AssertReturn(!strMachineFolder.isEmpty(), QString()); 1047 1047 1048 /* Where to start browsing for content. */ 1049 QString strLastFolder = gEDataManager->recentFolderForOpticalDisks(); 1050 if (strLastFolder.isEmpty()) 1051 strLastFolder = gEDataManager->recentFolderForFloppyDisks(); 1052 if (strLastFolder.isEmpty()) 1053 strLastFolder = gEDataManager->recentFolderForHardDrives(); 1054 QString strHomeFolder = fUseLastFolder && !strLastFolder.isEmpty() ? strLastFolder : strMachineFolder; 1055 1056 /* Execute the open file dialog: */ 1048 /* Figure out where to start browsing for content. */ 1049 QString strDirectory = gEDataManager->recentFolderForVISOContent(); 1050 if (strDirectory.isEmpty()) 1051 strDirectory = QDir::homePath(); 1052 if (strDirectory.isEmpty()) 1053 strDirectory = homeFolder(); 1054 1055 /* Execute the open file dialog, getting a list of files & dirs back. */ 1057 1056 /** @todo make it possible to select directories... */ 1058 QStringList files = QIFileDialog::getOpenFileNames(str HomeFolder, tr("All files (*)"), pParent,1057 QStringList files = QIFileDialog::getOpenFileNames(strDirectory, tr("All files (*)"), pParent, 1059 1058 /// @todo tr("Please select files and directories to be on the VISO"), 1060 1059 tr("Please select files to be on the VISO"), … … 1064 1063 if (files.empty() || files[0].isEmpty()) 1065 1064 return QString(); 1065 1066 /* Remember folder for the next time. */ 1067 gEDataManager->setRecentFolderForVISOContent(QFileInfo(files[0]).absolutePath()); 1066 1068 1067 1069 /* Produce the VISO. */ … … 1108 1110 return openMedium(UIMediumType_DVD, QString(szVisoPath), pParent); 1109 1111 1110 /** @todo error message. 1112 /** @todo error message. */ 1111 1113 return QString(); 1112 1114 } … … 1514 1516 strMachineFolder) 1515 1517 : vboxGlobal().createVisoMediumWithFileOpenDialog(windowManager().mainWindowShown(), 1516 strMachineFolder , true /*fUseLastFolder*/);1518 strMachineFolder); 1517 1519 /* Return focus back: */ 1518 1520 if (pLastFocusedWidget) -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r70111 r70113 313 313 void createMedium(const UIMedium &medium); 314 314 void deleteMedium(const QString &strMediumID); 315 QString createVisoMediumWithFileOpenDialog(QWidget *pParent, const QString &strMachineFolder , bool fUseLastFolder);315 QString createVisoMediumWithFileOpenDialog(QWidget *pParent, const QString &strMachineFolder); 316 316 QString openMediumWithFileOpenDialog(UIMediumType mediumType, QWidget *pParent = 0, 317 317 const QString &strDefaultFolder = QString(), bool fUseLastFolder = true);
Note:
See TracChangeset
for help on using the changeset viewer.