6 #include <QDesktopServices>
9 #include "ui_updateinfodialog.h"
13 using namespace swift::misc::db;
17 CUpdateInfoDialog::CUpdateInfoDialog(QWidget *parent) : QDialog(parent), ui(new Ui::
CUpdateInfoDialog)
20 ui->bb_UpdateInfolDialog->button(QDialogButtonBox::Ok)->setText(
" Download and install ");
21 ui->cb_DontShowAgain->setChecked(!m_setting.
get());
22 this->selectionChanged();
24 &CUpdateInfoDialog::selectionChanged);
25 connect(ui->cb_DontShowAgain, &QCheckBox::toggled,
this, &CUpdateInfoDialog::onDontShowAgain);
32 const bool newVersion = ui->comp_UpdateInfo->isNewPilotClientVersionAvailable();
38 const int r = QDialog::exec();
39 if (r != QDialog::Accepted) {
return r; }
40 if (!ui->comp_UpdateInfo->isNewPilotClientVersionAvailable()) {
return QDialog::Rejected; }
41 const CDistribution distribution = ui->comp_UpdateInfo->getCurrentDistribution();
44 ui->comp_UpdateInfo->triggerDownload();
51 return QDialog::event(
event);
54 void CUpdateInfoDialog::onDontShowAgain(
bool dontShowAgain) { m_setting.
setAndSave(!dontShowAgain); }
56 void CUpdateInfoDialog::selectionChanged()
58 const bool nv = ui->comp_UpdateInfo->isNewPilotClientVersionAvailable();
59 ui->bb_UpdateInfolDialog->button(QDialogButtonBox::Ok)->setVisible(nv);
static bool triggerShowHelp(const QWidget *widget, QEvent *event)
Static version used with dialogs.
void selectionChanged()
New platfrom or channel.
Download and install swift.
virtual ~CUpdateInfoDialog()
Destructor.
virtual bool event(QEvent *event)
bool isNewVersionAvailable() const
A new version existing?
CStatusMessage setAndSave(const T &value, qint64 timestamp=0)
Write and save in the same step. Must be called from the thread in which the owner lives.
T get() const
Get a copy of the current value.
Distributions for channel.
bool hasDownloadUrl() const
Has a download URL?
High level reusable GUI components.