VirtualBox

Ignore:
Timestamp:
May 4, 2018 8:04:48 AM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
122493
Message:

FE/Qt bugref:6769 Change the item delegate to UIFilePathSelector in 'Appliance Settings' view in import dialogs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.cpp

    r71355 r72101  
    3737# include "UIApplianceEditorWidget.h"
    3838# include "UIConverter.h"
     39# include "UIFilePathSelector.h"
    3940# include "UIIconPool.h"
    4041# include "UILineTextEdit.h"
     
    665666            case KVirtualSystemDescriptionType_HardDiskImage:
    666667            {
    667                 /* disabled for now
    668668                   UIFilePathSelector *pFileChooser = new UIFilePathSelector(pParent);
    669                    pFileChooser->setMode(UIFilePathSelector::Mode_File);
     669                   pFileChooser->setMode(UIFilePathSelector::Mode_File_Save);
    670670                   pFileChooser->setResetEnabled(false);
    671                    */
    672                 QLineEdit *pLineEdit = new QLineEdit(pParent);
    673                 pEditor = pLineEdit;
     671                   pEditor = pFileChooser;
    674672                break;
    675673            }
     
    753751        case KVirtualSystemDescriptionType_HardDiskImage:
    754752        {
    755             /* disabled for now
    756                if (UIFilePathSelector *pFileChooser = qobject_cast<UIFilePathSelector*>(pEditor))
    757                {
    758                pFileChooser->setPath(m_strConfigValue);
    759                }
    760                */
    761             if (QLineEdit *pLineEdit = qobject_cast<QLineEdit*>(pEditor))
    762             {
    763                 pLineEdit->setText(m_strConfigValue);
     753            if (UIFilePathSelector *pFileChooser = qobject_cast<UIFilePathSelector*>(pEditor))
     754            {
     755                pFileChooser->setPath(m_strConfigValue);
    764756                fDone = true;
    765757            }
     
    886878        case KVirtualSystemDescriptionType_HardDiskImage:
    887879        {
    888             /* disabled for now
    889                if (UIFilePathSelector *pFileChooser = qobject_cast<UIFilePathSelector*>(pEditor))
    890                {
    891                m_strConfigValue = pFileChooser->path();
    892                }
    893                */
    894             if (QLineEdit *pLineEdit = qobject_cast<QLineEdit*>(pEditor))
    895             {
    896                 m_strConfigValue = pLineEdit->text();
     880            if (UIFilePathSelector *pFileChooser = qobject_cast<UIFilePathSelector*>(pEditor))
     881            {
     882                m_strConfigValue = pFileChooser->path();
    897883                fDone = true;
    898884            }
     
    11401126    QWidget *pEditor = pItem->createEditor(pParent, styleOption, index);
    11411127
     1128    if (!pEditor)
     1129        return QItemDelegate::createEditor(pParent, styleOption, index);
     1130
    11421131    /* Allow UILineTextEdit to commit data early: */
    1143     if (pEditor && qobject_cast<UILineTextEdit*>(pEditor))
     1132    if (qobject_cast<UILineTextEdit*>(pEditor))
    11441133        connect(pEditor, SIGNAL(sigFinished(QWidget*)), this, SIGNAL(commitData(QWidget*)));
    11451134
    1146     if (pEditor == 0)
    1147         return QItemDelegate::createEditor(pParent, styleOption, index);
    1148     else
    1149         return pEditor;
     1135    return pEditor;
    11501136}
    11511137
     
    14431429    }
    14441430}
    1445 
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette