18 static const QString
DEFS_URL =
"https://raw.githubusercontent.com/"
19 "alex-spataru/QSimpleUpdater/master/tutorial/"
20 "definitions/updates.json";
32 setWindowTitle(qApp->applicationName());
38 connect(m_updater, SIGNAL(checkingFinished(QString)),
this, SLOT(
updateChangelog(QString)));
39 connect(m_updater, SIGNAL(appcastDownloaded(QString, QByteArray)),
this, SLOT(
displayAppcast(QString, QByteArray)));
42 connect(m_ui->resetButton, SIGNAL(clicked()),
this, SLOT(
resetFields()));
43 connect(m_ui->closeButton, SIGNAL(clicked()),
this, SLOT(close()));
44 connect(m_ui->checkButton, SIGNAL(clicked()),
this, SLOT(
checkForUpdates()));
47 setMinimumSize(minimumSizeHint());
48 resize(minimumSizeHint());
69 m_ui->installedVersion->setText(
"0.1");
70 m_ui->customAppcast->setChecked(
false);
71 m_ui->enableDownloader->setChecked(
true);
72 m_ui->showAllNotifcations->setChecked(
false);
73 m_ui->showUpdateNotifications->setChecked(
true);
74 m_ui->mandatoryUpdate->setChecked(
false);
84 QString
version = m_ui->installedVersion->text();
85 bool customAppcast = m_ui->customAppcast->isChecked();
86 bool downloaderEnabled = m_ui->enableDownloader->isChecked();
87 bool notifyOnFinish = m_ui->showAllNotifcations->isChecked();
88 bool notifyOnUpdate = m_ui->showUpdateNotifications->isChecked();
89 bool mandatoryUpdate = m_ui->mandatoryUpdate->isChecked();
110 m_ui->changelogText->setText(m_updater->
getChangelog(url));
121 QString text =
"This is the downloaded appcast: <p><pre>" + QString::fromUtf8(reply)
122 +
"</pre></p><p> If you need to store more information on the "
123 "appcast (or use another format), just use the "
124 "<b>QSimpleUpdater::setCustomAppcast()</b> function. "
125 "It allows your application to interpret the appcast "
126 "using your code and not QSU's code.</p>";
128 m_ui->changelogText->setText(text);
static const QString DEFS_URL
void setModuleVersion(const QString &url, const QString &version)
void setNotifyOnUpdate(const QString &url, const bool notify)
void setNotifyOnFinish(const QString &url, const bool notify)
QString getChangelog(const QString &url) const
void checkForUpdates(const QString &url)
void setMandatoryUpdate(const QString &url, const bool mandatory_update)
void setDownloaderEnabled(const QString &url, const bool enabled)
void setUseCustomAppcast(const QString &url, const bool customAppcast)
static QSimpleUpdater * getInstance()
void displayAppcast(const QString &url, const QByteArray &reply)
void updateChangelog(const QString &url)
Window(QWidget *parent=0)