From a512176b4bdbf0f0471a9b9089f4a936c14e2732 Mon Sep 17 00:00:00 2001 From: Duong Do Minh Chau Date: Thu, 12 Nov 2020 16:38:44 +0700 Subject: Add options to hide some context menu entries This commit add options to hide the following context menu entries: - Add to Places - Copy Location - Duplicate Here - Open in New Tab and Open in New Tabs - Open in New Window - Sort By - View Mode The Services settings page is renamed to Context Menu ShowCopyMoveMenu option is moved from GeneralSettings to ContextMenuSettings BUG: 314594 --- src/settings/kcm/kcmdolphincontextmenu.cpp | 47 ++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/settings/kcm/kcmdolphincontextmenu.cpp (limited to 'src/settings/kcm/kcmdolphincontextmenu.cpp') diff --git a/src/settings/kcm/kcmdolphincontextmenu.cpp b/src/settings/kcm/kcmdolphincontextmenu.cpp new file mode 100644 index 000000000..a730dfcfe --- /dev/null +++ b/src/settings/kcm/kcmdolphincontextmenu.cpp @@ -0,0 +1,47 @@ +/* + * SPDX-FileCopyrightText: 2009 Peter Penz + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "kcmdolphincontextmenu.h" + +#include "settings/contextmenu/contextmenusettingspage.h" + +#include +#include +#include + +#include + +K_PLUGIN_FACTORY(KCMDolphinContextMenuConfigFactory, registerPlugin(QStringLiteral("dolphincontextmenu"));) + +DolphinContextMenuConfigModule::DolphinContextMenuConfigModule(QWidget* parent, const QVariantList& args) : + KCModule(parent, args), + m_contextMenu(nullptr) +{ + setButtons(KCModule::Default | KCModule::Help); + + QVBoxLayout* topLayout = new QVBoxLayout(this); + topLayout->setContentsMargins(0, 0, 0, 0); + + m_contextMenu = new ContextMenuSettingsPage(this); + connect(m_contextMenu, &ContextMenuSettingsPage::changed, this, &DolphinContextMenuConfigModule::markAsChanged); + topLayout->addWidget(m_contextMenu, 0, {}); +} + +DolphinContextMenuConfigModule::~DolphinContextMenuConfigModule() +{ +} + +void DolphinContextMenuConfigModule::save() +{ + m_contextMenu->applySettings(); +} + +void DolphinContextMenuConfigModule::defaults() +{ + m_contextMenu->restoreDefaults(); +} + +#include "kcmdolphincontextmenu.moc" -- cgit v1.3