VirtualBox

Changeset 105363 in vbox


Ignore:
Timestamp:
Jul 16, 2024 6:12:00 PM (5 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10513: Removing Guided/Expert button from UINativeWizard interface; Determine initial wizard mode on the basis of basic/expert experience mode value taken from Preferences/Settings.

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  
    144144const char *UIExtraDataDefs::GUI_ExtraDataManager_SplitterHints = "GUI/ExtraDataManager/SplitterHints";
    145145#endif /* VBOX_GUI_WITH_EXTRADATA_MANAGER_UI */
    146 
    147 /* Wizards: */
    148 const char *UIExtraDataDefs::GUI_HideDescriptionForWizards = "GUI/HideDescriptionForWizards";
    149146
    150147
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h

    r104642 r105363  
    265265    /** @} */
    266266#endif /* VBOX_GUI_WITH_EXTRADATA_MANAGER_UI */
    267 
    268     /** @name Wizards
    269       * @{ */
    270         /** Holds wizard types for which descriptions should be hidden. */
    271         SHARED_LIBRARY_STUFF extern const char *GUI_HideDescriptionForWizards;
    272     /** @} */
    273267
    274268    /** @name Virtual Machine
     
    940934enum WizardMode
    941935{
    942     WizardMode_Auto,
    943936    WizardMode_Basic,
    944937    WizardMode_Expert
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r105081 r105363  
    19441944           << GUI_CloudConsoleManager_Details_Expanded
    19451945           << GUI_CloudConsole_PublicKey_Path
    1946            << GUI_HideDescriptionForWizards
    19471946           << GUI_HideFromManager << GUI_HideDetails
    19481947           << GUI_PreventReconfiguration << GUI_PreventSnapshotOperations
     
    32263225}
    32273226
    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 
    32533227bool UIExtraDataManager::showMachineInVirtualBoxManagerChooser(const QUuid &uID)
    32543228{
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h

    r104968 r105363  
    523523    /** @} */
    524524
    525     /** @name Wizards
    526       * @{ */
    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 
    533525    /** @name Virtual Machine
    534526      * @{ */
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/UINativeWizard.cpp

    r104358 r105363  
    9393UINativeWizard::UINativeWizard(QWidget *pParent,
    9494                               WizardType enmType,
    95                                WizardMode enmMode /* = WizardMode_Auto */,
    9695                               const QString &strHelpKeyword /* = QString() */)
    9796    : QDialog(pParent, Qt::Window)
    9897    , m_enmType(enmType)
    99     , m_enmMode(enmMode == WizardMode_Auto ? gEDataManager->modeForWizardType(m_enmType) : enmMode)
     98    , m_enmMode(gEDataManager->isSettingsInExpertMode() ? WizardMode_Expert : WizardMode_Basic)
    10099    , m_strHelpKeyword(strHelpKeyword)
    101100    , m_iLastIndex(-1)
     
    122121bool UINativeWizard::handleNotificationProgressNow(UINotificationProgress *pProgress)
    123122{
    124     wizardButton(WizardButtonType_Expert)->setEnabled(false);
    125123    const bool fResult = m_pNotificationCenter->handleNow(pProgress);
    126     wizardButton(WizardButtonType_Expert)->setEnabled(true);
    127124    return fResult;
    128125}
     
    206203        pButtonHelp->setText(tr("&Help"));
    207204        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;
    228205    }
    229206
     
    321298        iIndex = m_pWidgetStack->currentIndex();
    322299
    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 
    333300    /* Disable/enable Back button: */
    334301    QPushButton *pButtonBack = wizardButton(WizardButtonType_Back);
     
    364331    AssertMsgReturnVoid(pButtonNext, ("No Next wizard button found!\n"));
    365332    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();
    382333}
    383334
     
    583534                    uiCommon().setHelpKeyword(this, m_strHelpKeyword);
    584535                }
    585                 connect(wizardButton(WizardButtonType_Expert), &QPushButton::clicked,
    586                         this, &UINativeWizard::sltExpert);
    587536                connect(wizardButton(WizardButtonType_Back), &QPushButton::clicked,
    588537                        this, &UINativeWizard::sltPrevious);
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/UINativeWizard.h

    r104038 r105363  
    5656    WizardButtonType_Invalid,
    5757    WizardButtonType_Help,
    58     WizardButtonType_Expert,
    5958    WizardButtonType_Back,
    6059    WizardButtonType_Next,
     
    9796    /** Constructs wizard passing @a pParent to the base-class.
    9897      * @param  enmType         Brings the wizard type.
    99       * @param  enmMode         Brings the wizard mode.
    10098      * @param  strHelpKeyword  Brings the wizard help keyword. */
    10199    UINativeWizard(QWidget *pParent,
    102100                   WizardType enmType,
    103                    WizardMode enmMode = WizardMode_Auto,
    104101                   const QString &strHelpKeyword = QString());
    105102    /** Destructs wizard. */
     
    168165    void sltCompleteChanged();
    169166
    170     /** Toggles between basic and expert modes. */
    171     void sltExpert();
    172167    /** Switches to previous page. */
    173168    void sltPrevious();
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageExpert.cpp

    r104568 r105363  
    293293
    294294    /* Update profile instances: */
    295     wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(false);
    296295    populateProfileInstances(m_pSourceInstanceList, wizard()->notificationCenter(), wizard()->client());
    297     wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(true);
    298296    sltHandleSourceInstanceChange();
    299297
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/addcloudvm/UIWizardAddCloudVMPageSource.cpp

    r104585 r105363  
    517517
    518518    /* Update profile instances: */
    519     wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(false);
    520519    populateProfileInstances(m_pSourceInstanceList, wizard()->notificationCenter(), wizard()->client());
    521     wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(true);
    522520    sltHandleSourceInstanceChange();
    523521
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevm/UIWizardCloneVM.cpp

    r105081 r105363  
    4545UIWizardCloneVM::UIWizardCloneVM(QWidget *pParent, const CMachine &machine,
    4646                                 const QString &strGroup, CSnapshot snapshot /* = CSnapshot() */)
    47     : UINativeWizard(pParent, WizardType_CloneVM, WizardMode_Auto, "clone" /* help keyword */)
     47    : UINativeWizard(pParent, WizardType_CloneVM, "clone" /* help keyword */)
    4848    , m_machine(machine)
    4949    , m_snapshot(snapshot)
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportApp.cpp

    r105152 r105363  
    5151                                     const QStringList &predefinedMachineNames /* = QStringList() */,
    5252                                     bool fFastTraverToExportOCI /* = false */)
    53     : UINativeWizard(pParent, WizardType_ExportAppliance, WizardMode_Auto,
     53    : UINativeWizard(pParent, WizardType_ExportAppliance,
    5454                     fFastTraverToExportOCI ? "cloud-export-oci" : "ovf")
    5555    , m_predefinedMachineNames(predefinedMachineNames)
     
    7777void UIWizardExportApp::disableButtons()
    7878{
    79     wizardButton(WizardButtonType_Expert)->setEnabled(false);
    8079    wizardButton(WizardButtonType_Back)->setEnabled(false);
    8180    wizardButton(WizardButtonType_Next)->setEnabled(false);
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.cpp

    r104559 r105363  
    829829    CVirtualSystemDescription comDescription;
    830830    CVirtualSystemDescriptionForm comForm;
    831     wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(false);
    832831    refreshCloudStuff(comAppliance,
    833832                      comClient,
     
    839838                      wizard()->uri(),
    840839                      wizard()->cloudExportMode());
    841     wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(true);
    842840    wizard()->setCloudAppliance(comAppliance);
    843841    wizard()->setCloudClient(comClient);
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageFormat.cpp

    r104559 r105363  
    12051205    CVirtualSystemDescription comDescription;
    12061206    CVirtualSystemDescriptionForm comForm;
    1207     wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(false);
    12081207    refreshCloudStuff(comAppliance,
    12091208                      comClient,
     
    12151214                      wizard()->uri(),
    12161215                      wizard()->cloudExportMode());
    1217     wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(true);
    12181216    wizard()->setCloudAppliance(comAppliance);
    12191217    wizard()->setCloudClient(comClient);
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportApp.cpp

    r103961 r105363  
    157157                                     bool fImportFromOCIByDefault,
    158158                                     const QString &strFileName)
    159     : UINativeWizard(pParent, WizardType_ImportAppliance, WizardMode_Auto, "ovf")
     159    : UINativeWizard(pParent, WizardType_ImportAppliance, "ovf")
    160160    , m_fImportFromOCIByDefault(fImportFromOCIByDefault)
    161161    , m_strFileName(strFileName)
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageExpert.cpp

    r104585 r105363  
    657657{
    658658    /* Refresh profile instances: */
    659     wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(false);
    660659    refreshCloudProfileInstances(m_pProfileInstanceList,
    661660                                 wizard()->notificationCenter(),
     
    663662                                 profileName(m_pProfileComboBox),
    664663                                 wizard()->isSourceCloudOne());
    665     wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(true);
    666664    sltHandleInstanceListChange();
    667665
     
    682680    CAppliance comAppliance;
    683681    CVirtualSystemDescriptionForm comForm;
    684     wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(false);
    685682    refreshCloudStuff(comAppliance,
    686683                      comForm,
     
    690687                      profileName(m_pProfileComboBox),
    691688                      wizard()->isSourceCloudOne());
    692     wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(true);
    693689    wizard()->setCloudAppliance(comAppliance);
    694690    wizard()->setVsdImportForm(comForm);
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageSource.cpp

    r104585 r105363  
    831831{
    832832    /* Refresh required settings: */
    833     wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(false);
    834833    refreshCloudProfileInstances(m_pProfileInstanceList,
    835834                                 wizard()->notificationCenter(),
     
    837836                                 profileName(m_pProfileComboBox),
    838837                                 wizard()->isSourceCloudOne());
    839     wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(true);
    840838
    841839    /* Notify about changes: */
     
    861859    CAppliance comAppliance;
    862860    CVirtualSystemDescriptionForm comForm;
    863     wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(false);
    864861    refreshCloudStuff(comAppliance,
    865862                      comForm,
     
    869866                      profileName(m_pProfileComboBox),
    870867                      wizard()->isSourceCloudOne());
    871     wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(true);
    872868    wizard()->setCloudAppliance(comAppliance);
    873869    wizard()->setVsdImportForm(comForm);
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageExpert.cpp

    r104566 r105363  
    388388{
    389389    /* Update source type: */
    390     wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(false);
    391390    populateSourceImages(m_pSourceImageList, m_pSourceTabBar, wizard()->notificationCenter(), wizard()->client());
    392     wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(true);
    393391    sltHandleSourceImageChange();
    394392
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageSource.cpp

    r104585 r105363  
    608608{
    609609    /* Update source type: */
    610     wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(false);
    611610    populateSourceImages(m_pSourceImageList, m_pSourceTabBar, wizard()->notificationCenter(), wizard()->client());
    612     wizard()->wizardButton(WizardButtonType_Expert)->setEnabled(true);
    613611    sltHandleSourceImageChange();
    614612
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVD.cpp

    r104915 r105363  
    4646                             const QString &strDefaultPath,
    4747                             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 */)
    4949    , m_strDefaultName(strDefaultName)
    5050    , m_strDefaultPath(strDefaultPath)
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp

    r105119 r105363  
    6666                             const QString &strMachineGroup,
    6767                             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 */)
    6969    , m_strMachineGroup(strMachineGroup)
    7070    , m_iIDECount(0)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette