Purpose

youtubeplugin_config.qml
1/*
2 SPDX-FileCopyrightText: 2014 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
3
4 SPDX-License-Identifier: LGPL-2.1-or-later
5*/
6
7import QtQuick
8import QtQuick.Controls
9import QtQuick.Layouts
10import org.kde.kcmutils as KCMUtils
11import SSO.OnlineAccounts as OA
12
13ColumnLayout {
14 id: root
15
16 property alias videoDesc: description.text
17 property alias videoTitle: title.text
18 property alias videoTags: tags.text
19 property var accountId
20 property var urls
21 property var mimeType
22
23 function accountChanged() {
24 var valid = accountsCombo.enabled && accountsCombo.currentIndex >= 0;
25 accountId = valid ? serviceModel.get(accountsCombo.currentIndex, "accountId") : null
26 }
27
28 Label {
29 text: i18nd("purpose6_youtube", "Account:")
30 }
31 RowLayout {
32 Layout.fillWidth: true
33 ComboBox {
34 id: accountsCombo
35
36 Layout.fillWidth: true
37 textRole: "displayName"
38 enabled: count > 0
39 model: OA.AccountServiceModel {
40 id: serviceModel
41 serviceType: "google-youtube"
42 }
43 onCurrentIndexChanged: root.accountChanged()
44 Component.onCompleted: root.accountChanged()
45 }
46 Button {
47 icon.name: "settings-configure"
48 onClicked: KCMUtils.KCMLauncher.openSystemSettings("kcm_kaccounts")
49 }
50 }
51
52 Label {
53 text: i18nd("purpose6_youtube", "Title:")
54 }
55 TextField {
56 id: title
57 Layout.fillWidth: true
58 placeholderText: i18nd("purpose6_youtube", "Enter a title for the video...")
59 }
60
61 Label {
62 text: i18nd("purpose6_youtube", "Tags:")
63 }
64 TextField {
65 id: tags
66 Layout.fillWidth: true
67 placeholderText: i18nd("purpose6_youtube", "KDE, Kamoso")
68 }
69
70 Label {
71 text: i18nd("purpose6_youtube", "Description:")
72 }
73 TextArea {
74 id: description
75 wrapMode: TextEdit.Wrap
76 Layout.fillWidth: true
77 Layout.fillHeight: true
78 }
79}
QString i18nd(const char *domain, const char *text, const TYPE &arg...)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:06 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.