view ui/certificatelistwidget.h @ 1101:2b3526ef2d69

(issue111) Keep manually changed certificates in the manually changed list. This invents the new property "active certificate" an inactive certificate is a certificate that is displayed but has no impact on the store.
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 15 Sep 2014 13:55:47 +0200
parents 9c4543128666
children 6f7b7d88f048
line wrap: on
line source
/* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
 * Software engineering by Intevation GmbH
 *
 * This file is Free Software under the GNU GPL (v>=2)
 * and comes with ABSOLUTELY NO WARRANTY!
 * See LICENSE.txt for details.
 */
#ifndef CERTIFICATELISTWIDGET_H
#define CERTIFICATELISTWIDGET_H

#include <QWidget>
#include <QMainWindow>
#include <QLabel>
#include <QListWidget>
#include <QVBoxLayout>

#include "certificate.h"
/**
 * @file certificatelistwidget.h
 * @brief Displays a list of certificates and a details panel for a selected
 * certificate.
 */

class CertificateItemWidget;

Q_DECLARE_METATYPE(Certificate);
class CertificateListWidget : public QWidget
{
    Q_OBJECT
public:
    CertificateListWidget(QWidget *parent, Qt::WindowFlags flags = 0);

    void addCertificate(const Certificate &certificate, bool state,
                        bool editable = true,
                        const QString& installLabel = QString(),
                        const QString& removeLabel = QString());
    void removeCertificate(const Certificate &cert);
    void activateCertificate(const Certificate &cert);
    void deactivateCertificate(const Certificate &cert);
    void setCertState(bool state, const Certificate &cert);
    void clear();
    QStringList certificates();
    QStringList selectedCertificates();
    QStringList unselectedCertificates();
    QList<Certificate> certificateList();
    int selectedCertCount();
    int activeCertificates();
    bool contains(const Certificate &cert);

private:

    QList <CertificateItemWidget*> mCertificateWidgets;
    QVBoxLayout mLayout;

private slots:
    void certStateChanged(bool state, const Certificate &cert);

signals:
    void certListChanged(int selected);
    void certChanged(bool state, const Certificate &cert);

};
#endif // CERTIFICATELISTWIDGET_H

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