Warning, /multimedia/kasts/src/qml/AddFeedSheet.qml is written in an unsupported language. File is not indexed.

0001 /**
0002  * SPDX-FileCopyrightText: 2020 Tobias Fella <tobias.fella@kde.org>
0003  *
0004  * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005  */
0006 
0007 import QtQuick
0008 import QtQuick.Controls as Controls
0009 import QtQuick.Layouts
0010 
0011 import org.kde.kirigami as Kirigami
0012 
0013 import org.kde.kasts
0014 
0015 Kirigami.Dialog {
0016     id: addSheet
0017     parent: applicationWindow().overlay
0018     showCloseButton: true
0019     standardButtons: Kirigami.Dialog.NoButton
0020 
0021     title: i18n("Add New Podcast")
0022     padding: Kirigami.Units.largeSpacing
0023     preferredWidth: Kirigami.Units.gridUnit * 20
0024 
0025     ColumnLayout {
0026         Controls.Label {
0027             text: i18n("Url:")
0028         }
0029         Controls.TextField {
0030             id: urlField
0031             Layout.fillWidth: true
0032             placeholderText: "https://example.com/podcast-feed.rss"
0033             // focus: addSheet.sheetOpen // disabled for now since it causes problem with virtual keyboard appearing at the same time as the overlay
0034             Keys.onReturnPressed: addFeedAction.triggered();
0035         }
0036 
0037         // This item can be used to trigger the addition of a feed; it will open an
0038         // overlay with options in case the operation is not allowed by the settings
0039         ConnectionCheckAction {
0040             id: addFeed
0041             function action() {
0042                 DataManager.addFeed(urlField.text);
0043             }
0044         }
0045     }
0046 
0047     customFooterActions: Kirigami.Action {
0048         id: addFeedAction
0049         text: i18n("Add Podcast")
0050         enabled: urlField.text
0051         onTriggered: {
0052             addSheet.close();
0053             addFeed.run();
0054         }
0055     }
0056 }