annotate ui/createcertlistdialog.h @ 459:34cc448409ec

Fix error handling
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 23 Apr 2014 13:47:33 +0000
parents efd1bd85112f
children 88dfe16a0bb9
rev   line source
404
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 367
diff changeset
1 /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 367
diff changeset
2 * Software engineering by Intevation GmbH
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 367
diff changeset
3 *
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 367
diff changeset
4 * This file is Free Software under the GNU GPL (v>=2)
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 367
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY!
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 367
diff changeset
6 * See LICENSE.txt for details.
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 367
diff changeset
7 */
367
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
8 #ifndef CREATECERTLISTDIALOG_H
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
9 #define CREATECERTLISTDIALOG_H
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
10
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
11 #include <QDialog>
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
12 #include <QMainWindow>
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
13 #include <QLineEdit>
454
efd1bd85112f Save selected certificate in settings and parse it.
Andre Heinecke <aheinecke@intevation.de>
parents: 404
diff changeset
14
efd1bd85112f Save selected certificate in settings and parse it.
Andre Heinecke <aheinecke@intevation.de>
parents: 404
diff changeset
15 #include <polarssl/pk.h>
367
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
16 /**
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
17 * @file createinstallerdialog.h
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
18 * @brief The dialog to show settings and create an installer.
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
19 */
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
20
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
21 class QListWidget;
454
efd1bd85112f Save selected certificate in settings and parse it.
Andre Heinecke <aheinecke@intevation.de>
parents: 404
diff changeset
22 class AdministratorWindow;
367
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
23
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
24 class CreateCertListDialog : public QDialog
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
25 {
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
26 Q_OBJECT
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
27 public:
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
28 /** @brief Create a dialog showing settings for the create certificate list
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
29 * process
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
30 * */
454
efd1bd85112f Save selected certificate in settings and parse it.
Andre Heinecke <aheinecke@intevation.de>
parents: 404
diff changeset
31 CreateCertListDialog(AdministratorWindow *parent);
367
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
32
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
33 private:
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
34 void setupGUI();
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
35
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
36 QLineEdit *mCertFile;
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
37 QLineEdit *mSaveFile;
454
efd1bd85112f Save selected certificate in settings and parse it.
Andre Heinecke <aheinecke@intevation.de>
parents: 404
diff changeset
38 AdministratorWindow *mAdminWindow;
efd1bd85112f Save selected certificate in settings and parse it.
Andre Heinecke <aheinecke@intevation.de>
parents: 404
diff changeset
39
efd1bd85112f Save selected certificate in settings and parse it.
Andre Heinecke <aheinecke@intevation.de>
parents: 404
diff changeset
40 pk_context *mPk;
367
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
41
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
42 private slots:
454
efd1bd85112f Save selected certificate in settings and parse it.
Andre Heinecke <aheinecke@intevation.de>
parents: 404
diff changeset
43 /** @brief Open the certificate selection dialog and parse the certificate
efd1bd85112f Save selected certificate in settings and parse it.
Andre Heinecke <aheinecke@intevation.de>
parents: 404
diff changeset
44 *
efd1bd85112f Save selected certificate in settings and parse it.
Andre Heinecke <aheinecke@intevation.de>
parents: 404
diff changeset
45 * If the certificate can be parsed mPk is replaced by the new key
efd1bd85112f Save selected certificate in settings and parse it.
Andre Heinecke <aheinecke@intevation.de>
parents: 404
diff changeset
46 * otherwise an error message is shown to the user.
efd1bd85112f Save selected certificate in settings and parse it.
Andre Heinecke <aheinecke@intevation.de>
parents: 404
diff changeset
47 */
367
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
48 void openCertificateSelect();
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
49 void openSaveLocation();
454
efd1bd85112f Save selected certificate in settings and parse it.
Andre Heinecke <aheinecke@intevation.de>
parents: 404
diff changeset
50 /** @brief create a valid certificate list file
efd1bd85112f Save selected certificate in settings and parse it.
Andre Heinecke <aheinecke@intevation.de>
parents: 404
diff changeset
51 *
efd1bd85112f Save selected certificate in settings and parse it.
Andre Heinecke <aheinecke@intevation.de>
parents: 404
diff changeset
52 * The contents of the certificate list is the certificatelist
efd1bd85112f Save selected certificate in settings and parse it.
Andre Heinecke <aheinecke@intevation.de>
parents: 404
diff changeset
53 * of the adminWindow. It is signed with the currently
efd1bd85112f Save selected certificate in settings and parse it.
Andre Heinecke <aheinecke@intevation.de>
parents: 404
diff changeset
54 * loaded certificate in mPk. On errors the user is
efd1bd85112f Save selected certificate in settings and parse it.
Andre Heinecke <aheinecke@intevation.de>
parents: 404
diff changeset
55 * informed with showErrorMessage */
367
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
56 void createList();
454
efd1bd85112f Save selected certificate in settings and parse it.
Andre Heinecke <aheinecke@intevation.de>
parents: 404
diff changeset
57
efd1bd85112f Save selected certificate in settings and parse it.
Andre Heinecke <aheinecke@intevation.de>
parents: 404
diff changeset
58 /** @brief show an error message with QMessageBox */
efd1bd85112f Save selected certificate in settings and parse it.
Andre Heinecke <aheinecke@intevation.de>
parents: 404
diff changeset
59 void showErrorMessage(const QString&msg);
367
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
60 };
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
61
9491782a8f5a Added dialog to create a signed certificate list file.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
62 #endif // CREATECERTLISTDIALOG_H

http://wald.intevation.org/projects/trustbridge/