Changeset 87929 in vbox
- Timestamp:
- Mar 3, 2021 8:45:46 AM (4 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/UIWizardNewVDPageBasic2.cpp
r87912 r87929 31 31 32 32 UIWizardNewVDPage2::UIWizardNewVDPage2() 33 : m_pVariantButtonGroup(0) 34 , m_pDynamicalButton(0) 35 , m_pFixedButton(0) 33 : m_pFixedCheckBox(0) 36 34 , m_pSplitBox(0) 37 35 , m_pDescriptionLabel(0) … … 58 56 if (pVariantLayout) 59 57 { 60 m_pVariantButtonGroup = new QButtonGroup; 61 { 62 m_pDynamicalButton = new QRadioButton; 63 { 64 m_pDynamicalButton->click(); 65 m_pDynamicalButton->setFocus(); 66 } 67 m_pFixedButton = new QRadioButton; 68 m_pVariantButtonGroup->addButton(m_pDynamicalButton, 0); 69 m_pVariantButtonGroup->addButton(m_pFixedButton, 1); 70 } 58 m_pFixedCheckBox = new QCheckBox; 71 59 m_pSplitBox = new QCheckBox; 72 pVariantLayout->addWidget(m_pDynamicalButton); 73 pVariantLayout->addWidget(m_pFixedButton); 60 pVariantLayout->addWidget(m_pFixedCheckBox); 74 61 pVariantLayout->addWidget(m_pSplitBox); 75 62 } … … 94 81 95 82 /* Exclusive options: */ 96 if (m_pDynamicalButton && m_pDynamicalButton->isChecked()) 83 if (m_pFixedCheckBox && m_pFixedCheckBox->isChecked()) 84 uMediumVariant = (qulonglong)KMediumVariant_Fixed; 85 else 97 86 uMediumVariant = (qulonglong)KMediumVariant_Standard; 98 else if (m_pFixedButton && m_pFixedButton->isChecked())99 uMediumVariant = (qulonglong)KMediumVariant_Fixed;100 87 101 88 /* Additional options: */ … … 112 99 if (uMediumVariant & (qulonglong)KMediumVariant_Fixed) 113 100 { 114 m_pFixedButton->click(); 115 m_pFixedButton->setFocus(); 116 } 117 else 118 { 119 m_pDynamicalButton->click(); 120 m_pDynamicalButton->setFocus(); 101 m_pFixedCheckBox->click(); 102 m_pFixedCheckBox->setFocus(); 121 103 } 122 104 … … 127 109 void UIWizardNewVDPage2::retranslateWidgets() 128 110 { 129 if (m_pDynamicalButton) 130 m_pDynamicalButton->setText(UIWizardNewVD::tr("&Dynamically allocated")); 131 if (m_pFixedButton) 132 m_pFixedButton->setText(UIWizardNewVD::tr("&Fixed size")); 111 if (m_pFixedCheckBox) 112 m_pFixedCheckBox->setText(UIWizardNewVD::tr("&Fixed size")); 133 113 if (m_pSplitBox) 134 114 m_pSplitBox->setText(UIWizardNewVD::tr("&Split into files of less than 2GB")); … … 164 144 bool fIsCreateFixedPossible = uCapabilities & KMediumFormatCapabilities_CreateFixed; 165 145 bool fIsCreateSplitPossible = uCapabilities & KMediumFormatCapabilities_CreateSplit2G; 146 if (m_pFixedCheckBox) 147 { 148 if (!fIsCreateDynamicPossible) 149 { 150 m_pFixedCheckBox->setChecked(true); 151 m_pFixedCheckBox->setEnabled(false); 152 } 153 if (!fIsCreateFixedPossible) 154 { 155 m_pFixedCheckBox->setChecked(false); 156 m_pFixedCheckBox->setEnabled(false); 157 } 158 } 166 159 if (m_pDynamicLabel) 167 160 m_pDynamicLabel->setHidden(!fIsCreateDynamicPossible); 168 if (m_pDynamicalButton)169 m_pDynamicalButton->setHidden(!fIsCreateDynamicPossible);170 161 if (m_pFixedLabel) 171 162 m_pFixedLabel->setHidden(!fIsCreateFixedPossible); 172 if (m_pFixed Button)173 m_pFixed Button->setHidden(!fIsCreateFixedPossible);163 if (m_pFixedCheckBox) 164 m_pFixedCheckBox->setHidden(!fIsCreateFixedPossible); 174 165 if (m_pSplitLabel) 175 166 m_pSplitLabel->setHidden(!fIsCreateSplitPossible); … … 186 177 187 178 /* Setup connections: */ 188 connect(m_p VariantButtonGroup,static_cast<void(QButtonGroup::*)(QAbstractButton*)>(&QButtonGroup::buttonClicked),179 connect(m_pFixedCheckBox, &QAbstractButton::toggled, 189 180 this, &UIWizardNewVDPageBasic2::completeChanged); 190 181 connect(m_pSplitBox, &QCheckBox::stateChanged, -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageBasic2.h
r87891 r87929 28 28 class CMediumFormat; 29 29 class QButtonGroup; 30 class QRadioButton;31 30 class QCheckBox; 32 31 class QIRichTextLabel; … … 49 48 /** @name Widgets 50 49 * @{ */ 51 QButtonGroup *m_pVariantButtonGroup; 52 QRadioButton *m_pDynamicalButton; 53 QRadioButton *m_pFixedButton; 50 QCheckBox *m_pFixedCheckBox; 54 51 QCheckBox *m_pSplitBox; 55 52 /** @} */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageExpert.cpp
r87891 r87929 93 93 QVBoxLayout *pVariantGroupBoxLayout = new QVBoxLayout(m_pVariantGroupBox); 94 94 { 95 m_pVariantButtonGroup = new QButtonGroup(m_pVariantGroupBox); 96 { 97 m_pDynamicalButton = new QRadioButton(m_pVariantGroupBox); 98 { 99 m_pDynamicalButton->click(); 100 m_pDynamicalButton->setFocus(); 101 } 102 m_pFixedButton = new QRadioButton(m_pVariantGroupBox); 103 m_pVariantButtonGroup->addButton(m_pDynamicalButton, 0); 104 m_pVariantButtonGroup->addButton(m_pFixedButton, 1); 105 } 95 m_pFixedCheckBox = new QCheckBox; 106 96 m_pSplitBox = new QCheckBox(m_pVariantGroupBox); 107 pVariantGroupBoxLayout->addWidget(m_pDynamicalButton); 108 pVariantGroupBoxLayout->addWidget(m_pFixedButton); 97 pVariantGroupBoxLayout->addWidget(m_pFixedCheckBox); 109 98 pVariantGroupBoxLayout->addWidget(m_pSplitBox); 110 99 } … … 121 110 connect(m_pFormatButtonGroup, static_cast<void(QButtonGroup::*)(QAbstractButton*)>(&QButtonGroup::buttonClicked), 122 111 this, &UIWizardNewVDPageExpert::sltMediumFormatChanged); 123 connect(m_p VariantButtonGroup, static_cast<void(QButtonGroup::*)(QAbstractButton*)>(&QButtonGroup::buttonClicked),112 connect(m_pFixedCheckBox, &QAbstractButton::toggled, 124 113 this, &UIWizardNewVDPageExpert::completeChanged); 125 114 connect(m_pSplitBox, &QCheckBox::stateChanged, … … 167 156 bool fIsCreateFixedPossible = uCapabilities & KMediumFormatCapabilities_CreateFixed; 168 157 bool fIsCreateSplitPossible = uCapabilities & KMediumFormatCapabilities_CreateSplit2G; 169 m_pDynamicalButton->setEnabled(fIsCreateDynamicPossible); 170 m_pFixedButton->setEnabled(fIsCreateFixedPossible); 158 159 if (m_pFixedCheckBox) 160 { 161 if (!fIsCreateDynamicPossible) 162 { 163 m_pFixedCheckBox->setEnabled(false); 164 m_pFixedCheckBox->setChecked(true); 165 } 166 if (!fIsCreateFixedPossible) 167 { 168 m_pFixedCheckBox->setEnabled(false); 169 m_pFixedCheckBox->setChecked(false); 170 } 171 } 171 172 m_pSplitBox->setEnabled(fIsCreateSplitPossible); 172 173 … … 219 220 if (m_pVariantGroupBox) 220 221 m_pVariantGroupBox->setTitle(UIWizardNewVD::tr("Storage on physical hard disk")); 221 if (m_pDynamicalButton) 222 m_pDynamicalButton->setText(UIWizardNewVD::tr("&Dynamically allocated")); 223 if (m_pFixedButton) 224 m_pFixedButton->setText(UIWizardNewVD::tr("&Fixed size")); 222 if (m_pFixedCheckBox) 223 m_pFixedCheckBox->setText(UIWizardNewVD::tr("&Fixed size")); 225 224 if (m_pSplitBox) 226 225 m_pSplitBox->setText(UIWizardNewVD::tr("&Split into files of less than 2GB"));
Note:
See TracChangeset
for help on using the changeset viewer.