Index: sources/gui/qml/pages/disinfect/DisinfectBase.qml =================================================================== diff -u -r2216ac6ac7f77437a7c29ac8b4043be01bc4609e -r8a5dbf556a66524fbe4b60ac1573182a0bd27617 --- sources/gui/qml/pages/disinfect/DisinfectBase.qml (.../DisinfectBase.qml) (revision 2216ac6ac7f77437a7c29ac8b4043be01bc4609e) +++ sources/gui/qml/pages/disinfect/DisinfectBase.qml (.../DisinfectBase.qml) (revision 8a5dbf556a66524fbe4b60ac1573182a0bd27617) @@ -20,160 +20,12 @@ // Qml imports import "qrc:/globals" import "qrc:/components" -import "qrc:/compounds" +import "qrc:/pages" /*! * \brief the parent page of the post-treatment screens */ -ScreenItem { id: _root +TreatmentFlowBase { id: _root objectName: "_DisinfectBase" - - property alias reasonText : _notification.text - property alias header : _titleBar - property alias title : _titleText - property alias footer : _footer - - property bool instructionBased : false - readonly property alias instruction : _instructionLoader.item - property string instructionlocation : "" - property var instructionStepNames : [] - property var instructionStepImages : [] - - property bool hasTimeCircle : false - readonly property alias timeCircle : _timeCircleLoader.item - property bool timeCircleIsChecked : false - property int timeCircleMinimum : 0 - property int timeCircleMaximum : 0 - property int timeCircleProgressValue : 0 - property int timeCircleTimeTextValue : 0 - - property bool hasCheckList : false - readonly property alias checkList : _checkListLoader.item - property var checkListStepNames : [] - property int checkListCompleteMargin : 50 - property string completeText : "" - - property bool isComplete : false - - readonly property int titleTopMargin: 110 - - signal backClicked() - signal confirmClicked() - - // vvvvvvvvvvvvvvvvvvvvvvvvv HEADER vvvvvvvvvvvvvvvvvvvvvvvvv // - StepNavigationTitleBar { id: _titleBar - stepIndex : stackStepIndex // shall have a definition in the parent stack - anchors.top : _root.top - anchors.horizontalCenter : parent.horizontalCenter - width : _root.width - confirmEnabled : instruction ? instruction.lastStep : true - stepNames : [] - stepLineLength : 120 - onBackClicked : _root.backClicked() - onConfirmClicked: _root.confirmClicked() - } - - Text { id: _titleText - anchors { - top : _root.top - topMargin : titleTopMargin - horizontalCenter: parent.horizontalCenter - } - text : qsTr("PostTreatmentBase") - color : Colors.textMain - font.pixelSize : Fonts.fontPixelTitle - } - - // ^^^^^^^^^^^^^^^^^^^^^^^^^ HEADER ^^^^^^^^^^^^^^^^^^^^^^^^^ // - - // vvvvvvvvvvvvvvvvvvvv Optional Components vvvvvvvvvvvvvvvvvvvv // - Loader { id: _instructionLoader - readonly property int outerHMargin : 30 - readonly property int outerVMargin : 15 - active : _root.instructionBased - anchors { - top : title.bottom - bottom : footer.top - left : parent.left - right : parent.right - leftMargin : outerHMargin - rightMargin : outerHMargin - topMargin : outerVMargin - bottomMargin : outerVMargin - } - sourceComponent : InstructionView { id: _instructionView - location : _root.instructionlocation - stepNames : _root.instructionStepNames - stepImages : _root.instructionStepImages - } - } - - Loader { id : _timeCircleLoader - active : _root.hasTimeCircle - - anchors.top : _root.hasCheckList ? title.bottom : undefined - anchors.topMargin : _root.hasCheckList ? 25 : 0 - anchors.horizontalCenter: _root.horizontalCenter - anchors.centerIn : ! _root.hasCheckList ? parent : undefined - sourceComponent : TimeCircle { id: _timeCircle - isChecked : _root.isComplete - minimum : _root.timeCircleMinimum - maximum : _root.timeCircleMaximum - progressValue : _root.timeCircleProgressValue - timeTextValue : _root.timeCircleTimeTextValue - thickness : _root.hasCheckList ? 1 : 2 - diameter : _root.hasCheckList ? Variables.progressCircleDiameterSmall : Variables.progressCircleDiameterNormal - timeTextPixelSize : _root.hasCheckList ? Fonts.fontPixelCirclProgressTimeSmall : Fonts.fontPixelCirclProgressTimeNormal - } - } - - Loader { id: _checkListLoader - active : _root.hasCheckList - anchors.top : _root.hasTimeCircle ? _timeCircleLoader.bottom : undefined - anchors.topMargin : _root.hasTimeCircle ? 25 : 0 - anchors.horizontalCenter: _root.horizontalCenter - anchors.centerIn : ! _root.hasTimeCircle ? parent : undefined - width : Variables.checkListViewItemWidth - height : Variables.checkListViewItemHeight * _root.checkListStepNames.length - sourceComponent : CheckListView { id: _checkListView - completeVisible : _root.isComplete - completeText : _root.completeText - stepNames : _root.checkListStepNames - completeMargin : _root.checkListCompleteMargin - } - } - - // ^^^^^^^^^^^^^^^^^^^^ Optional Components ^^^^^^^^^^^^^^^^^^^^ // - - Footer { id: _footer } - - NotificationBar { id: _notification - iconVisible: false - } - - Connections { target: vSettings - onSettingsChanged : { - if ( instructionBased ) { - var group = vSettings.groupFormat.arg(header.stepNames[stackStepIndex]).arg(title.text) - var settingsGroup = vSettings.settings[group] - // DEBUG : console.debug(" 22222 ", group) - if ( settingsGroup !== undefined ) { - _root.instructionlocation = settingsGroup.location - _root.instructionStepNames = settingsGroup.keys - _root.instructionStepImages = settingsGroup.values - } - } - } - } - - onVisibleChanged: { - if (checkList) - checkList.resetItems() - if (instruction) - instruction.currentStepIndex = 0 - _notification.text = "" - if (visible) { - _mainMenu.hidden = true - } - } + header.stepLineLength: 100 }