mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-01-12 18:24:58 +08:00
WINDOWS: Search first in PATH for python. Closes #956.
This commit is contained in:
parent
1144555eca
commit
b6d4030cd8
@ -458,6 +458,7 @@ void MainWindow::displayRSSTab(bool enable) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::displaySearchTab(bool enable) {
|
void MainWindow::displaySearchTab(bool enable) {
|
||||||
|
Preferences::instance()->setSearchEnabled(enable);
|
||||||
if (enable) {
|
if (enable) {
|
||||||
// RSS tab
|
// RSS tab
|
||||||
if (!searchEngine) {
|
if (!searchEngine) {
|
||||||
@ -1327,7 +1328,14 @@ void MainWindow::on_actionRSS_Reader_triggered() {
|
|||||||
void MainWindow::on_actionSearch_engine_triggered() {
|
void MainWindow::on_actionSearch_engine_triggered() {
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
if (!has_python && actionSearch_engine->isChecked()) {
|
if (!has_python && actionSearch_engine->isChecked()) {
|
||||||
bool res = addPythonPathToEnv();
|
bool res = false;
|
||||||
|
|
||||||
|
// Check if python is already in PATH
|
||||||
|
if (misc::pythonVersion())
|
||||||
|
res = true;
|
||||||
|
else
|
||||||
|
res = addPythonPathToEnv();
|
||||||
|
|
||||||
if (res)
|
if (res)
|
||||||
has_python = true;
|
has_python = true;
|
||||||
else if (QMessageBox::question(this, tr("Missing Python Interpreter"),
|
else if (QMessageBox::question(this, tr("Missing Python Interpreter"),
|
||||||
@ -1544,7 +1552,6 @@ void MainWindow::pythonDownloadSuccess(QString url, QString file_path) {
|
|||||||
has_python = addPythonPathToEnv();
|
has_python = addPythonPathToEnv();
|
||||||
if (has_python) {
|
if (has_python) {
|
||||||
actionSearch_engine->setChecked(true);
|
actionSearch_engine->setChecked(true);
|
||||||
Preferences::instance()->setSearchEnabled(true);
|
|
||||||
displaySearchTab(true);
|
displaySearchTab(true);
|
||||||
}
|
}
|
||||||
sender()->deleteLater();
|
sender()->deleteLater();
|
||||||
|
Loading…
Reference in New Issue
Block a user