- Timestamp:
- Jun 13, 2018 2:24:53 PM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.cpp
r72527 r72545 194 194 /** Cache currently stored values, such as @a finalStates, @a finalValues and @a finalExtraValues. */ 195 195 virtual void putBack(QVector<BOOL> &finalStates, QVector<QString> &finalValues, QVector<QString> &finalExtraValues) /* override */; 196 197 KVirtualSystemDescriptionType systemDescriptionType() const; 196 198 197 199 private: … … 287 289 childItem(i)->putBack(finalStates, finalValues, finalExtraValues); 288 290 } 289 290 291 291 292 /********************************************************************************************************************************* … … 523 524 case KVirtualSystemDescriptionType_SoundCard: value = UIIconPool::iconSet(":/sound_16px.png"); break; 524 525 case KVirtualSystemDescriptionType_BaseFolder: value = vboxGlobal().icon(QFileIconProvider::Folder); break; 525 case KVirtualSystemDescriptionType_PrimaryGroup: 526 case KVirtualSystemDescriptionType_PrimaryGroup: value = UIIconPool::iconSet(":/vm_group_name_16px.png"); break; 526 527 default: break; 527 528 } … … 918 919 { 919 920 m_strConfigValue = pComboBox->itemData(pComboBox->currentIndex()).toString(); 920 printf("%s\n", qPrintable(pComboBox->itemData(pComboBox->currentIndex()).toString()));921 921 fDone = true; 922 922 } … … 964 964 } 965 965 966 967 KVirtualSystemDescriptionType UIVirtualHardwareItem::systemDescriptionType() const 968 { 969 return m_enmVSDType; 970 } 966 971 967 972 /********************************************************************************************************************************* … … 1162 1167 } 1163 1168 1169 1170 void UIApplianceModel::setVirtualSystemBaseFolder(const QString& path) 1171 { 1172 if (!m_pRootItem) 1173 return; 1174 /* For each Virtual System: */ 1175 for (int i = 0; i < m_pRootItem->childCount(); ++i) 1176 { 1177 UIVirtualSystemItem *pVirtualSystem = dynamic_cast<UIVirtualSystemItem*>(m_pRootItem->childItem(i)); 1178 if (!pVirtualSystem) 1179 continue; 1180 int iItemCount = pVirtualSystem->childCount(); 1181 for (int j = 0; j < iItemCount; ++j) 1182 { 1183 UIVirtualHardwareItem *pHardwareItem = dynamic_cast<UIVirtualHardwareItem*>(pVirtualSystem->childItem(j)); 1184 if (!pHardwareItem) 1185 continue; 1186 if (pHardwareItem->systemDescriptionType() != KVirtualSystemDescriptionType_BaseFolder) 1187 continue; 1188 QVariant data(path); 1189 pHardwareItem->setData(ApplianceViewSection_ConfigValue, data, Qt::EditRole); 1190 QModelIndex index = createIndex(pHardwareItem->row(), 0, pHardwareItem); 1191 emit dataChanged(index, index); 1192 } 1193 } 1194 } 1164 1195 1165 1196 /********************************************************************************************************************************* … … 1369 1400 1370 1401 /* Create layout: */ 1371 QVBoxLayout *pLayout = new QVBoxLayout(this);1402 m_pLayout = new QVBoxLayout(this); 1372 1403 { 1373 1404 /* Configure information layout: */ 1374 pLayout->setContentsMargins(0, 0, 0, 0);1405 m_pLayout->setContentsMargins(0, 0, 0, 0); 1375 1406 1376 1407 /* Create information pane: */ … … 1378 1409 { 1379 1410 /* Create information layout: */ 1380 QVBoxLayout * pLayoutInformation = new QVBoxLayout(m_pPaneInformation);1411 QVBoxLayout *m_pLayoutInformation = new QVBoxLayout(m_pPaneInformation); 1381 1412 { 1382 1413 /* Configure information layout: */ 1383 pLayoutInformation->setContentsMargins(0, 0, 0, 0);1414 m_pLayoutInformation->setContentsMargins(0, 0, 0, 0); 1384 1415 1385 1416 /* Create tree-view: */ … … 1394 1425 1395 1426 /* Add tree-view into information layout: */ 1396 pLayoutInformation->addWidget(m_pTreeViewSettings);1427 m_pLayoutInformation->addWidget(m_pTreeViewSettings); 1397 1428 } 1398 1429 … … 1404 1435 1405 1436 /* Add tree-view into information layout: */ 1406 pLayoutInformation->addWidget(m_pCheckBoxReinitMACs);1437 m_pLayoutInformation->addWidget(m_pCheckBoxReinitMACs); 1407 1438 } 1408 1439 } 1409 1440 1410 1441 /* Add information pane into layout: */ 1411 pLayout->addWidget(m_pPaneInformation);1442 m_pLayout->addWidget(m_pPaneInformation); 1412 1443 } 1413 1444 … … 1420 1451 1421 1452 /* Create warning layout: */ 1422 QVBoxLayout * pLayoutWarning = new QVBoxLayout(m_pPaneWarning);1453 QVBoxLayout *m_pLayoutWarning = new QVBoxLayout(m_pPaneWarning); 1423 1454 { 1424 1455 /* Configure warning layout: */ 1425 pLayoutWarning->setContentsMargins(0, 0, 0, 0);1456 m_pLayoutWarning->setContentsMargins(0, 0, 0, 0); 1426 1457 1427 1458 /* Create label: */ … … 1429 1460 { 1430 1461 /* Add label into warning layout: */ 1431 pLayoutWarning->addWidget(m_pLabelWarning);1462 m_pLayoutWarning->addWidget(m_pLabelWarning); 1432 1463 } 1433 1464 … … 1441 1472 1442 1473 /* Add text-edit into warning layout: */ 1443 pLayoutWarning->addWidget(m_pTextEditWarning);1474 m_pLayoutWarning->addWidget(m_pTextEditWarning); 1444 1475 } 1445 1476 } 1446 1477 1447 1478 /* Add warning pane into layout: */ 1448 pLayout->addWidget(m_pPaneWarning);1479 m_pLayout->addWidget(m_pPaneWarning); 1449 1480 } 1450 1481 } … … 1488 1519 } 1489 1520 } 1521 1522 void UIApplianceEditorWidget::setVirtualSystemBaseFolder(const QString& path) 1523 { 1524 if (!m_pModel) 1525 return; 1526 m_pModel->setVirtualSystemBaseFolder(path); 1527 } -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.h
r69500 r72545 38 38 class QTextEdit; 39 39 class QITreeView; 40 40 class QVBoxLayout; 41 41 42 42 /** Appliance tree-view section types. */ … … 101 101 /** Cache currently stored values. */ 102 102 void putBack(); 103 104 void setVirtualSystemBaseFolder(const QString& path); 103 105 104 106 private: … … 211 213 virtual void retranslateUi() /* override */; 212 214 215 void setVirtualSystemBaseFolder(const QString& path); 216 213 217 /** Holds the currently set appliance reference. */ 214 218 CAppliance *m_pAppliance; 215 219 /** Holds the Appliance model reference. */ 216 220 UIApplianceModel *m_pModel; 221 222 QVBoxLayout *m_pLayout; 217 223 218 224 /** Holds the information pane instance. */ … … 246 252 247 253 #endif /* !___UIApplianceEditorWidget_h___ */ 248 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceImportEditorWidget.cpp
r69500 r72545 23 23 # include <QCheckBox> 24 24 # include <QTextEdit> 25 # include <QVBoxLayout> 25 26 26 27 /* GUI includes: */ 28 # include "QIRichTextLabel.h" 27 29 # include "QITreeView.h" 28 30 # include "UIApplianceImportEditorWidget.h" 31 # include "UIFilePathSelector.h" 32 # include "UIMessageCenter.h" 33 # include "UIWizardImportApp.h" 29 34 # include "VBoxGlobal.h" 30 # include "UIMessageCenter.h"31 35 32 36 /* COM includes: */ 33 37 # include "CAppliance.h" 38 # include "CSystemProperties.h" 34 39 35 40 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ … … 57 62 /* Show the MAC check box */ 58 63 m_pCheckBoxReinitMACs->setHidden(false); 64 65 m_pPathSelectorLabel = new QIRichTextLabel(this); 66 if (m_pPathSelectorLabel) 67 { 68 m_pLayout->addWidget(m_pPathSelectorLabel); 69 } 70 m_pPathSelector = new UIFilePathSelector(this); 71 if (m_pPathSelector) 72 { 73 m_pPathSelector->setResetEnabled(true); 74 m_pPathSelector->setDefaultPath(vboxGlobal().virtualBox().GetSystemProperties().GetDefaultMachineFolder()); 75 m_pPathSelector->setPath(vboxGlobal().virtualBox().GetSystemProperties().GetDefaultMachineFolder()); 76 connect(m_pPathSelector, &UIFilePathSelector::pathChanged, this, &UIApplianceImportEditorWidget::sltHandlePathChanged); 77 m_pLayout->addWidget(m_pPathSelector); 78 } 79 m_pLayout->addStretch(); 80 retranslateUi(); 59 81 } 60 82 … … 137 159 } 138 160 } 161 /* Make sure we initialize model items with correct base folder path: */ 162 if (m_pPathSelector) 163 sltHandlePathChanged(m_pPathSelector->path()); 164 139 165 return fResult; 140 166 } … … 199 225 } 200 226 227 void UIApplianceImportEditorWidget::retranslateUi() 228 { 229 UIApplianceEditorWidget::retranslateUi(); 230 m_pPathSelectorLabel->setText(UIWizardImportApp::tr("You can modify the base folder which will host " 231 "all the virtual machines. Virtual home folders " 232 "can also be individually modified.")); 233 234 } 235 236 void UIApplianceImportEditorWidget::sltHandlePathChanged(const QString &newPath) 237 { 238 setVirtualSystemBaseFolder(newPath); 239 } -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceImportEditorWidget.h
r69500 r72545 22 22 #include "UIApplianceEditorWidget.h" 23 23 24 /* Forward declarations: */ 25 class UIFilePathSelector; 26 class QIRichTextLabel; 27 24 28 class UIApplianceImportEditorWidget: public UIApplianceEditorWidget 25 29 { … … 34 38 35 39 QList<QPair<QString, QString> > licenseAgreements() const; 40 41 protected: 42 /** Handles translation event. */ 43 virtual void retranslateUi() /* override */; 44 45 private slots: 46 47 void sltHandlePathChanged(const QString &newPath); 48 49 private: 50 51 QIRichTextLabel *m_pPathSelectorLabel; 52 UIFilePathSelector *m_pPathSelector; 36 53 }; 37 54 38 55 #endif /* __UIApplianceImportEditorWidget_h__ */ 39 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic2.cpp
r71318 r72545 21 21 22 22 /* Global includes: */ 23 # include <QLabel> 24 # include <QPointer> 25 # include <QPushButton> 26 # include <QTextBrowser> 23 27 # include <QVBoxLayout> 24 # include <QTextBrowser>25 # include <QPushButton>26 # include <QPointer>27 # include <QLabel>28 28 29 29 /* Local includes: */ 30 # include "QIDialogButtonBox.h" 31 # include "QIRichTextLabel.h" 32 # include "UIWizardImportApp.h" 30 33 # include "UIWizardImportAppPageBasic2.h" 31 # include "UIWizardImportApp.h"32 # include "QIRichTextLabel.h"33 # include "QIDialogButtonBox.h"34 34 35 35 /* COM includes: */ … … 296 296 m_pTextBrowser->setText(QString("<table>%1</table>").arg(strTableContent)); 297 297 } 298 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic2.h
r69500 r72545 113 113 114 114 #endif /* !___UIWizardImportAppPageBasic2_h___ */ 115
Note:
See TracChangeset
for help on using the changeset viewer.