Changeset 103674 in vbox
- Timestamp:
- Mar 4, 2024 6:28:21 PM (7 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
-
globals/UIGuestOSType.cpp (modified) (5 diffs)
-
globals/UIGuestOSType.h (modified) (5 diffs)
-
settings/editors/UINameAndSystemEditor.cpp (modified) (1 diff)
-
widgets/UIGuestOSTypeSelectionButton.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIGuestOSType.cpp
r103673 r103674 38 38 void UIGuestOSTypeManager::reCacheGuestOSTypes() 39 39 { 40 /* Acquire CVirtualBox: */ 41 CVirtualBox comVBox = uiCommon().virtualBox(); 42 43 /* Acquire a total list of guest OS types, supported or not: */ 44 CGuestOSTypeVector guestOSTypes = comVBox.GetGuestOSTypes(); 45 40 46 /* Acquire a list of guest OS types supported by this host: */ 41 CGuestOSTypeVector guestOSTypes; 42 CSystemProperties comSysProps = uiCommon().virtualBox().GetSystemProperties(); 43 foreach (const KPlatformArchitecture &enmArch, comSysProps.GetSupportedPlatformArchitectures()) 44 { 45 CPlatformProperties comPlatProps = uiCommon().virtualBox().GetPlatformProperties(enmArch); 46 guestOSTypes += comPlatProps.GetSupportedGuestOSTypes(); 47 m_supportedGuestOSTypeIDs.clear(); 48 CSystemProperties comSystemProps = comVBox.GetSystemProperties(); 49 foreach (const KPlatformArchitecture &enmArch, comSystemProps.GetSupportedPlatformArchitectures()) 50 { 51 CPlatformProperties comPlatformProps = comVBox.GetPlatformProperties(enmArch); 52 foreach (const CGuestOSType &comType, comPlatformProps.GetSupportedGuestOSTypes()) 53 m_supportedGuestOSTypeIDs << comType.GetId(); 47 54 } 48 55 … … 75 82 /* Append guest OS type to a list of cached wrappers: */ 76 83 m_guestOSTypes.append(UIGuestOSType(comType)); 77 m_typeIdIndexMap[m_guestOSTypes.last().getId()] = m_guestOSTypes.size() - 1;78 84 79 85 /* Acquire a bit of attributes: */ 86 const QString strId = m_guestOSTypes.last().getId(); 80 87 const QString strFamilyId = m_guestOSTypes.last().getFamilyId(); 81 88 const QString strFamilyDesc = m_guestOSTypes.last().getFamilyDescription(); 82 89 const QString strSubtype = m_guestOSTypes.last().getSubtype(); 83 90 const KPlatformArchitecture enmArch = m_guestOSTypes.last().getPlatformArchitecture(); 91 const bool fSupported = m_supportedGuestOSTypeIDs.contains(strId); 92 93 /* Remember guest OS type index as well: */ 94 m_typeIdIndexMap[strId] = m_guestOSTypes.size() - 1; 84 95 85 96 /* Cache or update family info: */ 86 UIFamilyInfo fi(strFamilyId, strFamilyDesc, enmArch );97 UIFamilyInfo fi(strFamilyId, strFamilyDesc, enmArch, fSupported); 87 98 if (!m_guestOSFamilies.contains(fi)) 88 99 m_guestOSFamilies << fi; … … 93 104 if (m_guestOSFamilies.at(iIndex).m_enmArch != enmArch) 94 105 m_guestOSFamilies[iIndex].m_enmArch = KPlatformArchitecture_None; // means any 106 if (m_guestOSFamilies.at(iIndex).m_fSupported != fSupported) 107 m_guestOSFamilies[iIndex].m_fSupported = true; // cause at least one is supported 95 108 } 96 109 … … 103 116 104 117 UIGuestOSTypeManager::UIGuestOSFamilyInfo 105 UIGuestOSTypeManager::getFamilies( KPlatformArchitecture enmArch /* = KPlatformArchitecture_None */) const118 UIGuestOSTypeManager::getFamilies(bool fListAll, KPlatformArchitecture enmArch /* = KPlatformArchitecture_None */) const 106 119 { 107 120 /* Return all families by default: */ … … 114 127 { 115 128 const KPlatformArchitecture enmCurrentArch = fi.m_enmArch; 116 if ( enmCurrentArch == enmArch117 || enmCurrentArch == KPlatformArchitecture_None)129 if ( (enmCurrentArch == enmArch || enmCurrentArch == KPlatformArchitecture_None) 130 && (fListAll || fi.m_fSupported)) 118 131 families << fi; 119 132 } -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIGuestOSType.h
r103673 r103674 47 47 UIFamilyInfo() 48 48 : m_enmArch(KPlatformArchitecture_None) 49 , m_fSupported(false) 49 50 {} 50 51 … … 52 53 * @param strId Brings the family ID. 53 54 * @param strDescription Brings the family description. 54 * @param enmArch Brings the family architecture. */ 55 * @param enmArch Brings the family architecture. 56 * @param fSupported Brings whether family is supported. */ 55 57 UIFamilyInfo(const QString &strId, 56 58 const QString &strDescription, 57 KPlatformArchitecture enmArch) 59 KPlatformArchitecture enmArch, 60 bool fSupported) 58 61 : m_strId(strId) 59 62 , m_strDescription(strDescription) 60 63 , m_enmArch(enmArch) 64 , m_fSupported(fSupported) 61 65 {} 62 66 … … 73 77 /** Holds family architecture. */ 74 78 KPlatformArchitecture m_enmArch; 79 /** Holds whether family is supported. */ 80 bool m_fSupported; 75 81 }; 76 82 … … 145 151 146 152 /** Returns a list of all families (id and description). */ 147 UIGuestOSFamilyInfo getFamilies( KPlatformArchitecture enmArch = KPlatformArchitecture_None) const;153 UIGuestOSFamilyInfo getFamilies(bool fListAll, KPlatformArchitecture enmArch = KPlatformArchitecture_None) const; 148 154 /** Returns the list of subtypes for @p strFamilyId. This may be an empty list. */ 149 155 QStringList getSubtypeListForFamilyId(const QString &strFamilyId, … … 185 191 void addGuestOSType(const CGuestOSType &comType); 186 192 193 /** Holds the list of supported guest OS type IDs. */ 194 QStringList m_supportedGuestOSTypeIDs; 195 187 196 /** The type list. Here it is a pointer to QVector to delay definition of UIGuestOSType. */ 188 197 QVector<UIGuestOSType> m_guestOSTypes; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UINameAndSystemEditor.cpp
r103672 r103674 616 616 617 617 /* Acquire family IDs: */ 618 const UIGuestOSTypeManager::UIGuestOSFamilyInfo families = uiCommon().guestOSTypeManager().getFamilies( enmArch);618 const UIGuestOSTypeManager::UIGuestOSFamilyInfo families = uiCommon().guestOSTypeManager().getFamilies(false, enmArch); 619 619 620 620 /* Block signals initially and clear the combo: */ -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIGuestOSTypeSelectionButton.cpp
r103672 r103674 108 108 m_pMainMenu->clear(); 109 109 110 UIGuestOSTypeManager::UIGuestOSFamilyInfo familyList = uiCommon().guestOSTypeManager().getFamilies( );110 UIGuestOSTypeManager::UIGuestOSFamilyInfo familyList = uiCommon().guestOSTypeManager().getFamilies(true); 111 111 112 112 for (int i = 0; i < familyList.size(); ++i)
Note:
See TracChangeset
for help on using the changeset viewer.

