Browse Source

- Redesigned search tab to improve usability

- Started work on categorized searching but not yet functional
adaptive-webui-19844
Christophe Dumez 16 years ago
parent
commit
b8d8862562
  1. 1
      Changelog
  2. BIN
      src/Icons/gnome-shutdown.png
  3. BIN
      src/Icons/oxygen/tab-close.png
  4. 2
      src/icons.qrc
  5. 134
      src/search.ui
  6. 19
      src/searchEngine.cpp
  7. 1
      src/searchEngine.h

1
Changelog

@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
- FEATURE: Added "Unread" item to RSS feed list to display all unread news
- FEATURE: If a torrent contains a torrent file, process downloaded torrent file too
- BUGFIX: torrent resume code rewrited
- COSMETIC: Redesigned search tab to improve usability
- COSMETIC: Redesigned RSS tab to improve usability
* Sun Aug 21 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.4.1

BIN
src/Icons/gnome-shutdown.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

BIN
src/Icons/oxygen/tab-close.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

2
src/icons.qrc

@ -1,6 +1,5 @@ @@ -1,6 +1,5 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>Icons/gnome-shutdown.png</file>
<file>Icons/rss32.png</file>
<file>Icons/money.png</file>
<file>Icons/sphere2.png</file>
@ -95,6 +94,7 @@ @@ -95,6 +94,7 @@
<file>Icons/oxygen/edit-copy.png</file>
<file>Icons/oxygen/bt_settings.png</file>
<file>Icons/oxygen/document-new.png</file>
<file>Icons/oxygen/tab-close.png</file>
<file>Icons/oxygen/webui.png</file>
<file>Icons/oxygen/list-remove.png</file>
<file>Icons/oxygen/connection.png</file>

134
src/search.ui

@ -13,39 +13,9 @@ @@ -13,39 +13,9 @@
<property name="windowTitle">
<string>Search</string>
</property>
<layout class="QVBoxLayout">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="search_lbl">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>35</height>
</size>
</property>
<property name="font">
<font>
<family>Sans Serif</family>
<pointsize>9</pointsize>
<weight>75</weight>
<italic>false</italic>
<bold>true</bold>
<underline>false</underline>
<strikeout>false</strikeout>
</font>
</property>
<property name="text">
<string>Search Pattern:</string>
</property>
</widget>
</item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLineEdit" name="search_pattern">
<property name="maximumSize">
@ -60,26 +30,52 @@ @@ -60,26 +30,52 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="clearPatternButton">
<property name="maximumSize">
<size>
<width>34</width>
<height>29</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="icons.qrc">
<normaloff>:/Icons/oxygen/edit_clear.png</normaloff>:/Icons/oxygen/edit_clear.png</iconset>
</property>
<property name="iconSize">
<size>
<width>30</width>
<height>21</height>
</size>
</property>
<widget class="QComboBox" name="comboCategory">
<item>
<property name="text">
<string>All categories</string>
</property>
</item>
<item>
<property name="text">
<string>Movies</string>
</property>
</item>
<item>
<property name="text">
<string>TV shows</string>
</property>
</item>
<item>
<property name="text">
<string>Music</string>
</property>
</item>
<item>
<property name="text">
<string>Games</string>
</property>
</item>
<item>
<property name="text">
<string>Anime</string>
</property>
</item>
<item>
<property name="text">
<string>Software</string>
</property>
</item>
<item>
<property name="text">
<string>Pictures</string>
</property>
</item>
<item>
<property name="text">
<string>Books</string>
</property>
</item>
</widget>
</item>
<item>
@ -95,33 +91,10 @@ @@ -95,33 +91,10 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="stop_search_button">
<property name="enabled">
<bool>false</bool>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>29</height>
</size>
</property>
<property name="text">
<string>Stop</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="enginesButton">
<property name="text">
<string>Search engines...</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="status_lbl">
<property name="maximumSize">
@ -150,7 +123,7 @@ @@ -150,7 +123,7 @@
<widget class="QLabel" name="search_status">
<property name="minimumSize">
<size>
<width>400</width>
<width>200</width>
<height>0</height>
</size>
</property>
@ -233,6 +206,13 @@ @@ -233,6 +206,13 @@
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="enginesButton">
<property name="text">
<string>Search engines...</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>

