Changeset 45583 in vbox for trunk/src/VBox
- Timestamp:
- Apr 17, 2013 8:55:05 AM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDPageBasic2.cpp
r44528 r45583 104 104 addFormatButton(this, pFormatLayout, medFormat); 105 105 } 106 m_pFormatButtonGroup->button(0)->click(); 107 m_pFormatButtonGroup->button(0)->setFocus(); 106 if (!m_pFormatButtonGroup->buttons().isEmpty()) 107 { 108 m_pFormatButtonGroup->button(0)->click(); 109 m_pFormatButtonGroup->button(0)->setFocus(); 110 } 108 111 } 109 112 } … … 154 157 { 155 158 /* Show variant page only if there is something to show: */ 156 CMediumFormat medFormat = mediumFormat(); 157 // ULONG uCapabilities = medFormat.GetCapabilities(); 158 ULONG uCapabilities = 0; 159 QVector<KMediumFormatCapabilities> capabilities; 160 capabilities = medFormat.GetCapabilities(); 161 for (int i = 0; i < capabilities.size(); i++) 162 uCapabilities |= capabilities[i]; 159 CMediumFormat mf = mediumFormat(); 160 if (mf.isNull()) 161 { 162 AssertMsgFailed(("No medium format set!")); 163 } 164 else 165 { 166 ULONG uCapabilities = 0; 167 QVector<KMediumFormatCapabilities> capabilities; 168 capabilities = mf.GetCapabilities(); 169 for (int i = 0; i < capabilities.size(); i++) 170 uCapabilities |= capabilities[i]; 163 171 164 int cTest = 0; 165 if (uCapabilities & KMediumFormatCapabilities_CreateDynamic) 166 ++cTest; 167 if (uCapabilities & KMediumFormatCapabilities_CreateFixed) 168 ++cTest; 169 if (uCapabilities & KMediumFormatCapabilities_CreateSplit2G) 170 ++cTest; 171 if (cTest > 1) 172 return UIWizardCloneVD::Page3; 172 int cTest = 0; 173 if (uCapabilities & KMediumFormatCapabilities_CreateDynamic) 174 ++cTest; 175 if (uCapabilities & KMediumFormatCapabilities_CreateFixed) 176 ++cTest; 177 if (uCapabilities & KMediumFormatCapabilities_CreateSplit2G) 178 ++cTest; 179 if (cTest > 1) 180 return UIWizardCloneVD::Page3; 181 } 173 182 /* Skip otherwise: */ 174 183 return UIWizardCloneVD::Page4; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDPageExpert.cpp
r45316 r45583 103 103 addFormatButton(m_pFormatCnt, pFormatCntLayout, medFormat); 104 104 } 105 m_pFormatButtonGroup->button(0)->click(); 106 m_pFormatButtonGroup->button(0)->setFocus(); 105 if (!m_pFormatButtonGroup->buttons().isEmpty()) 106 { 107 m_pFormatButtonGroup->button(0)->click(); 108 m_pFormatButtonGroup->button(0)->setFocus(); 109 } 107 110 } 108 111 } … … 186 189 /* Get medium format: */ 187 190 CMediumFormat mf = mediumFormat(); 191 if (mf.isNull()) 192 { 193 AssertMsgFailed(("No medium format set!")); 194 return; 195 } 188 196 189 197 /* Enable/disable widgets: */
Note:
See TracChangeset
for help on using the changeset viewer.