1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

PluginsManager: Opens plugin settings with double click in ListWidget

This commit is contained in:
nowrep 2012-07-08 17:57:06 +02:00
parent ac36261549
commit 0e12433c0e
2 changed files with 4 additions and 2 deletions

View File

@ -24,6 +24,7 @@
PluginListDelegate::PluginListDelegate(QListWidget* parent) PluginListDelegate::PluginListDelegate(QListWidget* parent)
: QStyledItemDelegate(parent) : QStyledItemDelegate(parent)
, m_rowHeight(0) , m_rowHeight(0)
, m_padding(0)
{ {
} }

View File

@ -47,6 +47,7 @@ PluginsManager::PluginsManager(QWidget* parent)
connect(ui->butSettings, SIGNAL(clicked()), this, SLOT(settingsClicked())); connect(ui->butSettings, SIGNAL(clicked()), this, SLOT(settingsClicked()));
connect(ui->list, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SLOT(currentChanged(QListWidgetItem*))); connect(ui->list, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SLOT(currentChanged(QListWidgetItem*)));
connect(ui->list, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*))); connect(ui->list, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(itemChanged(QListWidgetItem*)));
connect(ui->list, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(settingsClicked()));
connect(ui->allowAppPlugins, SIGNAL(clicked(bool)), this, SLOT(allowAppPluginsChanged(bool))); connect(ui->allowAppPlugins, SIGNAL(clicked(bool)), this, SLOT(allowAppPluginsChanged(bool)));
ui->list->setItemDelegate(new PluginListDelegate(ui->list)); ui->list->setItemDelegate(new PluginListDelegate(ui->list));
@ -264,7 +265,7 @@ void PluginsManager::itemChanged(QListWidgetItem* item)
void PluginsManager::settingsClicked() void PluginsManager::settingsClicked()
{ {
QListWidgetItem* item = ui->list->currentItem(); QListWidgetItem* item = ui->list->currentItem();
if (!item) { if (!item || item->checkState() == Qt::Unchecked) {
return; return;
} }
@ -276,7 +277,7 @@ void PluginsManager::settingsClicked()
item->setData(Qt::UserRole + 10, qVariantFromValue(plugin)); item->setData(Qt::UserRole + 10, qVariantFromValue(plugin));
} }
if (plugin.isLoaded()) { if (plugin.isLoaded() && plugin.pluginSpec.hasSettings) {
plugin.instance->showSettings(this); plugin.instance->showSettings(this);
} }
} }