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 2.2
8import QtQuick.Controls 2.15
9import QtQuick.Layouts 1.1
10import org.kde.kcmutils as KCMUtils
11import SSO.OnlineAccounts 0.1 as OA
12
13ColumnLayout
14{
15 id: root
16
17 property alias videoDesc: description.text
18 property alias videoTitle: title.text
19 property alias videoTags: tags.text
20 property var accountId
21 property var urls
22 property var mimeType
23
24 function accountChanged()
25 {
26 var valid = accountsCombo.enabled && accountsCombo.currentIndex>=0;
27 accountId = valid ? serviceModel.get(accountsCombo.currentIndex, "accountId") : null
28 }
29
30 Label { text: i18nd("purpose6_youtube", "Account:") }
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 { text: i18nd("purpose6_youtube", "Title:") }
53 TextField {
54 id: title
55 Layout.fillWidth: true
56 placeholderText: i18nd("purpose6_youtube", "Enter a title for the video...")
57 }
58
59 Label { text: i18nd("purpose6_youtube", "Tags:") }
60 TextField {
61 id: tags
62 Layout.fillWidth: true
63 placeholderText: i18nd("purpose6_youtube", "KDE, Kamoso")
64 }
65
66 Label { text: i18nd("purpose6_youtube", "Description:") }
67 TextArea {
68 id: description
69 wrapMode: TextEdit.Wrap
70 Layout.fillWidth: true
71 Layout.fillHeight: true
72 }
73}
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 Tue Mar 26 2024 11:14:05 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.