-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
483 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
#include "fvavailableupdate.h" | ||
|
||
FvAvailableUpdate::FvAvailableUpdate(QObject *parent) : | ||
QObject(parent) | ||
{ | ||
// noop | ||
} | ||
|
||
QString FvAvailableUpdate::GetTitle() | ||
{ | ||
return m_title; | ||
} | ||
|
||
void FvAvailableUpdate::SetTitle(QString title) | ||
{ | ||
m_title = title; | ||
} | ||
|
||
QUrl FvAvailableUpdate::GetReleaseNotesLink() | ||
{ | ||
return m_releaseNotesLink; | ||
} | ||
|
||
void FvAvailableUpdate::SetReleaseNotesLink(QUrl releaseNotesLink) | ||
{ | ||
m_releaseNotesLink = releaseNotesLink; | ||
} | ||
|
||
void FvAvailableUpdate::SetReleaseNotesLink(QString releaseNotesLink) | ||
{ | ||
SetReleaseNotesLink(QUrl(releaseNotesLink)); | ||
} | ||
|
||
QString FvAvailableUpdate::GetPubDate() | ||
{ | ||
return m_pubDate; | ||
} | ||
|
||
void FvAvailableUpdate::SetPubDate(QString pubDate) | ||
{ | ||
m_pubDate = pubDate; | ||
} | ||
|
||
QUrl FvAvailableUpdate::GetEnclosureUrl() | ||
{ | ||
return m_enclosureUrl; | ||
} | ||
|
||
void FvAvailableUpdate::SetEnclosureUrl(QUrl enclosureUrl) | ||
{ | ||
m_enclosureUrl = enclosureUrl; | ||
} | ||
|
||
void FvAvailableUpdate::SetEnclosureUrl(QString enclosureUrl) | ||
{ | ||
SetEnclosureUrl(QUrl(enclosureUrl)); | ||
} | ||
|
||
QString FvAvailableUpdate::GetEnclosureVersion() | ||
{ | ||
return m_enclosureVersion; | ||
} | ||
|
||
void FvAvailableUpdate::SetEnclosureVersion(QString enclosureVersion) | ||
{ | ||
m_enclosureVersion = enclosureVersion; | ||
} | ||
|
||
QString FvAvailableUpdate::GetEnclosurePlatform() | ||
{ | ||
return m_enclosurePlatform; | ||
} | ||
|
||
void FvAvailableUpdate::SetEnclosurePlatform(QString enclosurePlatform) | ||
{ | ||
m_enclosurePlatform = enclosurePlatform; | ||
} | ||
|
||
unsigned long FvAvailableUpdate::GetEnclosureLength() | ||
{ | ||
return m_enclosureLength; | ||
} | ||
|
||
void FvAvailableUpdate::SetEnclosureLength(unsigned long enclosureLength) | ||
{ | ||
m_enclosureLength = enclosureLength; | ||
} | ||
|
||
QString FvAvailableUpdate::GetEnclosureType() | ||
{ | ||
return m_enclosureType; | ||
} | ||
|
||
void FvAvailableUpdate::SetEnclosureType(QString enclosureType) | ||
{ | ||
m_enclosureType = enclosureType; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#ifndef FVAVAILABLEUPDATE_H | ||
#define FVAVAILABLEUPDATE_H | ||
|
||
#include <QObject> | ||
#include <QUrl> | ||
|
||
class FvAvailableUpdate : public QObject | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit FvAvailableUpdate(QObject *parent = 0); | ||
|
||
QString GetTitle(); | ||
void SetTitle(QString title); | ||
|
||
QUrl GetReleaseNotesLink(); | ||
void SetReleaseNotesLink(QUrl releaseNotesLink); | ||
void SetReleaseNotesLink(QString releaseNotesLink); | ||
|
||
QString GetPubDate(); | ||
void SetPubDate(QString pubDate); | ||
|
||
QUrl GetEnclosureUrl(); | ||
void SetEnclosureUrl(QUrl enclosureUrl); | ||
void SetEnclosureUrl(QString enclosureUrl); | ||
|
||
QString GetEnclosureVersion(); | ||
void SetEnclosureVersion(QString enclosureVersion); | ||
|
||
QString GetEnclosurePlatform(); | ||
void SetEnclosurePlatform(QString enclosurePlatform); | ||
|
||
unsigned long GetEnclosureLength(); | ||
void SetEnclosureLength(unsigned long enclosureLength); | ||
|
||
QString GetEnclosureType(); | ||
void SetEnclosureType(QString enclosureType); | ||
|
||
private: | ||
QString m_title; | ||
QUrl m_releaseNotesLink; | ||
QString m_pubDate; | ||
QUrl m_enclosureUrl; | ||
QString m_enclosureVersion; | ||
QString m_enclosurePlatform; | ||
unsigned long m_enclosureLength; | ||
QString m_enclosureType; | ||
|
||
}; | ||
|
||
#endif // FVAVAILABLEUPDATE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,44 @@ | ||
#include "fvupdateconfirmdialog.h" | ||
#include "fvavailableupdate.h" | ||
#include "fvupdater.h" | ||
#include "ui_fvupdateconfirmdialog.h" | ||
|
||
|
||
FvUpdateConfirmDialog::FvUpdateConfirmDialog(QWidget *parent) : | ||
QDialog(parent), | ||
m_ui(new Ui::FvUpdateConfirmDialog) | ||
{ | ||
m_ui->setupUi(this); | ||
|
||
// Delete on close | ||
setAttribute(Qt::WA_DeleteOnClose, true); | ||
|
||
// Set the "close app, then reopen" string | ||
QString closeReopenString = m_ui->downloadThisUpdateLabel->text().arg(QApplication::applicationName()); | ||
m_ui->downloadThisUpdateLabel->setText(closeReopenString); | ||
|
||
// Connect buttons | ||
connect(m_ui->confirmButtonBox, SIGNAL(accepted()), | ||
FvUpdater::sharedUpdater(), SLOT(UpdateInstallationConfirmed())); | ||
connect(m_ui->confirmButtonBox, SIGNAL(rejected()), | ||
FvUpdater::sharedUpdater(), SLOT(UpdateInstallationNotConfirmed())); | ||
} | ||
|
||
FvUpdateConfirmDialog::~FvUpdateConfirmDialog() | ||
{ | ||
delete m_ui; | ||
} | ||
|
||
bool FvUpdateConfirmDialog::UpdateWindowWithCurrentProposedUpdate() | ||
{ | ||
FvAvailableUpdate* proposedUpdate = FvUpdater::sharedUpdater()->GetProposedUpdate(); | ||
if (! proposedUpdate) { | ||
return false; | ||
} | ||
|
||
QString downloadLinkString = m_ui->updateFileLinkLabel->text() | ||
.arg(proposedUpdate->GetEnclosureUrl().toString()); | ||
m_ui->updateFileLinkLabel->setText(downloadLinkString); | ||
|
||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.