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:
Gabriele 2015-02-27 14:00:00 +01:00
parent e34cc79dad
commit 0c23d22472
2 changed files with 6 additions and 1 deletions

View file

@ -269,7 +269,7 @@ int Utils::Misc::pythonVersion()
return version;
}
QString misc::pythonExecutable()
QString Utils::Misc::pythonExecutable()
{
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
/*

View file

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