Changeset 60636 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Apr 21, 2016 4:41:09 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageBasic1.cpp
r60625 r60636 41 41 } 42 42 43 void UIWizardNewVDPage1::addFormatButton(QWidget *pParent, QVBoxLayout *pFormatLayout, CMediumFormat medFormat )43 void UIWizardNewVDPage1::addFormatButton(QWidget *pParent, QVBoxLayout *pFormatLayout, CMediumFormat medFormat, bool fPreferred /* = false */) 44 44 { 45 45 /* Check that medium format supports creation: */ … … 63 63 /* Create/add corresponding radio-button: */ 64 64 QRadioButton *pFormatButton = new QRadioButton(pParent); 65 pFormatLayout->addWidget(pFormatButton); 66 m_formats << medFormat; 67 m_formatNames << medFormat.GetName(); 68 m_pFormatButtonGroup->addButton(pFormatButton, m_formatNames.size() - 1); 65 AssertPtrReturnVoid(pFormatButton); 66 { 67 /* Make the preferred button font bold: */ 68 if (fPreferred) 69 { 70 QFont font = pFormatButton->font(); 71 font.setBold(true); 72 pFormatButton->setFont(font); 73 } 74 pFormatLayout->addWidget(pFormatButton); 75 m_formats << medFormat; 76 m_formatNames << medFormat.GetName(); 77 m_pFormatButtonGroup->addButton(pFormatButton, m_formatNames.size() - 1); 78 } 69 79 } 70 80 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageBasic1.h
r55401 r60636 41 41 42 42 /* Helping stuff: */ 43 void addFormatButton(QWidget *pParent, QVBoxLayout *pFormatsLayout, CMediumFormat medFormat );43 void addFormatButton(QWidget *pParent, QVBoxLayout *pFormatsLayout, CMediumFormat medFormat, bool fPreferred = false); 44 44 45 45 /* Stuff for 'mediumFormat' field: */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageExpert.cpp
r56180 r60636 128 128 const CMediumFormat &medFormat = medFormats[i]; 129 129 if (medFormat.GetName() == "VDI") 130 addFormatButton(m_pFormatCnt, pFormatCntLayout, medFormat );130 addFormatButton(m_pFormatCnt, pFormatCntLayout, medFormat, true); 131 131 } 132 132 for (int i = 0; i < medFormats.size(); ++i) 133 133 { 134 134 const CMediumFormat &medFormat = medFormats[i]; 135 const QVector<KMediumFormatCapabilities> &capabilities = medFormat.GetCapabilities(); 135 136 if (medFormat.GetName() != "VDI") 136 addFormatButton(m_pFormatCnt, pFormatCntLayout, medFormat );137 addFormatButton(m_pFormatCnt, pFormatCntLayout, medFormat, capabilities.contains(KMediumFormatCapabilities_Preferred)); 137 138 } 138 139 if (!m_pFormatButtonGroup->buttons().isEmpty())
Note:
See TracChangeset
for help on using the changeset viewer.