Changeset 60637 in vbox
- Timestamp:
- Apr 21, 2016 4:53:29 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDPageBasic2.cpp
r56180 r60637 41 41 } 42 42 43 void UIWizardCloneVDPage2::addFormatButton(QWidget *pParent, QVBoxLayout *pFormatLayout, CMediumFormat medFormat )43 void UIWizardCloneVDPage2::addFormatButton(QWidget *pParent, QVBoxLayout *pFormatLayout, CMediumFormat medFormat, bool fPreferred /* = false */) 44 44 { 45 45 /* Check that medium format supports creation: */ 46 //ULONG uFormatCapabilities = medFormat.GetCapabilities();47 46 ULONG uFormatCapabilities = 0; 48 47 QVector<KMediumFormatCapabilities> capabilities; … … 64 63 /* Create/add corresponding radio-button: */ 65 64 QRadioButton *pFormatButton = new QRadioButton(pParent); 66 pFormatLayout->addWidget(pFormatButton); 67 m_formats << medFormat; 68 m_formatNames << medFormat.GetName(); 69 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 } 70 79 } 71 80 … … 106 115 { 107 116 const CMediumFormat &medFormat = medFormats[i]; 108 if (medFormat.GetName() != "VDI") 117 const QVector<KMediumFormatCapabilities> &capabilities = medFormat.GetCapabilities(); 118 if (medFormat.GetName() != "VDI" && capabilities.contains(KMediumFormatCapabilities_Preferred)) 109 119 addFormatButton(this, pFormatLayout, medFormat); 110 120 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDPageBasic2.h
r55401 r60637 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/clonevd/UIWizardCloneVDPageExpert.cpp
r56180 r60637 92 92 QVBoxLayout *pFormatCntLayout = new QVBoxLayout(m_pFormatCnt); 93 93 { 94 m_pFormatButtonGroup = new QButtonGroup( this);94 m_pFormatButtonGroup = new QButtonGroup(m_pFormatCnt); 95 95 { 96 96 CSystemProperties systemProperties = vboxGlobal().virtualBox().GetSystemProperties(); … … 100 100 const CMediumFormat &medFormat = medFormats[i]; 101 101 if (medFormat.GetName() == "VDI") 102 addFormatButton(m_pFormatCnt, pFormatCntLayout, medFormat );102 addFormatButton(m_pFormatCnt, pFormatCntLayout, medFormat, true); 103 103 } 104 104 for (int i = 0; i < medFormats.size(); ++i) 105 105 { 106 106 const CMediumFormat &medFormat = medFormats[i]; 107 const QVector<KMediumFormatCapabilities> &capabilities = medFormat.GetCapabilities(); 107 108 if (medFormat.GetName() != "VDI") 108 addFormatButton(m_pFormatCnt, pFormatCntLayout, medFormat );109 addFormatButton(m_pFormatCnt, pFormatCntLayout, medFormat, capabilities.contains(KMediumFormatCapabilities_Preferred)); 109 110 } 110 111 if (!m_pFormatButtonGroup->buttons().isEmpty()) -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageBasic1.cpp
r60636 r60637 119 119 addFormatButton(this, pFormatLayout, medFormat); 120 120 } 121 }122 if (!m_pFormatButtonGroup->buttons().isEmpty())123 {124 m_pFormatButtonGroup->button(0)->click();125 m_pFormatButtonGroup->button(0)->setFocus();121 if (!m_pFormatButtonGroup->buttons().isEmpty()) 122 { 123 m_pFormatButtonGroup->button(0)->click(); 124 m_pFormatButtonGroup->button(0)->setFocus(); 125 } 126 126 } 127 127 } … … 132 132 133 133 /* Setup connections: */ 134 connect(m_pFormatButtonGroup, SIGNAL(buttonClicked(QAbstractButton *)), this, SIGNAL(completeChanged()));134 connect(m_pFormatButtonGroup, SIGNAL(buttonClicked(QAbstractButton *)), this, SIGNAL(completeChanged())); 135 135 136 136 /* Register classes: */
Note:
See TracChangeset
for help on using the changeset viewer.