Index: sources/gui/qml/pages/settings/SettingsExportLogs.qml =================================================================== diff -u -r265ce7409a0ea99a4ae059f5ce7978c9cdb10631 -r7823da721f8041d6d39c37cd040e162ea9d35e7f --- sources/gui/qml/pages/settings/SettingsExportLogs.qml (.../SettingsExportLogs.qml) (revision 265ce7409a0ea99a4ae059f5ce7978c9cdb10631) +++ sources/gui/qml/pages/settings/SettingsExportLogs.qml (.../SettingsExportLogs.qml) (revision 7823da721f8041d6d39c37cd040e162ea9d35e7f) @@ -60,7 +60,7 @@ readonly property string typeLabelService : qsTr("Service" ) readonly property string typeLabelTreatment : qsTr("Treatment" ) - property bool isDevice : true + property bool isDevice : true //false // readonly property string typePathClr : "" readonly property string typePathSrc : isDevice ? "file:///media/sd-card" : "file:///home/denali/Desktop/sd-card" readonly property string typePathDst : isDevice ? "file:///media/usb" : "file:///home/denali/Desktop/usb-disk" @@ -109,6 +109,7 @@ function updatePanels (vIndex) { isUpdatePanels = true + _GuiView.doExportListRemove() _sdcFolderColumn.clearModel() _usbFolderColumn.clearModel() @@ -137,6 +138,9 @@ onSdIsReadyChanged: { _root.updatePanels() } + onDidExportStat: { + _sdcFolderView.positionViewAtIndex(vIndex, ListView.Center) + } } USBButton { id: _usbEjectButton @@ -314,7 +318,7 @@ height : parent.height anchors.verticalCenter : parent.verticalCenter Label { id : _sdcLabel - text : _root.sdcLabel + ": %1 files"/*, %2 %3"*/.arg(_sdcFolderModel.count)//.arg("__").arg(_root.dvcUnit) + text : _root.sdcLabel + ": %1 files"/*, %2 %3"*/.arg(_sdcFolderModel.count) + (_GuiView.exportCount ? " [Selected: %1]".arg(_GuiView.exportCount ) : "") //.arg("__").arg(_root.dvcUnit) width : parent.width height : _root.headetRowHight verticalAlignment : Text.AlignVCenter @@ -335,40 +339,81 @@ ListView { id : _sdcFolderView clip : true anchors.fill : parent - anchors.margins : 10 - spacing : 5 + anchors.leftMargin : 5 + anchors.rightMargin : 5 + spacing : 3 FolderListModel { id : _sdcFolderModel showDirs : false sortField : FolderListModel.Time folder : _sdcFolderColumn.currentTypeFolderApplication // FIXME: there has to be a View for this which also get changed by log type. } + Component { id : _sdcFileDelegate - Row { id : _sdcFileRow + ProgressBar { id : _sdcItemBackground + // *** IMPORTANT *** + // QML kills the items when they get out of the view port in regards to the cacheBuffer, + // and the next time it gets in the view port will be created with all the properties in their defaults. + property bool inExportList : _GuiView.exportList [ index ] // I couldn't make it work and this always returns undefined, but has to be used to trigger the change. + ? _GuiView.exportList [ index ] // In case the issue fixes it should return true if it is true, obviously! + : _GuiView.doExportListSelect ( index ) // otherwise for now, it calls the contains() function of the list in C++ backend. + property int exportPercent : _GuiView.exportIndex === index + ? _GuiView.exportPercent + : 0 + onExportPercentChanged : console.log( "%", exportPercent) + //DEBUG: onInExportListChanged: console.debug(" * ", index, inExportList) + function exportListUpdate() { + if (_GuiView.doExportListSelect( index ) ) { + _GuiView.doExportListDelete( index ) + } + else { + _GuiView.doExportListInsert( index , fileName ) + } + } + + MouseArea { + anchors.fill : parent + onClicked : exportListUpdate() + } + progress.z : 0 + minText.visible : false + maxText.visible : false + marker.visible : false + maximum : 100 // percent + value : maximum - exportPercent width : parent.width height : 40 - Text { id : _sdcFileNameText - clip : true - width : _contentRect.columnWidthFileName - text : fileName - color : Colors.textMain - font.pixelSize : Fonts.fontPixelTextRectExtra - verticalAlignment : Text.AlignVCenter - horizontalAlignment : Text.AlignLeft + bgColor : Colors.transparent + color : inExportList ? Colors.borderButtonSelected : Colors.transparent + radius : 5 + Row { id : _sdcFileRow + width : parent.width + height : 40 + leftPadding : 5 + Text { id : _sdcFileNameText + x : 2 + clip : true + width : _contentRect.columnWidthFileName - 2 + text : fileName + color : Colors.textMain + font.pixelSize : Fonts.fontPixelTextRectExtra + verticalAlignment : Text.AlignVCenter + horizontalAlignment : Text.AlignLeft + } + Rectangle { id : _sdcColumnVerticalLine + color : Colors.borderButtonUnselected + width : 1 + height : parent.height + _usbFolderColumn.spacing + } + Text { id : _sdcFileSizeText + clip : true + width : _contentRect.columnWidthFileSize + text : Variables.sizeConverted( fileSize, 1000, 3) + color : Colors.textMain + font.pixelSize : Fonts.fontPixelTextRectExtra + verticalAlignment : Text.AlignVCenter + horizontalAlignment : Text.AlignRight + } } - Rectangle { - color: Colors.borderButtonUnselected - width : 1 - height : parent.height + _usbFolderColumn.spacing - } - Text { id : _sdcFileSizeText - clip : true - width : _contentRect.columnWidthFileSize - text : Variables.sizeConverted( fileSize, 1000, 3) - color : Colors.textMain - font.pixelSize : Fonts.fontPixelTextRectExtra - verticalAlignment : Text.AlignVCenter - horizontalAlignment : Text.AlignRight - } } } model : _sdcFolderModel