Browse Source

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.
adaptive-webui-19844
Gabriele 10 years ago
parent
commit
0c23d22472
  1. 2
      src/core/utils/misc.cpp
  2. 5
      src/searchengine/searchengine.cpp

2
src/core/utils/misc.cpp

@ -269,7 +269,7 @@ int Utils::Misc::pythonVersion() @@ -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)
/*

5
src/searchengine/searchengine.cpp

@ -180,6 +180,11 @@ void SearchEngine::giveFocusToSearchInput() { @@ -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();

Loading…
Cancel
Save