mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-15 12:41:36 +03:00
- Launch directly the new search instead of stopping the current one if the user changed the search pattern
This commit is contained in:
parent
5656fe9a9b
commit
b4b61b9b7d
2 changed files with 13 additions and 2 deletions
|
@ -88,6 +88,7 @@ SearchEngine::SearchEngine(GUI *parent, Bittorrent *BTSession) : QWidget(parent)
|
|||
// Fill in category combobox
|
||||
fillCatCombobox();
|
||||
connect(search_pattern, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(displayPatternContextMenu(QPoint)));
|
||||
connect(search_pattern, SIGNAL(textEdited(QString)), this, SLOT(searchTextEdited(QString)));
|
||||
}
|
||||
|
||||
void SearchEngine::fillCatCombobox() {
|
||||
|
@ -199,6 +200,11 @@ void SearchEngine::saveSearchHistory() {
|
|||
settings.setValue("Search/searchHistory",searchHistory.stringList());
|
||||
}
|
||||
|
||||
void SearchEngine::searchTextEdited(QString) {
|
||||
// Enable search button
|
||||
search_button->setText(tr("Search"));
|
||||
}
|
||||
|
||||
// Function called when we click on search button
|
||||
void SearchEngine::on_search_button_clicked(){
|
||||
if(searchProcess->state() != QProcess::NotRunning){
|
||||
|
@ -207,8 +213,12 @@ void SearchEngine::on_search_button_clicked(){
|
|||
if(searchTimeout->isActive()) {
|
||||
searchTimeout->stop();
|
||||
}
|
||||
search_button->setText("Search");
|
||||
if(search_button->text() != tr("Search")) {
|
||||
search_button->setText(tr("Search"));
|
||||
return;
|
||||
} else {
|
||||
searchProcess->waitForFinished(1000);
|
||||
}
|
||||
}
|
||||
// Reload environment variables (proxy)
|
||||
searchProcess->setEnvironment(QProcess::systemEnvironment());
|
||||
|
|
|
@ -125,6 +125,7 @@ protected slots:
|
|||
void displayPatternContextMenu(QPoint);
|
||||
void createCompleter();
|
||||
void fillCatCombobox();
|
||||
void searchTextEdited(QString);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue