Browse Source

- Redesigned search tab to improve usability

- Started work on categorized searching but not yet functional
adaptive-webui-19844
Christophe Dumez 15 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 @@
- FEATURE: Added "Unread" item to RSS feed list to display all unread news - 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 - FEATURE: If a torrent contains a torrent file, process downloaded torrent file too
- BUGFIX: torrent resume code rewrited - BUGFIX: torrent resume code rewrited
- COSMETIC: Redesigned search tab to improve usability
- COSMETIC: Redesigned RSS tab to improve usability - COSMETIC: Redesigned RSS tab to improve usability
* Sun Aug 21 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.4.1 * 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 @@
<!DOCTYPE RCC><RCC version="1.0"> <!DOCTYPE RCC><RCC version="1.0">
<qresource> <qresource>
<file>Icons/gnome-shutdown.png</file>
<file>Icons/rss32.png</file> <file>Icons/rss32.png</file>
<file>Icons/money.png</file> <file>Icons/money.png</file>
<file>Icons/sphere2.png</file> <file>Icons/sphere2.png</file>
@ -95,6 +94,7 @@
<file>Icons/oxygen/edit-copy.png</file> <file>Icons/oxygen/edit-copy.png</file>
<file>Icons/oxygen/bt_settings.png</file> <file>Icons/oxygen/bt_settings.png</file>
<file>Icons/oxygen/document-new.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/webui.png</file>
<file>Icons/oxygen/list-remove.png</file> <file>Icons/oxygen/list-remove.png</file>
<file>Icons/oxygen/connection.png</file> <file>Icons/oxygen/connection.png</file>

134
src/search.ui

@ -13,39 +13,9 @@
<property name="windowTitle"> <property name="windowTitle">
<string>Search</string> <string>Search</string>
</property> </property>
<layout class="QVBoxLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<layout class="QHBoxLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<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>
<item> <item>
<widget class="QLineEdit" name="search_pattern"> <widget class="QLineEdit" name="search_pattern">
<property name="maximumSize"> <property name="maximumSize">
@ -60,26 +30,52 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="clearPatternButton"> <widget class="QComboBox" name="comboCategory">
<property name="maximumSize"> <item>
<size> <property name="text">
<width>34</width> <string>All categories</string>
<height>29</height> </property>
</size> </item>
</property> <item>
<property name="text"> <property name="text">
<string/> <string>Movies</string>
</property> </property>
<property name="icon"> </item>
<iconset resource="icons.qrc"> <item>
<normaloff>:/Icons/oxygen/edit_clear.png</normaloff>:/Icons/oxygen/edit_clear.png</iconset> <property name="text">
</property> <string>TV shows</string>
<property name="iconSize"> </property>
<size> </item>
<width>30</width> <item>
<height>21</height> <property name="text">
</size> <string>Music</string>
</property> </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> </widget>
</item> </item>
<item> <item>
@ -95,33 +91,10 @@
</property> </property>
</widget> </widget>
</item> </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> </layout>
</item> </item>
<item> <item>
<layout class="QHBoxLayout"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
<widget class="QLabel" name="status_lbl"> <widget class="QLabel" name="status_lbl">
<property name="maximumSize"> <property name="maximumSize">
@ -150,7 +123,7 @@
<widget class="QLabel" name="search_status"> <widget class="QLabel" name="search_status">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>400</width> <width>200</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
@ -233,6 +206,13 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="QPushButton" name="enginesButton">
<property name="text">
<string>Search engines...</string>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>

19
src/searchEngine.cpp

@ -60,7 +60,7 @@ SearchEngine::SearchEngine(bittorrent *BTSession, QSystemTrayIcon *myTrayIcon, b
createCompleter(); createCompleter();
// Add close tab button // Add close tab button
closeTab_button = new QPushButton(); 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); closeTab_button->setFlat(true);
connect(closeTab_button, SIGNAL(clicked()), this, SLOT(closeTab_button_clicked())); connect(closeTab_button, SIGNAL(clicked()), this, SLOT(closeTab_button_clicked()));
tabWidget->setCornerWidget(closeTab_button); tabWidget->setCornerWidget(closeTab_button);
@ -200,6 +200,8 @@ void SearchEngine::on_search_button_clicked(){
if(searchProcess->state() != QProcess::NotRunning){ if(searchProcess->state() != QProcess::NotRunning){
searchProcess->kill(); searchProcess->kill();
searchProcess->waitForFinished(); searchProcess->waitForFinished();
search_button->setText("Search");
return;
} }
if(searchTimeout->isActive()) { if(searchTimeout->isActive()) {
searchTimeout->stop(); searchTimeout->stop();
@ -306,12 +308,7 @@ void SearchEngine::searchStarted(){
// Update SearchEngine widgets // Update SearchEngine widgets
search_status->setText(tr("Searching...")); search_status->setText(tr("Searching..."));
search_status->repaint(); search_status->repaint();
stop_search_button->setEnabled(true); search_button->setText("Stop");
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();
} }
// Download the given item from search results list // Download the given item from search results list
@ -464,8 +461,7 @@ void SearchEngine::searchFinished(int exitcode,QProcess::ExitStatus){
} }
if(currentSearchTab) if(currentSearchTab)
currentSearchTab->getCurrentLabel()->setText(tr("Results", "i.e: Search results")+QString::fromUtf8(" <i>(")+misc::toQString(nb_search_results)+QString::fromUtf8(")</i>:")); currentSearchTab->getCurrentLabel()->setText(tr("Results", "i.e: Search results")+QString::fromUtf8(" <i>(")+misc::toQString(nb_search_results)+QString::fromUtf8(")</i>:"));
search_button->setEnabled(true); search_button->setText("Search");
stop_search_button->setEnabled(false);
} }
// SLOT to append one line to search results list // SLOT to append one line to search results list
@ -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 // Download selected items in search results list
void SearchEngine::on_download_button_clicked(){ void SearchEngine::on_download_button_clicked(){
//QModelIndexList selectedIndexes = currentSearchTab->getCurrentTreeView()->selectionModel()->selectedIndexes(); //QModelIndexList selectedIndexes = currentSearchTab->getCurrentTreeView()->selectionModel()->selectedIndexes();

1
src/searchEngine.h

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

Loading…
Cancel
Save