Mercurial > trustbridge
annotate ui/statusdialog.cpp @ 249:6a7eb102716d
Remove code duplication by unifying the certificatelist.
You should now check for isInstallCert to determine wether this
certificate should be installed or removed.
Leaving the getInstallCertificates and getRemoveCertificates
in place for compatibilty would have been easier to keep the
tests stable.
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Mon, 31 Mar 2014 08:06:17 +0000 |
parents | be628d261617 |
children | 17e1c8f37d72 |
rev | line source |
---|---|
211
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
1 #include "statusdialog.h" |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
2 #include <QDebug> |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
3 #include <QVBoxLayout> |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
4 #include <QTextEdit> |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
5 #include <QPushButton> |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
6 |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
7 StatusDialog::StatusDialog(QMainWindow *parent) : |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
8 QDialog(parent) |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
9 { |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
10 setupGUI(); |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
11 } |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
12 |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
13 void StatusDialog::setupGUI() |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
14 { |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
15 QVBoxLayout *mainLayout = new QVBoxLayout(this); |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
16 QTextEdit *helpText = new QTextEdit; |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
17 helpText->setReadOnly(true); |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
18 QString dummyText = tr("The following certificates are successfully installed:\r"); |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
19 dummyText.append(tr("* Email CA 2013\r")); |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
20 dummyText.append(tr("* Server CA 2010\r")); |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
21 dummyText.append(tr("\rThe following certificates are successfully removed:\r")); |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
22 dummyText.append(tr("* Email CA 2010\r")); |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
23 dummyText.append(tr("\rErrors while processing certificates:\r")); |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
24 dummyText.append(tr("* PCA-1-Verwaltung-08\r")); |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
25 helpText->setPlainText(dummyText); |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
26 |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
27 QHBoxLayout *buttonLayout = new QHBoxLayout; |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
28 QPushButton *closeButton = new QPushButton(tr("Close")); |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
29 connect(closeButton, SIGNAL(clicked()), this, SLOT(close())); |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
30 buttonLayout->insertStretch(0, 10); |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
31 buttonLayout->addWidget(closeButton); |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
32 |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
33 mainLayout->addWidget(helpText); |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
34 mainLayout->addLayout(buttonLayout); |
be628d261617
Added new status dialog.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
35 } |