Changeset 101316 in vbox
- Timestamp:
- Sep 29, 2023 1:40:05 PM (12 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 14 edited
-
globals/UICommon.h (modified) (1 diff)
-
globals/UIDetailsGenerator.cpp (modified) (1 diff)
-
runtime/UISession.cpp (modified) (2 diffs)
-
runtime/information/UIInformationRuntime.cpp (modified) (1 diff)
-
settings/editors/UINameAndSystemEditor.cpp (modified) (9 diffs)
-
snapshots/UISnapshotDetailsWidget.cpp (modified) (1 diff)
-
widgets/UIApplianceEditorWidget.cpp (modified) (1 diff)
-
widgets/UIGuestOSTypeSelectionButton.cpp (modified) (4 diffs)
-
wizards/newvm/UIWizardNewVM.cpp (modified) (5 diffs)
-
wizards/newvm/UIWizardNewVMDiskPage.cpp (modified) (1 diff)
-
wizards/newvm/UIWizardNewVMExpertPage.cpp (modified) (4 diffs)
-
wizards/newvm/UIWizardNewVMHardwarePage.cpp (modified) (4 diffs)
-
wizards/newvm/UIWizardNewVMNameOSTypePage.cpp (modified) (1 diff)
-
wizards/newvm/UIWizardNewVMSummaryPage.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h
r101315 r101316 317 317 /** @name COM: Guest OS Type stuff. 318 318 * @{ */ 319 const UIGuestOSTypeManager *guestOSTypeManager() const { return m_pGuestOSTypeManager; } 320 UIGuestOSTypeManager &guestOSTypeManager2() const { return *m_pGuestOSTypeManager; } 319 const UIGuestOSTypeManager &guestOSTypeManager() const { return *m_pGuestOSTypeManager; } 321 320 /** @} */ 322 321 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDetailsGenerator.cpp
r101315 r101316 119 119 const QString strAnchorType = QString("os_type"); 120 120 const QString strOsTypeId = comMachine.GetOSTypeId(); 121 const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager();122 QString strOsTypeDescription;123 if (pManager)124 strOsTypeDescription = pManager->getDescription(strOsTypeId);125 121 table << UITextTableLine(QApplication::translate("UIDetails", "Operating System", "details (general)"), 126 122 QString("<a href=#%1,%2>%3</a>") 127 123 .arg(strAnchorType, 128 124 strOsTypeId, 129 strOsTypeDescription));125 uiCommon().guestOSTypeManager().getDescription(strOsTypeId))); 130 126 } 131 127 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r101315 r101316 848 848 } 849 849 850 const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager(); 851 AssertReturn(pManager, false); 852 853 const KStorageBus enmRecommendedDvdBus = pManager->getRecommendedDVDStorageBus(osTypeId()); 854 const KStorageControllerType enmRecommendedDvdType = pManager->getRecommendedDVDStorageController(osTypeId()); 850 const KStorageBus enmRecommendedDvdBus = uiCommon().guestOSTypeManager().getRecommendedDVDStorageBus(osTypeId()); 851 const KStorageControllerType enmRecommendedDvdType = uiCommon().guestOSTypeManager().getRecommendedDVDStorageController(osTypeId()); 855 852 856 853 /* Search for an attachment of required bus & type: */ … … 1305 1302 1306 1303 /* Auto GA update is currently for Windows and Linux guests only */ 1307 const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager(); 1308 AssertReturn(pManager, false); 1309 1310 bool fIsWindowOrLinux = pManager->isLinux(uimachine()->osTypeId()) || pManager->isWindows(uimachine()->osTypeId()); 1304 bool fIsWindowOrLinux = uiCommon().guestOSTypeManager().isLinux(uimachine()->osTypeId()) 1305 || uiCommon().guestOSTypeManager().isWindows(uimachine()->osTypeId()); 1311 1306 1312 1307 if (!fIsWindowOrLinux) -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.cpp
r101315 r101316 352 352 else 353 353 { 354 const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager(); 355 if (pManager) 356 strOSType = pManager->getDescription(strOSType); 354 strOSType = uiCommon().guestOSTypeManager().getDescription(strOSType); 357 355 } 358 356 updateInfoRow(InfoRow_GuestOSType, QString("%1").arg(m_strGuestOSTypeLabel), strOSType); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UINameAndSystemEditor.cpp
r101294 r101316 164 164 AssertReturn(m_pComboFamily, false); 165 165 166 const UIGuestOSTypeManager * const pGuestOSTypeManager = uiCommon().guestOSTypeManager();167 AssertReturn(pGuestOSTypeManager, false);168 // const UIGuestOSType &type = pGuestOSTypeManager->findGuestTypeById(strTypeId);169 // if (!type.isOk())170 // return false;171 172 166 int iFamilyComboIndex = -1; 173 167 /* We already have to have an item in the family combo box for this family id: */ … … 175 169 { 176 170 QString strComboFamilyId = m_pComboFamily->itemData(i, FamilyID).toString(); 177 if (!strComboFamilyId.isEmpty() && strComboFamilyId == pGuestOSTypeManager->getFamilyId(strTypeId))171 if (!strComboFamilyId.isEmpty() && strComboFamilyId == uiCommon().guestOSTypeManager().getFamilyId(strTypeId)) 178 172 iFamilyComboIndex = i; 179 173 } … … 185 179 186 180 /* If variant is not empty then try to select correct index. This will populate type combo: */ 187 QString strVariant = pGuestOSTypeManager->getVariant(strTypeId);181 QString strVariant = uiCommon().guestOSTypeManager().getVariant(strTypeId); 188 182 if (!strVariant.isEmpty()) 189 183 { … … 314 308 AssertReturnVoid(m_pComboFamily); 315 309 AssertReturnVoid(m_pComboVariant); 316 const UIGuestOSTypeManager * const pGuestOSTypeManager = uiCommon().guestOSTypeManager();317 AssertReturnVoid(pGuestOSTypeManager);318 310 319 311 m_strFamilyId = m_pComboFamily->itemData(index, FamilyID).toString(); … … 327 319 m_pComboVariant->clear(); 328 320 329 const QStringList variantList = pGuestOSTypeManager->getVariantListForFamilyId(m_strFamilyId);321 const QStringList variantList = uiCommon().guestOSTypeManager().getVariantListForFamilyId(m_strFamilyId); 330 322 331 323 if (variantList.isEmpty()) … … 334 326 m_pLabelVariant->setEnabled(false); 335 327 /* If variant list is empty the all the types of the family are added to typ selection combo: */ 336 populateTypeCombo( pGuestOSTypeManager->getTypeListForFamilyId(m_strFamilyId));328 populateTypeCombo(uiCommon().guestOSTypeManager().getTypeListForFamilyId(m_strFamilyId)); 337 329 } 338 330 else … … 350 342 m_pComboVariant->setCurrentIndex(iOracleIndex); 351 343 352 populateTypeCombo( pGuestOSTypeManager->getTypeListForVariant(m_pComboVariant->currentText()));344 populateTypeCombo(uiCommon().guestOSTypeManager().getTypeListForVariant(m_pComboVariant->currentText())); 353 345 } 354 346 m_pComboVariant->blockSignals(false); … … 360 352 void UINameAndSystemEditor::sltVariantChanged(const QString &strVariant) 361 353 { 362 const UIGuestOSTypeManager * const pGuestOSTypeManager = uiCommon().guestOSTypeManager();363 AssertReturnVoid(pGuestOSTypeManager);364 354 m_strVariant = strVariant; 365 populateTypeCombo( pGuestOSTypeManager->getTypeListForVariant(strVariant));355 populateTypeCombo(uiCommon().guestOSTypeManager().getTypeListForVariant(strVariant)); 366 356 } 367 357 … … 650 640 AssertPtrReturnVoid(m_pComboFamily); 651 641 652 const UIGuestOSTypeManager * const pGuestOSTypeManager = uiCommon().guestOSTypeManager();653 AssertPtrReturnVoid(pGuestOSTypeManager);654 655 642 /* Acquire family IDs: */ 656 const UIGuestOSTypeManager::UIGuestOSTypeFamilyInfo &families = pGuestOSTypeManager->getFamilies();643 const UIGuestOSTypeManager::UIGuestOSTypeFamilyInfo &families = uiCommon().guestOSTypeManager().getFamilies(); 657 644 658 645 /* For each known family ID: */ -
trunk/src/VBox/Frontends/VirtualBox/src/snapshots/UISnapshotDetailsWidget.cpp
r101315 r101316 1297 1297 /* Operating System: */ 1298 1298 ++iRowCount; 1299 const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager(); 1300 if (pManager) 1301 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIDetails", "Operating System", "details (general)"), 1302 empReport(pManager->getDescription(comMachine.GetOSTypeId()), 1303 pManager->getDescription(comMachineOld.GetOSTypeId()))); 1299 strItem += QString(sSectionItemTpl2).arg(QApplication::translate("UIDetails", "Operating System", "details (general)"), 1300 empReport(uiCommon().guestOSTypeManager().getDescription(comMachine.GetOSTypeId()), 1301 uiCommon().guestOSTypeManager().getDescription(comMachineOld.GetOSTypeId()))); 1304 1302 1305 1303 /* Location of the settings file: */ -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.cpp
r101315 r101316 538 538 value = strTmp; break; 539 539 } 540 case KVirtualSystemDescriptionType_OS: 541 { 542 const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager(); 543 if (pManager) 544 value = pManager->getDescription(m_strConfigValue); 545 break; 546 } 540 case KVirtualSystemDescriptionType_OS: value = uiCommon().guestOSTypeManager().getDescription(m_strConfigValue); break; 547 541 case KVirtualSystemDescriptionType_Memory: value = m_strConfigValue + " " + UICommon::tr("MB", "size suffix MBytes=1024 KBytes"); break; 548 542 case KVirtualSystemDescriptionType_SoundCard: value = gpConverter->toString(static_cast<KAudioControllerType>(m_strConfigValue.toInt())); break; -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIGuestOSTypeSelectionButton.cpp
r101285 r101316 81 81 if (m_strOSTypeId == strOSTypeId) 82 82 return; 83 const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager();84 AssertReturnVoid(pManager);85 86 83 m_strOSTypeId = strOSTypeId; 87 84 … … 91 88 #endif 92 89 93 setText( pManager->getDescription(m_strOSTypeId));90 setText(uiCommon().guestOSTypeManager().getDescription(m_strOSTypeId)); 94 91 } 95 92 … … 116 113 m_pMainMenu->clear(); 117 114 118 const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager(); 119 AssertReturnVoid(pManager); 120 UIGuestOSTypeManager::UIGuestOSTypeFamilyInfo familyList = pManager->getFamilies(); 115 UIGuestOSTypeManager::UIGuestOSTypeFamilyInfo familyList = uiCommon().guestOSTypeManager().getFamilies(); 121 116 122 117 for (int i = 0; i < familyList.size(); ++i) … … 124 119 const QPair<QString, QString> &familyInfo = familyList[i]; 125 120 QMenu *pSubMenu = m_pMainMenu->addMenu(familyInfo.second); 126 QStringList variantList = pManager->getVariantListForFamilyId(familyInfo.first);121 QStringList variantList = uiCommon().guestOSTypeManager().getVariantListForFamilyId(familyInfo.first); 127 122 128 123 if (variantList.isEmpty()) 129 createOSTypeMenu( pManager->getTypeListForFamilyId(familyInfo.first), pSubMenu);124 createOSTypeMenu(uiCommon().guestOSTypeManager().getTypeListForFamilyId(familyInfo.first), pSubMenu); 130 125 else 131 126 { 132 127 foreach (const QString &strVariant, variantList) 133 createOSTypeMenu( pManager->getTypeListForVariant(strVariant), pSubMenu->addMenu(strVariant));128 createOSTypeMenu(uiCommon().guestOSTypeManager().getTypeListForVariant(strVariant), pSubMenu->addMenu(strVariant)); 134 129 } 135 130 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp
r101278 r101316 93 93 setPixmapName(":/wizard_new_welcome_bg.png"); 94 94 #endif /* VBOX_WS_MAC */ 95 /* Register classes: */96 qRegisterMetaType<CGuestOSType>();97 98 95 connect(this, &UIWizardNewVM::rejected, this, &UIWizardNewVM::sltHandleWizardCancel); 99 96 … … 279 276 QUuid uMachineId = m_machine.GetId(); 280 277 CSession session = uiCommon().openSession(uMachineId); 281 const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager(); 282 if (!session.isNull() && pManager) 278 if (!session.isNull()) 283 279 { 284 280 CMachine machine = session.GetMachine(); 285 281 if (!m_virtualDisk.isNull()) 286 282 { 287 KStorageBus enmHDDBus = pManager->getRecommendedHDStorageBus(m_guestOSTypeId);283 KStorageBus enmHDDBus = uiCommon().guestOSTypeManager().getRecommendedHDStorageBus(m_guestOSTypeId); 288 284 CStorageController comHDDController = m_machine.GetStorageControllerByInstance(enmHDDBus, 0); 289 285 if (!comHDDController.isNull()) … … 297 293 298 294 /* Attach optical drive: */ 299 KStorageBus enmDVDBus = pManager->getRecommendedDVDStorageBus(m_guestOSTypeId);295 KStorageBus enmDVDBus = uiCommon().guestOSTypeManager().getRecommendedDVDStorageBus(m_guestOSTypeId); 300 296 CStorageController comDVDController = m_machine.GetStorageControllerByInstance(enmDVDBus, 0); 301 297 if (!comDVDController.isNull()) … … 318 314 319 315 /* Attach an empty floppy drive if recommended */ 320 if ( pManager->getRecommendedFloppy(m_guestOSTypeId))316 if (uiCommon().guestOSTypeManager().getRecommendedFloppy(m_guestOSTypeId)) 321 317 { 322 318 CStorageController comFloppyController = m_machine.GetStorageControllerByInstance(KStorageBus_Floppy, 0); … … 795 791 QString UIWizardNewVM::getGuestOSTypeDescription() const 796 792 { 797 const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager(); 798 if (!pManager) 799 return QString(); 800 return pManager->getDescription(m_guestOSTypeId); 793 return uiCommon().guestOSTypeManager().getDescription(m_guestOSTypeId); 801 794 } 802 795 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMDiskPage.cpp
r101278 r101316 265 265 266 266 LONG64 iRecommendedSize = 0; 267 const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager(); 268 if ( pManager &&!m_userModifiedParameters.contains("SelectedDiskSource"))269 { 270 iRecommendedSize = pManager->getRecommendedHDD(pWizard->guestOSTypeId());267 268 if (!m_userModifiedParameters.contains("SelectedDiskSource")) 269 { 270 iRecommendedSize = uiCommon().guestOSTypeManager().getRecommendedHDD(pWizard->guestOSTypeId()); 271 271 if (iRecommendedSize != 0) 272 272 { -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMExpertPage.cpp
r101272 r101316 343 343 { 344 344 UIWizardNewVM *pWizard = wizardWindow<UIWizardNewVM>(); 345 const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager();346 345 AssertReturnVoid(pWizard); 347 AssertReturnVoid(pManager);348 346 349 347 QString strTypeId = pWizard->guestOSTypeId(); 350 348 /* Get recommended 'ram' field value: */ 351 ULONG recommendedRam = pManager->getRecommendedRAM(strTypeId);349 ULONG recommendedRam = uiCommon().guestOSTypeManager().getRecommendedRAM(strTypeId); 352 350 353 351 if (m_pHardwareWidgetContainer) … … 363 361 364 362 /* Set Firmware Type of the widget and the wizard: */ 365 KFirmwareType fwType = pManager->getRecommendedFirmware(strTypeId);363 KFirmwareType fwType = uiCommon().guestOSTypeManager().getRecommendedFirmware(strTypeId); 366 364 if (!m_userModifiedParameters.contains("EFIEnabled")) 367 365 { … … 371 369 372 370 /* Initialize CPU count:*/ 373 int iCPUCount = pManager->getRecommendedCPUCount(strTypeId);371 int iCPUCount = uiCommon().guestOSTypeManager().getRecommendedCPUCount(strTypeId); 374 372 if (!m_userModifiedParameters.contains("CPUCount")) 375 373 { … … 380 378 } 381 379 382 LONG64 iRecommendedDiskSize = pManager->getRecommendedHDD(strTypeId);380 LONG64 iRecommendedDiskSize = uiCommon().guestOSTypeManager().getRecommendedHDD(strTypeId); 383 381 /* Prepare initial disk choice: */ 384 382 if (!m_userModifiedParameters.contains("SelectedDiskSource")) -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMHardwarePage.cpp
r101278 r101316 89 89 90 90 UIWizardNewVM *pWizard = wizardWindow<UIWizardNewVM>(); 91 const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager(); 92 93 if (pManager && pWizard && m_pHardwareWidgetContainer) 91 if (pWizard && m_pHardwareWidgetContainer) 94 92 { 95 93 const QString &strTypeId = pWizard->guestOSTypeId(); … … 98 96 if (!m_userModifiedParameters.contains("MemorySize")) 99 97 { 100 ULONG recommendedRam = pManager->getRecommendedRAM(strTypeId);98 ULONG recommendedRam = uiCommon().guestOSTypeManager().getRecommendedRAM(strTypeId); 101 99 m_pHardwareWidgetContainer->setMemorySize(recommendedRam); 102 100 pWizard->setMemorySize(recommendedRam); … … 104 102 if (!m_userModifiedParameters.contains("CPUCount")) 105 103 { 106 ULONG recommendedCPUs = pManager->getRecommendedCPUCount(strTypeId);104 ULONG recommendedCPUs = uiCommon().guestOSTypeManager().getRecommendedCPUCount(strTypeId); 107 105 m_pHardwareWidgetContainer->setCPUCount(recommendedCPUs); 108 106 pWizard->setCPUCount(recommendedCPUs); … … 110 108 if (!m_userModifiedParameters.contains("EFIEnabled")) 111 109 { 112 KFirmwareType fwType = pManager->getRecommendedFirmware(strTypeId);110 KFirmwareType fwType = uiCommon().guestOSTypeManager().getRecommendedFirmware(strTypeId); 113 111 m_pHardwareWidgetContainer->setEFIEnabled(fwType != KFirmwareType_BIOS); 114 112 pWizard->setEFIEnabled(fwType != KFirmwareType_BIOS); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMNameOSTypePage.cpp
r101315 r101316 550 550 else if (!pWizard->detectedOSTypeId().isEmpty()) 551 551 { 552 const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager(); 553 QString strType; 554 if (pManager) 555 strType = pManager->getDescription(pWizard->detectedOSTypeId()); 552 QString strType = uiCommon().guestOSTypeManager().getDescription(pWizard->detectedOSTypeId()); 556 553 if (!pWizard->isUnattendedInstallSupported()) 557 554 strMessage = UIWizardNewVM::tr("Detected OS type: %1. %2") -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMSummaryPage.cpp
r101278 r101316 355 355 pNameRoot->addChild(UIWizardNewVM::tr("Machine Folder"), pWizard->machineFolder()); 356 356 pNameRoot->addChild(UIWizardNewVM::tr("ISO Image"), pWizard->ISOFilePath()); 357 const UIGuestOSTypeManager *pManager = uiCommon().guestOSTypeManager(); 358 if (pManager) 359 pNameRoot->addChild(UIWizardNewVM::tr("Guest OS Type"), pManager->getDescription(pWizard->guestOSTypeId())); 357 pNameRoot->addChild(UIWizardNewVM::tr("Guest OS Type"), uiCommon().guestOSTypeManager().getDescription(pWizard->guestOSTypeId())); 360 358 361 359 const QString &ISOPath = pWizard->ISOFilePath();
Note:
See TracChangeset
for help on using the changeset viewer.

