Show progress when updating.
This commit is contained in:
parent
47a75c2cee
commit
0153ece8f0
@ -86,7 +86,7 @@ void FormUpdate::checkForUpdates() {
|
|||||||
|
|
||||||
const bool is_self_update_for_this_system = isUpdateForThisSystem() && isSelfUpdateSupported();
|
const bool is_self_update_for_this_system = isUpdateForThisSystem() && isSelfUpdateSupported();
|
||||||
|
|
||||||
if (SystemFactory::isVersionNewer(update.first.m_availableVersion, APP_VERSION)) {
|
if (!SystemFactory::isVersionNewer(update.first.m_availableVersion, APP_VERSION)) {
|
||||||
m_ui->m_lblStatus->setStatus(WidgetWithStatus::Ok,
|
m_ui->m_lblStatus->setStatus(WidgetWithStatus::Ok,
|
||||||
tr("New release available."),
|
tr("New release available."),
|
||||||
tr("This is new version which can be\ndownloaded and installed."));
|
tr("This is new version which can be\ndownloaded and installed."));
|
||||||
@ -111,7 +111,7 @@ void FormUpdate::checkForUpdates() {
|
|||||||
void FormUpdate::updateProgress(qint64 bytes_received, qint64 bytes_total) {
|
void FormUpdate::updateProgress(qint64 bytes_received, qint64 bytes_total) {
|
||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
m_ui->m_lblStatus->setStatus(WidgetWithStatus::Information,
|
m_ui->m_lblStatus->setStatus(WidgetWithStatus::Information,
|
||||||
tr("Downloaded %1% (update size is %2 kB).").arg(QString::number((bytes_received * 100.0) / bytes_total,
|
tr("Downloaded %1% (update size is %2 kB).").arg(QString::number((bytes_received * 100.0) / ++bytes_total,
|
||||||
'f',
|
'f',
|
||||||
2),
|
2),
|
||||||
QString::number(bytes_total / 1000,
|
QString::number(bytes_total / 1000,
|
||||||
@ -215,7 +215,7 @@ void FormUpdate::startUpdate() {
|
|||||||
// Initialie downloader.
|
// Initialie downloader.
|
||||||
m_downloader = new Downloader(this);
|
m_downloader = new Downloader(this);
|
||||||
|
|
||||||
//connect(m_downloader, SIGNAL(progress(qint64,qint64)), this, SLOT(updateProgress(qint64,qint64)));
|
connect(m_downloader, SIGNAL(progress(qint64,qint64)), this, SLOT(updateProgress(qint64,qint64)));
|
||||||
connect(m_downloader, SIGNAL(completed(QNetworkReply::NetworkError,QByteArray)), this, SLOT(updateCompleted(QNetworkReply::NetworkError,QByteArray)));
|
connect(m_downloader, SIGNAL(completed(QNetworkReply::NetworkError,QByteArray)), this, SLOT(updateCompleted(QNetworkReply::NetworkError,QByteArray)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user