comparison ui/certificateitemwidget.cpp @ 582:88c9bdc74175 trustbridge-refactor

New widgets to display certificates in lists.
author Raimund Renkert <rrenkert@intevation.de>
date Tue, 27 May 2014 16:16:21 +0200
parents
children 566ee111e331
comparison
equal deleted inserted replaced
581:ab622e094786 582:88c9bdc74175
1 /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
2 * Software engineering by Intevation GmbH
3 *
4 * This file is Free Software under the GNU GPL (v>=2)
5 * and comes with ABSOLUTELY NO WARRANTY!
6 * See LICENSE.txt for details.
7 */
8 #include "certificateitemwidget.h"
9
10 #include <QHBoxLayout>
11 #include <QDebug>
12
13 CertificateItemWidget::CertificateItemWidget(
14 QWidget *parent,
15 const Certificate &cert) : QWidget(parent)
16 {
17 mCertificate = cert;
18 setupGUI();
19 }
20
21 void CertificateItemWidget::setupGUI()
22 {
23 mLabel = new QLabel(mCertificate.subjectCN());
24 mComboBox = new QComboBox;
25 mComboBox->setFixedWidth(46);
26
27 if (mCertificate.isInstallCert()) {
28 mComboBox->addItem(QIcon(":/img/list-add.png"), tr("add"), QVariant("true"));
29 mComboBox->addItem(QIcon(":/img/list-remove.png"),
30 tr("remove"), QVariant("false"));
31 }
32 else {
33 mComboBox->addItem(QIcon(":/img/list-add.png"), tr("add"), QVariant("true"));
34 mComboBox->addItem(QIcon(":/img/list-remove.png"),
35 tr("remove"), QVariant("false"));
36 }
37 QHBoxLayout *layout = new QHBoxLayout;
38 layout->addWidget(mComboBox);
39 layout->addWidget(mLabel);
40 this->setLayout(layout);
41 }

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