Show update channel in the update dialog, actually show changelog for the selected update channel.
This commit is contained in:
parent
7c51cc475b
commit
6f75009a80
@ -1,13 +1,16 @@
|
|||||||
#include "UpdateDialog.h"
|
#include "UpdateDialog.h"
|
||||||
#include "ui_UpdateDialog.h"
|
#include "ui_UpdateDialog.h"
|
||||||
#include "gui/Platform.h"
|
#include "gui/Platform.h"
|
||||||
#include <BuildConfig.h>
|
|
||||||
#include "logger/QsLog.h"
|
#include "logger/QsLog.h"
|
||||||
|
#include "MultiMC.h"
|
||||||
|
#include <logic/settings/SettingsObject.h>
|
||||||
|
|
||||||
UpdateDialog::UpdateDialog(QWidget *parent) : QDialog(parent), ui(new Ui::UpdateDialog)
|
UpdateDialog::UpdateDialog(QWidget *parent) : QDialog(parent), ui(new Ui::UpdateDialog)
|
||||||
{
|
{
|
||||||
MultiMCPlatform::fixWM_CLASS(this);
|
MultiMCPlatform::fixWM_CLASS(this);
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
auto channel = MMC->settings()->get("UpdateChannel").toString();
|
||||||
|
ui->label->setText(tr("A new %1 update is available!").arg(channel));
|
||||||
loadChangelog();
|
loadChangelog();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -17,8 +20,9 @@ UpdateDialog::~UpdateDialog()
|
|||||||
|
|
||||||
void UpdateDialog::loadChangelog()
|
void UpdateDialog::loadChangelog()
|
||||||
{
|
{
|
||||||
|
auto channel = MMC->settings()->get("UpdateChannel").toString();
|
||||||
dljob.reset(new NetJob("Changelog"));
|
dljob.reset(new NetJob("Changelog"));
|
||||||
auto url = QString("https://raw.githubusercontent.com/MultiMC/MultiMC5/%1/changelog.md").arg(BuildConfig.VERSION_CHANNEL);
|
auto url = QString("https://raw.githubusercontent.com/MultiMC/MultiMC5/%1/changelog.md").arg(channel);
|
||||||
changelogDownload = ByteArrayDownload::make(QUrl(url));
|
changelogDownload = ByteArrayDownload::make(QUrl(url));
|
||||||
dljob->addNetAction(changelogDownload);
|
dljob->addNetAction(changelogDownload);
|
||||||
connect(dljob.get(), &NetJob::succeeded, this, &UpdateDialog::changelogLoaded);
|
connect(dljob.get(), &NetJob::succeeded, this, &UpdateDialog::changelogLoaded);
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>A new MultiMC update is available!</string>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
<property name="alignment">
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
|
Loading…
Reference in New Issue
Block a user