]> cloud.milkyroute.net Git - dolphin.git/blob - src/settings/contextmenu/contextmenusettingspage.h
Add Filelight menu to Tools menu
[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, const KActionCollection *actions, const QStringList &actionIds);
29 ~ContextMenuSettingsPage() override;
30
31 /** @see SettingsPageBase::applySettings() */
32 void applySettings() override;
33
34 /** @see SettingsPageBase::restoreDefaults() */
35 void restoreDefaults() override;
36
37 protected:
38 void showEvent(QShowEvent *event) override;
39
40 private Q_SLOTS:
41 /**
42 * Loads locally installed services.
43 */
44 void loadServices();
45
46 private:
47 /**
48 * Loads installed version control systems.
49 */
50 void loadVersionControlSystems();
51
52 bool isInServicesList(const QString &service) const;
53
54 /**
55 * Adds a row to the model of m_listView.
56 */
57 void addRow(const QString &icon, const QString &text, const QString &value, bool checked);
58 bool entryVisible(const QString &id);
59 void setEntryVisible(const QString &id, bool visible);
60
61 private:
62 bool m_initialized;
63 ServiceModel *m_serviceModel;
64 QSortFilterProxyModel *m_sortModel;
65 QListView *m_listView;
66 QLineEdit *m_searchLineEdit;
67 QStringList m_enabledVcsPlugins;
68 const KActionCollection *m_actions;
69 const QStringList m_actionIds;
70 };
71
72 #endif