kateconfigdialog.h 2.29 KB
Newer Older
1
/*  SPDX-License-Identifier: LGPL-2.0-or-later
2

3
4
5
    SPDX-FileCopyrightText: 2001 Christoph Cullmann <cullmann@kde.org>
    SPDX-FileCopyrightText: 2002 Joseph Wenninger <jowenn@kde.org>
    SPDX-FileCopyrightText: 2007 Mirko Stocker <me@misto.ch>
6

7
    SPDX-License-Identifier: LGPL-2.0-or-later
8
9
10
11
12
*/

#ifndef __kate_configdialog_h__
#define __kate_configdialog_h__

13
#include <KTextEditor/ConfigPage>
Christoph Cullmann's avatar
Christoph Cullmann committed
14
#include <KTextEditor/Document>
15
16
#include <KTextEditor/Editor>
#include <KTextEditor/Plugin>
Christoph Cullmann's avatar
Christoph Cullmann committed
17
#include <KTextEditor/View>
18

Michal Humpula's avatar
Michal Humpula committed
19
#include <KPageDialog>
20

21
22
23
24
#ifdef WITH_KUSERFEEDBACK
#include <KUserFeedback/FeedbackConfigWidget>
#endif

25
26
#include "ui_sessionconfigwidget.h"

27
class QCheckBox;
28
class QComboBox;
29
class QSpinBox;
30
class KateMainWindow;
31
32
class KPluralHandlingSpinBox;

33
34
struct PluginPageListItem {
    KTextEditor::Plugin *plugin;
35
    int idInPlugin;
36
37
38
    KTextEditor::ConfigPage *pluginPage;
    QWidget *pageParent;
    KPageWidgetItem *pageWidgetItem;
39
40
41
42
43
44
};

class KateConfigDialog : public KPageDialog
{
    Q_OBJECT

45
public:
46
    KateConfigDialog(KateMainWindow *parent);
47

48
49
50
51
52
public: // static
    /**
     * Reads the value from the given open config. If not present in config yet then
     * the default value 10 is used.
     */
53
    static int recentFilesMaxCount();
54

55
56
57
public:
    void addPluginPage(KTextEditor::Plugin *plugin);
    void removePluginPage(KTextEditor::Plugin *plugin);
58
    void showAppPluginPage(KTextEditor::Plugin *plugin, int id);
59

60
protected Q_SLOTS:
61
62
    void slotApply();
    void slotChanged();
Christoph Cullmann's avatar
Christoph Cullmann committed
63
    void slotHelp();
64

65
66
protected:
    void closeEvent(QCloseEvent *event) override;
67

68
private:
69
70
71
72
73
74
75
76
77
    void addBehaviorPage();
    void addSessionPage();
    void addPluginsPage();
    void addFeedbackPage();
    void addPluginPages();
    void addEditorPages();

private:
    KateMainWindow * const m_mainWindow;
Adam Treat's avatar
Adam Treat committed
78

79
    bool m_dataChanged = false;
Adam Treat's avatar
Adam Treat committed
80
81

    QCheckBox *m_modNotifications;
82
83
    QComboBox *m_cmbQuickOpenMatchMode;
    QComboBox *m_cmbQuickOpenListMode;
84
    QSpinBox *m_tabLimit;
85
86
    QCheckBox *m_showTabCloseButton;
    QCheckBox *m_expandTabs;
87

88
    Ui::SessionConfigWidget sessionConfigUi;
89

90
    QHash<KPageWidgetItem *, PluginPageListItem *> m_pluginPages;
Christoph Cullmann's avatar
Christoph Cullmann committed
91
    QList<KTextEditor::ConfigPage *> m_editorPages;
92
93
94
95

#ifdef WITH_KUSERFEEDBACK
    KUserFeedback::FeedbackConfigWidget *m_userFeedbackWidget = nullptr;
#endif
96
97
98
};

#endif