mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-24 12:46:35 +01:00
Add filter to preferences extensions page
Developed by: Yehor Tsyba @malibushko BUG: 408312
This commit is contained in:
parent
f7cb769371
commit
d8a706f3a9
@ -11,6 +11,13 @@
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="search">
|
||||
<property name="placeholderText">
|
||||
<string>Enter name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="list">
|
||||
<property name="alternatingRowColors">
|
||||
|
@ -52,6 +52,7 @@ PluginsManager::PluginsManager(QWidget* parent)
|
||||
connect(ui->butRemove, &QAbstractButton::clicked, this, &PluginsManager::removeClicked);
|
||||
connect(ui->list, &QListWidget::currentItemChanged, this, &PluginsManager::currentChanged);
|
||||
connect(ui->list, &QListWidget::itemChanged, this, &PluginsManager::itemChanged);
|
||||
connect(ui->search, &QLineEdit::textChanged, this, &PluginsManager::addFilter);
|
||||
connect(mApp->plugins(), &Plugins::availablePluginsChanged, this, &PluginsManager::refresh);
|
||||
|
||||
ui->list->setItemDelegate(new PluginListDelegate(ui->list));
|
||||
@ -243,6 +244,19 @@ void PluginsManager::removeClicked()
|
||||
mApp->plugins()->removePlugin(&plugin);
|
||||
}
|
||||
|
||||
void PluginsManager::addFilter(const QString& filter) {
|
||||
for (int i = 0; i < ui->list->count(); ++i) {
|
||||
const QString& pluginName = ui->list->item(i)->text();
|
||||
|
||||
if (pluginName.contains(filter,Qt::CaseInsensitive) || !filter.size()) {
|
||||
ui->list->item(i)->setHidden(false);
|
||||
}
|
||||
else {
|
||||
ui->list->item(i)->setHidden(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PluginsManager::~PluginsManager()
|
||||
{
|
||||
delete ui;
|
||||
|
@ -45,6 +45,7 @@ private Q_SLOTS:
|
||||
void removeClicked();
|
||||
void currentChanged(QListWidgetItem* item);
|
||||
void itemChanged(QListWidgetItem* item);
|
||||
void addFilter(const QString& newText);
|
||||
|
||||
void refresh();
|
||||
|
||||
|
@ -232,7 +232,7 @@ QString Scripts::completeFormData(const QByteArray &data)
|
||||
" var type = input.type.toLowerCase();"
|
||||
" if (type != 'text' && type != 'password' && type != 'email')"
|
||||
" continue;"
|
||||
" if (input.name == key) {"
|
||||
" if (input.name == key && input.name != "") {"
|
||||
" input.value = val;"
|
||||
" input.dispatchEvent(new Event('change'));"
|
||||
" }"
|
||||
|
Loading…
Reference in New Issue
Block a user