Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <QDebug>
#include "appupdatedialog.h"
#include "ui_appimageupdatedialog.h"
AppUpdateDialog::AppUpdateDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::AppImageUpdateDialog)
{
ui->setupUi(this);
connect(ui->latterButton, &QPushButton::clicked, this, &AppUpdateDialog::reject);
}
AppUpdateDialog::~AppUpdateDialog()
{
delete ui;
}
void AppUpdateDialog::showUpdateConfirmationMessage()
{
setWindowTitle(tr("Pling Store Update Available"));
ui->confirmationLabel->setText(tr("Do you want to update now to the new Pling Store version now?"));
ui->doitButton->setText("Yes");
disconnect(ui->doitButton, nullptr, this, nullptr);
connect(ui->doitButton, &QPushButton::released, this, &AppUpdateDialog::updateRequested);
ui->stackedWidget->setCurrentWidget(ui->confirmationPage);
show();
}
void AppUpdateDialog::showErrorMessage(const QString &msg)
{
setWindowTitle(tr("Pling Store Update Failed"));
ui->confirmationLabel->setText(tr("Do you want to try again?"));
ui->doitButton->setText("Yes");
disconnect(ui->doitButton, nullptr, this, nullptr);
connect(ui->doitButton, &QPushButton::released, this, &AppUpdateDialog::updateRequested);
ui->stackedWidget->setCurrentWidget(ui->confirmationPage);
show();
}
void AppUpdateDialog::showCompletionMessage()
{
setWindowTitle(tr("Plign Store Update Completed"));
ui->confirmationLabel->setText(tr("Do you want to open the new version now?"));
ui->doitButton->setText("Yes");
disconnect(ui->doitButton, nullptr, this, nullptr);
connect(ui->doitButton, &QPushButton::released, this, &AppUpdateDialog::restartRequested);
ui->stackedWidget->setCurrentWidget(ui->confirmationPage);
show();
}
void AppUpdateDialog::showProgress(int progress)
{
setWindowTitle(tr("Pling Store Update"));
ui->progressBar->setValue(progress);
ui->progressPage->show();
ui->stackedWidget->setCurrentWidget(ui->progressPage);
show();
}