Changeset View
Changeset View
Standalone View
Standalone View
plugins/meson/settings/mesonconfigpage.h
- This file was added.
1 | /* This file is part of KDevelop | ||||
---|---|---|---|---|---|
2 | Copyright 2018 Daniel Mensinger <daniel@mensinger-ka.de> | ||||
3 | | ||||
4 | This library is free software; you can redistribute it and/or | ||||
5 | modify it under the terms of the GNU Library General Public | ||||
6 | License as published by the Free Software Foundation; either | ||||
7 | version 2 of the License, or (at your option) any later version. | ||||
8 | | ||||
9 | This library is distributed in the hope that it will be useful, | ||||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
12 | Library General Public License for more details. | ||||
13 | | ||||
14 | You should have received a copy of the GNU Library General Public License | ||||
15 | along with this library; see the file COPYING.LIB. If not, write to | ||||
16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||||
17 | Boston, MA 02110-1301, USA. | ||||
18 | */ | ||||
19 | | ||||
20 | #pragma once | ||||
21 | | ||||
22 | #include <interfaces/configpage.h> | ||||
23 | #include "mesonconfig.h" | ||||
24 | | ||||
25 | namespace KDevelop | ||||
26 | { | ||||
27 | class IPlugin; | ||||
28 | class IProject; | ||||
29 | } | ||||
30 | | ||||
31 | namespace Ui { | ||||
32 | class MesonConfigPage; | ||||
33 | } | ||||
34 | | ||||
35 | class MesonConfigPage : public KDevelop::ConfigPage | ||||
36 | { | ||||
37 | Q_OBJECT | ||||
38 | public: | ||||
39 | explicit MesonConfigPage(KDevelop::IPlugin* plugin, KDevelop::IProject *project, QWidget* parent = nullptr); | ||||
40 | | ||||
41 | QString name() const override; | ||||
42 | QString fullName() const override; | ||||
43 | QIcon icon() const override; | ||||
44 | | ||||
45 | public Q_SLOTS: | ||||
46 | void apply() override; | ||||
47 | void defaults() override; | ||||
48 | void reset() override; | ||||
49 | | ||||
50 | void addBuildDir(); | ||||
51 | void removeBuildDir(); | ||||
52 | void changeBuildDirIndex(int index); | ||||
53 | void emitChanged(); | ||||
54 | | ||||
55 | private: | ||||
56 | void updateUI(); | ||||
57 | void readUI(); | ||||
58 | void writeConfig(); | ||||
59 | void setWidgetsDisabled(bool disabled); | ||||
60 | | ||||
61 | private: | ||||
62 | KDevelop::IProject *m_project = nullptr; | ||||
63 | Ui::MesonConfigPage *m_ui = nullptr; | ||||
64 | Meson::MesonConfig m_config; | ||||
65 | Meson::BuildDir m_current; | ||||
66 | bool m_configChanged = false; | ||||
67 | }; |