Browse Source

Update Python version requirements

adaptive-webui-19844
ngosang 9 years ago
parent
commit
88626b26d2
  1. 11
      src/gui/mainwindow.cpp

11
src/gui/mainwindow.cpp

@ -1494,13 +1494,16 @@ void MainWindow::on_actionSearchWidget_triggered()
bool res = false; bool res = false;
if ((pythonVersion == 2) || (pythonVersion == 3)) { if ((pythonVersion == 2) || (pythonVersion == 3)) {
// Check python minimum requirement: 2.7.0/3.3.0 // Check Python minimum requirement: 2.7.9 / 3.3.0
QString version = Utils::Misc::pythonVersionComplete(); QString version = Utils::Misc::pythonVersionComplete();
QStringList splitted = version.split('.'); QStringList splitted = version.split('.');
if (splitted.size() > 1) { if (splitted.size() > 2) {
int middleVer = splitted.at(1).toInt(); int middleVer = splitted.at(1).toInt();
if (((pythonVersion == 2) && (middleVer < 7)) || ((pythonVersion == 3) && (middleVer < 3))) { int lowerVer = splitted.at(2).toInt();
QMessageBox::information(this, tr("Old Python Interpreter"), tr("Your Python version %1 is outdated. Please upgrade to latest version for search engines to work. Minimum requirement: 2.7.0/3.3.0.").arg(version)); if (((pythonVersion == 2) && (middleVer < 7))
|| ((pythonVersion == 2) && (middleVer == 7) && (lowerVer < 9))
|| ((pythonVersion == 3) && (middleVer < 3))) {
QMessageBox::information(this, tr("Old Python Interpreter"), tr("Your Python version (%1) is outdated. Please upgrade to latest version for search engines to work.\nMinimum requirement: 2.7.9 / 3.3.0.").arg(version));
m_ui->actionSearchWidget->setChecked(false); m_ui->actionSearchWidget->setChecked(false);
Preferences::instance()->setSearchEnabled(false); Preferences::instance()->setSearchEnabled(false);
return; return;

Loading…
Cancel
Save