VirtualBox

Changeset 100333 in vbox for trunk/src


Ignore:
Timestamp:
Jun 29, 2023 5:15:20 PM (18 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9080. Now we add imported ISO file path to VISO content.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/medium/viso
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoContentBrowser.cpp

    r100330 r100333  
    282282    QList<ISOFileObject> objectList = openAndReadISODir(strISOFilePath, strDirPath);
    283283
     284    /* Update import ISO path and effectively add it to VISO file content if ISO reading has succeeds: */
     285    if (!objectList.isEmpty())
     286        setImportedISOPath(strISOFilePath);
     287
    284288    for (int i = 0; i < objectList.size(); ++i)
    285289    {
     
    304308        //     pAddedItem->setIsSymLinkToADirectory(QFileInfo(fileInfo.symLinkTarget()).isDir());
    305309        // }
    306         createVisoEntry(pAddedItem);
     310        //createVisoEntry(pAddedItem);
    307311    }
    308312    if (m_pTableProxyModel)
     
    595599}
    596600
     601const QString &UIVisoContentBrowser::importedISOPath() const
     602{
     603    return m_strImportedISOPath;
     604}
     605
     606void UIVisoContentBrowser::setImportedISOPath(const QString &strPath)
     607{
     608    if (m_strImportedISOPath == strPath)
     609        return;
     610    m_strImportedISOPath = strPath;
     611}
     612
    597613void UIVisoContentBrowser::prepareConnections()
    598614{
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoContentBrowser.h

    r100330 r100333  
    7676    void prepareMainMenu(QMenu *pMenu);
    7777
     78    const QString &importedISOPath() const;
     79    void setImportedISOPath(const QString &strPath);
     80
    7881public slots:
    7982
     
    111114    UICustomFileSystemItem *startItem();
    112115
    113     /** @name Index conversion functions. These are half-smart and tries to determine the source model before conversion.
    114       * @{ */
    115         QModelIndex         convertIndexToTableIndex(const QModelIndex &index);
    116     /** @} */
     116    QModelIndex             convertIndexToTableIndex(const QModelIndex &index);
    117117    /** Lists the content of the host file system directory by using Qt file system API. */
    118118    void                    scanHostDirectory(UICustomFileSystemItem *directory);
     
    133133    bool                           onStartItem();
    134134    void                           goUp();
    135     UIVisoContentTableView       *m_pTableView;
    136     UICustomFileSystemModel      *m_pModel;
    137     UICustomFileSystemProxyModel *m_pTableProxyModel;
     135    UIVisoContentTableView        *m_pTableView;
     136    UICustomFileSystemModel       *m_pModel;
     137    UICustomFileSystemProxyModel  *m_pTableProxyModel;
    138138
    139139    QString                       m_strVisoName;
     140    QString                       m_strImportedISOPath;
    140141    /** keys of m_entryMap are iso locations and values are
    141142     *  local location of file objects. these keys and values are
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.cpp

    r100329 r100333  
    288288}
    289289
     290QString UIVisoCreatorWidget::importedISOPath() const
     291{
     292    if (!m_pVISOContentBrowser)
     293        return QString();
     294    return m_pVISOContentBrowser->importedISOPath();
     295}
     296
    290297const QString &UIVisoCreatorWidget::visoName() const
    291298{
     
    656663    {
    657664        QStringList VisoEntryList = pVisoCreator->entryList();
    658 
    659         if (VisoEntryList.empty() || VisoEntryList[0].isEmpty())
     665        QString strImportedISOPath = pVisoCreator->importedISOPath();
     666        if ((VisoEntryList.empty() || VisoEntryList[0].isEmpty()) && strImportedISOPath.isEmpty())
    660667        {
    661668            delete pVisoCreator;
     
    673680            stream << QString("%1 %2").arg("--iprt-iso-maker-file-marker-bourne-sh").arg(QUuid::createUuid().toString()) << "\n";
    674681            stream<< "--volume-id=" << strVisoName << "\n";
     682            if (!strImportedISOPath.isEmpty())
     683                stream << "--import-iso=" << strImportedISOPath;
    675684            stream << VisoEntryList.join("\n");
    676685            if (!pVisoCreator->customOptions().isEmpty())
     
    725734}
    726735
     736QString UIVisoCreatorDialog::importedISOPath() const
     737{
     738    if (m_pVisoCreatorWidget)
     739        return m_pVisoCreatorWidget->importedISOPath();
     740    return QString();
     741}
     742
    727743QStringList UIVisoCreatorDialog::customOptions() const
    728744{
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.h

    r100320 r100333  
    9090    /** Returns the content of the .viso file. Each element of the list corresponds to a line in the .viso file. */
    9191    QStringList       entryList() const;
     92    QString           importedISOPath() const;
    9293    const QString    &visoName() const;
    9394    /** Returns custom ISO options (if any). */
     
    174175    QStringList  entryList() const;
    175176    QString visoName() const;
     177    QString importedISOPath() const;
    176178    QStringList customOptions() const;
    177179    QString currentPath() const;
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