3
* List of files in current directory.
9
* Copyright (C) 2015 Urs Fleisch
11
* This program is free software; you can redistribute it and/or modify
12
* it under the terms of the GNU Lesser General Public License as published by
13
* the Free Software Foundation; version 3.
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU Lesser General Public License for more details.
20
* You should have received a copy of the GNU Lesser General Public License
21
* along with this program. If not, see <http://www.gnu.org/licenses/>.
25
import "../componentsqtquick" //@!Ubuntu
26
//import Ubuntu.Components 1.1 //@Ubuntu
27
//import Ubuntu.Components.Popups 1.0 //@Ubuntu
28
//import Ubuntu.Components.ListItems 1.0 //@Ubuntu
32
function currentFilePath() {
33
return fileModel.getDataValue(fileModel.currentRow,
39
anchors.left: parent.left
40
anchors.top: parent.top
41
spacing: constants.spacing
46
onClicked: confirmedOpenDirectory(
47
script.getIndexRoleData(fileModel.parentModelIndex(),
51
property bool selectAll: true
58
app.deselectAllFiles()
60
selectAll = !selectAll
64
iconName: "go-previous"
66
onClicked: app.previousFile()
71
onClicked: app.nextFile()
78
anchors.left: parent.left
79
anchors.top: fileButtonRow.bottom
80
anchors.bottom: parent.bottom
81
anchors.right: parent.right
82
anchors.margins: constants.margins
85
model: CheckableListModel {
87
sourceModel: app.fileProxyModel
88
selectionModel: app.fileSelectionModel
89
rootIndex: app.fileRootIndex
90
onCurrentRowChanged: {
91
fileList.currentIndex = row
100
ListView.view.currentIndex = index
101
fileModel.currentRow = index
103
confirmedOpenDirectory(filePath)
106
selected: ListView.isCurrentItem
112
anchors.verticalCenter: parent.verticalCenter
114
// QTBUG-7932, assigning is not possible
115
fileModel.setDataValue(index, "checkState",
116
checked ? Qt.Checked : Qt.Unchecked)
120
// workaround for QTBUG-31627
121
// should work with "checked: checkState === Qt.Checked"
124
value: checkState === Qt.Checked
128
anchors.verticalCenter: parent.verticalCenter
129
color: truncated ? constants.errorColor : "transparent"
134
source: "image://kid3/fileicon/" + iconId
139
anchors.verticalCenter: parent.verticalCenter
142
? constants.selectedTextColor : constants.backgroundTextColor