Browse Source

Move m_searchPattern widget from code to .ui file

adaptive-webui-19844
Chocobo1 9 years ago
parent
commit
216d98844b
  1. 8
      src/gui/search/searchwidget.cpp
  2. 2
      src/gui/search/searchwidget.h
  3. 10
      src/gui/search/searchwidget.ui

8
src/gui/search/searchwidget.cpp

@ -61,7 +61,6 @@ @@ -61,7 +61,6 @@
#include "mainwindow.h"
#include "addnewtorrentdialog.h"
#include "guiiconprovider.h"
#include "lineedit.h"
#include "pluginselectdlg.h"
#include "searchsortmodel.h"
#include "searchtab.h"
@ -78,13 +77,8 @@ SearchWidget::SearchWidget(MainWindow *mainWindow) @@ -78,13 +77,8 @@ SearchWidget::SearchWidget(MainWindow *mainWindow)
{
setupUi(this);
m_searchPattern = new LineEdit(this);
searchBarLayout->insertWidget(0, m_searchPattern);
connect(m_searchPattern, SIGNAL(returnPressed()), searchButton, SLOT(click()));
QString searchPatternHint;
QTextStream stream(&searchPatternHint, QIODevice::WriteOnly);
stream << "<html><head/><body><p>"
<< tr("A phrase to search for.") << "<br>"
<< tr("Spaces in a search term may be protected by double quotes.")
@ -99,7 +93,6 @@ SearchWidget::SearchWidget(MainWindow *mainWindow) @@ -99,7 +93,6 @@ SearchWidget::SearchWidget(MainWindow *mainWindow)
"Search phrase example, illustrates quotes usage, double quoted"
"pair of space delimited words, the whole pair is highlighted")
<< "</p></body></html>" << flush;
m_searchPattern->setToolTip(searchPatternHint);
// Icons
@ -120,6 +113,7 @@ SearchWidget::SearchWidget(MainWindow *mainWindow) @@ -120,6 +113,7 @@ SearchWidget::SearchWidget(MainWindow *mainWindow)
fillCatCombobox();
fillPluginComboBox();
connect(m_searchPattern, SIGNAL(returnPressed()), searchButton, SLOT(click()));
connect(m_searchPattern, SIGNAL(textEdited(QString)), this, SLOT(searchTextEdited(QString)));
connect(selectPlugin, SIGNAL(currentIndexChanged(int)), this, SLOT(selectMultipleBox(int)));
}

2
src/gui/search/searchwidget.h

@ -38,7 +38,6 @@ @@ -38,7 +38,6 @@
#include "ui_searchwidget.h"
class MainWindow;
class LineEdit;
class SearchEngine;
struct SearchResult;
class SearchTab;
@ -82,7 +81,6 @@ private: @@ -82,7 +81,6 @@ private:
QString selectedCategory() const;
QString selectedPlugin() const;
LineEdit *m_searchPattern;
SearchEngine *m_searchEngine;
QPointer<SearchTab> m_currentSearchTab; // Selected tab
QPointer<SearchTab> m_activeSearchTab; // Tab with running search

10
src/gui/search/searchwidget.ui

@ -16,6 +16,9 @@ @@ -16,6 +16,9 @@
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="searchBarLayout">
<item>
<widget class="LineEdit" name="m_searchPattern"/>
</item>
<item>
<widget class="QComboBox" name="comboCategory">
<property name="sizePolicy">
@ -114,6 +117,13 @@ @@ -114,6 +117,13 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>LineEdit</class>
<extends>QLineEdit</extends>
<header>lineedit.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

Loading…
Cancel
Save