Warning, /multimedia/kasts/src/qml/Settings/StorageSettingsPage.qml is written in an unsupported language. File is not indexed.
0001 /**
0002 * SPDX-FileCopyrightText: 2020 Tobias Fella <tobias.fella@kde.org>
0003 * SPDX-FileCopyrightText: 2021 Bart De Vries <bart@mogwai.be>
0004 *
0005 * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0006 */
0007
0008 import QtQuick
0009 import QtQuick.Controls as Controls
0010 import QtQuick.Layouts
0011
0012 import org.kde.kirigami as Kirigami
0013 import org.kde.kirigamiaddons.formcard as FormCard
0014
0015 import org.kde.kasts
0016 import org.kde.kasts.settings
0017
0018 FormCard.FormCardPage {
0019 id: root
0020
0021 FormCard.FormHeader {
0022 title: i18n("Storage path")
0023 Layout.fillWidth: true
0024 }
0025
0026 FormCard.FormCard {
0027 Layout.fillWidth: true
0028
0029 FormCard.FormTextDelegate {
0030 id: storagePath
0031 visible: Qt.platform.os !== "android" // not functional on android
0032 text: i18n("Storage path")
0033 description: StorageManager.storagePath
0034
0035 trailing: Controls.Button {
0036 Layout.leftMargin: Kirigami.Units.largeSpacing
0037 icon.name: "document-open-folder"
0038 text: i18n("Select folder…")
0039 enabled: !defaultStoragePath.checked
0040 onClicked: storagePathDialog.open()
0041 }
0042
0043
0044 StorageDirDialog {
0045 id: storagePathDialog
0046 title: i18n("Select Storage Path")
0047 }
0048 }
0049
0050 FormCard.FormDelegateSeparator { above: storagePath; below: defaultStoragePath }
0051
0052 FormCard.FormCheckDelegate {
0053 id: defaultStoragePath
0054 visible: Qt.platform.os !== "android" // not functional on android
0055 checked: SettingsManager.storagePath == ""
0056 text: i18n("Use default path")
0057 onToggled: {
0058 if (checked) {
0059 StorageManager.setStoragePath("");
0060 }
0061 }
0062 }
0063 }
0064
0065 FormCard.FormHeader {
0066 Layout.fillWidth: true
0067 title: i18n("Information")
0068 }
0069
0070 FormCard.FormCard {
0071 Layout.fillWidth: true
0072
0073 FormCard.FormTextDelegate {
0074 text: i18n("Podcast downloads")
0075 description: i18nc("Using <amount of bytes> of disk space", "Using %1 of disk space", StorageManager.formattedEnclosureDirSize)
0076 }
0077
0078 FormCard.FormDelegateSeparator {}
0079
0080 FormCard.FormTextDelegate {
0081 text: i18n("Image cache")
0082 description: i18nc("Using <amount of bytes> of disk space", "Using %1 of disk space", StorageManager.formattedImageDirSize)
0083
0084 trailing: Controls.Button {
0085 icon.name: "edit-clear-all"
0086 text: i18n("Clear Cache")
0087 onClicked: StorageManager.clearImageCache();
0088 }
0089 }
0090 }
0091 }