1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

[launcher] add option to ignore SSL errors

affects fetching mods list
This commit is contained in:
Andrey Filipenkov 2024-04-20 19:46:30 +03:00
parent 51345727f8
commit 99eb5b67cc
5 changed files with 40 additions and 6 deletions

View File

@ -573,6 +573,7 @@
"extraRepositoryEnabled",
"enableInstalledMods",
"autoCheckRepositories",
"ignoreSslErrors",
"updateOnStartup",
"updateConfigUrl"
],
@ -601,6 +602,10 @@
"type" : "boolean",
"default" : true
},
"ignoreSslErrors" : {
"type" : "boolean",
"default" : false
},
"autoCheckRepositories" : {
"type" : "boolean",
"default" : true

View File

@ -12,10 +12,16 @@
#include "../launcherdirs.h"
#include "../../lib/CConfigHandler.h"
CDownloadManager::CDownloadManager()
{
connect(&manager, SIGNAL(finished(QNetworkReply *)),
SLOT(downloadFinished(QNetworkReply *)));
connect(&manager, &QNetworkAccessManager::sslErrors, [](QNetworkReply * reply, const QList<QSslError> & errors) {
if(settings["launcher"]["ignoreSslErrors"].Bool())
reply->ignoreSslErrors();
});
}
void CDownloadManager::downloadFile(const QUrl & url, const QString & file, qint64 bytesTotal)

View File

@ -107,6 +107,8 @@ void CSettingsView::loadSettings()
ui->checkBoxRepositoryDefault->setChecked(settings["launcher"]["defaultRepositoryEnabled"].Bool());
ui->checkBoxRepositoryExtra->setChecked(settings["launcher"]["extraRepositoryEnabled"].Bool());
ui->checkBoxIgnoreSslErrors->setChecked(settings["launcher"]["ignoreSslErrors"].Bool());
ui->comboBoxAutoSave->setCurrentIndex(settings["general"]["saveFrequency"].Integer() > 0 ? 1 : 0);
ui->spinBoxAutoSaveLimit->setValue(settings["general"]["autosaveCountLimit"].Integer());
@ -571,3 +573,8 @@ void CSettingsView::on_comboBoxRendererType_currentTextChanged(const QString &ar
node->String() = arg1.toStdString();
}
void CSettingsView::on_checkBoxIgnoreSslErrors_clicked(bool checked)
{
Settings node = settings.write["launcher"]["ignoreSslErrors"];
node->Bool() = checked;
}

View File

@ -77,6 +77,8 @@ private slots:
void on_comboBoxRendererType_currentTextChanged(const QString &arg1);
void on_checkBoxIgnoreSslErrors_clicked(bool checked);
private:
Ui::CSettingsView * ui;

View File

@ -139,7 +139,7 @@
<item row="1" column="1" colspan="4">
<widget class="QComboBox" name="comboBoxLanguage"/>
</item>
<item row="31" column="2" colspan="3">
<item row="32" column="2" colspan="3">
<widget class="QLineEdit" name="lineEditRepositoryDefault">
<property name="text">
<string notr="true"/>
@ -170,14 +170,14 @@
</property>
</widget>
</item>
<item row="32" column="0">
<item row="33" column="0">
<widget class="QLabel" name="labelRepositoryExtra">
<property name="text">
<string>Additional repository</string>
</property>
</widget>
</item>
<item row="32" column="2" colspan="3">
<item row="33" column="2" colspan="3">
<widget class="QLineEdit" name="lineEditRepositoryExtra">
<property name="text">
<string notr="true"/>
@ -211,7 +211,7 @@
</property>
</widget>
</item>
<item row="31" column="1">
<item row="32" column="1">
<widget class="QCheckBox" name="checkBoxRepositoryDefault">
<property name="enabled">
<bool>true</bool>
@ -333,7 +333,7 @@
</property>
</widget>
</item>
<item row="32" column="1">
<item row="33" column="1">
<widget class="QCheckBox" name="checkBoxRepositoryExtra">
<property name="text">
<string/>
@ -608,7 +608,7 @@ Fullscreen Exclusive Mode - game will cover entirety of your screen and will use
</property>
</widget>
</item>
<item row="31" column="0">
<item row="32" column="0">
<widget class="QLabel" name="labelRepositoryDefault">
<property name="text">
<string>Default repository</string>
@ -625,6 +625,20 @@ Fullscreen Exclusive Mode - game will cover entirety of your screen and will use
</property>
</widget>
</item>
<item row="31" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Ignore SSL errors</string>
</property>
</widget>
</item>
<item row="31" column="1">
<widget class="QCheckBox" name="checkBoxIgnoreSslErrors">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</widget>