summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-09-20 11:45:35 (GMT)
committerMontel Laurent <montel@kde.org>2016-09-20 11:45:35 (GMT)
commit8d71eaf903efa96223329592c2545f984efa291f (patch)
treef0cf9d4c2a0659dc8b2e5dfc6980acec01655301
parent0d6da5eb62cb11490a5a5624e5cb04a5cab17b86 (diff)
Look at to implement configure plugin support
-rw-r--r--src/configureplugins/configurepluginslistwidget.cpp22
-rw-r--r--src/configureplugins/configurepluginslistwidget.h2
2 files changed, 24 insertions, 0 deletions
diff --git a/src/configureplugins/configurepluginslistwidget.cpp b/src/configureplugins/configurepluginslistwidget.cpp
index 7f6b9f3..e391d24 100644
--- a/src/configureplugins/configurepluginslistwidget.cpp
+++ b/src/configureplugins/configurepluginslistwidget.cpp
@@ -23,7 +23,10 @@
#include <QHBoxLayout>
#include <QLabel>
+#include <QPushButton>
+#include <QToolButton>
#include <QTreeWidget>
+#include <QHeaderView>
using namespace PimCommon;
ConfigurePluginsListWidget::ConfigurePluginsListWidget(QWidget *parent)
@@ -104,6 +107,10 @@ void ConfigurePluginsListWidget::savePlugins(const QString &groupName, const QSt
void ConfigurePluginsListWidget::fillTopItems(const QVector<PimCommon::PluginUtilData> &lst, const QString &topLevelItemName,
const QString &groupName, const QString &prefixKey, QList<PluginItem *> &itemsList)
{
+#ifdef CONFIGUREPLUGIN_SUPPORT
+ mListWidget->setColumnCount(2);
+ mListWidget->header()->resizeSection(0, 300);
+#endif
itemsList.clear();
if (!lst.isEmpty()) {
QTreeWidgetItem *topLevel = new QTreeWidgetItem(mListWidget, QStringList() << topLevelItemName);
@@ -117,11 +124,26 @@ void ConfigurePluginsListWidget::fillTopItems(const QVector<PimCommon::PluginUti
subItem->mEnableByDefault = data.mEnableByDefault;
const bool isPluginActivated = PimCommon::PluginUtil::isPluginActivated(pair.first, pair.second, data.mEnableByDefault, data.mIdentifier);
subItem->setCheckState(0, isPluginActivated ? Qt::Checked : Qt::Unchecked);
+#ifdef CONFIGUREPLUGIN_SUPPORT
+ QToolButton *but = new QToolButton(mListWidget);
+ but->setFixedWidth(48);
+ but->setToolTip(i18n("Configure"));
+ but->setAutoFillBackground(true);
+ mListWidget->setItemWidget(subItem, 1, but);
+ connect(but, &QToolButton::clicked, this, &ConfigurePluginsListWidget::slotClicked);
+#endif
itemsList.append(subItem);
}
}
}
+void ConfigurePluginsListWidget::slotClicked()
+{
+#ifdef CONFIGUREPLUGIN_SUPPORT
+ qDebug() <<" void ConfigurePluginsListWidget::slotClicked()";
+#endif
+}
+
void ConfigurePluginsListWidget::changeState(const QList<PluginItem *> &items)
{
Q_FOREACH (PluginItem *item, items) {
diff --git a/src/configureplugins/configurepluginslistwidget.h b/src/configureplugins/configurepluginslistwidget.h
index 7d80e64..376643b 100644
--- a/src/configureplugins/configurepluginslistwidget.h
+++ b/src/configureplugins/configurepluginslistwidget.h
@@ -64,6 +64,8 @@ protected:
void changeState(const QList<PluginItem *> &items);
QTreeWidget *mListWidget;
+private Q_SLOTS:
+ void slotClicked();
};
}