VirtualBox

Changeset 84587 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
May 28, 2020 12:31:13 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
138317
Message:

FE/Qt: bugref:9653: VirtualBox Manager: Chooser pane: Rework search functionality a bit; First of all, make sure search widget line-edit directly receives focus; Besides that, repeat search if chooser item tree was rebuilt.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp

    r84582 r84587  
    15711571        makeSureAtLeastOneItemSelected();
    15721572    }
     1573
     1574    /* Repeat search if search widget is visible: */
     1575    if (view() && view()->isSearchWidgetVisible())
     1576        view()->redoSearch();
    15731577}
    15741578
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserSearchWidget.cpp

    r82968 r84587  
    6464}
    6565
     66void UIChooserSearchWidget::redoSearch()
     67{
     68    if (!m_pLineEdit)
     69        return;
     70    sltHandleSearchTermChange(m_pLineEdit->text());
     71}
     72
    6673void UIChooserSearchWidget::prepareWidgets()
    6774{
     
    93100        m_pMainLayout->addWidget(m_pLineEdit);
    94101        m_pLineEdit->installEventFilter(this);
     102        setFocusProxy(m_pLineEdit);
    95103    }
    96104
     
    116124{
    117125    if (m_pLineEdit)
    118     {
    119         connect(m_pLineEdit, &QILineEdit::textChanged,
    120                 this, &UIChooserSearchWidget::sltHandleSearchTermChange);
    121     }
     126        connect(m_pLineEdit, &QILineEdit::textChanged, this, &UIChooserSearchWidget::sltHandleSearchTermChange);
    122127    if (m_pCloseButton)
    123128        connect(m_pCloseButton, &QIToolButton::clicked, this, &UIChooserSearchWidget::sltHandleCloseButtonClick);
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserSearchWidget.h

    r82968 r84587  
    5757    /** Appends the @a strSearchText to the current (if any) search text. */
    5858    void appendToSearchString(const QString &strSearchText);
     59    /** Repeats the last search again. */
     60    void redoSearch();
    5961
    6062protected:
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserView.cpp

    r84578 r84587  
    169169}
    170170
     171void UIChooserView::redoSearch()
     172{
     173    /* Make sure search widget exists: */
     174    AssertPtrReturnVoid(m_pSearchWidget);
     175
     176    /* Pass request to search widget: */
     177    m_pSearchWidget->redoSearch();
     178}
     179
    171180void UIChooserView::sltMinimumWidthHintChanged(int iHint)
    172181{
  • TabularUnified trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserView.h

    r84578 r84587  
    7070          * turn appends it to the current (if any) search term. */
    7171        void appendToSearchString(const QString &strSearchText);
     72        /** Repeats the last search again. */
     73        void redoSearch();
    7274    /** @} */
    7375
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