Purpose

reviewboardplugin_config.qml
1/*
2 SPDX-FileCopyrightText: 2015 Aleix Pol Gonzalez <aleixpol@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.1-or-later
5*/
6
7import QtQuick
8import QtQuick.Controls
9import QtQuick.Layouts
10import org.kde.purpose.reviewboard
11
12ColumnLayout {
13 id: root
14
15 property alias server: serverField.text
16 property alias username: usernameField.text
17 property alias password: passwordField.text
18 property alias repository: repositoriesCombo.currentText
19 property string updateRR: ""
20 property string baseDir
21 property string localBaseDir
22 property var extraData: rcfile.extraData
23
24 Label {
25 text: root.updateRR
26 }
27
28 ReviewboardRC {
29 id: rcfile
30 path: root.localBaseDir + "/.reviewboardrc"
31 }
32
33 Label {
34 text: i18nd("purpose6_reviewboard", "Server:")
35 }
36 TextField {
37 id: serverField
38 Layout.fillWidth: true
39 text: rcfile.server
40 }
41 Label {
42 text: i18nd("purpose6_reviewboard", "Username:")
43 }
44 TextField {
45 id: usernameField
46 Layout.fillWidth: true
47 }
48 Label {
49 text: i18nd("purpose6_reviewboard", "Password:")
50 }
51 TextField {
52 id: passwordField
53 echoMode: TextInput.Password
54 Layout.fillWidth: true
55 }
56
57 Label {
58 text: i18nd("purpose6_reviewboard", "Repository:")
59 }
60 ComboBox {
61 id: repositoriesCombo
62 Layout.fillWidth: true
63 textRole: "display"
64 model: RepositoriesModel {
65 server: serverField.text
66 onRepositoriesChanged: {
67 repositoriesCombo.currentIndex = findRepository(rcfile.repository);
68 }
69 }
70 }
71
72 function refreshUpdateRR() {
73 root.updateRR = (updateRRCombo.currentIndex >= 0 && update.checked) ? reviewsList.get(updateRRCombo.currentIndex, "toolTip") : ""
74 }
75
76 Item {
77 Layout.fillWidth: true
78 height: update.height
79
80 CheckBox {
81 anchors.centerIn: parent
82 id: update
83 text: i18nd("purpose6_reviewboard", "Update Review:")
84 enabled: updateRRCombo.count > 0
85 onCheckedChanged: {
86 root.refreshUpdateRR();
87 }
88 }
89 }
90 ComboBox {
91 id: updateRRCombo
92 Layout.fillWidth: true
93 enabled: update.checked
94 textRole: "display"
95 model: ReviewsListModel {
96 id: reviewsList
97 server: root.server
98 repository: root.repository
99 username: root.username
100 status: "pending"
101 }
102 onCurrentIndexChanged: {
103 root.refreshUpdateRR();
104 }
105 }
106
107 Item {
108 Layout.fillHeight: true
109 Layout.fillWidth: true
110 }
111}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:03:06 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.