Changeset 107130 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Nov 25, 2024 2:07:45 PM (8 weeks ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings/editors
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIMotherboardFeaturesEditor.cpp
r106061 r107130 36 36 #include "UIMessageCenter.h" 37 37 #include "UIMotherboardFeaturesEditor.h" 38 39 /* COM includes: */ 40 #include "KPlatformArchitecture.h" 38 41 39 42 … … 148 151 } 149 152 153 void UIMotherboardFeaturesEditor::handleFilterChange() 154 { 155 /* Some options hidden for ARM machines: */ 156 const KPlatformArchitecture enmArch = optionalFlags().contains("arch") 157 ? optionalFlags().value("arch").value<KPlatformArchitecture>() 158 : KPlatformArchitecture_x86; 159 const bool fARMMachine = enmArch == KPlatformArchitecture_ARM; 160 if (fARMMachine) 161 { 162 if (m_pCheckBoxEnableIoApic) 163 m_pCheckBoxEnableIoApic->hide(); 164 rebuildLayout(); 165 } 166 } 167 150 168 void UIMotherboardFeaturesEditor::sltRetranslateUI() 151 169 { … … 243 261 m_pLabel = new QLabel(this); 244 262 if (m_pLabel) 245 {246 263 m_pLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 247 m_pLayout->addWidget(m_pLabel, 0, 0);248 }249 264 /* Prepare 'enable IO APIC' check-box: */ 250 265 m_pCheckBoxEnableIoApic = new QCheckBox(this); 251 266 if (m_pCheckBoxEnableIoApic) 252 {253 267 connect(m_pCheckBoxEnableIoApic, &QCheckBox::stateChanged, 254 268 this, &UIMotherboardFeaturesEditor::sigChangedIoApic); 255 m_pLayout->addWidget(m_pCheckBoxEnableIoApic, 0, 1);256 }257 269 /* Prepare 'enable UTC time' check-box: */ 258 270 m_pCheckBoxEnableUtcTime = new QCheckBox(this); 259 271 if (m_pCheckBoxEnableUtcTime) 260 {261 272 connect(m_pCheckBoxEnableUtcTime, &QCheckBox::stateChanged, 262 273 this, &UIMotherboardFeaturesEditor::sigChangedUtcTime); 263 m_pLayout->addWidget(m_pCheckBoxEnableUtcTime, 1, 1);264 }265 274 /* Prepare 'enable EFI' check-box: */ 266 275 m_pCheckBoxEnableEfi = new QCheckBox(this); 267 276 if (m_pCheckBoxEnableEfi) 268 {269 277 connect(m_pCheckBoxEnableEfi, &QCheckBox::stateChanged, 270 278 this, &UIMotherboardFeaturesEditor::sltHandleEnableEfiToggling); 271 m_pLayout->addWidget(m_pCheckBoxEnableEfi, 2, 1);272 }273 279 /* Prepare 'enable secure boot' check-box: */ 274 280 m_pCheckBoxEnableSecureBoot = new QCheckBox(this); 275 281 if (m_pCheckBoxEnableSecureBoot) 276 {277 282 connect(m_pCheckBoxEnableSecureBoot, &QCheckBox::stateChanged, 278 283 this, &UIMotherboardFeaturesEditor::sltHandleEnableSecureBootToggling); 279 m_pLayout->addWidget(m_pCheckBoxEnableSecureBoot, 3, 1);280 }281 284 /* Prepare 'reset secure boot' tool-button: */ 282 285 m_pPushButtonResetSecureBoot = new QPushButton(this); … … 286 289 connect(m_pPushButtonResetSecureBoot, &QPushButton::clicked, 287 290 this, &UIMotherboardFeaturesEditor::sltResetSecureBoot); 288 m_pLayout->addWidget(m_pPushButtonResetSecureBoot, 4, 1);289 291 } 292 293 rebuildLayout(); 290 294 } 291 295 … … 297 301 sltRetranslateUI(); 298 302 } 303 304 void UIMotherboardFeaturesEditor::rebuildLayout() 305 { 306 if (m_pLayout) 307 { 308 /* Remove all the widgets from the layout if any: */ 309 m_pLayout->removeWidget(m_pLabel); 310 m_pLayout->removeWidget(m_pCheckBoxEnableIoApic); 311 m_pLayout->removeWidget(m_pCheckBoxEnableUtcTime); 312 m_pLayout->removeWidget(m_pCheckBoxEnableEfi); 313 m_pLayout->removeWidget(m_pCheckBoxEnableSecureBoot); 314 m_pLayout->removeWidget(m_pPushButtonResetSecureBoot); 315 316 /* Put them back only if they are visible: */ 317 int i = 0; 318 if (m_pLabel) 319 m_pLayout->addWidget(m_pLabel, i, 0); 320 if (m_pCheckBoxEnableIoApic && !m_pCheckBoxEnableIoApic->isHidden()) 321 m_pLayout->addWidget(m_pCheckBoxEnableIoApic, i++, 1); 322 if (m_pCheckBoxEnableUtcTime && !m_pCheckBoxEnableUtcTime->isHidden()) 323 m_pLayout->addWidget(m_pCheckBoxEnableUtcTime, i++, 1); 324 if (m_pCheckBoxEnableEfi && !m_pCheckBoxEnableEfi->isHidden()) 325 m_pLayout->addWidget(m_pCheckBoxEnableEfi, i++, 1); 326 if (m_pCheckBoxEnableSecureBoot && !m_pCheckBoxEnableSecureBoot->isHidden()) 327 m_pLayout->addWidget(m_pCheckBoxEnableSecureBoot, i++, 1); 328 if (m_pPushButtonResetSecureBoot && !m_pPushButtonResetSecureBoot->isHidden()) 329 m_pLayout->addWidget(m_pPushButtonResetSecureBoot, i++, 1); 330 } 331 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIMotherboardFeaturesEditor.h
r106061 r107130 90 90 void setMinimumLayoutIndent(int iIndent); 91 91 92 protected: 93 94 /** Handles filter change. */ 95 virtual void handleFilterChange() RT_OVERRIDE; 96 92 97 private slots: 93 98 … … 107 112 /** Prepares all. */ 108 113 void prepare(); 114 /** Rebuilds layout. */ 115 void rebuildLayout(); 109 116 110 117 /** @name Values
Note:
See TracChangeset
for help on using the changeset viewer.