Browse Source

Merge pull request #5336 from ngosang/pythonversion

Update Python version requirements
adaptive-webui-19844
sledgehammer999 9 years ago
parent
commit
978d1e1d3e
  1. 11
      src/gui/mainwindow.cpp

11
src/gui/mainwindow.cpp

@ -1494,13 +1494,16 @@ void MainWindow::on_actionSearchWidget_triggered() @@ -1494,13 +1494,16 @@ void MainWindow::on_actionSearchWidget_triggered()
bool res = false;
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();
QStringList splitted = version.split('.');
if (splitted.size() > 1) {
if (splitted.size() > 2) {
int middleVer = splitted.at(1).toInt();
if (((pythonVersion == 2) && (middleVer < 7)) || ((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. Minimum requirement: 2.7.0/3.3.0.").arg(version));
int lowerVer = splitted.at(2).toInt();
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);
Preferences::instance()->setSearchEnabled(false);
return;

Loading…
Cancel
Save