Index: sources/gui/qml/pages/settings/SettingsExportLogs.qml =================================================================== diff -u -r80476e323935705a3b8b547dd8536d3a90a49e3e -r32dc194cb261763cd4e9d5409921d4c8523fc84d --- sources/gui/qml/pages/settings/SettingsExportLogs.qml (.../SettingsExportLogs.qml) (revision 80476e323935705a3b8b547dd8536d3a90a49e3e) +++ sources/gui/qml/pages/settings/SettingsExportLogs.qml (.../SettingsExportLogs.qml) (revision 32dc194cb261763cd4e9d5409921d4c8523fc84d) @@ -134,6 +134,39 @@ isUpdatePanels = false } + // updateDisplayedList() is added to manually combine the contents of the FileListModel + // for the log folder and the sub-folder, pending, to a third ListModel that is used as + // the model of the ListView. + // NOTE: this function will no longer be needed if a CPP model is added to replace the three + // list models providing for the ListView of SD-Card files. + function updateDisplayedList(){ + let mainFolderReady = _sdcFolderModel.status == FolderListModel.Ready + let pendingFolderReady = _sdcFolderModelPending.status == FolderListModel.Ready + let isPendingFolderEmpty = _sdcFolderModelPending.count == 0 + + _displayedFolderList.clear(); // clear list of the last set of files + + if(!mainFolderReady) return; // if list is not ready, skip handling + + var index = 0; + // append the non-pending subfolder log files + for (index = 0; _sdcFolderModel.count > index; index++) { + _displayedFolderList.append({"fileName" : _sdcFolderModel.get(index, "fileName"), + "fileSize" : _sdcFolderModel.get(index, "fileSize"), + "isFromPendingFolder" :false + }) + + } + + // append the pending subfolder log files + for (index = 0; _sdcFolderModelPending.count > index; index++) { + _displayedFolderList.append({"fileName" : _sdcFolderModelPending.get(index, "fileName"), + "fileSize" : _sdcFolderModelPending.get(index, "fileSize"), + "isFromPendingFolder" : true + }) + } + } + Connections { target: _GuiView function onSdIsReadyChanged ( vValue ) { _root.updatePanels() } function onDidExportStat ( vIndex, vFileName, vPercent ) { _sdcFolderView.positionViewAtIndex(vIndex, ListView.Center) } @@ -308,18 +341,24 @@ function updateModel() { _sdcFolderModel.folder = currentTypeFolderApplication // FIXME: there has to be a View for this which also get changed by log type. _sdcFolderModel.nameFilters = _root.typeFilterAll + + _sdcFolderModelPending.folder = currentTypeFolderApplication + "/pending/" // FIXME: This needs to be handled as part of a single model (_sdcFolderModel) + _sdcFolderModelPending.nameFilters = _root.typeFilterAll } function clearModel() { _sdcFolderModel.folder = _root.typePathClr _sdcFolderModel.nameFilters = _root.typeFilterClr + + _sdcFolderModelPending.folder = _root.typePathClr + _sdcFolderModelPending.nameFilters = _root.typeFilterClr } spacing : 5 width : _contentRect.columnWidthFolder height : parent.height anchors.verticalCenter : parent.verticalCenter Label { id : _sdcLabel - text : _root.sdcLabel + ": %1 files"/*, %2 %3"*/.arg(_sdcFolderModel.count) + (_GuiView.exportCount ? " [Selected: %1]".arg(_GuiView.exportCount ) : "") //.arg("__").arg(_root.dvcUnit) + text : _root.sdcLabel + ": %1 files"/*, %2 %3"*/.arg(_sdcFolderModel.count + _sdcFolderModelPending.count) + (_GuiView.exportCount ? " [Selected: %1]".arg(_GuiView.exportCount ) : "") //.arg("__").arg(_root.dvcUnit) width : parent.width height : _root.headetRowHight verticalAlignment : Text.AlignVCenter @@ -346,11 +385,24 @@ anchors.leftMargin : 5 anchors.rightMargin : 5 spacing : 3 + + ListModel { id: _displayedFolderList + // TODO / FIXME : Ideally, the following : _displayed, _sdcFolderModel, and _sdcFolderModelPending is + // provided by a single CPP model that will navigate and provide the files from both root and subdirectories + } + FolderListModel { id : _sdcFolderModel + // FIXME: there has to be a View for this which also get changed by log type. showDirs : false sortField : FolderListModel.Time - rootFolder : _sdcFolderColumn.currentTypeFolderApplication // FIXME: there has to be a View for this which also get changed by log type. + onStatusChanged: updateDisplayedList() } + FolderListModel { id : _sdcFolderModelPending + // FIXME: This needs to be handled as part of a single model (_sdcFolderModel) + showDirs : false + sortField : FolderListModel.Time + onStatusChanged: updateDisplayedList() + } Component { id : _sdcFileDelegate ProgressBar { id : _sdcItemBackground @@ -370,7 +422,7 @@ _GuiView.doExportListDelete( index ) } else { - _GuiView.doExportListInsert( index , fileName ) + _GuiView.doExportListInsert( index , fileName, isFromPendingFolder) } } @@ -420,7 +472,7 @@ } } } - model : _sdcFolderModel + model : _displayedFolderList delegate : _sdcFileDelegate } }