Mercurial > trustbridge
annotate ui/certificateitemwidget.cpp @ 764:5b505acbb2d1
Handle system wide installation for crontab.
author | Sascha Wilde <wilde@intevation.de> |
---|---|
date | Fri, 04 Jul 2014 18:41:23 +0200 |
parents | b6172b9f885d |
children | 9f13c00a2647 |
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 #include "certificateitemwidget.h" |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
9 |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
10 #include <QHBoxLayout> |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
11 #include <QDebug> |
701
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
12 #include <QStyleFactory> |
582
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
13 |
687
973a7ce19658
(issue24) Let the string for install / remove be set for each item individually
Andre Heinecke <andre.heinecke@intevation.de>
parents:
685
diff
changeset
|
14 CertificateItemWidget::CertificateItemWidget(QWidget *parent, |
973a7ce19658
(issue24) Let the string for install / remove be set for each item individually
Andre Heinecke <andre.heinecke@intevation.de>
parents:
685
diff
changeset
|
15 const Certificate &cert, |
973a7ce19658
(issue24) Let the string for install / remove be set for each item individually
Andre Heinecke <andre.heinecke@intevation.de>
parents:
685
diff
changeset
|
16 bool state, |
973a7ce19658
(issue24) Let the string for install / remove be set for each item individually
Andre Heinecke <andre.heinecke@intevation.de>
parents:
685
diff
changeset
|
17 bool editable, |
973a7ce19658
(issue24) Let the string for install / remove be set for each item individually
Andre Heinecke <andre.heinecke@intevation.de>
parents:
685
diff
changeset
|
18 const QString &installLabel, |
973a7ce19658
(issue24) Let the string for install / remove be set for each item individually
Andre Heinecke <andre.heinecke@intevation.de>
parents:
685
diff
changeset
|
19 const QString &removeLabel) : |
973a7ce19658
(issue24) Let the string for install / remove be set for each item individually
Andre Heinecke <andre.heinecke@intevation.de>
parents:
685
diff
changeset
|
20 QWidget(parent), |
973a7ce19658
(issue24) Let the string for install / remove be set for each item individually
Andre Heinecke <andre.heinecke@intevation.de>
parents:
685
diff
changeset
|
21 mInstallLabel (installLabel), |
973a7ce19658
(issue24) Let the string for install / remove be set for each item individually
Andre Heinecke <andre.heinecke@intevation.de>
parents:
685
diff
changeset
|
22 mRemoveLabel (removeLabel) |
582
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
23 { |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
24 mCertificate = cert; |
638
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
25 mState = state; |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
26 mEditable = editable; |
582
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
27 setupGUI(); |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
28 } |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
29 |
701
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
30 |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
31 /* We use the label as data to hide it in the normal dropdown menu and only |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
32 * show it when the popup is shown.*/ |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
33 |
582
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
34 void CertificateItemWidget::setupGUI() |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
35 { |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
710
diff
changeset
|
36 mLabel = new QLabel; |
701
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
37 mComboBox = new IconOnlyTextPopupBox; |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
38 QStyle *fusionStyle = QStyleFactory::create("Fusion"); |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
39 if (!fusionStyle) { |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
40 qDebug() << "Failed to create fusion style"; |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
41 } else { |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
42 mComboBox->setStyle(fusionStyle); |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
43 } |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
44 |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
710
diff
changeset
|
45 mComboBox->setIconSize(QSize(48, 48)); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
710
diff
changeset
|
46 mComboBox->setFixedWidth(68); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
710
diff
changeset
|
47 |
744
b6172b9f885d
Fix test typo
Andre Heinecke <andre.heinecke@intevation.de>
parents:
743
diff
changeset
|
48 const QString validity = tr("Valid: %1 until %2").arg( |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
710
diff
changeset
|
49 QLocale::system().toString(mCertificate.validFrom().date(), QLocale::ShortFormat)).arg( |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
710
diff
changeset
|
50 QLocale::system().toString(mCertificate.validTo().date(), QLocale::ShortFormat)); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
710
diff
changeset
|
51 const QString fpstring = tr("Fingerprint (SHA1): <%1>").arg(mCertificate.fingerprint()); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
710
diff
changeset
|
52 mLabel->setText(QString::fromLatin1("<big><b>%1</b><br/>%2<br/>%3<br/>%4</big>").arg |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
710
diff
changeset
|
53 (mCertificate.subjectCN()).arg(mCertificate.subjectO()).arg(validity).arg |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
710
diff
changeset
|
54 (fpstring)); |
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
710
diff
changeset
|
55 mLabel->setTextFormat(Qt::RichText); |
701
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
56 |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
57 mLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
58 mComboBox->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); |
627
566ee111e331
Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents:
582
diff
changeset
|
59 connect(mComboBox, SIGNAL(currentIndexChanged(int)), |
566ee111e331
Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents:
582
diff
changeset
|
60 this, SLOT(currentStateChanged(int))); |
582
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
61 |
638
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
62 QHBoxLayout *layout = new QHBoxLayout; |
582
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
63 if (mCertificate.isInstallCert()) { |
701
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
64 mComboBox->addItem(QIcon(":/img/security-high.png"), QString(), mInstallLabel); |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
65 mComboBox->addItem(QIcon(":/img/security-low.png"), QString(), mRemoveLabel); |
638
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
66 if (mState) |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
67 mComboBox->setCurrentIndex(0); |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
68 else { |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
69 mComboBox->setCurrentIndex(1); |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
70 } |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
71 layout->addWidget(mComboBox); |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
72 } |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
73 else if (!mCertificate.isInstallCert() && !mEditable){ |
650
9c3e7754b76b
Use new icons in certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
638
diff
changeset
|
74 QImage *img = new QImage(":/img/trash-empty.png"); |
638
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
75 QLabel *imgLabel = new QLabel; |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
76 imgLabel->setPixmap(QPixmap::fromImage(*img)); |
743
a467204a35f5
Rework User Interface.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
710
diff
changeset
|
77 imgLabel->setFixedSize(48, 48); |
650
9c3e7754b76b
Use new icons in certificate lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
638
diff
changeset
|
78 imgLabel->setMargin(2); |
638
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
79 layout->addWidget(imgLabel); |
582
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
80 } |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
81 else { |
710
86c9ff4cfb02
(Issue30) Actually set the text as data also for removal
Andre Heinecke <andre.heinecke@intevation.de>
parents:
701
diff
changeset
|
82 mComboBox->addItem(QIcon(":/img/trash-empty.png"), QString(), tr("uninstall")); |
86c9ff4cfb02
(Issue30) Actually set the text as data also for removal
Andre Heinecke <andre.heinecke@intevation.de>
parents:
701
diff
changeset
|
83 mComboBox->addItem(QIcon(":/img/security-medium.png"), QString(), tr("keep")); |
638
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
84 if (mState) |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
85 mComboBox->setCurrentIndex(0); |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
86 else { |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
87 mComboBox->setCurrentIndex(1); |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
88 } |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
89 layout->addWidget(mComboBox); |
582
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
90 } |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
91 layout->addWidget(mLabel); |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
92 this->setLayout(layout); |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
93 } |
627
566ee111e331
Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents:
582
diff
changeset
|
94 |
566ee111e331
Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents:
582
diff
changeset
|
95 bool CertificateItemWidget::state() |
566ee111e331
Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents:
582
diff
changeset
|
96 { |
685
248d4f24e618
(Issue 29) Uneditable items are always selected
Andre Heinecke <andre.heinecke@intevation.de>
parents:
659
diff
changeset
|
97 if (!mEditable) { |
248d4f24e618
(Issue 29) Uneditable items are always selected
Andre Heinecke <andre.heinecke@intevation.de>
parents:
659
diff
changeset
|
98 return true; |
248d4f24e618
(Issue 29) Uneditable items are always selected
Andre Heinecke <andre.heinecke@intevation.de>
parents:
659
diff
changeset
|
99 } |
701
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
100 |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
101 const QString currentString = mComboBox->currentData().toString(); |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
102 |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
103 if (!mCertificate.isInstallCert()) { |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
104 return currentString == tr("uninstall"); |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
105 } |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
106 |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
107 return currentString == mInstallLabel; |
627
566ee111e331
Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents:
582
diff
changeset
|
108 } |
566ee111e331
Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents:
582
diff
changeset
|
109 |
638
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
110 void CertificateItemWidget::setState(bool state) |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
111 { |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
112 disconnect(mComboBox, SIGNAL(currentIndexChanged(int)), |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
113 this, SLOT(currentStateChanged(int))); |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
114 |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
115 if (state) { |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
116 mComboBox->setCurrentIndex(0); |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
117 } |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
118 else { |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
119 mComboBox->setCurrentIndex(1); |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
120 } |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
121 connect(mComboBox, SIGNAL(currentIndexChanged(int)), |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
122 this, SLOT(currentStateChanged(int))); |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
123 } |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
124 |
627
566ee111e331
Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents:
582
diff
changeset
|
125 Certificate CertificateItemWidget::certificate() |
566ee111e331
Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents:
582
diff
changeset
|
126 { |
566ee111e331
Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents:
582
diff
changeset
|
127 return mCertificate; |
566ee111e331
Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents:
582
diff
changeset
|
128 } |
566ee111e331
Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents:
582
diff
changeset
|
129 |
566ee111e331
Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents:
582
diff
changeset
|
130 void CertificateItemWidget::currentStateChanged(int) |
566ee111e331
Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents:
582
diff
changeset
|
131 { |
566ee111e331
Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents:
582
diff
changeset
|
132 bool state = mComboBox->currentData().toBool(); |
566ee111e331
Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents:
582
diff
changeset
|
133 emit stateChanged(state, mCertificate); |
566ee111e331
Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents:
582
diff
changeset
|
134 } |
701
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
135 |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
136 void IconOnlyTextPopupBox::showPopup() { |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
137 for (int i = 0; i < count(); i++) { |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
138 setItemText(i, itemData(i).toString()); |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
139 } |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
140 QComboBox::showPopup(); |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
141 } |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
142 |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
143 void IconOnlyTextPopupBox::hidePopup() { |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
144 for (int i = 0; i < count(); i++) { |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
145 setItemText(i, QString()); |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
146 } |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
147 QComboBox::hidePopup(); |
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
148 } |