- Timestamp:
- Sep 22, 2023 5:39:44 AM (15 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UINameAndSystemEditor.cpp
r101226 r101232 251 251 } 252 252 253 voidUINameAndSystemEditor::setGuestOSTypeByTypeId(const QString &strTypeId)254 { 255 AssertReturn Void(m_pComboFamily);253 bool UINameAndSystemEditor::setGuestOSTypeByTypeId(const QString &strTypeId) 254 { 255 AssertReturn(m_pComboFamily, false); 256 256 257 257 const UIGuestOSTypeManager * const pGuestOSTypeManager = uiCommon().guestOSTypeManager(); 258 AssertReturn Void(pGuestOSTypeManager);258 AssertReturn(pGuestOSTypeManager, false); 259 259 const UIGuestOSTypeII &type = pGuestOSTypeManager->findGuestTypeById(strTypeId); 260 260 if (!type.isOk()) 261 return ;261 return false; 262 262 263 263 int iFamilyComboIndex = -1; … … 271 271 /* Bail out if family combo has no such item: */ 272 272 if (iFamilyComboIndex == -1) 273 return ;273 return false; 274 274 /* Set the family combo's index. This will cause variant combo to be populated accordingly: */ 275 275 m_pComboFamily->setCurrentIndex(iFamilyComboIndex); … … 287 287 m_pComboVariant->setCurrentIndex(index); 288 288 else 289 return ;289 return false; 290 290 } 291 291 … … 299 299 if (iTypeIndex != -1) 300 300 m_pComboType->setCurrentIndex(iTypeIndex); 301 return true; 301 302 } 302 303 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UINameAndSystemEditor.h
r101226 r101232 122 122 123 123 /* strTypeId should be one of the type ids defined in Global.cpp and returned by IGuestOSType::getId(). */ 124 voidsetGuestOSTypeByTypeId(const QString &strTypeId);124 bool setGuestOSTypeByTypeId(const QString &strTypeId); 125 125 /** Defines the VM OS @a strTypeId and @a strFamilyId if passed. */ 126 126 void setTypeId(QString strTypeId, QString strFamilyId = QString()); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMNameOSTypePage.cpp
r101226 r101232 179 179 { QRegularExpression("sarge.*32", QRegularExpression::CaseInsensitiveOption), "Debian31" }, 180 180 { QRegularExpression("^etch.*64", QRegularExpression::CaseInsensitiveOption), "Debian4_x64" }, 181 { QRegularExpression("debian.*4.*64", QRegularExpression::CaseInsensitiveOption), "Debian4_x64" }, 181 182 { QRegularExpression("^etch.*32", QRegularExpression::CaseInsensitiveOption), "Debian4" }, 183 { QRegularExpression("debian.*4.*32", QRegularExpression::CaseInsensitiveOption), "Debian4" }, 182 184 { QRegularExpression("lenny.*64", QRegularExpression::CaseInsensitiveOption), "Debian5_x64" }, 183 185 { QRegularExpression("lenny.*32", QRegularExpression::CaseInsensitiveOption), "Debian5" }, 184 186 { QRegularExpression("squeeze.*64", QRegularExpression::CaseInsensitiveOption), "Debian6_x64" }, 187 { QRegularExpression("debian.*6.*64", QRegularExpression::CaseInsensitiveOption), "Debian6_x64" }, 185 188 { QRegularExpression("squeeze.*32", QRegularExpression::CaseInsensitiveOption), "Debian6" }, 189 { QRegularExpression("debian.*6.*32", QRegularExpression::CaseInsensitiveOption), "Debian6" }, 186 190 { QRegularExpression("wheezy.*64", QRegularExpression::CaseInsensitiveOption), "Debian7_x64" }, 191 { QRegularExpression("debian.*7.*64", QRegularExpression::CaseInsensitiveOption), "Debian7_x64" }, 187 192 { QRegularExpression("wheezy.*32", QRegularExpression::CaseInsensitiveOption), "Debian7" }, 193 { QRegularExpression("debian.*7.*32", QRegularExpression::CaseInsensitiveOption), "Debian7" }, 188 194 { QRegularExpression("jessie.*64", QRegularExpression::CaseInsensitiveOption), "Debian8_x64" }, 195 { QRegularExpression("debian.*8.*64", QRegularExpression::CaseInsensitiveOption), "Debian8_x64" }, 189 196 { QRegularExpression("jessie.*32", QRegularExpression::CaseInsensitiveOption), "Debian8" }, 197 { QRegularExpression("debian.*8*32", QRegularExpression::CaseInsensitiveOption), "Debian8" }, 190 198 { QRegularExpression("stretch.*64", QRegularExpression::CaseInsensitiveOption), "Debian9_x64" }, 191 199 { QRegularExpression("debian.*9.*64", QRegularExpression::CaseInsensitiveOption), "Debian9_x64" }, … … 287 295 { 288 296 if (strNewName.contains(gs_OSTypePattern[i].pattern)) 297 return pNameAndSystemEditor->setGuestOSTypeByTypeId(gs_OSTypePattern[i].pcstId); 298 } 299 return false; 300 } 301 302 bool UIWizardNewVMNameOSTypeCommon::guessOSTypeDetectedOSTypeString(UINameAndSystemEditor *pNameAndSystemEditor, QString strDetectedOSType) 303 { 304 AssertReturn(pNameAndSystemEditor, false); 305 if (!strDetectedOSType.isEmpty()) 306 { 307 if (!pNameAndSystemEditor->setGuestOSTypeByTypeId(strDetectedOSType)) 289 308 { 290 pNameAndSystemEditor->setGuestOSTypeByTypeId(gs_OSTypePattern[i].pcstId); 291 return true; 309 pNameAndSystemEditor->setGuestOSTypeByTypeId("Other"); 310 /* Return false to allow OS type guessing from name. See caller code: */ 311 return false; 292 312 } 293 } 294 return false; 295 } 296 297 bool UIWizardNewVMNameOSTypeCommon::guessOSTypeDetectedOSTypeString(UINameAndSystemEditor *pNameAndSystemEditor, QString strDetectedOSType) 298 { 299 AssertReturn(pNameAndSystemEditor, false); 300 301 if (!strDetectedOSType.isEmpty()) 302 { 303 CGuestOSType const osType = uiCommon().vmGuestOSType(strDetectedOSType); 304 if (!osType.isNull()) 305 { 306 pNameAndSystemEditor->setType(osType); 307 return true; 308 } 309 /* The detectedOSType shall be a valid OS type ID. So, unless the UI is 310 out of sync with the types in main this shouldn't ever happen. */ 311 AssertFailed(); 312 } 313 pNameAndSystemEditor->setType(uiCommon().vmGuestOSType("Other")); 314 /* Return false to allow OS type guessing from name. See caller code: */ 313 return true; 314 } 315 pNameAndSystemEditor->setGuestOSTypeByTypeId("Other"); 315 316 return false; 316 317 }
Note:
See TracChangeset
for help on using the changeset viewer.