Changeset View
Changeset View
Standalone View
Standalone View
plugins/projectservicemanager/config/projectconfigpage.h
- This file was added.
1 | /* This file is part of KDevelop | ||||
---|---|---|---|---|---|
2 | Copyright 2017 Friedrich W. H. Kossebau <kossebau@kde.org> | ||||
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 | #ifndef KDEVPROJECTSERVICEHOOKUPMANAGER_PROJECTCONFIGPAGE_H | ||||
21 | #define KDEVPROJECTSERVICEHOOKUPMANAGER_PROJECTCONFIGPAGE_H | ||||
22 | | ||||
23 | #include <interfaces/configpage.h> | ||||
24 | | ||||
25 | #include "projectservicehookuplistmodel.h" | ||||
26 | | ||||
27 | class QItemSelection; | ||||
28 | | ||||
29 | namespace KDevelop | ||||
30 | { | ||||
31 | class IProject; | ||||
32 | class ProjectServiceHookupConfigPage; | ||||
33 | } | ||||
34 | | ||||
35 | namespace ProjectServiceHookupManager { | ||||
36 | | ||||
37 | namespace Ui | ||||
38 | { | ||||
39 | class ProjectConfigPage; | ||||
40 | } | ||||
41 | | ||||
42 | /** | ||||
43 | * @todo write docs | ||||
44 | */ | ||||
45 | class ProjectConfigPage : public KDevelop::ConfigPage | ||||
46 | { | ||||
47 | Q_OBJECT | ||||
48 | | ||||
49 | public: | ||||
50 | /** | ||||
51 | * Constructor | ||||
52 | * | ||||
53 | * @param plugin | ||||
54 | * @param project | ||||
55 | * @param parent | ||||
56 | */ | ||||
57 | ProjectConfigPage(KDevelop::IPlugin* plugin, KDevelop::IProject* project, QWidget* parent); | ||||
58 | ~ProjectConfigPage() override; | ||||
59 | | ||||
60 | QIcon icon() const override; | ||||
61 | QString name() const override; | ||||
62 | | ||||
63 | void apply() override; | ||||
64 | void defaults() override; | ||||
65 | void reset() override; | ||||
66 | | ||||
67 | private: | ||||
68 | void addHookupConfiguration(); | ||||
69 | void deleteHookupConfiguration(); | ||||
70 | void onSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected); | ||||
71 | void onConfigurationsAboutToBeReset(); | ||||
72 | void onConfigurationToBeRemoved(KDevelop::IProjectServiceHookupConfiguration* configuration); | ||||
73 | void onConfigPageContentChanged(); | ||||
74 | | ||||
75 | private: | ||||
76 | QScopedPointer<Ui::ProjectConfigPage> m_ui; | ||||
77 | KDevelop::ProjectServiceHookupConfigPage* m_configurationPage; | ||||
78 | KDevelop::IProject* m_project; | ||||
79 | ProjectServiceHookupListModel m_serviceHookupListModel; | ||||
80 | KDevelop::IProjectServiceHookupConfiguration* m_editedConfiguration; | ||||
81 | }; | ||||
82 | | ||||
83 | } | ||||
84 | | ||||
85 | #endif // KDEVPROJECTSERVICEHOOKUPMANAGER_PROJECTCONFIGPAGE_H |