┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/settings/contextmenu
diff options
context:
space:
mode:
authorAlbert Mkhitaryan <[email protected]>2026-03-02 10:50:33 +0000
committerMéven Car <[email protected]>2026-03-02 10:50:33 +0000
commitdb15f8b24366a66529050c181ab78fcfb9917104 (patch)
tree8b07446980b21dc3a489f92cb4ac09d54afa54ec /src/settings/contextmenu
parent07086b062d9696e33ed2a36710d25d6c2fc967cc (diff)
contextmenusettingspage: add hint for context menu shortcuts in contex menu settings page
* added link button in Context Menu Settings to Shortcuts for Context Menu Actions as shown below * removed the text above the search bar, which said "Select which services should be shown in the context menu:" since the check-boxes are clear enough * instead of "Download New Services" the link to download services now just says "Download Services" for brevity. ![context_menu_text_buttons.png](/uploads/1af045ab8aae9daf527b30cf1b1dcbba/context_menu_text_buttons.png){width="602" height="600"} before: ![image.png](/uploads/08615dfcc102880f8e5cb080f2491c9c/image.png){width=768 height=600}
Diffstat (limited to 'src/settings/contextmenu')
-rw-r--r--src/settings/contextmenu/contextmenusettingspage.cpp46
1 files changed, 27 insertions, 19 deletions
diff --git a/src/settings/contextmenu/contextmenusettingspage.cpp b/src/settings/contextmenu/contextmenusettingspage.cpp
index eaa636db4..9c29e77f4 100644
--- a/src/settings/contextmenu/contextmenusettingspage.cpp
+++ b/src/settings/contextmenu/contextmenusettingspage.cpp
@@ -22,6 +22,7 @@
#include <kwidgetsaddons_version.h>
#include <KNSWidgets/Button>
+#include <KStandardAction>
#include <QtGlobal>
#include <QApplication>
@@ -29,6 +30,7 @@
#include <QLabel>
#include <QLineEdit>
#include <QListWidget>
+#include <QPushButton>
#include <QScroller>
#include <QShowEvent>
#include <QSortFilterProxyModel>
@@ -53,16 +55,36 @@ ContextMenuSettingsPage::ContextMenuSettingsPage(QWidget *parent, const KActionC
{
QVBoxLayout *topLayout = new QVBoxLayout(this);
- QLabel *label = new QLabel(i18nc("@label:textbox",
- "Select which services should "
- "be shown in the context menu:"),
- this);
- label->setWordWrap(true);
+ auto *searchLayout = new QHBoxLayout();
m_searchLineEdit = new QLineEdit(this);
m_searchLineEdit->setPlaceholderText(i18nc("@label:textbox", "Search…"));
connect(m_searchLineEdit, &QLineEdit::textChanged, this, [this](const QString &filter) {
m_sortModel->setFilterFixedString(filter);
});
+ searchLayout->addWidget(m_searchLineEdit);
+
+#ifndef Q_OS_WIN
+ using NewStuffButton = KNSWidgets::Button;
+ auto *downloadButton = new NewStuffButton(i18nc("@action:button", "Download Services…"), QStringLiteral("servicemenu.knsrc"), this);
+ connect(downloadButton, &NewStuffButton::dialogFinished, this, [this](const auto &changedEntries) {
+ if (!changedEntries.isEmpty()) {
+ m_serviceModel->clear();
+ loadServices();
+ }
+ });
+ searchLayout->addWidget(downloadButton);
+#endif // Q_OS_WIN
+
+#if KIO_VERSION >= QT_VERSION_CHECK(6, 24, 0)
+ auto *shortcutsButton = new QPushButton(QIcon::fromTheme(QStringLiteral("configure-shortcuts")), i18nc("@action:button", "Shortcuts…"), this);
+ connect(shortcutsButton, &QPushButton::clicked, this, [this] {
+ if (auto *action = m_actions->action(KStandardAction::name(KStandardAction::KeyBindings))) {
+ action->trigger();
+ }
+ });
+ searchLayout->addWidget(shortcutsButton);
+#endif
+ topLayout->addLayout(searchLayout);
m_listView = new QListView(this);
QScroller::grabGesture(m_listView->viewport(), QScroller::TouchGesture);
@@ -78,22 +100,8 @@ ContextMenuSettingsPage::ContextMenuSettingsPage(QWidget *parent, const KActionC
m_listView->setVerticalScrollMode(QListView::ScrollPerPixel);
connect(m_listView, &QListView::clicked, this, &ContextMenuSettingsPage::changed);
- topLayout->addWidget(label);
- topLayout->addWidget(m_searchLineEdit);
topLayout->addWidget(m_listView);
-#ifndef Q_OS_WIN
- using NewStuffButton = KNSWidgets::Button;
- auto *downloadButton = new NewStuffButton(i18nc("@action:button", "Download New Services…"), QStringLiteral("servicemenu.knsrc"), this);
- connect(downloadButton, &NewStuffButton::dialogFinished, this, [this](const auto &changedEntries) {
- if (!changedEntries.isEmpty()) {
- m_serviceModel->clear();
- loadServices();
- }
- });
- topLayout->addWidget(downloadButton);
-#endif // Q_OS_WIN
-
m_enabledVcsPlugins = VersionControlSettings::enabledPlugins();
std::sort(m_enabledVcsPlugins.begin(), m_enabledVcsPlugins.end());
}