|
|
@ -56,6 +56,7 @@ SearchEngine::SearchEngine(bittorrent *BTSession, QSystemTrayIcon *myTrayIcon, b |
|
|
|
connect(searchProcess, SIGNAL(started()), this, SLOT(searchStarted())); |
|
|
|
connect(searchProcess, SIGNAL(started()), this, SLOT(searchStarted())); |
|
|
|
connect(searchProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(readSearchOutput())); |
|
|
|
connect(searchProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(readSearchOutput())); |
|
|
|
connect(searchProcess, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(searchFinished(int,QProcess::ExitStatus))); |
|
|
|
connect(searchProcess, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(searchFinished(int,QProcess::ExitStatus))); |
|
|
|
|
|
|
|
connect(tabWidget,SIGNAL(currentChanged(int)),this,SLOT(on_tab_changed(int))); |
|
|
|
searchTimeout = new QTimer(this); |
|
|
|
searchTimeout = new QTimer(this); |
|
|
|
searchTimeout->setSingleShot(true); |
|
|
|
searchTimeout->setSingleShot(true); |
|
|
|
connect(searchTimeout, SIGNAL(timeout()), this, SLOT(on_stop_search_button_clicked())); |
|
|
|
connect(searchTimeout, SIGNAL(timeout()), this, SLOT(on_stop_search_button_clicked())); |
|
|
@ -77,6 +78,19 @@ SearchEngine::~SearchEngine(){ |
|
|
|
delete downloader; |
|
|
|
delete downloader; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SearchEngine::on_tab_changed(int t) |
|
|
|
|
|
|
|
{//when we switch from a tab that is not empty to another that is empty the download button
|
|
|
|
|
|
|
|
//doesn't have to be available
|
|
|
|
|
|
|
|
if(t>-1) |
|
|
|
|
|
|
|
{//-1 = no more tab
|
|
|
|
|
|
|
|
if(all_tab.at(tabWidget->currentIndex())->getCurrentSearchListModel()->rowCount()) { |
|
|
|
|
|
|
|
download_button->setEnabled(true); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
download_button->setEnabled(false); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void SearchEngine::on_enginesButton_clicked() { |
|
|
|
void SearchEngine::on_enginesButton_clicked() { |
|
|
|
engineSelectDlg *dlg = new engineSelectDlg(this); |
|
|
|
engineSelectDlg *dlg = new engineSelectDlg(this); |
|
|
|
connect(dlg, SIGNAL(enginesChanged()), this, SLOT(loadEngineSettings())); |
|
|
|
connect(dlg, SIGNAL(enginesChanged()), this, SLOT(loadEngineSettings())); |
|
|
@ -134,8 +148,8 @@ void SearchEngine::on_search_button_clicked(){ |
|
|
|
} |
|
|
|
} |
|
|
|
// Tab Addition
|
|
|
|
// Tab Addition
|
|
|
|
currentSearchTab=new SearchTab(this); |
|
|
|
currentSearchTab=new SearchTab(this); |
|
|
|
tabWidget->addTab(currentSearchTab, pattern); |
|
|
|
|
|
|
|
all_tab.append(currentSearchTab); |
|
|
|
all_tab.append(currentSearchTab); |
|
|
|
|
|
|
|
tabWidget->addTab(currentSearchTab, pattern); |
|
|
|
tabWidget->setCurrentWidget(currentSearchTab); |
|
|
|
tabWidget->setCurrentWidget(currentSearchTab); |
|
|
|
closeTab_button->setEnabled(true); |
|
|
|
closeTab_button->setEnabled(true); |
|
|
|
// if the pattern is not in the pattern
|
|
|
|
// if the pattern is not in the pattern
|
|
|
|