From 0c23d22472c3244f9fad4a4ede450681cec50675 Mon Sep 17 00:00:00 2001 From: Gabriele Date: Fri, 27 Feb 2015 14:00:00 +0100 Subject: [PATCH] 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. --- src/core/utils/misc.cpp | 2 +- src/searchengine/searchengine.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/utils/misc.cpp b/src/core/utils/misc.cpp index 2647b41f2..56c6cab8b 100644 --- a/src/core/utils/misc.cpp +++ b/src/core/utils/misc.cpp @@ -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) /* diff --git a/src/searchengine/searchengine.cpp b/src/searchengine/searchengine.cpp index 70955e779..f4d606da9 100644 --- a/src/searchengine/searchengine.cpp +++ b/src/searchengine/searchengine.cpp @@ -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();