- Timestamp:
- Jul 24, 2019 6:36:34 PM (5 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp
r79963 r79964 272 272 /* Load old 'Motherboard' data from the cache: */ 273 273 m_pSliderMemorySize->setValue(oldSystemData.m_iMemorySize); 274 mTwBootOrder->setBootItems(oldSystemData.m_bootItems); 274 275 const int iChipsetTypePosition = m_pComboChipsetType->findData(oldSystemData.m_chipsetType); 275 276 m_pComboChipsetType->setCurrentIndex(iChipsetTypePosition == -1 ? 0 : iChipsetTypePosition); … … 279 280 m_pCheckBoxEFI->setChecked(oldSystemData.m_fEnabledEFI); 280 281 m_pCheckBoxUseUTC->setChecked(oldSystemData.m_fEnabledUTC); 281 /* Remove any old data in the boot view: */282 QAbstractItemView *pItemView = qobject_cast<QAbstractItemView*>(mTwBootOrder);283 pItemView->model()->removeRows(0, pItemView->model()->rowCount());284 /* Apply internal variables data to QWidget(s): */285 for (int i = 0; i < oldSystemData.m_bootItems.size(); ++i)286 {287 const UIBootItemData data = oldSystemData.m_bootItems[i];288 QListWidgetItem *pItem = new UIBootTableItem(data.m_enmType);289 pItem->setCheckState(data.m_fEnabled ? Qt::Checked : Qt::Unchecked);290 mTwBootOrder->addItem(pItem);291 }292 282 293 283 /* Load old 'Processor' data from the cache: */ … … 323 313 /* Gather 'Motherboard' data: */ 324 314 newSystemData.m_iMemorySize = m_pSliderMemorySize->value(); 315 newSystemData.m_bootItems = mTwBootOrder->bootItems(); 325 316 newSystemData.m_chipsetType = (KChipsetType)m_pComboChipsetType->itemData(m_pComboChipsetType->currentIndex()).toInt(); 326 317 newSystemData.m_pointingHIDType = (KPointingHIDType)m_pComboPointingHIDType->itemData(m_pComboPointingHIDType->currentIndex()).toInt(); … … 329 320 newSystemData.m_fEnabledEFI = m_pCheckBoxEFI->isChecked(); 330 321 newSystemData.m_fEnabledUTC = m_pCheckBoxUseUTC->isChecked(); 331 /* Gather boot-table data: */332 newSystemData.m_bootItems.clear();333 for (int i = 0; i < mTwBootOrder->count(); ++i)334 {335 QListWidgetItem *pItem = mTwBootOrder->item(i);336 UIBootItemData bootData;337 bootData.m_enmType = static_cast<UIBootTableItem*>(pItem)->type();338 bootData.m_fEnabled = pItem->checkState() == Qt::Checked;339 newSystemData.m_bootItems << bootData;340 }341 322 342 323 /* Gather 'Processor' data: */ -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIBootTable.cpp
r76606 r79964 65 65 } 66 66 67 void UIBootTable::setBootItems(const UIBootItemDataList &bootItems) 68 { 69 /* Clear initially: */ 70 clear(); 71 72 /* Apply internal variables data to QWidget(s): */ 73 foreach (const UIBootItemData &data, bootItems) 74 { 75 UIBootTableItem *pItem = new UIBootTableItem(data.m_enmType); 76 pItem->setCheckState(data.m_fEnabled ? Qt::Checked : Qt::Unchecked); 77 addItem(pItem); 78 } 79 } 80 81 UIBootItemDataList UIBootTable::bootItems() const 82 { 83 /* Prepare boot items: */ 84 UIBootItemDataList bootItems; 85 86 /* Enumerate all the items we have: */ 87 for (int i = 0; i < count(); ++i) 88 { 89 QListWidgetItem *pItem = item(i); 90 UIBootItemData bootData; 91 bootData.m_enmType = static_cast<UIBootTableItem*>(pItem)->type(); 92 bootData.m_fEnabled = pItem->checkState() == Qt::Checked; 93 bootItems << bootData; 94 } 95 96 /* Return boot items: */ 97 return bootItems; 98 } 99 67 100 void UIBootTable::adjustSizeToFitContent() 68 101 { -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIBootTable.h
r79962 r79964 77 77 /** Holds the item type. */ 78 78 KDeviceType m_enmType; 79 80 79 }; 81 80 … … 96 95 /** Constructs boot-table passing @a pParent to the base-class. */ 97 96 UIBootTable(QWidget *pParent = 0); 97 98 /** Defines @a bootItems list. */ 99 void setBootItems(const UIBootItemDataList &bootItems); 100 /** Returns boot item list. */ 101 UIBootItemDataList bootItems() const; 98 102 99 103 /** Adjusts table size to fit contents. */
Note:
See TracChangeset
for help on using the changeset viewer.