VirtualBox

Changeset 101723 in vbox for trunk


Ignore:
Timestamp:
Nov 3, 2023 8:38:21 AM (18 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
159819
Message:

FE/Qt: bugref:10513: UIEditor and UIAdvancedSettingsDialog: Optional flag facility which allows to pass customization tweaks through whole the UIEditor hierarchy.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/settings
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UIAdvancedSettingsDialog.cpp

    r101717 r101723  
    907907}
    908908
     909void UIAdvancedSettingsDialog::setOptionalFlags(const QMap<QString, QVariant> &flags)
     910{
     911    /* Avoid excessive calls: */
     912    if (m_flags == flags)
     913        return;
     914
     915    /* Save new flags: */
     916    m_flags = flags;
     917
     918    /* Reapply optional flags: */
     919    sltApplyFilteringRules();
     920}
     921
    909922void UIAdvancedSettingsDialog::addItem(const QString &strBigIcon,
    910923                                       const QString &strMediumIcon,
     
    10951108    foreach (UISettingsPageFrame *pFrame, m_frames.values())
    10961109        pFrame->filterOut(m_pCheckBoxMode->isChecked(),
    1097                           m_pEditorFilter->text());
     1110                          m_pEditorFilter->text(),
     1111                          m_flags);
    10981112}
    10991113
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UIAdvancedSettingsDialog.h

    r101717 r101723  
    141141    bool isSerializationInProgress() const { return m_fSerializationIsInProgress; }
    142142
     143    /** Returns dialog optional flags. */
     144    QMap<QString, QVariant> optionalFlags() const { return m_flags; }
     145    /** Defines dialog optional @a flags. */
     146    void setOptionalFlags(const QMap<QString, QVariant> &flags);
     147
    143148    /** Returns the dialog title extension. */
    144149    virtual QString titleExtension() const = 0;
     
    236241    bool  m_fClosed;
    237242
     243    /** Holds the dialog optional flags. */
     244    QMap<QString, QVariant>  m_flags;
     245
    238246    /** Holds the status-bar widget instance. */
    239247    QStackedWidget         *m_pStatusBar;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIEditor.cpp

    r101717 r101723  
    6060}
    6161
    62 void UIEditor::filterOut(bool fExpertMode, const QString &strFilter)
     62void UIEditor::filterOut(bool fExpertMode, const QString &strFilter, const QMap<QString, QVariant> &flags)
    6363{
    6464    /* Save if editor is in expert mode: */
    6565    m_fInExpertMode = fExpertMode;
     66    /* Save editor's optional flags: */
     67    m_flags = flags;
    6668
    6769    /* Propagate filter towards all the children: */
    6870    foreach (UIEditor *pEditor, m_editors)
    69         pEditor->filterOut(m_fInExpertMode, strFilter);
     71        pEditor->filterOut(m_fInExpertMode, strFilter, m_flags);
    7072
    7173    /* Make sure the editor is visible if mode and filter are suitable: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIEditor.h

    r101717 r101723  
    6161    /** Filters out contents.
    6262      * @param  fExpertMode  Brings whether editor is in expert mode.
    63       * @param  strFilter    Brings the filter description should match to. */
    64     virtual void filterOut(bool fExpertMode, const QString &strFilter);
     63      * @param  strFilter    Brings the filter description should match to.
     64      * @param  flags        Brings the optional flags for this editor. */
     65    virtual void filterOut(bool fExpertMode,
     66                           const QString &strFilter,
     67                           const QMap<QString, QVariant> &flags);
    6568
    6669protected:
     
    8285    bool  m_fInExpertMode;
    8386
     87    /** Holds the editor optional flags. */
     88    QMap<QString, QVariant>  m_flags;
     89
    8490    /** Holds the parent tab-widget if any. */
    8591    QTabWidget *m_pTabWidget;
Note: See TracChangeset for help on using the changeset viewer.

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