Index: sources/gui/qml/pages/settings/SettingsExportLogs.qml =================================================================== diff -u -r265ce7409a0ea99a4ae059f5ce7978c9cdb10631 -rb77869b5e44de6f8b140f6d8764efc5a2bb61a59 --- sources/gui/qml/pages/settings/SettingsExportLogs.qml (.../SettingsExportLogs.qml) (revision 265ce7409a0ea99a4ae059f5ce7978c9cdb10631) +++ sources/gui/qml/pages/settings/SettingsExportLogs.qml (.../SettingsExportLogs.qml) (revision b77869b5e44de6f8b140f6d8764efc5a2bb61a59) @@ -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" @@ -314,7 +314,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 +335,77 @@ 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 + property bool selected : false + function exportListUpdate() { + selected = ! selected + if ( selected ) + _GuiView.doExportListInsert( index , fileName ) + else + _GuiView.doExportListDelete( index ) + } + + MouseArea { + anchors.fill : parent + onClicked : exportListUpdate() + } + progress.z : 0 + minText.visible : false + maxText.visible : false + marker.visible : false + maximum : fileSize + value : fileSize 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 + // *** IMPORTANT *** + // QML kills the items when they get our of the view port and regarding the cacheBuffer, + // and the next time it getsin the view port to be created, selected is false as its default + // therfore we need to update the current with selected property while the item is alive, + // on recreation the list will help update the item. + color : selected || // to update the current item/index in the view port on the item click + _GuiView.doExportListSelect(index) ? // to update the selected item/index later when gets back in the view port + 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