Changeset 105363 in vbox
- Timestamp:
- Jul 16, 2024 6:12:00 PM (5 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp
r104642 r105363 144 144 const char *UIExtraDataDefs::GUI_ExtraDataManager_SplitterHints = "GUI/ExtraDataManager/SplitterHints"; 145 145 #endif /* VBOX_GUI_WITH_EXTRADATA_MANAGER_UI */ 146 147 /* Wizards: */148 const char *UIExtraDataDefs::GUI_HideDescriptionForWizards = "GUI/HideDescriptionForWizards";149 146 150 147 -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r104642 r105363 265 265 /** @} */ 266 266 #endif /* VBOX_GUI_WITH_EXTRADATA_MANAGER_UI */ 267 268 /** @name Wizards269 * @{ */270 /** Holds wizard types for which descriptions should be hidden. */271 SHARED_LIBRARY_STUFF extern const char *GUI_HideDescriptionForWizards;272 /** @} */273 267 274 268 /** @name Virtual Machine … … 940 934 enum WizardMode 941 935 { 942 WizardMode_Auto,943 936 WizardMode_Basic, 944 937 WizardMode_Expert -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r105081 r105363 1944 1944 << GUI_CloudConsoleManager_Details_Expanded 1945 1945 << GUI_CloudConsole_PublicKey_Path 1946 << GUI_HideDescriptionForWizards1947 1946 << GUI_HideFromManager << GUI_HideDetails 1948 1947 << GUI_PreventReconfiguration << GUI_PreventSnapshotOperations … … 3226 3225 } 3227 3226 3228 WizardMode UIExtraDataManager::modeForWizardType(WizardType type)3229 {3230 /* Otherwise get mode from cached extra-data: */3231 return extraDataStringList(GUI_HideDescriptionForWizards).contains(gpConverter->toInternalString(type))3232 ? WizardMode_Expert : WizardMode_Basic;3233 }3234 3235 void UIExtraDataManager::setModeForWizardType(WizardType type, WizardMode mode)3236 {3237 /* Get wizard name: */3238 const QString strWizardName = gpConverter->toInternalString(type);3239 /* Get current value: */3240 const QStringList oldValue = extraDataStringList(GUI_HideDescriptionForWizards);3241 QStringList newValue = oldValue;3242 /* Include wizard-name into expert-mode wizard list if necessary: */3243 if (mode == WizardMode_Expert && !newValue.contains(strWizardName))3244 newValue << strWizardName;3245 /* Exclude wizard-name from expert-mode wizard list if necessary: */3246 else if (mode == WizardMode_Basic && newValue.contains(strWizardName))3247 newValue.removeAll(strWizardName);3248 /* Update extra-data if necessary: */3249 if (newValue != oldValue)3250 setExtraDataStringList(GUI_HideDescriptionForWizards, newValue);3251 }3252 3253 3227 bool UIExtraDataManager::showMachineInVirtualBoxManagerChooser(const QUuid &uID) 3254 3228 { -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r104968 r105363 523 523 /** @} */ 524 524 525 /** @name Wizards526 * @{ */527 /** Returns mode for wizard of passed @a type. */528 WizardMode modeForWizardType(WizardType type);529 /** Defines @a mode for wizard of passed @a type. */530 void setModeForWizardType(WizardType type, WizardMode mode);531 /** @} */532 533 525 /** @name Virtual Machine 534 526 * @{ */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/UINativeWizard.cpp
r104358 r105363 93 93 UINativeWizard::UINativeWizard(QWidget *pParent, 94 94 WizardType enmType, 95 WizardMode enmMode /* = WizardMode_Auto */,96 95 const QString &strHelpKeyword /* = QString() */) 97 96 : QDialog(pParent, Qt::Window) 98 97 , m_enmType(enmType) 99 , m_enmMode( enmMode == WizardMode_Auto ? gEDataManager->modeForWizardType(m_enmType) : enmMode)98 , m_enmMode(gEDataManager->isSettingsInExpertMode() ? WizardMode_Expert : WizardMode_Basic) 100 99 , m_strHelpKeyword(strHelpKeyword) 101 100 , m_iLastIndex(-1) … … 122 121 bool UINativeWizard::handleNotificationProgressNow(UINotificationProgress *pProgress) 123 122 { 124 wizardButton(WizardButtonType_Expert)->setEnabled(false);125 123 const bool fResult = m_pNotificationCenter->handleNow(pProgress); 126 wizardButton(WizardButtonType_Expert)->setEnabled(true);127 124 return fResult; 128 125 } … … 206 203 pButtonHelp->setText(tr("&Help")); 207 204 pButtonHelp->setToolTip(tr("Open corresponding Help topic.")); 208 }209 210 /* Translate basic/expert button: */211 QPushButton *pButtonExpert = wizardButton(WizardButtonType_Expert);212 AssertMsgReturnVoid(pButtonExpert, ("No Expert wizard button found!\n"));213 switch (m_enmMode)214 {215 case WizardMode_Basic:216 pButtonExpert->setText(tr("&Expert Mode"));217 pButtonExpert->setToolTip(tr("Switch to the Expert Mode, "218 "a one-page dialog for experienced users."));219 break;220 case WizardMode_Expert:221 pButtonExpert->setText(tr("&Guided Mode"));222 pButtonExpert->setToolTip(tr("Switch to the Guided Mode, "223 "a step-by-step dialog with detailed explanations."));224 break;225 default:226 AssertMsgFailed(("Invalid wizard mode: %d", m_enmMode));227 break;228 205 } 229 206 … … 321 298 iIndex = m_pWidgetStack->currentIndex(); 322 299 323 /* Hide/show Expert button (hidden by default): */324 bool fIsExpertButtonAvailable = false;325 /* Show Expert button for 1st page: */326 if (iIndex == 0)327 fIsExpertButtonAvailable = true;328 /* Hide/show Expert button finally: */329 QPushButton *pButtonExpert = wizardButton(WizardButtonType_Expert);330 AssertMsgReturnVoid(pButtonExpert, ("No Expert wizard button found!\n"));331 pButtonExpert->setVisible(fIsExpertButtonAvailable);332 333 300 /* Disable/enable Back button: */ 334 301 QPushButton *pButtonBack = wizardButton(WizardButtonType_Back); … … 364 331 AssertMsgReturnVoid(pButtonNext, ("No Next wizard button found!\n")); 365 332 pButtonNext->setEnabled(pPage->isComplete()); 366 }367 368 void UINativeWizard::sltExpert()369 {370 /* Toggle mode: */371 switch (m_enmMode)372 {373 case WizardMode_Basic: m_enmMode = WizardMode_Expert; break;374 case WizardMode_Expert: m_enmMode = WizardMode_Basic; break;375 default: AssertMsgFailed(("Invalid mode: %d", m_enmMode)); break;376 }377 gEDataManager->setModeForWizardType(m_enmType, m_enmMode);378 379 /* Reinit everything: */380 deinit();381 init();382 333 } 383 334 … … 583 534 uiCommon().setHelpKeyword(this, m_strHelpKeyword); 584 535 } 585 connect(wizardButton(WizardButtonType_Expert), &QPushButton::clicked,586 this, &UINativeWizard::sltExpert);587 536 connect(wizardButton(WizardButtonType_Back), &QPushButton::clicked, 588 537 this, &UINativeWizard::sltPrevious); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/UINativeWizard.h
r104038 r105363 56 56 WizardButtonType_Invalid, 57 57 WizardButtonType_Help, 58 WizardButtonType_Expert,59 58 WizardButtonType_Back, 60 59 WizardButtonType_Next, … … 97 96 /** Constructs wizard passing @a pParent to the base-class. 98 97 * @param enmType Brings the wizard type. 99 * @param enmMode Brings the wizard mode.100 98 * @param strHelpKeyword Brings the wizard help keyword. */ 101 99 UINativeWizard(QWidget *pParent, 102 100 WizardType enmType, 103 WizardMode enmMode = WizardMode_Auto,104 101 const QString &strHelpKeyword = QString()); 105 102 /** Destructs wizard. */ … … 168 165 void sltCompleteChanged(); 169 166 170 /** Toggles between basic and expert modes. */171 void sltExpert();172 167 /** Switches to previous page. */ 173 168 void sltPrevious(); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageExpert.cpp
r104568 r105363 293 293 294 294 /* Update profile instances: */ 295 wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(false);296 295 populateProfileInstances(m_pSourceInstanceList, wizard()->notificationCenter(), wizard()->client()); 297 wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(true);298 296 sltHandleSourceInstanceChange(); 299 297 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageSource.cpp
r104585 r105363 517 517 518 518 /* Update profile instances: */ 519 wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(false);520 519 populateProfileInstances(m_pSourceInstanceList, wizard()->notificationCenter(), wizard()->client()); 521 wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(true);522 520 sltHandleSourceInstanceChange(); 523 521 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVM.cpp
r105081 r105363 45 45 UIWizardCloneVM::UIWizardCloneVM(QWidget *pParent, const CMachine &machine, 46 46 const QString &strGroup, CSnapshot snapshot /* = CSnapshot() */) 47 : UINativeWizard(pParent, WizardType_CloneVM, WizardMode_Auto,"clone" /* help keyword */)47 : UINativeWizard(pParent, WizardType_CloneVM, "clone" /* help keyword */) 48 48 , m_machine(machine) 49 49 , m_snapshot(snapshot) -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportApp.cpp
r105152 r105363 51 51 const QStringList &predefinedMachineNames /* = QStringList() */, 52 52 bool fFastTraverToExportOCI /* = false */) 53 : UINativeWizard(pParent, WizardType_ExportAppliance, WizardMode_Auto,53 : UINativeWizard(pParent, WizardType_ExportAppliance, 54 54 fFastTraverToExportOCI ? "cloud-export-oci" : "ovf") 55 55 , m_predefinedMachineNames(predefinedMachineNames) … … 77 77 void UIWizardExportApp::disableButtons() 78 78 { 79 wizardButton(WizardButtonType_Expert)->setEnabled(false);80 79 wizardButton(WizardButtonType_Back)->setEnabled(false); 81 80 wizardButton(WizardButtonType_Next)->setEnabled(false); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.cpp
r104559 r105363 829 829 CVirtualSystemDescription comDescription; 830 830 CVirtualSystemDescriptionForm comForm; 831 wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(false);832 831 refreshCloudStuff(comAppliance, 833 832 comClient, … … 839 838 wizard()->uri(), 840 839 wizard()->cloudExportMode()); 841 wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(true);842 840 wizard()->setCloudAppliance(comAppliance); 843 841 wizard()->setCloudClient(comClient); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageFormat.cpp
r104559 r105363 1205 1205 CVirtualSystemDescription comDescription; 1206 1206 CVirtualSystemDescriptionForm comForm; 1207 wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(false);1208 1207 refreshCloudStuff(comAppliance, 1209 1208 comClient, … … 1215 1214 wizard()->uri(), 1216 1215 wizard()->cloudExportMode()); 1217 wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(true);1218 1216 wizard()->setCloudAppliance(comAppliance); 1219 1217 wizard()->setCloudClient(comClient); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportApp.cpp
r103961 r105363 157 157 bool fImportFromOCIByDefault, 158 158 const QString &strFileName) 159 : UINativeWizard(pParent, WizardType_ImportAppliance, WizardMode_Auto,"ovf")159 : UINativeWizard(pParent, WizardType_ImportAppliance, "ovf") 160 160 , m_fImportFromOCIByDefault(fImportFromOCIByDefault) 161 161 , m_strFileName(strFileName) -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageExpert.cpp
r104585 r105363 657 657 { 658 658 /* Refresh profile instances: */ 659 wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(false);660 659 refreshCloudProfileInstances(m_pProfileInstanceList, 661 660 wizard()->notificationCenter(), … … 663 662 profileName(m_pProfileComboBox), 664 663 wizard()->isSourceCloudOne()); 665 wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(true);666 664 sltHandleInstanceListChange(); 667 665 … … 682 680 CAppliance comAppliance; 683 681 CVirtualSystemDescriptionForm comForm; 684 wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(false);685 682 refreshCloudStuff(comAppliance, 686 683 comForm, … … 690 687 profileName(m_pProfileComboBox), 691 688 wizard()->isSourceCloudOne()); 692 wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(true);693 689 wizard()->setCloudAppliance(comAppliance); 694 690 wizard()->setVsdImportForm(comForm); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageSource.cpp
r104585 r105363 831 831 { 832 832 /* Refresh required settings: */ 833 wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(false);834 833 refreshCloudProfileInstances(m_pProfileInstanceList, 835 834 wizard()->notificationCenter(), … … 837 836 profileName(m_pProfileComboBox), 838 837 wizard()->isSourceCloudOne()); 839 wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(true);840 838 841 839 /* Notify about changes: */ … … 861 859 CAppliance comAppliance; 862 860 CVirtualSystemDescriptionForm comForm; 863 wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(false);864 861 refreshCloudStuff(comAppliance, 865 862 comForm, … … 869 866 profileName(m_pProfileComboBox), 870 867 wizard()->isSourceCloudOne()); 871 wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(true);872 868 wizard()->setCloudAppliance(comAppliance); 873 869 wizard()->setVsdImportForm(comForm); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageExpert.cpp
r104566 r105363 388 388 { 389 389 /* Update source type: */ 390 wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(false);391 390 populateSourceImages(m_pSourceImageList, m_pSourceTabBar, wizard()->notificationCenter(), wizard()->client()); 392 wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(true);393 391 sltHandleSourceImageChange(); 394 392 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageSource.cpp
r104585 r105363 608 608 { 609 609 /* Update source type: */ 610 wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(false);611 610 populateSourceImages(m_pSourceImageList, m_pSourceTabBar, wizard()->notificationCenter(), wizard()->client()); 612 wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(true);613 611 sltHandleSourceImageChange(); 614 612 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVD.cpp
r104915 r105363 46 46 const QString &strDefaultPath, 47 47 qulonglong uDefaultSize) 48 : UINativeWizard(pParent, WizardType_NewVD, WizardMode_Auto,"create-virtual-hard-disk-image" /* help keyword */)48 : UINativeWizard(pParent, WizardType_NewVD, "create-virtual-hard-disk-image" /* help keyword */) 49 49 , m_strDefaultName(strDefaultName) 50 50 , m_strDefaultPath(strDefaultPath) -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp
r105119 r105363 66 66 const QString &strMachineGroup, 67 67 const QString &strISOFilePath /* = QString() */) 68 : UINativeWizard(pParent, WizardType_NewVM, WizardMode_Auto,"create-vm-wizard" /* help keyword */)68 : UINativeWizard(pParent, WizardType_NewVM, "create-vm-wizard" /* help keyword */) 69 69 , m_strMachineGroup(strMachineGroup) 70 70 , m_iIDECount(0)
Note:
See TracChangeset
for help on using the changeset viewer.