Changeset 77765 in vbox
- Timestamp:
- Mar 18, 2019 4:22:11 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserSearchWidget.cpp
r77757 r77765 33 33 , m_pScrollToNextMatchButton(0) 34 34 , m_pScrollToPreviousMatchButton(0) 35 , m_pCloseButton(0) 35 36 { 36 37 /** Have a background. In some cases having no background causes strange artefacts in Cinnamon themes. */ … … 38 39 prepareWidgets(); 39 40 prepareConnections(); 41 retranslateUi(); 40 42 } 41 43 … … 68 70 m_pMainLayout->setSpacing(2); 69 71 m_pMainLayout->setContentsMargins(0, 0, 0, 0); 72 73 m_pCloseButton = new QIToolButton; 74 if (m_pCloseButton) 75 { 76 m_pCloseButton->setIcon(UIIconPool::iconSet(":/close_16px.png")); 77 m_pMainLayout->addWidget(m_pCloseButton, 0, Qt::AlignLeft); 78 } 79 70 80 m_pLineEdit = new UISearchLineEdit; 71 81 if (m_pLineEdit) … … 78 88 if (m_pScrollToPreviousMatchButton) 79 89 { 80 m_pScrollToPreviousMatchButton->setIcon(UIIconPool::iconSet(":/log_viewer_search_backward_16px.png", ":/log_viewer_search_backward_disabled_16px.png")); 90 m_pScrollToPreviousMatchButton->setIcon(UIIconPool::iconSet(":/log_viewer_search_backward_16px.png", 91 ":/log_viewer_search_backward_disabled_16px.png")); 81 92 m_pMainLayout->addWidget(m_pScrollToPreviousMatchButton); 82 93 } … … 84 95 if (m_pScrollToNextMatchButton) 85 96 { 86 m_pScrollToNextMatchButton->setIcon(UIIconPool::iconSet(":/log_viewer_search_forward_16px.png", ":/log_viewer_search_forward_disabled_16px.png")); 97 m_pScrollToNextMatchButton->setIcon(UIIconPool::iconSet(":/log_viewer_search_forward_16px.png", 98 ":/log_viewer_search_forward_disabled_16px.png")); 87 99 m_pMainLayout->addWidget(m_pScrollToNextMatchButton); 88 100 } … … 98 110 this, &UIChooserSearchWidget::sltHandleSearchTermChange); 99 111 } 112 if (m_pCloseButton) 113 connect(m_pCloseButton, &QIToolButton::clicked, this, &UIChooserSearchWidget::sltHandleCloseButtonClick); 100 114 if (m_pScrollToPreviousMatchButton) 101 115 connect(m_pScrollToPreviousMatchButton, &QIToolButton::clicked, this, &UIChooserSearchWidget::sltHandleScroolToButtonClick); … … 120 134 void UIChooserSearchWidget::retranslateUi() 121 135 { 136 if (m_pScrollToNextMatchButton) 137 m_pScrollToNextMatchButton->setToolTip(tr("Navigate to the next item among the search results")); 138 if (m_pScrollToPreviousMatchButton) 139 m_pScrollToPreviousMatchButton->setToolTip(tr("Navigate to the previous item among the search results")); 140 if (m_pLineEdit) 141 m_pLineEdit->setToolTip(tr("Enter a search term to be used during virtual machine search")); 142 if (m_pCloseButton) 143 m_pCloseButton->setToolTip(tr("Close the search widget")); 122 144 } 123 145 … … 149 171 emit sigScrollToMatch(false); 150 172 } 173 174 void UIChooserSearchWidget::sltHandleCloseButtonClick() 175 { 176 emit sigToggleVisibility(false); 177 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserSearchWidget.h
r77750 r77765 51 51 52 52 UIChooserSearchWidget(QWidget *pParent); 53 /** Forward @a iMatchCount to UISearchLineEdit. */ 53 54 void setMatchCount(int iMatchCount); 55 /** Forward @a iScrollToIndex to UISearchLineEdit. */ 54 56 void setScroolToIndex(int iScrollToIndex); 55 57 /** Appends the @a strSearchText to the current (if any) search text. */ … … 67 69 private slots: 68 70 71 /** Emits sigRedoSearch thuse causes a re-search. */ 69 72 void sltHandleSearchTermChange(const QString &strSearchTerm); 70 73 void sltHandleScroolToButtonClick(); 74 /** Emits sigToggleVisibility, */ 75 void sltHandleCloseButtonClick(); 71 76 72 77 private: … … 75 80 void prepareConnections(); 76 81 77 UISearchLineEdit *m_pLineEdit; 78 QHBoxLayout *m_pMainLayout; 79 QIToolButton *m_pScrollToNextMatchButton; 80 QIToolButton *m_pScrollToPreviousMatchButton; 82 /** @name Member widgets. 83 * @{ */ 84 UISearchLineEdit *m_pLineEdit; 85 QHBoxLayout *m_pMainLayout; 86 QIToolButton *m_pScrollToNextMatchButton; 87 QIToolButton *m_pScrollToPreviousMatchButton; 88 QIToolButton *m_pCloseButton; 89 /** @} */ 81 90 }; 82 91
Note:
See TracChangeset
for help on using the changeset viewer.