Commit 7b38b8f5 authored by Laurent Montel's avatar Laurent Montel 😁

Allow to create no selectable item

parent 9227f50e
cmake_minimum_required(VERSION 3.5)
set(PIM_VERSION "5.10.43")
set(PIM_VERSION "5.10.44")
project(pimcommon VERSION ${PIM_VERSION})
......
......@@ -112,7 +112,7 @@ 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, const QString &configureGroupName)
QList<PluginItem *> &itemsList, const QString &configureGroupName, bool checkable)
{
itemsList.clear();
if (!lst.isEmpty()) {
......@@ -126,9 +126,11 @@ void ConfigurePluginsListWidget::fillTopItems(const QVector<PimCommon::PluginUti
subItem->mDescription = data.mDescription;
subItem->mEnableByDefault = data.mEnableByDefault;
subItem->mHasConfigureSupport = data.mHasConfigureDialog;
const bool isPluginActivated = PimCommon::PluginUtil::isPluginActivated(pair.first, pair.second, data.mEnableByDefault, data.mIdentifier);
subItem->mEnableFromUserSettings = isPluginActivated;
subItem->setCheckState(0, isPluginActivated ? Qt::Checked : Qt::Unchecked);
if (checkable) {
const bool isPluginActivated = PimCommon::PluginUtil::isPluginActivated(pair.first, pair.second, data.mEnableByDefault, data.mIdentifier);
subItem->mEnableFromUserSettings = isPluginActivated;
subItem->setCheckState(0, isPluginActivated ? Qt::Checked : Qt::Unchecked);
}
if (data.mHasConfigureDialog) {
QToolButton *but = new QToolButton(mListWidget);
QAction *act = new QAction(but);
......
......@@ -68,7 +68,7 @@ protected:
};
void savePlugins(const QString &groupName, const QString &prefixSettingKey, const QList<PluginItem *> &listItems);
void fillTopItems(const QVector<PimCommon::PluginUtilData> &lst, const QString &topLevelItemName, const QString &groupName, const QString &prefixKey, QList<PluginItem *> &itemsList,
const QString &configureGroupName = QString());
const QString &configureGroupName = QString(), bool checkable = true);
void resetToUserSettings(const QList<PluginItem *> &items);
void changeState(const QList<PluginItem *> &items);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment