annotate ui/administratorwindow.h @ 667:fb69aef056ea

Be more verbose in error logging
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 26 Jun 2014 17:41:53 +0200
parents 9db7034b2d6c
children 75cd2fbf9ac6
rev   line source
404
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 376
diff changeset
1 /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 376
diff changeset
2 * Software engineering by Intevation GmbH
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 376
diff changeset
3 *
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 376
diff changeset
4 * This file is Free Software under the GNU GPL (v>=2)
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 376
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY!
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 376
diff changeset
6 * See LICENSE.txt for details.
17e1c8f37d72 Add License
Andre Heinecke <aheinecke@intevation.de>
parents: 376
diff changeset
7 */
333
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
8 #ifndef ADMINSTRATORWINDOW_H
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
9 #define ADMINSTRATORWINDOW_H
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
10
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
11 /**
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
12 * @file administratorwindow.h
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
13 * @brief Administrator UI controller
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
14 */
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
15
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
16 #include <QMainWindow>
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
17 #include <QSettings>
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
18 #include <QMenuBar>
335
811eec4e1b99 Use a table view with the new certificate table model in administrator app.
Raimund Renkert <rrenkert@intevation.de>
parents: 333
diff changeset
19 #include <QTableView>
333
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
20 #include <QPushButton>
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
21
343
e3d6de930c90 Updated the table ui in administrator app.
Raimund Renkert <rrenkert@intevation.de>
parents: 335
diff changeset
22 #include "certificatelist.h"
e3d6de930c90 Updated the table ui in administrator app.
Raimund Renkert <rrenkert@intevation.de>
parents: 335
diff changeset
23 #include "certificatetablemodel.h"
e3d6de930c90 Updated the table ui in administrator app.
Raimund Renkert <rrenkert@intevation.de>
parents: 335
diff changeset
24
333
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
25 class QMenu;
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
26 class QAction;
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
27
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
28 class AdministratorWindow : public QMainWindow
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
29 {
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
30 Q_OBJECT
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
31
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
32 public:
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
33 AdministratorWindow();
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
34
463
5200b8e9b2ae Rename tablemodel certificates and add accessors
Andre Heinecke <aheinecke@intevation.de>
parents: 453
diff changeset
35 /** @brief obtain a reference to the certificates currently in the model
5200b8e9b2ae Rename tablemodel certificates and add accessors
Andre Heinecke <aheinecke@intevation.de>
parents: 453
diff changeset
36 * @returns the currently shown certificates
453
6dec8101793c Rename settings and certlist and add accessors
Andre Heinecke <aheinecke@intevation.de>
parents: 427
diff changeset
37 */
463
5200b8e9b2ae Rename tablemodel certificates and add accessors
Andre Heinecke <aheinecke@intevation.de>
parents: 453
diff changeset
38 const QList<Certificate>& certificates() const {
5200b8e9b2ae Rename tablemodel certificates and add accessors
Andre Heinecke <aheinecke@intevation.de>
parents: 453
diff changeset
39 return certificateModel->certificates();
5200b8e9b2ae Rename tablemodel certificates and add accessors
Andre Heinecke <aheinecke@intevation.de>
parents: 453
diff changeset
40 }
453
6dec8101793c Rename settings and certlist and add accessors
Andre Heinecke <aheinecke@intevation.de>
parents: 427
diff changeset
41
6dec8101793c Rename settings and certlist and add accessors
Andre Heinecke <aheinecke@intevation.de>
parents: 427
diff changeset
42 /** @brief get the settings for this application
6dec8101793c Rename settings and certlist and add accessors
Andre Heinecke <aheinecke@intevation.de>
parents: 427
diff changeset
43 * @returns a reference the applications settings object
6dec8101793c Rename settings and certlist and add accessors
Andre Heinecke <aheinecke@intevation.de>
parents: 427
diff changeset
44 */
6dec8101793c Rename settings and certlist and add accessors
Andre Heinecke <aheinecke@intevation.de>
parents: 427
diff changeset
45 QSettings* settings() {return &mSettings;}
6dec8101793c Rename settings and certlist and add accessors
Andre Heinecke <aheinecke@intevation.de>
parents: 427
diff changeset
46
562
ccdc4c6b97ce Log diff between initial certificate list and saved list to a logfile.
Raimund Renkert <rrenkert@intevation.de>
parents: 463
diff changeset
47 /** @brief log the diff between the initial certificate list and the list
ccdc4c6b97ce Log diff between initial certificate list and saved list to a logfile.
Raimund Renkert <rrenkert@intevation.de>
parents: 463
diff changeset
48 * saved as current.
ccdc4c6b97ce Log diff between initial certificate list and saved list to a logfile.
Raimund Renkert <rrenkert@intevation.de>
parents: 463
diff changeset
49 *
ccdc4c6b97ce Log diff between initial certificate list and saved list to a logfile.
Raimund Renkert <rrenkert@intevation.de>
parents: 463
diff changeset
50 * @param currentCerts Path to the current certificate list file.
ccdc4c6b97ce Log diff between initial certificate list and saved list to a logfile.
Raimund Renkert <rrenkert@intevation.de>
parents: 463
diff changeset
51 */
ccdc4c6b97ce Log diff between initial certificate list and saved list to a logfile.
Raimund Renkert <rrenkert@intevation.de>
parents: 463
diff changeset
52 void logChanges(const QString &currentCerts);
ccdc4c6b97ce Log diff between initial certificate list and saved list to a logfile.
Raimund Renkert <rrenkert@intevation.de>
parents: 463
diff changeset
53
565
9db7034b2d6c Added method to get the current certificate list changes.
Raimund Renkert <rrenkert@intevation.de>
parents: 562
diff changeset
54 /** @brief get the currently changed certificates.
9db7034b2d6c Added method to get the current certificate list changes.
Raimund Renkert <rrenkert@intevation.de>
parents: 562
diff changeset
55 * @return a list of certificates.
9db7034b2d6c Added method to get the current certificate list changes.
Raimund Renkert <rrenkert@intevation.de>
parents: 562
diff changeset
56 */
9db7034b2d6c Added method to get the current certificate list changes.
Raimund Renkert <rrenkert@intevation.de>
parents: 562
diff changeset
57 QList<Certificate> currentChanges();
9db7034b2d6c Added method to get the current certificate list changes.
Raimund Renkert <rrenkert@intevation.de>
parents: 562
diff changeset
58
333
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
59 private slots:
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
60 void createInstaller();
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
61 void showAbout();
344
4454a4dc73a3 Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents: 343
diff changeset
62 void loadCertificateFile();
368
f9c98f9e9f76 Show the new dialog on save button click.
Raimund Renkert <rrenkert@intevation.de>
parents: 358
diff changeset
63 void saveCertificateFile();
358
9ba7b4b4c1de Implemented the load from certificate file and set the edit state of certificates.
Raimund Renkert <rrenkert@intevation.de>
parents: 344
diff changeset
64 void addCertificates();
376
9731d28b95af Implemented 'remove certificate' in administrator app.
Raimund Renkert <rrenkert@intevation.de>
parents: 368
diff changeset
65 void removeCertificates();
9731d28b95af Implemented 'remove certificate' in administrator app.
Raimund Renkert <rrenkert@intevation.de>
parents: 368
diff changeset
66 void clickedCertificate(const QModelIndex&);
333
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
67
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
68 private:
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
69 void createActions();
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
70 void createMenuBar();
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
71 void createContent();
344
4454a4dc73a3 Added file dialog to load a certificate list from file.
Raimund Renkert <rrenkert@intevation.de>
parents: 343
diff changeset
72 void loadCertificateTable();
358
9ba7b4b4c1de Implemented the load from certificate file and set the edit state of certificates.
Raimund Renkert <rrenkert@intevation.de>
parents: 344
diff changeset
73 void addToCertificateTable(const QList<Certificate> &certs);
562
ccdc4c6b97ce Log diff between initial certificate list and saved list to a logfile.
Raimund Renkert <rrenkert@intevation.de>
parents: 463
diff changeset
74 QByteArray createLogEntries(const CertificateList &list);
333
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
75
453
6dec8101793c Rename settings and certlist and add accessors
Andre Heinecke <aheinecke@intevation.de>
parents: 427
diff changeset
76 QSettings mSettings;
333
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
77
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
78 QMenuBar *menuBar;
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
79
335
811eec4e1b99 Use a table view with the new certificate table model in administrator app.
Raimund Renkert <rrenkert@intevation.de>
parents: 333
diff changeset
80 QTableView *certificateView;
453
6dec8101793c Rename settings and certlist and add accessors
Andre Heinecke <aheinecke@intevation.de>
parents: 427
diff changeset
81 CertificateList mCertList;
343
e3d6de930c90 Updated the table ui in administrator app.
Raimund Renkert <rrenkert@intevation.de>
parents: 335
diff changeset
82 CertificateTabelModel *certificateModel;
333
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
83 QPushButton *saveButton;
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
84 QPushButton *loadButton;
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
85 QPushButton *addButton;
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
86 QPushButton *removeButton;
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
87 };
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
88
de94c4ec22b1 Renamed management to administrator application.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
89 #endif // ADMINSTRATORWINDOW_H

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