Changeset 101051 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Sep 7, 2023 1:05:21 PM (15 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.cpp
r101031 r101051 79 79 } 80 80 81 void UISettingsPage::filterOut(const QString &strFilter)82 {83 /* Propagate filter towards all the children: */84 foreach (UIEditor *pEditor, m_editors)85 pEditor->filterOut(strFilter);86 87 /* Check if at least one of children visible: */88 bool fVisible = false;89 foreach (UIEditor *pEditor, m_editors)90 if (pEditor->isVisibleTo(this))91 {92 fVisible = true;93 break;94 }95 96 /* Update page visibility: */97 setVisible(fVisible);98 }99 100 81 void UISettingsPage::revalidate() 101 82 { … … 202 183 if (m_pLabelName) 203 184 m_pLabelName->setText(m_strName); 204 }205 206 void UISettingsPageFrame::filterOut(const QString &strFilter)207 {208 /* Propagate filter to the child: */209 AssertReturnVoid(m_editors.size() == 1);210 m_editors.first()->filterOut(strFilter);211 212 /* Check if child visible: */213 const bool fVisible = m_editors.first()->isVisibleTo(this);214 215 /* Update frame visibility: */216 setVisible(fVisible);217 185 } 218 186 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.h
r101031 r101051 184 184 virtual void polishPage() {} 185 185 186 /** Filters out contents with description unrelated to passed @a strFilter. */187 virtual void filterOut(const QString &strFilter) RT_OVERRIDE;188 189 186 public slots: 190 187 … … 298 295 void setName(const QString &strName); 299 296 300 /** Filters out contents with description unrelated to passed @a strFilter. */301 virtual void filterOut(const QString &strFilter) RT_OVERRIDE;302 303 297 protected: 304 298 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIEditor.cpp
r101030 r101051 43 43 void UIEditor::filterOut(const QString &strFilter) 44 44 { 45 /* Make sure the editor is visible in case if filter is empty: */ 45 /* Propagate filter towards all the children: */ 46 foreach (UIEditor *pEditor, m_editors) 47 pEditor->filterOut(strFilter); 48 49 /* Make sure the editor is visible if filter is empty: */ 46 50 bool fVisible = strFilter.isEmpty(); 51 52 /* If editor still hidden we'll need to make it 53 * visible if at least one of children is. */ 47 54 if (!fVisible) 48 55 { 49 /* Otherwise we'll have to walk through all the 50 * descriptions to check whether filter is suitable: */ 56 foreach (UIEditor *pEditor, m_editors) 57 if (pEditor->isVisibleTo(this)) 58 { 59 fVisible = true; 60 break; 61 } 62 } 63 64 /* If editor still hidden we'll need to make it 65 * visible if at least one of descriptions suits filter well: */ 66 if (!fVisible) 67 { 51 68 foreach (const QString &strDescription, description()) 52 69 if (strDescription.contains(strFilter, Qt::CaseInsensitive)) … … 56 73 } 57 74 } 58 /* We'll show whole the editor if filter is suitable: */ 75 76 /* Update widget visibility: */ 59 77 setVisible(fVisible); 60 78 }
Note:
See TracChangeset
for help on using the changeset viewer.