Work on updating...

This commit is contained in:
Martin Rotter 2014-02-19 22:07:19 +01:00
parent e06fb13ed3
commit 24835ca8ec
3 changed files with 15 additions and 1 deletions

View File

@ -411,6 +411,8 @@ void FormMain::showUpdates() {
QPointer<FormUpdate> form_update = new FormUpdate(this);
form_update.data()->exec();
delete form_update.data();
SystemFactory::instance()->applicationCloseLock()->unlock();
}
void FormMain::showSettings() {

View File

@ -24,6 +24,9 @@ FormUpdate::FormUpdate(QWidget *parent)
MessageBox::iconify(m_ui->m_buttonBox);
#endif
connect(m_ui->m_cmbAvailableRelease->comboBox(), SIGNAL(currentIndexChanged(int)),
this, SLOT(updateChanges(int)));
m_ui->m_lblCurrentRelease->setText(APP_VERSION);
checkForUpdates();
@ -33,6 +36,14 @@ FormUpdate::~FormUpdate() {
delete m_ui;
}
void FormUpdate::updateChanges(int new_release_index) {
if (new_release_index >= 0) {
UpdateInfo info = m_ui->m_cmbAvailableRelease->comboBox()->itemData(new_release_index).value<UpdateInfo>();
m_ui->m_txtChanges->setText(info.m_changes);
}
}
void FormUpdate::checkForUpdates() {
QByteArray releases_xml;
QNetworkReply::NetworkError download_result = NetworkFactory::downloadFeedFile(RELEASES_LIST,

View File

@ -18,7 +18,8 @@ class FormUpdate : public QDialog {
explicit FormUpdate(QWidget *parent = 0);
virtual ~FormUpdate();
protected:
protected slots:
void updateChanges(int new_release_index);
void checkForUpdates();
private: