Show notification if Python is not found and a search is started

Also, don't bother starting a search if it's known that Python is
not available.
This commit is contained in:
sledgehammer999 2015-07-21 21:57:38 +03:00
commit 26b635ca33

View file

@ -181,6 +181,11 @@ void SearchEngine::giveFocusToSearchInput() {
// Function called when we click on search button // Function called when we click on search button
void SearchEngine::on_search_button_clicked() { void SearchEngine::on_search_button_clicked() {
if (misc::pythonVersion() < 0) {
mp_mainWindow->showNotificationBaloon(tr("Search Engine"), tr("Please install Python to use the Search Engine."));
return;
}
if (searchProcess->state() != QProcess::NotRunning) { if (searchProcess->state() != QProcess::NotRunning) {
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
searchProcess->kill(); searchProcess->kill();