Warning, /maui/shelf/src/views/SettingsDialog.qml is written in an unsupported language. File is not indexed.
0001 /* 0002 * Copyright 2020 Camilo Higuita <milo.h@aol.com> 0003 * 0004 * This program is free software; you can redistribute it and/or modify 0005 * it under the terms of the GNU Library General Public License as 0006 * published by the Free Software Foundation; either version 2, or 0007 * (at your option) any later version. 0008 * 0009 * This program is distributed in the hope that it will be useful, 0010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0012 * GNU General Public License for more details 0013 * 0014 * You should have received a copy of the GNU Library General Public 0015 * License along with this program; if not, write to the 0016 * Free Software Foundation, Inc., 0017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 0018 */ 0019 0020 import QtQuick 2.14 0021 import QtQuick.Controls 2.14 0022 import QtQuick.Layouts 1.3 0023 import org.maui.shelf 1.0 0024 import org.mauikit.controls 1.3 as Maui 0025 0026 Maui.SettingsDialog 0027 { 0028 id: control 0029 0030 Maui.InfoDialog 0031 { 0032 id: confirmationDialog 0033 property string url : "" 0034 0035 title : "Remove source" 0036 message : "Are you sure you want to remove the source: \n "+url 0037 template.iconSource: "emblem-warning" 0038 0039 standardButtons: Dialog.Ok | Dialog.Cancel 0040 0041 onAccepted: 0042 { 0043 if(url.length>0) 0044 Library.removeSource(url) 0045 confirmationDialog.close() 0046 } 0047 0048 onRejected: confirmationDialog.close() 0049 } 0050 0051 Maui.SectionGroup 0052 { 0053 title: i18n("General") 0054 // description: i18n("Configure the app plugins and behavior.") 0055 0056 // Maui.SectionItem 0057 // { 0058 // label1.text: i18n("Thumbnails") 0059 // label2.text: i18n("Show thumbnail previews") 0060 0061 // Switch 0062 // { 0063 // checkable: true 0064 // checked: viewerSettings.fetchArtwork 0065 // onToggled: viewerSettings.fetchArtwork = !viewerSettings.fetchArtwork 0066 // } 0067 // } 0068 0069 Maui.SectionItem 0070 { 0071 label1.text: i18n("Auto Scan") 0072 label2.text: i18n("Scan all the document sources on startup to keep your collection up to date.") 0073 0074 Switch 0075 { 0076 checkable: true 0077 checked: viewerSettings.autoScan 0078 onToggled: viewerSettings.autoScan = !viewerSettings.autoScan 0079 } 0080 } 0081 0082 0083 Maui.SectionItem 0084 { 0085 label1.text: i18n("Previews") 0086 label2.text: i18n("Display thumbnail previews.") 0087 0088 Switch 0089 { 0090 checkable: true 0091 checked: viewerSettings.showThumbnails 0092 onToggled: viewerSettings.showThumbnails = !viewerSettings.showThumbnails 0093 } 0094 } 0095 0096 Maui.SectionItem 0097 { 0098 visible: Maui.Handy.isAndroid 0099 0100 label1.text: i18n("Dark Mode") 0101 label2.text: i18n("Switch between light and dark colorscheme.") 0102 0103 Switch 0104 { 0105 Layout.fillHeight: true 0106 checked: viewerSettings.darkMode 0107 onToggled: 0108 { 0109 viewerSettings.darkMode = !viewerSettings.darkMode 0110 setAndroidStatusBarColor() 0111 } 0112 } 0113 } 0114 } 0115 0116 Maui.SectionGroup 0117 { 0118 title: i18n("Sources") 0119 // description: i18n("Add or remove sources") 0120 0121 ColumnLayout 0122 { 0123 Layout.fillWidth: true 0124 spacing: Maui.Style.space.medium 0125 0126 Repeater 0127 { 0128 0129 id: _sourcesList 0130 0131 model: Library.sources 0132 0133 delegate: Maui.ListDelegate 0134 { 0135 Layout.fillWidth: true 0136 template.iconSource: modelData.icon 0137 template.iconSizeHint: Maui.Style.iconSizes.small 0138 template.label1.text: modelData.label 0139 template.label2.text: modelData.path 0140 0141 template.content: ToolButton 0142 { 0143 icon.name: "edit-clear" 0144 flat: true 0145 onClicked: 0146 { 0147 confirmationDialog.url = modelData.path 0148 confirmationDialog.open() 0149 } 0150 } 0151 } 0152 } 0153 0154 Button 0155 { 0156 Layout.fillWidth: true 0157 text: i18n("Add") 0158 // flat: true 0159 onClicked: 0160 { 0161 _dialogLoader.sourceComponent = _fileDialog 0162 _dialogLoader.item.settings.onlyDirs = true 0163 _dialogLoader.item.callback = function(urls) 0164 { 0165 Library.addSources(urls) 0166 } 0167 _dialogLoader.item.open() 0168 } 0169 } 0170 0171 Button 0172 { 0173 Layout.fillWidth: true 0174 text: i18n("Scan now") 0175 onClicked: Library.rescan() 0176 0177 } 0178 } 0179 } 0180 0181 }