Index: denali.pro.user =================================================================== diff -u -r3a2114c103d6eaf2807d2f515eeb9e0fbdeabc69 -rb77869b5e44de6f8b140f6d8764efc5a2bb61a59 --- denali.pro.user (.../denali.pro.user) (revision 3a2114c103d6eaf2807d2f515eeb9e0fbdeabc69) +++ denali.pro.user (.../denali.pro.user) (revision b77869b5e44de6f8b140f6d8764efc5a2bb61a59) @@ -1,6 +1,6 @@ - + EnvironmentId Index: sources/gui/GuiView.h =================================================================== diff -u -r265ce7409a0ea99a4ae059f5ce7978c9cdb10631 -rb77869b5e44de6f8b140f6d8764efc5a2bb61a59 --- sources/gui/GuiView.h (.../GuiView.h) (revision 265ce7409a0ea99a4ae059f5ce7978c9cdb10631) +++ sources/gui/GuiView.h (.../GuiView.h) (revision b77869b5e44de6f8b140f6d8764efc5a2bb61a59) @@ -69,7 +69,10 @@ PROPERTY(bool , usbIsLow , false ) PROPERTY(bool , exportRunning , false ) + PROPERTY(quint32, exportCount , 0 ) + QMap _exportList; + public: explicit GuiView(QObject *parent = nullptr); @@ -99,6 +102,11 @@ void doExportService (); void doExportTreatment (); + void doExportListInsert (quint32 vIndex, const QString &vFilename ) { /* DEBUG: qDebug() << vIndex; */ _exportList [vIndex] = vFilename; exportCount( _exportList.count() ); } + void doExportListDelete (quint32 vIndex ) { /* DEBUG: qDebug() << vIndex; */ _exportList.remove (vIndex) ; exportCount( _exportList.count() ); } + bool doExportListSelect (quint32 vIndex ) { /* DEBUG: qDebug() << vIndex; */ return _exportList.contains(vIndex) ; } + + signals: void didActionReceive (GuiActionType vAction, const QVariantList &vData); // UI <= HD/DG void didActionTransmit(GuiActionType vAction, const QVariantList &vData); // UI => HD/DG @@ -111,6 +119,6 @@ void didExportLog (); void didExportService (); void didExportTreatment (); - void didExport (); + void didExport (); }; } Index: sources/gui/qml/components/ProgressBar.qml =================================================================== diff -u -r27cc308ff5113a9386899d3c8f8b29962a8498e1 -rb77869b5e44de6f8b140f6d8764efc5a2bb61a59 --- sources/gui/qml/components/ProgressBar.qml (.../ProgressBar.qml) (revision 27cc308ff5113a9386899d3c8f8b29962a8498e1) +++ sources/gui/qml/components/ProgressBar.qml (.../ProgressBar.qml) (revision b77869b5e44de6f8b140f6d8764efc5a2bb61a59) @@ -25,6 +25,7 @@ */ RangeRect { id: _root + property alias progress : _progressRect property int progressWidth : _progressRect.width property alias value : _progressRect.value 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 Index: sources/model/hd/alarm/MAlarmMapping.cpp =================================================================== diff -u -r3a2114c103d6eaf2807d2f515eeb9e0fbdeabc69 -rb77869b5e44de6f8b140f6d8764efc5a2bb61a59 --- sources/model/hd/alarm/MAlarmMapping.cpp (.../MAlarmMapping.cpp) (revision 3a2114c103d6eaf2807d2f515eeb9e0fbdeabc69) +++ sources/model/hd/alarm/MAlarmMapping.cpp (.../MAlarmMapping.cpp) (revision b77869b5e44de6f8b140f6d8764efc5a2bb61a59) @@ -7,7 +7,7 @@ * * \file MAlarmMapping.cpp * \author (last) Behrouz NematiPour - * \date (last) 06-Oct-2022 + * \date (last) 11-Oct-2022 * \author (original) Behrouz NematiPour * \date (original) 03-May-2021 *