Index: sources/gui/qml/pages/settings/SettingsExportLogs.qml =================================================================== diff -u -rdc8969f6c7bbdb46d2de22622e58e457ceb37df4 -r7360f85ae13ee2a460ddfb11bc455203d6edf3ff --- sources/gui/qml/pages/settings/SettingsExportLogs.qml (.../SettingsExportLogs.qml) (revision dc8969f6c7bbdb46d2de22622e58e457ceb37df4) +++ sources/gui/qml/pages/settings/SettingsExportLogs.qml (.../SettingsExportLogs.qml) (revision 7360f85ae13ee2a460ddfb11bc455203d6edf3ff) @@ -147,7 +147,6 @@ } Connections { target: _logTypeCombo - function onCurrentIndexChanged() { vLocalization.notification = "" } @@ -165,163 +164,139 @@ qsTr("log export to USB is complete") } } + BaseComboBox { id: _logTypeCombo + anchors.top : _root.top + anchors.topMargin : Variables.headerButtonsMargin + anchors.horizontalCenter : parent.horizontalCenter + height : Variables.contentHeight + currentIndex : 0 + model : [ + _root.typeLabelApplication , + _root.typeLabelService , + _root.typeLabelTreatment + ] + + onActivated: updatePanels( _logTypeCombo.currentIndex ) + } + USBButton { id: _usbEjectButton - width : 120 + width : 150 height : 50 anchors.right : _root.right anchors.top : _root.top anchors.margins : Variables.headerButtonsMargin enabled : _GuiView.usbIsReady && !_GuiView.exportRunning && ! isUpdatePanels } - contentItem: Row { id : _contentRect - spacing : Variables.minVGap + contentItem: Item { id : _contentRect readonly property int columnWidthProgress : 375 - readonly property int columnWidthFolder : _root.horizontalLayout ? 840 : 725 + readonly property int columnWidthFolder : parent.width / 2.3 readonly property int columnWidthFileName : _root.horizontalLayout ? 685 : 575 // best combination - readonly property int columnWidthFileSize : _root.horizontalLayout ? 105 : 105 // best combination + readonly property int columnWidthFileSize : 120 + readonly property int columnCellHeight : 60 - Column { id : _progressColumn - property int progressWidth : 170 - property int progressHeight : height - _logTypeCombo.height - _logTypeExportButton.height + anchors.fill: parent - spacing : 10 - width : _contentRect.columnWidthProgress - height : parent.height + component Header: Rectangle { id: _Header + width : parent.width + height : _contentRect.columnCellHeight + color : Colors.panelBackgroundColor + radius : 9 - Row { id : _logTypeRow - anchors.left : parent.left - width : parent.width - height : _root.headetRowHight - spacing : _logTypeCombo.width - _logTypeExportButton.width + border { + width: 1 + color: Colors.panelBorderColor + } - BaseComboBox { id: _logTypeCombo - width : parent.width - height : parent.height - currentIndex : 0 - model : [ - _root.typeLabelApplication , - _root.typeLabelService , - _root.typeLabelTreatment - ] + Item { + width : parent.width + height : _contentRect.columnCellHeight - onActivated: updatePanels( _logTypeCombo.currentIndex ) - } - } - Column { - width : _progressColumn.progressWidth - height : _progressColumn.progressHeight - 2 * _progressColumn.spacing - Item { id : _SDC_item - width : _progressColumn.progressWidth - height : parent.height / 2 + Row { id : _HeaderRow + anchors.fill : parent + height : parent.height + leftPadding : Variables.defaultMargin * 2 + rightPadding : Variables.defaultMargin * 2 - SDCProgressItem { id: _SDC_progressItem - thickness : 10 - displayInformation : false - anchors.fill : parent + Text { id : _HeaderNameText + width : _contentRect.columnWidthFileName + height : parent.height + text : qsTr("Log Name:") + color : Colors.textMain + font.pixelSize : Fonts.fontPixelTextRectExtra + verticalAlignment : Text.AlignVCenter } - Label { - anchors.left : _SDC_progressItem.right - anchors.leftMargin : _progressColumn.spacing - anchors.verticalCenter : parent.verticalCenter - text : _root.sdcLabel + _root.devUnitLabel + ("Free : %1\nTotal: %2").arg( Variables.sizeConverted( _GuiView.sdAvail, 1000, 3) ).arg( Variables.sizeConverted( _GuiView.sdTotal, 1000, 3) ) - } - Label { - anchors.fill : parent - verticalAlignment : Text.AlignVCenter - horizontalAlignment : Text.AlignHCenter - text : _SDC_progressItem.percent - } - } - Item { id : _USB_item - width : _progressColumn.progressWidth - height : parent.height / 2 - USBProgressItem { id: _USB_progressItem - thickness : 10 - displayInformation : false - anchors.fill : parent + Text { id : _HeaderSizeText + width : _contentRect.columnWidthFileSize + height : parent.height + text : qsTr("Size:") + color : Colors.textMain + font.pixelSize : Fonts.fontPixelTextRectExtra + verticalAlignment : Text.AlignVCenter } - Label { - anchors.left : _USB_progressItem.right - anchors.leftMargin : _progressColumn.spacing - anchors.verticalCenter : parent.verticalCenter - text : _root.usbLabel + _root.devUnitLabel + ("Free : %1\nTotal: %2").arg( Variables.sizeConverted( _GuiView.usbAvail, 1000, 3) ).arg( Variables.sizeConverted( _GuiView.usbTotal, 1000, 3) ) - } - Label { - anchors.fill : parent - verticalAlignment : Text.AlignVCenter - horizontalAlignment : Text.AlignHCenter - text : _USB_progressItem.percent - } } } - ExportButton { id : _logTypeExportButton - width : parent.width - height : Variables.touchRectHeight - radius : Variables.touchRectRadius - border.width : Variables.borderWidth - enabled : _GuiView.usbIsReady && !_GuiView.exportRunning && ! isUpdatePanels - onClicked : doExport() - } } - Grid { - columns : _root.horizontalLayout ? 1 : 2 - spacing : 5 + + Column { id : _sdcFolderColumn + property string currentTypeFolderApplication : _root.typeFolderApplicationSrc + + anchors.left : parent.left width : _contentRect.columnWidthFolder - height : parent.height - Column { id : _sdcFolderColumn - property string currentTypeFolderApplication : _root.typeFolderApplicationSrc + height : parent.height - ( Variables.notificationHeight + Variables.defaultMargin ) - // FIXME: there has to be a View for this, and the timer should be removed and an event driven signal should be implemented there. - 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 - } - function clearModel() { - _sdcFolderModel.folder = _root.typePathClr - _sdcFolderModel.nameFilters = _root.typeFilterClr - } + // FIXME: there has to be a View for this, and the timer should be removed and an event driven signal should be implemented there. + 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 + } - spacing : 5 - width : _contentRect.columnWidthFolder - height : _root.horizontalLayout ? parent.height / 2 : parent.height - Label { id : _sdcLabel - 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 + function clearModel() { + _sdcFolderModel.folder = _root.typePathClr + _sdcFolderModel.nameFilters = _root.typeFilterClr + } + + Label { id : _sdcLabel + 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 + } + + Rectangle { id : _sdcFolderRectangle + color : Colors.panelBackgroundColor + radius : Variables.dialogRadius + anchors.left : parent.left + width : parent.width + height : parent.height + border { + width : 1 + color : Colors.panelBorderColor } - Rectangle { id : _sdcFolderRectangle - color : Colors.transparent - border.color : Colors.borderButton - radius : Variables.dialogRadius - anchors.left : parent.left - width : parent.width - height : parent.height - _sdcLabel.height - ScrollBar { - anchors.fill : _sdcFolderView - flickable : _sdcFolderView - handleWidth : Variables.settingsExportLogsScrollBarWidth - } + Column { id: _networkColumn + anchors.fill: parent - ListView { id : _sdcFolderView - enabled : !_GuiView.exportRunning && ! isUpdatePanels - clip : true - anchors.fill : parent - anchors.margins : 10 - 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. - } + Header { id: _sdcHeader } - Component { id : _sdcFileDelegate - ProgressBar { id : _sdcItemBackground + Item { id: _sdcListItem + width : parent.width + height : parent.height - _sdcHeader.height + + ListView { id : _sdcFolderView + enabled : ! _GuiView.exportRunning && ! isUpdatePanels + clip : true + width : parent.width + height : parent.height + + model: 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. + } + + delegate: 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. @@ -358,59 +333,100 @@ // Setting height and width to 0 when the file is not shown in the list because // it is a symlink or other conditions - width : isShownInList ? _sdcFolderView.width : 0 - height : isShownInList ? 40 : 0 + width : isShownInList ? _sdcFolderView.width : 0 + height : isShownInList ? _contentRect.columnCellHeight : 0 + progress.anchors.bottomMargin : 5 + progress.anchors.topMargin : 5 + progress.anchors.leftMargin : Variables.defaultMargin + progress.width : width - progress.anchors.leftMargin * 2 + bgColor : Colors.transparent - color : inExportList ? Colors.borderButtonSelected : Colors.transparent + color : inExportList ? Colors.borderButton : Colors.transparent radius : 5 - Row { id : _sdcFileRow - // Setting height and width to 0 when the file is not shown in the list because - // it is a symlink or other conditions - width : isShownInList ? parent.width : 0 - height : isShownInList ? 40 : 0 - leftPadding : 5 - Text { id : _sdcFileNameText - x : 2 - clip : true - width : isShownInList ? (_contentRect.columnWidthFileName - 2) : 0 - text : fileName - color : Colors.textMain - font.pixelSize : Fonts.fontPixelTextRectExtra - verticalAlignment : Text.AlignVCenter - horizontalAlignment : Text.AlignLeft + Item { + width : isShownInList ? parent.width : 0 + height : isShownInList ? _contentRect.columnCellHeight : 0 + + Row { id : _sdcFileRow + // Setting height and width to 0 when the file is not shown in the list because + // it is a symlink or other conditions + anchors.fill : parent + height : parent.height + leftPadding : Variables.defaultMargin * 2 + rightPadding : Variables.defaultMargin * 2 + + Text { id : _sdcFileNameText + clip : true + width : isShownInList ? (_contentRect.columnWidthFileName - 2) : 0 + height : parent.height + text : fileName + color : Colors.textMain + font.pixelSize : Fonts.fontPixelTextRectExtra + verticalAlignment : Text.AlignVCenter + } + + Text { id : _sdcFileSizeText + clip : true + width : isShownInList ? _contentRect.columnWidthFileSize : 0 + height : parent.height + text : Variables.sizeConverted( fileSize, 1000, 3) + color : Colors.textMain + font.pixelSize : Fonts.fontPixelTextRectExtra + verticalAlignment : Text.AlignVCenter + } } - Rectangle { id : _sdcColumnVerticalLine - color : Colors.borderButtonUnselected - width : isShownInList ? 1 : 0 - height : parent.height + _usbFolderColumn.spacing + + Line { id: _sdcDivider + color : Colors.panelBorderColor + visible : index !== _sdcFolderView.count - 1 + anchors { + bottom : parent.bottom + left : parent.left + leftMargin : Variables.defaultMargin * 2 + right : parent.right + rightMargin : Variables.defaultMargin * 2 + } } - Text { id : _sdcFileSizeText - clip : true - width : isShownInList ? _contentRect.columnWidthFileSize : 0 - text : Variables.sizeConverted( fileSize, 1000, 3) - color : Colors.textMain - font.pixelSize : Fonts.fontPixelTextRectExtra - verticalAlignment : Text.AlignVCenter - horizontalAlignment : Text.AlignRight - } } } } - model : _sdcFolderModel - delegate : _sdcFileDelegate + + ScrollBar { + anchors.fill : _sdcFolderView + flickable : _sdcFolderView + handleWidth : Variables.settingsExportLogsScrollBarWidth + scrollColor : Colors.scrollBarColor + } } } } - Column { id : _usbFolderColumn + } + + ExportButton { id : _logTypeExportButton + anchors.centerIn: parent + width : 100 + height : Variables.touchRectHeight + radius : Variables.touchRectRadius + border.width : Variables.borderWidth + enabled : _GuiView.usbIsReady && !_GuiView.exportRunning && ! isUpdatePanels + onClicked : doExport() + } + + Column { id : _usbFolderColumn property string currentTypeFolderApplication : _root.typeFolderApplicationDst + anchors.right : parent.right + width : _contentRect.columnWidthFolder + height : parent.height - ( Variables.notificationHeight + Variables.defaultMargin ) + // FIXME: there has to be a View for this, and the timer should be removed and an event driven signal should be implemented there. function updateModel() { _usbFolderModel.folder = currentTypeFolderApplication // FIXME: there has to be a View for this which also get changed by log type. _usbFolderModel.nameFilters = _root.typeFilterAll } + function clearModel() { _usbFolderModel.folder = _root.typePathClr _usbFolderModel.nameFilters = _root.typeFilterClr @@ -436,78 +452,145 @@ } } - spacing : 5 - width : _contentRect.columnWidthFolder - height : _root.horizontalLayout ? parent.height / 2 : parent.height - Label { id : _usbLabel + Label { id : _usbLabel text : _root.usbLabel + ": %1 files"/*", %2 %3"*/.arg(_usbFolderModel.count)//.arg("__").arg(_root.dvcUnit) width : parent.width height : _root.headetRowHight verticalAlignment : Text.AlignVCenter } Rectangle { id : _usbFolderRectangle - color : Colors.transparent - border.color : Colors.borderButton + color : Colors.panelBackgroundColor radius : Variables.dialogRadius anchors.left : parent.left width : parent.width - height : parent.height - _sdcLabel.height + height : parent.height + border { + width : 1 + color : Colors.panelBorderColor + } ScrollBar { anchors.fill : _usbFolderView flickable : _usbFolderView handleWidth : Variables.settingsExportLogsScrollBarWidth + scrollColor : Colors.scrollBarColor } ListView { id : _usbFolderView clip : true anchors.fill : parent - anchors.margins : 10 - spacing : 3 - anchors.leftMargin : 5 - anchors.rightMargin : 5 - - FolderListModel { id : _usbFolderModel // FIXME: I don't like this model, it's too lazy and I don't have control over it. There has to be a Model for this. + model: FolderListModel { id : _usbFolderModel // FIXME: I don't like this model, it's too lazy and I don't have control over it. There has to be a Model for this. showDirs : false sortField : FolderListModel.Time folder : _usbFolderColumn.currentTypeFolderApplication } - Component { id : _usbFileDelegate - Row { id : _usbFileRow - width : _usbFolderView.width - height : 40 - Text { id : _usbFileNameText + + delegate :Item { id: _usbDelegateItem + width : _usbFolderView.width + height : _contentRect.columnCellHeight + + Row { id : _usbFileRow + anchors.fill : parent + height : parent.height + leftPadding : Variables.defaultMargin * 2 + rightPadding : Variables.defaultMargin * 2 + + Text { id : _usbFileNameText clip : true width : _contentRect.columnWidthFileName + height : parent.height text : fileName color : Colors.textMain font.pixelSize : Fonts.fontPixelTextRectExtra verticalAlignment : Text.AlignVCenter - horizontalAlignment : Text.AlignLeft } - Rectangle { - color: Colors.borderButtonUnselected - width: 1 - height: parent.height + _usbFolderColumn.spacing - } - Text { id : _usbFileSizeText + + Text { id : _usbFileSizeText clip : true width : _contentRect.columnWidthFileSize + height : parent.height text : Variables.sizeConverted( fileSize, 1000, 3) color : Colors.textMain font.pixelSize : Fonts.fontPixelTextRectExtra verticalAlignment : Text.AlignVCenter - horizontalAlignment : Text.AlignRight } } + + Line { id: _usbDivider + color : Colors.panelBorderColor + visible : index !== _usbFolderView.count - 1 + anchors { + bottom : parent.bottom + left : parent.left + leftMargin : Variables.defaultMargin * 2 + right : parent.right + rightMargin : Variables.defaultMargin * 2 + } + } } - model : _usbFolderModel - delegate : _usbFileDelegate } } } + + Column { id : _progressColumn + property int progressWidth : 170 + property int progressHeight : height - _logTypeCombo.height - _logTypeExportButton.height + + spacing : 10 + width : _contentRect.columnWidthProgress + height : parent.height + + Column { + width : _progressColumn.progressWidth + height : _progressColumn.progressHeight - 2 * _progressColumn.spacing + Item { id : _SDC_item + width : _progressColumn.progressWidth + height : parent.height / 2 + + SDCProgressItem { id: _SDC_progressItem + thickness : 10 + displayInformation : false + anchors.fill : parent + } + Label { + anchors.left : _SDC_progressItem.right + anchors.leftMargin : _progressColumn.spacing + anchors.verticalCenter : parent.verticalCenter + text : _root.sdcLabel + _root.devUnitLabel + ("Free : %1\nTotal: %2").arg( Variables.sizeConverted( _GuiView.sdAvail, 1000, 3) ).arg( Variables.sizeConverted( _GuiView.sdTotal, 1000, 3) ) + } + Label { + anchors.fill : parent + verticalAlignment : Text.AlignVCenter + horizontalAlignment : Text.AlignHCenter + text : _SDC_progressItem.percent + } + } + + Item { id : _USB_item + width : _progressColumn.progressWidth + height : parent.height / 2 + + USBProgressItem { id: _USB_progressItem + thickness : 10 + displayInformation : false + anchors.fill : parent + } + Label { + anchors.left : _USB_progressItem.right + anchors.leftMargin : _progressColumn.spacing + anchors.verticalCenter : parent.verticalCenter + text : _root.usbLabel + _root.devUnitLabel + ("Free : %1\nTotal: %2").arg( Variables.sizeConverted( _GuiView.usbAvail, 1000, 3) ).arg( Variables.sizeConverted( _GuiView.usbTotal, 1000, 3) ) + } + Label { + anchors.fill : parent + verticalAlignment : Text.AlignVCenter + horizontalAlignment : Text.AlignHCenter + text : _USB_progressItem.percent + } + } + } } } }