Tweaked check-for-updates dialog.
This commit is contained in:
parent
04c2f3bcc6
commit
df91d2a24f
@ -5,6 +5,8 @@
|
|||||||
<li>[~] Message list optimizations.</li>
|
<li>[~] Message list optimizations.</li>
|
||||||
<li>[+] Feed list categories expand status is now persistent.</li>
|
<li>[+] Feed list categories expand status is now persistent.</li>
|
||||||
<li>[+] System-wide external web browser can now be used.</li>
|
<li>[+] System-wide external web browser can now be used.</li>
|
||||||
|
<li>[#] All datetimes fetched from feeds are now considered to be UTC.</li>
|
||||||
|
<li>[~] Tweaked "check for updates" dialog.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
[1.9.9.6]
|
[1.9.9.6]
|
||||||
|
@ -43,6 +43,10 @@ class UpdateInfo {
|
|||||||
Evolution
|
Evolution
|
||||||
};
|
};
|
||||||
|
|
||||||
|
explicit UpdateInfo() {
|
||||||
|
m_availableVersion = m_changes = "";
|
||||||
|
}
|
||||||
|
|
||||||
QString m_availableVersion;
|
QString m_availableVersion;
|
||||||
QString m_changes;
|
QString m_changes;
|
||||||
UpdateType m_type;
|
UpdateType m_type;
|
||||||
|
@ -38,7 +38,6 @@ FormUpdate::FormUpdate(QWidget *parent)
|
|||||||
|
|
||||||
m_btnUpdate = m_ui->m_buttonBox->addButton(tr("Update"), QDialogButtonBox::ActionRole);
|
m_btnUpdate = m_ui->m_buttonBox->addButton(tr("Update"), QDialogButtonBox::ActionRole);
|
||||||
m_btnUpdate->setToolTip(tr("Download new installation files."));
|
m_btnUpdate->setToolTip(tr("Download new installation files."));
|
||||||
m_btnUpdate->hide();
|
|
||||||
|
|
||||||
connect(m_btnUpdate, SIGNAL(clicked()), this, SLOT(startUpdate()));
|
connect(m_btnUpdate, SIGNAL(clicked()), this, SLOT(startUpdate()));
|
||||||
|
|
||||||
@ -71,13 +70,15 @@ void FormUpdate::checkForUpdates() {
|
|||||||
m_updateInfo = update.first;
|
m_updateInfo = update.first;
|
||||||
|
|
||||||
if (update.second != QNetworkReply::NoError) {
|
if (update.second != QNetworkReply::NoError) {
|
||||||
//: Uknown release.
|
//: Unknown release.
|
||||||
m_ui->m_lblAvailableRelease->setText(tr("unknown"));
|
m_ui->m_lblAvailableRelease->setText(tr("unknown"));
|
||||||
m_ui->m_txtChanges->clear();
|
m_ui->m_txtChanges->clear();
|
||||||
m_ui->m_lblStatus->setStatus(WidgetWithStatus::Error,
|
m_ui->m_lblStatus->setStatus(WidgetWithStatus::Error,
|
||||||
tr("Error: '%1'.").arg(NetworkFactory::networkErrorText(update.second)),
|
tr("Error: '%1'.").arg(NetworkFactory::networkErrorText(update.second)),
|
||||||
tr("List with updates was "
|
tr("List with updates was "
|
||||||
"not\ndownloaded successfully."));
|
"not\ndownloaded successfully."));
|
||||||
|
m_btnUpdate->setEnabled(false);
|
||||||
|
m_btnUpdate->setToolTip(tr("Checking for updates failed."));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_ui->m_lblAvailableRelease->setText(update.first.m_availableVersion);
|
m_ui->m_lblAvailableRelease->setText(update.first.m_availableVersion);
|
||||||
@ -92,19 +93,33 @@ void FormUpdate::checkForUpdates() {
|
|||||||
// is available.
|
// is available.
|
||||||
// TODO: Tady po stisku update tlacitka se provede
|
// TODO: Tady po stisku update tlacitka se provede
|
||||||
// stazeni archivu do tempu.
|
// stazeni archivu do tempu.
|
||||||
m_btnUpdate->setVisible(isUpdateForThisSystem());
|
m_btnUpdate->setEnabled(true);
|
||||||
|
m_btnUpdate->setToolTip(isUpdateForThisSystem() ?
|
||||||
|
tr("Download installation file for your OS.") :
|
||||||
|
tr("Installation file is not available directly.\n"
|
||||||
|
"Go to application website to obtain it manually."));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_ui->m_lblStatus->setStatus(WidgetWithStatus::Warning,
|
m_ui->m_lblStatus->setStatus(WidgetWithStatus::Warning,
|
||||||
tr("No new release available."),
|
tr("No new release available."),
|
||||||
tr("This release is not newer than\ncurrently installed one."));
|
tr("This release is not newer than\ncurrently installed one."));
|
||||||
m_btnUpdate->show();
|
m_btnUpdate->setEnabled(true);
|
||||||
|
m_btnUpdate->setToolTip(tr("No new update available."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormUpdate::startUpdate() {
|
void FormUpdate::startUpdate() {
|
||||||
if (!NetworkFactory::openUrlInExternalBrowser(m_updateInfo.m_urls.value(OS_ID).m_fileUrl)) {
|
QString url_file;
|
||||||
|
|
||||||
|
if (isUpdateForThisSystem()) {
|
||||||
|
url_file = m_updateInfo.m_urls.value(OS_ID).m_fileUrl;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
url_file = APP_URL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!NetworkFactory::openUrlInExternalBrowser(url_file)) {
|
||||||
if (SystemTrayIcon::isSystemTrayActivated()) {
|
if (SystemTrayIcon::isSystemTrayActivated()) {
|
||||||
SystemTrayIcon::instance()->showMessage(tr("Cannot update application"),
|
SystemTrayIcon::instance()->showMessage(tr("Cannot update application"),
|
||||||
tr("Cannot navigate to installation file. Check new installation downloads "
|
tr("Cannot navigate to installation file. Check new installation downloads "
|
||||||
|
@ -45,13 +45,13 @@
|
|||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Changes</string>
|
<string>Changes</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>m_txtChanges</cstring>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="QTextEdit" name="m_txtChanges">
|
<widget class="QTextEdit" name="m_txtChanges">
|
||||||
<property name="tabChangesFocus">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="undoRedoEnabled">
|
<property name="undoRedoEnabled">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
@ -69,7 +69,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p></body></html></string>
|
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="textInteractionFlags">
|
<property name="textInteractionFlags">
|
||||||
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -85,6 +85,9 @@ p, li { white-space: pre-wrap; }
|
|||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Status</string>
|
<string>Status</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>m_lblStatus</cstring>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="2" column="1">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user