Changeset View
Changeset View
Standalone View
Standalone View
src/creator/qml/metainfoeditors/AuthorEntryEditor.qml
Context not available. | |||||
51 | middleNameField.text = root.author.middleName(); | 51 | middleNameField.text = root.author.middleName(); | ||
---|---|---|---|---|---|
52 | lastNameField.text = root.author.lastName(); | 52 | lastNameField.text = root.author.lastName(); | ||
53 | nickNameField.text = root.author.nickName(); | 53 | nickNameField.text = root.author.nickName(); | ||
54 | if (root.author.homePages.count > 0) { | 54 | | ||
55 | homePageField.text = root.author.homePages()[0]; | | |||
56 | } | | |||
57 | if (root.author.emails.count > 0) { | | |||
58 | emailField.text = root.author.emails()[0]; | | |||
59 | } | | |||
60 | } | 55 | } | ||
61 | property QtObject author: null; | 56 | property QtObject author: null; | ||
62 | 57 | | |||
Context not available. | |||||
66 | property alias middleName: middleNameField.text; | 61 | property alias middleName: middleNameField.text; | ||
67 | property alias lastName: lastNameField.text; | 62 | property alias lastName: lastNameField.text; | ||
68 | property alias nickName: nickNameField.text; | 63 | property alias nickName: nickNameField.text; | ||
69 | property alias homePage: homePageField.text; | 64 | property var homePage: root.author.homePages; | ||
70 | property alias email: emailField.text; | 65 | property var email: root.author.emails; | ||
71 | 66 | | |||
72 | Column { | 67 | Column { | ||
73 | height: childrenRect.height; | 68 | height: childrenRect.height; | ||
Context not available. | |||||
87 | } | 82 | } | ||
88 | height: parent.height; | 83 | height: parent.height; | ||
89 | width: height; | 84 | width: height; | ||
85 | Keys.onReturnPressed: { | ||||
86 | root.save(); | ||||
87 | root.close(); | ||||
88 | } | ||||
90 | onClicked: { | 89 | onClicked: { | ||
91 | root.save(); | 90 | root.save(); | ||
92 | root.close(); | 91 | root.close(); | ||
Context not available. | |||||
111 | wrapMode: Text.WrapAtWordBoundaryOrAnywhere; | 110 | wrapMode: Text.WrapAtWordBoundaryOrAnywhere; | ||
112 | } | 111 | } | ||
113 | QtControls.ComboBox { | 112 | QtControls.ComboBox { | ||
113 | //enabled: activity; | ||||
114 | id: activityField; | 114 | id: activityField; | ||
115 | width: parent.width - Kirigami.Units.smallSpacing; | 115 | width: parent.width - Kirigami.Units.smallSpacing; | ||
116 | } | 116 | } | ||
Context not available. | |||||
184 | QtControls.Label { | 184 | QtControls.Label { | ||
185 | width: parent.width; | 185 | width: parent.width; | ||
186 | height: paintedHeight; | 186 | height: paintedHeight; | ||
187 | text: i18nc("label for the homepage field", "Homepage address:"); | 187 | text: i18nc("label for the homepage field", "Homepage addresses:"); | ||
188 | wrapMode: Text.WrapAtWordBoundaryOrAnywhere; | 188 | wrapMode: Text.WrapAtWordBoundaryOrAnywhere; | ||
189 | } | 189 | } | ||
190 | Repeater { | ||||
191 | model: root.author.homePages; | ||||
192 | QtControls.TextField { | ||||
193 | width: parent.width - removeHomePageButton.width - Kirigami.Units.smallSpacing; | ||||
194 | text: modelData; | ||||
195 | onEditingFinished: root.author.homePages[index] = text; | ||||
196 | | ||||
197 | QtControls.Button { | ||||
198 | id: removeHomePageButton; | ||||
199 | anchors { | ||||
200 | left: parent.right; | ||||
201 | leftMargin: Kirigami.Units.smallSpacing; | ||||
202 | } | ||||
203 | contentItem: Kirigami.Icon { | ||||
204 | source: "list-remove"; | ||||
205 | } | ||||
206 | height: parent.height; | ||||
207 | width: height; | ||||
208 | onClicked: root.author.removeHomePage(index); | ||||
209 | } | ||||
210 | } | ||||
211 | | ||||
212 | } | ||||
190 | QtControls.TextField { | 213 | QtControls.TextField { | ||
191 | id: homePageField; | 214 | id: homePageField; | ||
192 | width: parent.width - Kirigami.Units.smallSpacing; | 215 | width: parent.width - addHomepageButton.width - Kirigami.Units.smallSpacing; | ||
193 | placeholderText: i18nc("placeholder text for the homepage field", "Homepage"); | 216 | placeholderText: i18nc("placeholder text for the homepage field", "Add Homepage"); | ||
217 | Keys.onReturnPressed: addEntry(); | ||||
218 | function addEntry() { | ||||
219 | if (text!=="") { | ||||
220 | root.author.addHomePage(text); | ||||
221 | text=""; | ||||
222 | } | ||||
223 | } | ||||
224 | | ||||
225 | QtControls.Button { | ||||
226 | id: addHomepageButton; | ||||
227 | anchors { | ||||
228 | left: parent.right; | ||||
229 | leftMargin: Kirigami.Units.smallSpacing; | ||||
230 | } | ||||
231 | contentItem: Kirigami.Icon { | ||||
232 | source: "list-add"; | ||||
233 | } | ||||
234 | height: parent.height; | ||||
235 | width: height; | ||||
236 | onClicked: parent.addEntry(); | ||||
237 | } | ||||
194 | } | 238 | } | ||
195 | Item { width: parent.width; height: Kirigami.Units.smallSpacing; } | 239 | Item { width: parent.width; height: Kirigami.Units.smallSpacing; } | ||
196 | | ||||
197 | QtControls.Label { | 240 | QtControls.Label { | ||
198 | width: parent.width; | 241 | width: parent.width; | ||
199 | height: paintedHeight; | 242 | height: paintedHeight; | ||
200 | text: i18nc("label for the email field", "Email address:"); | 243 | text: i18nc("label for the email field", "Email addresses:"); | ||
201 | wrapMode: Text.WrapAtWordBoundaryOrAnywhere; | 244 | wrapMode: Text.WrapAtWordBoundaryOrAnywhere; | ||
202 | } | 245 | } | ||
246 | Repeater { | ||||
247 | model: root.author.emails; | ||||
248 | QtControls.TextField { | ||||
249 | width: parent.width - addEmailButton.width - Kirigami.Units.smallSpacing; | ||||
250 | text: modelData; | ||||
251 | onEditingFinished: root.author.emails[index] = text; | ||||
252 | | ||||
253 | QtControls.Button { | ||||
254 | id: removeEmailButton; | ||||
255 | anchors { | ||||
256 | left: parent.right; | ||||
257 | leftMargin: Kirigami.Units.smallSpacing; | ||||
258 | } | ||||
259 | contentItem: Kirigami.Icon { | ||||
260 | source: "list-remove"; | ||||
261 | } | ||||
262 | height: parent.height; | ||||
263 | width: height; | ||||
264 | onClicked: root.author.removeEmail(index); | ||||
265 | } | ||||
266 | } | ||||
267 | | ||||
268 | } | ||||
203 | QtControls.TextField { | 269 | QtControls.TextField { | ||
204 | id: emailField; | 270 | id: emailField; | ||
205 | width: parent.width - Kirigami.Units.smallSpacing; | 271 | width: parent.width - addEmailButton.width - Kirigami.Units.smallSpacing; | ||
206 | placeholderText: i18nc("placeholder text for the email field", "Email address"); | 272 | placeholderText: i18nc("placeholder text for the email field", "Add Email address"); | ||
273 | Keys.onReturnPressed: addEntry(); | ||||
274 | function addEntry() { | ||||
275 | if (text!=="") { | ||||
276 | root.author.addEmail(text); | ||||
277 | text = ""; | ||||
278 | } | ||||
279 | } | ||||
280 | | ||||
281 | QtControls.Button { | ||||
282 | id: addEmailButton; | ||||
283 | anchors { | ||||
284 | left: parent.right; | ||||
285 | leftMargin: Kirigami.Units.smallSpacing; | ||||
286 | } | ||||
287 | contentItem: Kirigami.Icon { | ||||
288 | source: "list-add"; | ||||
289 | } | ||||
290 | height: parent.height; | ||||
291 | width: height; | ||||
292 | onClicked: parent.addEntry(); | ||||
293 | } | ||||
207 | } | 294 | } | ||
208 | Item { width: parent.width; height: Kirigami.Units.smallSpacing; } | 295 | Item { width: parent.width; height: Kirigami.Units.smallSpacing; } | ||
209 | } | 296 | } | ||
Context not available. |