comparison ui/certificateitemwidget.cpp @ 687:973a7ce19658

(issue24) Let the string for install / remove be set for each item individually
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 01 Jul 2014 12:49:19 +0200
parents 248d4f24e618
children 31c3d2bc9880
comparison
equal deleted inserted replaced
686:a2e94e88d304 687:973a7ce19658
8 #include "certificateitemwidget.h" 8 #include "certificateitemwidget.h"
9 9
10 #include <QHBoxLayout> 10 #include <QHBoxLayout>
11 #include <QDebug> 11 #include <QDebug>
12 12
13 CertificateItemWidget::CertificateItemWidget( 13 CertificateItemWidget::CertificateItemWidget(QWidget *parent,
14 QWidget *parent, 14 const Certificate &cert,
15 const Certificate &cert, 15 bool state,
16 bool state, 16 bool editable,
17 bool editable) : QWidget(parent) 17 const QString &installLabel,
18 const QString &removeLabel) :
19 QWidget(parent),
20 mInstallLabel (installLabel),
21 mRemoveLabel (removeLabel)
18 { 22 {
19 mCertificate = cert; 23 mCertificate = cert;
20 mState = state; 24 mState = state;
21 mEditable = editable; 25 mEditable = editable;
22 setupGUI(); 26 setupGUI();
30 connect(mComboBox, SIGNAL(currentIndexChanged(int)), 34 connect(mComboBox, SIGNAL(currentIndexChanged(int)),
31 this, SLOT(currentStateChanged(int))); 35 this, SLOT(currentStateChanged(int)));
32 36
33 QHBoxLayout *layout = new QHBoxLayout; 37 QHBoxLayout *layout = new QHBoxLayout;
34 if (mCertificate.isInstallCert()) { 38 if (mCertificate.isInstallCert()) {
35 mComboBox->addItem(QIcon(":/img/security-high.png"), tr("install"), QVariant("true")); 39 mComboBox->addItem(QIcon(":/img/security-high.png"), mInstallLabel, QVariant("true"));
36 mComboBox->addItem(QIcon(":/img/security-low.png"), tr("remove"), QVariant("false")); 40 mComboBox->addItem(QIcon(":/img/security-low.png"), mRemoveLabel, QVariant("false"));
37 if (mState) 41 if (mState)
38 mComboBox->setCurrentIndex(0); 42 mComboBox->setCurrentIndex(0);
39 else { 43 else {
40 mComboBox->setCurrentIndex(1); 44 mComboBox->setCurrentIndex(1);
41 } 45 }

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