diff ui/certificateitemwidget.h @ 1106:6f7b7d88f048

(issue115) Rework CertificateListWidgets to have a ToolButton instead of a combobox
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 15 Sep 2014 17:43:56 +0200
parents 2b3526ef2d69
children 9bb9932bb819
line wrap: on
line diff
--- a/ui/certificateitemwidget.h	Mon Sep 15 17:43:02 2014 +0200
+++ b/ui/certificateitemwidget.h	Mon Sep 15 17:43:56 2014 +0200
@@ -14,20 +14,10 @@
  */
 #include <QWidget>
 #include <QLabel>
-#include <QComboBox>
 
 #include "certificate.h"
-/** @brief A combo box that shows the text only in the popup
- *
- * The text shown is the data set as Qt::UserRole
- */
-class IconOnlyTextPopupBox : public QComboBox
-{
-protected:
-    virtual void showPopup();
-    virtual void hidePopup();
-};
 
+class QToolButton;
 
 class CertificateItemWidget : public QWidget
 {
@@ -37,9 +27,7 @@
         QWidget *parent = 0,
         const Certificate &cert = Certificate(),
         bool state = false,
-        bool editable = true,
-        const QString& installLabel = QString(),
-        const QString& removeLabel = QString());
+        QToolButton * btn = NULL);
 
     bool state();
     void setState(bool state);
@@ -50,14 +38,11 @@
 
     Certificate mCertificate;
     bool mState;
-    bool mEditable;
     QLabel *mLabel;
-    IconOnlyTextPopupBox *mComboBox;
-    QString mInstallLabel;
-    QString mRemoveLabel;
+    QToolButton *mButton;
 
 private slots:
-    void currentStateChanged(int ndx);
+    void currentStateChanged(bool state);
 
 signals:
     void stateChanged(bool state, const Certificate &cert);

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