annotate ui/certificatelistwidget.h @ 1362:c2b76c8a8b82

(issue177) Only install certificate lists which are newer
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 19 Nov 2014 19:07:56 +0100
parents 2a1aa9df8f11
children
rev   line source
582
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
1 /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
2 * Software engineering by Intevation GmbH
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
3 *
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
4 * This file is Free Software under the GNU GPL (v>=2)
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY!
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
6 * See LICENSE.txt for details.
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
7 */
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
8 #ifndef CERTIFICATELISTWIDGET_H
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
9 #define CERTIFICATELISTWIDGET_H
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
10
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
11 #include <QWidget>
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
12 #include <QMainWindow>
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
13 #include <QLabel>
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
14 #include <QListWidget>
743
a467204a35f5 Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 720
diff changeset
15 #include <QVBoxLayout>
582
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
16
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
17 #include "certificate.h"
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
18 /**
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
19 * @file certificatelistwidget.h
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
20 * @brief Displays a list of certificates and a details panel for a selected
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
21 * certificate.
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
22 */
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
23
743
a467204a35f5 Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 720
diff changeset
24 class CertificateItemWidget;
1106
6f7b7d88f048 (issue115) Rework CertificateListWidgets to have a ToolButton instead of a combobox
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1101
diff changeset
25 class QToolButton;
743
a467204a35f5 Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 720
diff changeset
26
582
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
27 Q_DECLARE_METATYPE(Certificate);
1255
2a1aa9df8f11 (issue133) Improve API documentation
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1108
diff changeset
28 /**
2a1aa9df8f11 (issue133) Improve API documentation
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1108
diff changeset
29 * @brief Displays a list of certificates and a details panel for a selected
2a1aa9df8f11 (issue133) Improve API documentation
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1108
diff changeset
30 * certificate.
2a1aa9df8f11 (issue133) Improve API documentation
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1108
diff changeset
31 **/
582
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
32 class CertificateListWidget : public QWidget
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
33 {
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
34 Q_OBJECT
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
35 public:
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
36 CertificateListWidget(QWidget *parent, Qt::WindowFlags flags = 0);
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
37
687
973a7ce19658 (issue24) Let the string for install / remove be set for each item individually
Andre Heinecke <andre.heinecke@intevation.de>
parents: 653
diff changeset
38 void addCertificate(const Certificate &certificate, bool state,
1106
6f7b7d88f048 (issue115) Rework CertificateListWidgets to have a ToolButton instead of a combobox
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1101
diff changeset
39 QToolButton *btn);
639
c1b35edb097f New methods to modify and use the certificate list.
Raimund Renkert <rrenkert@intevation.de>
parents: 627
diff changeset
40 void removeCertificate(const Certificate &cert);
c1b35edb097f New methods to modify and use the certificate list.
Raimund Renkert <rrenkert@intevation.de>
parents: 627
diff changeset
41 void setCertState(bool state, const Certificate &cert);
627
566ee111e331 Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents: 582
diff changeset
42 void clear();
566ee111e331 Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents: 582
diff changeset
43 QStringList certificates();
639
c1b35edb097f New methods to modify and use the certificate list.
Raimund Renkert <rrenkert@intevation.de>
parents: 627
diff changeset
44 QStringList selectedCertificates();
c1b35edb097f New methods to modify and use the certificate list.
Raimund Renkert <rrenkert@intevation.de>
parents: 627
diff changeset
45 QStringList unselectedCertificates();
c1b35edb097f New methods to modify and use the certificate list.
Raimund Renkert <rrenkert@intevation.de>
parents: 627
diff changeset
46 QList<Certificate> certificateList();
627
566ee111e331 Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents: 582
diff changeset
47 int selectedCertCount();
639
c1b35edb097f New methods to modify and use the certificate list.
Raimund Renkert <rrenkert@intevation.de>
parents: 627
diff changeset
48 bool contains(const Certificate &cert);
582
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
49
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
50 private:
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
51
743
a467204a35f5 Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 720
diff changeset
52 QList <CertificateItemWidget*> mCertificateWidgets;
a467204a35f5 Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 720
diff changeset
53 QVBoxLayout mLayout;
582
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
54
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
55 private slots:
627
566ee111e331 Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents: 582
diff changeset
56 void certStateChanged(bool state, const Certificate &cert);
566ee111e331 Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents: 582
diff changeset
57
566ee111e331 Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents: 582
diff changeset
58 signals:
566ee111e331 Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents: 582
diff changeset
59 void certListChanged(int selected);
639
c1b35edb097f New methods to modify and use the certificate list.
Raimund Renkert <rrenkert@intevation.de>
parents: 627
diff changeset
60 void certChanged(bool state, const Certificate &cert);
582
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
61
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
62 };
88c9bdc74175 New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
63 #endif // CERTIFICATELISTWIDGET_H

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