- Timestamp:
- Sep 27, 2023 9:23:24 AM (16 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElement.cpp
r100075 r101286 911 911 pEditor->setPath(strValue); 912 912 else if (fChooseType) 913 pEditor->set TypeId(strValue);913 pEditor->setGuestOSTypeByTypeId(strValue); 914 914 915 915 /* Add to popup: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UINameAndSystemEditor.cpp
r101278 r101286 160 160 } 161 161 162 void UINameAndSystemEditor::setTypeId(QString strTypeId, QString strFamilyId /* = QString() */)163 {164 Q_UNUSED(strTypeId);165 Q_UNUSED(strFamilyId);166 // if (!m_pComboType)167 // return;168 // AssertMsgReturnVoid(!strTypeId.isNull(), ("Null guest OS type ID"));169 170 // /* Initialize indexes: */171 // int iTypeIndex = -1;172 // int iFamilyIndex = -1;173 174 // /* If family ID isn't empty: */175 // if (!strFamilyId.isEmpty())176 // {177 // /* Search for corresponding family ID index: */178 // iFamilyIndex = m_pComboFamily->findData(strFamilyId, TypeID);179 180 // /* If that family ID isn't present, we have to add it: */181 // if (iFamilyIndex == -1)182 // {183 // /* Append family ID to corresponding combo: */184 // m_pComboFamily->addItem(strFamilyId);185 // m_pComboFamily->setItemData(m_pComboFamily->count() - 1, strFamilyId, TypeID);186 // /* Append family ID to type cache: */187 // m_types[strFamilyId] = QList<UIGuestOSType>();188 189 // /* Search for corresponding family ID index finally: */190 // iFamilyIndex = m_pComboFamily->findData(strFamilyId, TypeID);191 // }192 // }193 // /* If family ID is empty: */194 // else195 // {196 // /* We'll try to find it by type ID: */197 // foreach (const QString &strKnownFamilyId, m_types.keys())198 // {199 // foreach (const UIGuestOSType &guiType, m_types.value(strKnownFamilyId))200 // {201 // if (guiType.typeId == strTypeId)202 // strFamilyId = strKnownFamilyId;203 // if (!strFamilyId.isNull())204 // break;205 // }206 // if (!strFamilyId.isNull())207 // break;208 // }209 210 // /* If we were unable to find it => use "Other": */211 // if (strFamilyId.isNull())212 // strFamilyId = "Other";213 214 // /* Search for corresponding family ID index finally: */215 // iFamilyIndex = m_pComboFamily->findData(strFamilyId, TypeID);216 // }217 218 // /* To that moment family ID index should be always found: */219 // AssertReturnVoid(iFamilyIndex != -1);220 // /* So we choose it: */221 // m_pComboFamily->setCurrentIndex(iFamilyIndex);222 // sltFamilyChanged(m_pComboFamily->currentIndex());223 224 // /* Search for corresponding type ID index: */225 // iTypeIndex = m_pComboType->findData(strTypeId, TypeID);226 227 // /* If that type ID isn't present, we have to add it: */228 // if (iTypeIndex == -1)229 // {230 // /* Append type ID to type cache: */231 // UIGuestOSType guiType;232 // guiType.typeId = strTypeId;233 // guiType.typeDescription = strTypeId;234 // guiType.is64bit = false;235 // m_types[strFamilyId] << guiType;236 237 // /* So we re-choose family again: */238 // m_pComboFamily->setCurrentIndex(iFamilyIndex);239 // sltFamilyChanged(m_pComboFamily->currentIndex());240 241 // /* Search for corresponding type ID index finally: */242 // iTypeIndex = m_pComboType->findData(strTypeId, TypeID);243 // }244 245 // /* To that moment type ID index should be always found: */246 // AssertReturnVoid(iTypeIndex != -1);247 // /* So we choose it: */248 // m_pComboType->setCurrentIndex(iTypeIndex);249 // sltTypeChanged(m_pComboType->currentIndex());250 }251 252 162 bool UINameAndSystemEditor::setGuestOSTypeByTypeId(const QString &strTypeId) 253 163 { … … 474 384 void UINameAndSystemEditor::selectPreferredType() 475 385 { 476 // /* Select the most recently chosen item: */477 // if (m_currentIds.contains(m_strFamilyId))478 // {479 // const QString strTypeId = m_currentIds.value(m_strFamilyId);480 // const int iTypeIndex = m_pComboType->findData(strTypeId, TypeID);481 // if (iTypeIndex != -1)482 // m_pComboType->setCurrentIndex(iTypeIndex);483 // }484 // /* Or select Windows 10 item for Windows family as default: */485 // else486 386 if (m_strFamilyId == "Windows") 487 387 { … … 758 658 for (int i = 0; i < families.size(); ++i) 759 659 { 760 //const QString &strFamilyId = familyIds.at(i);761 762 660 m_pComboFamily->addItem(families[i].second); 763 661 m_pComboFamily->setItemData(i, families[i].first, FamilyID); 764 765 /* Fill in the type cache: */766 // m_types[strFamilyId] = QList<UIGuestOSType>();767 // foreach (const CGuestOSType &comType, uiCommon().vmGuestOSTypeList(strFamilyId))768 // {769 // UIGuestOSType guiType;770 // guiType.typeId = comType.GetId();771 // guiType.typeDescription = QString(comType.GetDescription()).remove(" (64-bit)", Qt::CaseInsensitive);772 // guiType.is64bit = comType.GetIs64Bit();773 // m_types[strFamilyId] << guiType;774 // }775 662 } 776 663 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UINameAndSystemEditor.h
r101278 r101286 115 115 /* strTypeId should be one of the type ids defined in Global.cpp and returned by IGuestOSType::getId(). */ 116 116 bool setGuestOSTypeByTypeId(const QString &strTypeId); 117 /** Defines the VM OS @a strTypeId and @a strFamilyId if passed. */118 void setTypeId(QString strTypeId, QString strFamilyId = QString());119 117 /** Returns the VM OS type ID. */ 120 118 QString typeId() const; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp
r101265 r101286 252 252 { 253 253 m_pEditorNameAndSystem->setName(oldGeneralData.m_strName); 254 m_pEditorNameAndSystem->set TypeId(oldGeneralData.m_strGuestOsTypeId);254 m_pEditorNameAndSystem->setGuestOSTypeByTypeId(oldGeneralData.m_strGuestOsTypeId); 255 255 } 256 256
Note:
See TracChangeset
for help on using the changeset viewer.