/usr/share/webcamoid/qml/PluginConfig.qml is in webcamoid-data 8.1.0+dfsg-7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 | /* Webcamoid, webcam capture application.
* Copyright (C) 2011-2017 Gonzalo Exequiel Pedone
*
* Webcamoid is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Webcamoid is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Webcamoid. If not, see <http://www.gnu.org/licenses/>.
*
* Web-Site: http://webcamoid.github.io/
*/
import QtQuick 2.5
import QtQuick.Dialogs 1.2
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.1
import AkQml 1.0
ColumnLayout {
width: 400
height: 450
function fillSearchPaths()
{
searchPathsTable.model.clear()
var searchPaths = globalElement.searchPaths()
for (var path in searchPaths) {
searchPathsTable.model.append({
path: searchPaths[path]
})
}
}
function fillPluginList()
{
pluginsTable.model.clear()
var pluginsPaths = globalElement.listPluginPaths()
for (var path in pluginsPaths) {
pluginsTable.model.append({
path: pluginsPaths[path],
enabled: true
})
}
var blackList = globalElement.pluginsBlackList()
for (var path in blackList) {
pluginsTable.model.append({
path: blackList[path],
enabled: false
})
}
}
function refreshCache()
{
globalElement.clearCache()
fillPluginList()
PluginConfigs.saveProperties()
}
function refreshAll()
{
fillSearchPaths()
refreshCache()
}
AkElement {
id: globalElement
}
SystemPalette {
id: systemPalette
colorGroup: SystemPalette.Disabled
}
Component.onCompleted: {
fillSearchPaths()
fillPluginList()
}
Label {
text: qsTr("Use this page for configuring the plugins search paths.<br /><b>Don't touch nothing unless you know what you are doing</b>.")
wrapMode: Text.WordWrap
Layout.fillWidth: true
}
GroupBox {
title: qsTr("Extra search paths")
Layout.fillWidth: true
GridLayout {
columns: 3
anchors.fill: parent
CheckBox {
text: qsTr("Search plugins in subfolders.")
checked: globalElement.recursiveSearch()
Layout.fillWidth: true
onCheckedChanged: {
globalElement.setRecursiveSearch(checked)
refreshCache()
}
}
Button {
text: qsTr("Add")
iconName: "add"
iconSource: "image://icons/add"
onClicked: fileDialog.open()
}
Button {
id: btnRemove
text: qsTr("Remove")
iconName: "remove"
iconSource: "image://icons/remove"
enabled: searchPathsTable.currentRow >= 0
onClicked: {
var removeIndex = []
searchPathsTable.selection.forEach(function (rowIndex) {
removeIndex.push(rowIndex)
})
var searchPaths = globalElement.searchPaths();
var sp = []
for (var path in searchPaths)
if (removeIndex.indexOf(parseInt(path)) < 0)
sp.push(searchPaths[path])
globalElement.setSearchPaths(sp);
refreshAll()
searchPathsTable.selection.clear()
searchPathsTable.currentRow = -1
}
}
TableView {
id: searchPathsTable
headerVisible: false
selectionMode: SelectionMode.SingleSelection
Layout.columnSpan: 3
Layout.fillWidth: true
model: ListModel {
id: searchPathsModel
}
TableViewColumn {
role: "path"
title: qsTr("Search path")
elideMode: Text.ElideLeft
}
}
}
}
GroupBox {
title: qsTr("Plugins list")
Layout.fillWidth: true
GridLayout {
columns: 3
anchors.fill: parent
Button {
text: qsTr("Refresh")
iconName: "reset"
iconSource: "image://icons/reset"
onClicked: refreshCache()
}
Label {
Layout.fillWidth: true
}
Button {
id: btnEnableDisable
text: pluginIsEnabled? qsTr("Disable"): qsTr("Enable")
enabled: pluginsTable.currentRow >= 0
property bool pluginIsEnabled: false
onClicked: {
var blackList = globalElement.pluginsBlackList()
if (pluginIsEnabled) {
pluginsTable.selection.forEach(function (rowIndex) {
var path = pluginsTable.model.get(rowIndex).path
if (blackList.indexOf(path) < 0)
blackList.push(path)
})
} else {
pluginsTable.selection.forEach(function (rowIndex) {
var path = pluginsTable.model.get(rowIndex).path
var index = blackList.indexOf(path)
if (index >= 0)
blackList.splice(index, 1)
})
}
globalElement.setPluginsBlackList(blackList)
refreshCache()
pluginsTable.selection.clear()
pluginsTable.currentRow = -1
}
}
TableView {
id: pluginsTable
headerVisible: false
selectionMode: SelectionMode.SingleSelection
Layout.columnSpan: 3
Layout.fillWidth: true
model: ListModel {
id: pluginsModel
}
itemDelegate: Item {
height: Math.max(16, label.implicitHeight)
property int implicitWidth: label.implicitWidth + 20
Label {
id: label
enabled: false
objectName: "label"
width: parent.width
anchors.leftMargin: 12
anchors.left: parent.left
anchors.right: parent.right
horizontalAlignment: styleData.textAlignment
anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: 1
elide: styleData.elideMode
text: styleData.value !== undefined? styleData.value: ""
color: styleData.row >= 0 && pluginsTable.model.get(styleData.row).enabled?
styleData.textColor: systemPalette.text
renderType: Text.NativeRendering
}
}
onCurrentRowChanged: {
btnEnableDisable.pluginIsEnabled =
currentRow < 0? false: pluginsTable.model.get(currentRow).enabled
}
TableViewColumn {
role: "path"
title: qsTr("Plugin path")
elideMode: Text.ElideLeft
}
}
}
}
Label {
Layout.fillHeight: true
}
FileDialog {
id: fileDialog
title: qsTr("Add plugins search path")
selectFolder: true
onAccepted: {
var path = Webcamoid.urlToLocalFile(folder)
globalElement.addSearchPath(path)
refreshAll()
}
}
}
|