Changeset View
Changeset View
Standalone View
Standalone View
plugins/gitlab/gitlabhookupconfigpage.cpp
- 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 | #include "gitlabhookupconfigpage.h" | ||||
21 | #include "ui_gitlabhookupconfigpage.h" | ||||
22 | | ||||
23 | #include "gitlabhookupconfiguration.h" | ||||
24 | | ||||
25 | using namespace KDevelop; | ||||
26 | | ||||
27 | GitLabHookupConfigPage::GitLabHookupConfigPage(QWidget* parent) | ||||
28 | : ProjectServiceHookupConfigPage(parent) | ||||
29 | , m_ui(new Ui::GitLabHookupConfigPage) | ||||
30 | { | ||||
31 | m_ui->setupUi(this); | ||||
32 | connect(m_ui->baseUrlEdit, &QLineEdit::textEdited, this, &GitLabHookupConfigPage::changed); | ||||
33 | } | ||||
34 | | ||||
35 | GitLabHookupConfigPage::~GitLabHookupConfigPage() = default; | ||||
36 | | ||||
37 | | ||||
38 | void GitLabHookupConfigPage::loadFromConfiguration(const IProjectServiceHookupConfiguration* configuration) | ||||
39 | { | ||||
40 | const GitLabHookupConfiguration* gitlabHookupConfiguration = dynamic_cast<const GitLabHookupConfiguration*>(configuration); | ||||
41 | m_ui->baseUrlEdit->setText(gitlabHookupConfiguration->baseUrl().toString()); | ||||
42 | } | ||||
43 | | ||||
44 | void GitLabHookupConfigPage::saveToConfiguration(IProjectServiceHookupConfiguration* configuration) const | ||||
45 | { | ||||
46 | GitLabHookupConfiguration* gitlabHookupConfiguration = dynamic_cast<GitLabHookupConfiguration*>(configuration); | ||||
47 | gitlabHookupConfiguration->setBaseUrl(QUrl::fromUserInput(m_ui->baseUrlEdit->text())); | ||||
48 | } |