Changeset 72101 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- May 4, 2018 8:04:48 AM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 122493
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.cpp
r71355 r72101 37 37 # include "UIApplianceEditorWidget.h" 38 38 # include "UIConverter.h" 39 # include "UIFilePathSelector.h" 39 40 # include "UIIconPool.h" 40 41 # include "UILineTextEdit.h" … … 665 666 case KVirtualSystemDescriptionType_HardDiskImage: 666 667 { 667 /* disabled for now668 668 UIFilePathSelector *pFileChooser = new UIFilePathSelector(pParent); 669 pFileChooser->setMode(UIFilePathSelector::Mode_File );669 pFileChooser->setMode(UIFilePathSelector::Mode_File_Save); 670 670 pFileChooser->setResetEnabled(false); 671 */ 672 QLineEdit *pLineEdit = new QLineEdit(pParent); 673 pEditor = pLineEdit; 671 pEditor = pFileChooser; 674 672 break; 675 673 } … … 753 751 case KVirtualSystemDescriptionType_HardDiskImage: 754 752 { 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); 764 756 fDone = true; 765 757 } … … 886 878 case KVirtualSystemDescriptionType_HardDiskImage: 887 879 { 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(); 897 883 fDone = true; 898 884 } … … 1140 1126 QWidget *pEditor = pItem->createEditor(pParent, styleOption, index); 1141 1127 1128 if (!pEditor) 1129 return QItemDelegate::createEditor(pParent, styleOption, index); 1130 1142 1131 /* Allow UILineTextEdit to commit data early: */ 1143 if ( pEditor &&qobject_cast<UILineTextEdit*>(pEditor))1132 if (qobject_cast<UILineTextEdit*>(pEditor)) 1144 1133 connect(pEditor, SIGNAL(sigFinished(QWidget*)), this, SIGNAL(commitData(QWidget*))); 1145 1134 1146 if (pEditor == 0) 1147 return QItemDelegate::createEditor(pParent, styleOption, index); 1148 else 1149 return pEditor; 1135 return pEditor; 1150 1136 } 1151 1137 … … 1443 1429 } 1444 1430 } 1445
Note:
See TracChangeset
for help on using the changeset viewer.