]> cloud.milkyroute.net Git - dolphin.git/blob - src/settings/contextmenu/contextmenusettingspage.h
Build with QT_NO_KEYWORDS
[dolphin.git] / src / settings / contextmenu / contextmenusettingspage.h
1 /*
2 * SPDX-FileCopyrightText: 2009-2010 Peter Penz <peter.penz19@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 #ifndef CONTEXTMENUSETTINGSPAGE_H
7 #define CONTEXTMENUSETTINGSPAGE_H
8
9 #include "settings/settingspagebase.h"
10
11 #include <KActionCollection>
12
13 #include <QString>
14
15 class QListView;
16 class QSortFilterProxyModel;
17 class ServiceModel;
18 class QLineEdit;
19
20 /**
21 * @brief Configurations for services in the context menu.
22 */
23 class ContextMenuSettingsPage : public SettingsPageBase
24 {
25 Q_OBJECT
26
27 public:
28 explicit ContextMenuSettingsPage(QWidget* parent,
29 const KActionCollection* actions,
30 const QStringList& actionIds);
31 ~ContextMenuSettingsPage() override;
32
33 /** @see SettingsPageBase::applySettings() */
34 void applySettings() override;
35
36 /** @see SettingsPageBase::restoreDefaults() */
37 void restoreDefaults() override;
38
39 protected:
40 void showEvent(QShowEvent* event) override;
41
42 private Q_SLOTS:
43 /**
44 * Loads locally installed services.
45 */
46 void loadServices();
47
48 private:
49 /**
50 * Loads installed version control systems.
51 */
52 void loadVersionControlSystems();
53
54 bool isInServicesList(const QString &service) const;
55
56 /**
57 * Adds a row to the model of m_listView.
58 */
59 void addRow(const QString &icon,
60 const QString &text,
61 const QString &value,
62 bool checked);
63 bool entryVisible(const QString& id);
64 void setEntryVisible(const QString& id, bool visible);
65
66 private:
67 bool m_initialized;
68 ServiceModel *m_serviceModel;
69 QSortFilterProxyModel *m_sortModel;
70 QListView* m_listView;
71 QLineEdit *m_searchLineEdit;
72 QStringList m_enabledVcsPlugins;
73 const KActionCollection* m_actions;
74 const QStringList m_actionIds;
75 };
76
77 #endif