]> cloud.milkyroute.net Git - dolphin.git/blob - src/settings/kcm/kcmdolphincontextmenu.cpp
Add options to hide some context menu entries
[dolphin.git] / src / settings / kcm / kcmdolphincontextmenu.cpp
1 /*
2 * SPDX-FileCopyrightText: 2009 Peter Penz <peter.penz19@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7 #include "kcmdolphincontextmenu.h"
8
9 #include "settings/contextmenu/contextmenusettingspage.h"
10
11 #include <kconfigwidgets_version.h>
12 #include <KPluginFactory>
13 #include <KPluginLoader>
14
15 #include <QVBoxLayout>
16
17 K_PLUGIN_FACTORY(KCMDolphinContextMenuConfigFactory, registerPlugin<DolphinContextMenuConfigModule>(QStringLiteral("dolphincontextmenu"));)
18
19 DolphinContextMenuConfigModule::DolphinContextMenuConfigModule(QWidget* parent, const QVariantList& args) :
20 KCModule(parent, args),
21 m_contextMenu(nullptr)
22 {
23 setButtons(KCModule::Default | KCModule::Help);
24
25 QVBoxLayout* topLayout = new QVBoxLayout(this);
26 topLayout->setContentsMargins(0, 0, 0, 0);
27
28 m_contextMenu = new ContextMenuSettingsPage(this);
29 connect(m_contextMenu, &ContextMenuSettingsPage::changed, this, &DolphinContextMenuConfigModule::markAsChanged);
30 topLayout->addWidget(m_contextMenu, 0, {});
31 }
32
33 DolphinContextMenuConfigModule::~DolphinContextMenuConfigModule()
34 {
35 }
36
37 void DolphinContextMenuConfigModule::save()
38 {
39 m_contextMenu->applySettings();
40 }
41
42 void DolphinContextMenuConfigModule::defaults()
43 {
44 m_contextMenu->restoreDefaults();
45 }
46
47 #include "kcmdolphincontextmenu.moc"