VirtualBox

Ignore:
Timestamp:
Dec 13, 2017 3:02:26 PM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9080 Some adjustments to the ad hoc VISO mockup.

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  
    7575const char* UIExtraDataDefs::GUI_RecentFolderCD = "GUI/RecentFolderCD";
    7676const char* UIExtraDataDefs::GUI_RecentFolderFD = "GUI/RecentFolderFD";
     77const char* UIExtraDataDefs::GUI_RecentFolderVISOContent = "GUI/RecentFolderVISOContent";
    7778const char* UIExtraDataDefs::GUI_RecentListHD = "GUI/RecentListHD";
    7879const char* UIExtraDataDefs::GUI_RecentListCD = "GUI/RecentListCD";
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h

    r69722 r70113  
    124124        /** Holds recent folder for floppy-disks. */
    125125        extern const char* GUI_RecentFolderFD;
     126        /** Holds recent folder for VISO creation content. */
     127        extern const char* GUI_RecentFolderVISOContent;
    126128        /** Holds the list of recently used hard-drives. */
    127129        extern const char* GUI_RecentListHD;
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r69726 r70113  
    19501950           << GUI_ActivateHoveredMachineWindow
    19511951           << GUI_Input_SelectorShortcuts << GUI_Input_MachineShortcuts
    1952            << GUI_RecentFolderHD << GUI_RecentFolderCD << GUI_RecentFolderFD
     1952           << GUI_RecentFolderHD << GUI_RecentFolderCD << GUI_RecentFolderFD << GUI_RecentFolderVISOContent
    19531953           << GUI_RecentListHD << GUI_RecentListCD << GUI_RecentListFD
    19541954           << GUI_LastSelectorWindowPosition << GUI_SplitterSizes
     
    25362536}
    25372537
     2538QString UIExtraDataManager::recentFolderForVISOContent()
     2539{
     2540    return extraDataString(GUI_RecentFolderVISOContent);
     2541}
     2542
    25382543void UIExtraDataManager::setRecentFolderForHardDrives(const QString &strValue)
    25392544{
     
    25492554{
    25502555    setExtraDataString(GUI_RecentFolderFD, strValue);
     2556}
     2557
     2558void UIExtraDataManager::setRecentFolderForVISOContent(const QString &strValue)
     2559{
     2560    setExtraDataString(GUI_RecentFolderVISOContent, strValue);
    25512561}
    25522562
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h

    r69722 r70113  
    263263        /** Returns recent folder for floppy-disks. */
    264264        QString recentFolderForFloppyDisks();
     265        /** Returns recent folder for VISO creation content. */
     266        QString recentFolderForVISOContent();
    265267        /** Defines recent folder for hard-drives as @a strValue. */
    266268        void setRecentFolderForHardDrives(const QString &strValue);
     
    269271        /** Defines recent folder for floppy-disk as @a strValue. */
    270272        void setRecentFolderForFloppyDisks(const QString &strValue);
     273        /** Defines recent folder for VISO creation content as @a strValue. */
     274        void setRecentFolderForVISOContent(const QString &strValue);
    271275
    272276        /** Returns the list of recently used hard-drives. */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r70111 r70113  
    10421042 * @returns Medium ID string, empty on abort.
    10431043 */
    1044 QString VBoxGlobal::createVisoMediumWithFileOpenDialog(QWidget *pParent, const QString &strMachineFolder, bool fUseLastFolder)
     1044QString VBoxGlobal::createVisoMediumWithFileOpenDialog(QWidget *pParent, const QString &strMachineFolder)
    10451045{
    10461046    AssertReturn(!strMachineFolder.isEmpty(), QString());
    10471047
    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. */
    10571056    /** @todo make it possible to select directories... */
    1058     QStringList files = QIFileDialog::getOpenFileNames(strHomeFolder, tr("All files (*)"), pParent,
     1057    QStringList files = QIFileDialog::getOpenFileNames(strDirectory, tr("All files (*)"), pParent,
    10591058                                                       /// @todo tr("Please select files and directories to be on the VISO"),
    10601059                                                       tr("Please select files to be on the VISO"),
     
    10641063    if (files.empty() || files[0].isEmpty())
    10651064        return QString();
     1065
     1066    /* Remember folder for the next time. */
     1067    gEDataManager->setRecentFolderForVISOContent(QFileInfo(files[0]).absolutePath());
    10661068
    10671069    /* Produce the VISO. */
     
    11081110        return openMedium(UIMediumType_DVD, QString(szVisoPath), pParent);
    11091111
    1110     /** @todo error message.   */
     1112    /** @todo error message. */
    11111113    return QString();
    11121114}
     
    15141516                                                                                      strMachineFolder)
    15151517                                          : vboxGlobal().createVisoMediumWithFileOpenDialog(windowManager().mainWindowShown(),
    1516                                                                                             strMachineFolder, true /*fUseLastFolder*/);
     1518                                                                                            strMachineFolder);
    15171519                /* Return focus back: */
    15181520                if (pLastFocusedWidget)
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r70111 r70113  
    313313    void createMedium(const UIMedium &medium);
    314314    void deleteMedium(const QString &strMediumID);
    315     QString createVisoMediumWithFileOpenDialog(QWidget *pParent, const QString &strMachineFolder, bool fUseLastFolder);
     315    QString createVisoMediumWithFileOpenDialog(QWidget *pParent, const QString &strMachineFolder);
    316316    QString openMediumWithFileOpenDialog(UIMediumType mediumType, QWidget *pParent = 0,
    317317                                         const QString &strDefaultFolder = QString(), bool fUseLastFolder = true);
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