summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e076d86)
Summary:
You can now filter the list of installed services.
This is especially useful if you install additional service menus
from the kde store, because one instalaton can add a lot of services.
For instance the ReImage plugin.
Test Plan:
Compiles, search for a service menu.
Only services matching the query will show up.
Reviewers: ngraham, elvisangelaccio, meven
Reviewed By: meven
Subscribers: kfm-devel
Tags: #dolphin
Differential Revision: https://phabricator.kde.org/D29375
#include <QListWidget>
#include <QShowEvent>
#include <QSortFilterProxyModel>
#include <QListWidget>
#include <QShowEvent>
#include <QSortFilterProxyModel>
"Select which services should "
"be shown in the context menu:"), this);
label->setWordWrap(true);
"Select which services should "
"be shown in the context menu:"), this);
label->setWordWrap(true);
+ m_searchLineEdit = new QLineEdit(this);
+ m_searchLineEdit->setPlaceholderText(i18nc("@label:textbox", "Search..."));
+ connect(m_searchLineEdit, &QLineEdit::textChanged, [=](const QString &filter){
+ m_sortModel->setFilterFixedString(filter);
+ });
m_listView = new QListView(this);
ServiceItemDelegate* delegate = new ServiceItemDelegate(m_listView, m_listView);
m_listView = new QListView(this);
ServiceItemDelegate* delegate = new ServiceItemDelegate(m_listView, m_listView);
m_sortModel->setSourceModel(m_serviceModel);
m_sortModel->setSortRole(Qt::DisplayRole);
m_sortModel->setSortLocaleAware(true);
m_sortModel->setSourceModel(m_serviceModel);
m_sortModel->setSortRole(Qt::DisplayRole);
m_sortModel->setSortLocaleAware(true);
+ m_sortModel->setFilterRole(Qt::DisplayRole);
+ m_sortModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
m_listView->setModel(m_sortModel);
m_listView->setItemDelegate(delegate);
m_listView->setVerticalScrollMode(QListView::ScrollPerPixel);
m_listView->setModel(m_sortModel);
m_listView->setItemDelegate(delegate);
m_listView->setVerticalScrollMode(QListView::ScrollPerPixel);
connect(downloadButton, &KNS3::Button::dialogFinished, this, &ServicesSettingsPage::loadServices);
topLayout->addWidget(label);
connect(downloadButton, &KNS3::Button::dialogFinished, this, &ServicesSettingsPage::loadServices);
topLayout->addWidget(label);
+ topLayout->addWidget(m_searchLineEdit);
topLayout->addWidget(m_listView);
topLayout->addWidget(downloadButton);
topLayout->addWidget(m_listView);
topLayout->addWidget(downloadButton);
}
m_sortModel->sort(Qt::DisplayRole);
}
m_sortModel->sort(Qt::DisplayRole);
+ m_searchLineEdit->setFocus(Qt::OtherFocusReason);
}
void ServicesSettingsPage::loadVersionControlSystems()
}
void ServicesSettingsPage::loadVersionControlSystems()
class QListView;
class QSortFilterProxyModel;
class ServiceModel;
class QListView;
class QSortFilterProxyModel;
class ServiceModel;
/**
* @brief Page for the 'Services' settings of the Dolphin settings dialog.
/**
* @brief Page for the 'Services' settings of the Dolphin settings dialog.
ServiceModel* m_serviceModel;
QSortFilterProxyModel* m_sortModel;
QListView* m_listView;
ServiceModel* m_serviceModel;
QSortFilterProxyModel* m_sortModel;
QListView* m_listView;
+ QLineEdit *m_searchLineEdit;
QStringList m_enabledVcsPlugins;
};
QStringList m_enabledVcsPlugins;
};