1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-07 15:10:43 +02:00

Merge remote-tracking branch 'origin/check-for-updates' into mod-from-github

# Conflicts:
#	config/schemas/settings.json
This commit is contained in:
nordsoft 2022-08-28 04:16:43 +04:00
commit b8243b3858
3 changed files with 6 additions and 13 deletions

View File

@ -388,7 +388,7 @@
},
"updateConfigUrl" : {
"type" : "string",
"default" : "https://raw.githubusercontent.com/vcmi/vcmi-mods-repository/develop/github.json"
"default" : "https://raw.githubusercontent.com/vcmi/vcmi-updates/master/vcmi-updates.json"
}
}
}

View File

@ -55,7 +55,7 @@ UpdateDialog::UpdateDialog(bool calledManually, QWidget *parent):
QNetworkReply *response = networkManager.get(QNetworkRequest(QUrl(url)));
QObject::connect(response, &QNetworkReply::finished, [&, response]{
connect(response, &QNetworkReply::finished, [&, response]{
response->deleteLater();
if(response->error() != QNetworkReply::NoError)
@ -87,7 +87,7 @@ void UpdateDialog::showUpdateDialog(bool isManually)
void UpdateDialog::on_checkOnStartup_stateChanged(int state)
{
Settings node = settings.write["launcher"]["updateOnStartup"];
node->Bool() = (state == 2 ? true : false);
node->Bool() = ui->checkOnStartup->isChecked();
}
void UpdateDialog::loadFromJson(const JsonNode & node)
@ -128,7 +128,7 @@ void UpdateDialog::loadFromJson(const JsonNode & node)
else if(updateType == "critical")
bgColor = "red";
ui->versionLabel->setStyleSheet(QLatin1String("QLabel { background-color : %1; color : black; }").arg(bgColor));
ui->versionLabel->setStyleSheet(QString("QLabel { background-color : %1; color : black; }").arg(bgColor));
ui->versionLabel->setText(QString::fromStdString(newVersion));
ui->plainTextEdit->setPlainText(QString::fromStdString(node["changeLog"].String()));
@ -136,5 +136,5 @@ void UpdateDialog::loadFromJson(const JsonNode & node)
if(node["downloadLinks"][platformParameter].getType() == JsonNode::JsonType::DATA_STRING)
downloadLink = QString::fromStdString(node["downloadLinks"][platformParameter].String());
ui->downloadLink->setText(QString{"<a href=\"%1\">link</a>"}.arg(downloadLink));
ui->downloadLink->setText(QString{"<a href=\"%1\">Download page</a>"}.arg(downloadLink));
}

View File

@ -38,13 +38,6 @@
<property name="bottomMargin">
<number>12</number>
</property>
<item row="1" column="0">
<widget class="QLabel" name="downloadLabel">
<property name="text">
<string>Download:</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="5">
<widget class="QLabel" name="versionLabel">
<property name="sizePolicy">
@ -118,7 +111,7 @@
</sizepolicy>
</property>
<property name="text">
<string>not available</string>
<string/>
</property>
<property name="openExternalLinks">
<bool>true</bool>