19
src/searchEngine.cpp

@ -60,7 +60,7 @@ SearchEngine::SearchEngine(bittorrent *BTSession, QSystemTrayIcon *myTrayIcon, b @@ -60,7 +60,7 @@ SearchEngine::SearchEngine(bittorrent *BTSession, QSystemTrayIcon *myTrayIcon, b
createCompleter();
// Add close tab button
closeTab_button = new QPushButton();
closeTab_button->setIcon(QIcon(QString::fromUtf8(":/Icons/gnome-shutdown.png")));
closeTab_button->setIcon(QIcon(QString::fromUtf8(":/Icons/oxygen/tab-close.png")));
closeTab_button->setFlat(true);
connect(closeTab_button, SIGNAL(clicked()), this, SLOT(closeTab_button_clicked()));
tabWidget->setCornerWidget(closeTab_button);
@ -200,6 +200,8 @@ void SearchEngine::on_search_button_clicked(){ @@ -200,6 +200,8 @@ void SearchEngine::on_search_button_clicked(){
if(searchProcess->state() != QProcess::NotRunning){
searchProcess->kill();
searchProcess->waitForFinished();
search_button->setText("Search");
return;
}
if(searchTimeout->isActive()) {
searchTimeout->stop();
@ -306,12 +308,7 @@ void SearchEngine::searchStarted(){ @@ -306,12 +308,7 @@ void SearchEngine::searchStarted(){
// Update SearchEngine widgets
search_status->setText(tr("Searching..."));
search_status->repaint();
stop_search_button->setEnabled(true);
stop_search_button->repaint();
// clear results window ... not needed since we got Tabbed
//SearchListModel->removeRows(0, SearchListModel->rowCount());
// Clear previous results urls too
//searchResultsUrls.clear();
search_button->setText("Stop");
}
// Download the given item from search results list
@ -464,8 +461,7 @@ void SearchEngine::searchFinished(int exitcode,QProcess::ExitStatus){ @@ -464,8 +461,7 @@ void SearchEngine::searchFinished(int exitcode,QProcess::ExitStatus){
}
if(currentSearchTab)
currentSearchTab->getCurrentLabel()->setText(tr("Results", "i.e: Search results")+QString::fromUtf8(" <i>(")+misc::toQString(nb_search_results)+QString::fromUtf8(")</i>:"));
search_button->setEnabled(true);
stop_search_button->setEnabled(false);
search_button->setText("Search");
}
// SLOT to append one line to search results list
@ -527,11 +523,6 @@ void SearchEngine::closeTab_button_clicked(){ @@ -527,11 +523,6 @@ void SearchEngine::closeTab_button_clicked(){
}
}
void SearchEngine::on_clearPatternButton_clicked() {
search_pattern->clear();
search_pattern->setFocus();
}
// Download selected items in search results list
void SearchEngine::on_download_button_clicked(){
//QModelIndexList selectedIndexes = currentSearchTab->getCurrentTreeView()->selectionModel()->selectedIndexes();

1
src/searchEngine.h

@ -90,7 +90,6 @@ class SearchEngine : public QWidget, public Ui::search_engine{ @@ -90,7 +90,6 @@ class SearchEngine : public QWidget, public Ui::search_engine{
void updateNova();
void saveSearchHistory();
void on_enginesButton_clicked();
void on_clearPatternButton_clicked();
void propagateSectionResized(int index, int oldsize , int newsize);
void saveResultsColumnsWidth();
void downloadFinished(int exitcode, QProcess::ExitStatus);

Loading…
Cancel
Save