Index: sources/gui/qml/dialogs/RxManagerDialog.qml =================================================================== diff -u --- sources/gui/qml/dialogs/RxManagerDialog.qml (revision 0) +++ sources/gui/qml/dialogs/RxManagerDialog.qml (revision 47e53a72dae5a817465b3ef0be9f98a9dd16f60a) @@ -0,0 +1,62 @@ +/*! + * + * Copyright (c) 2020-2024 Diality Inc. - All Rights Reserved. + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file NotificationDialog.qml + * \author (last) Behrouz NematiPour + * \date (last) 17-Apr-2023 + * \author (original) Peter Lucia + * \date (original) 02-Jun-2020 + * + */ + +// Qt +import QtQuick 2.12 +import QtGraphicalEffects 1.12 + +// Project +// Qml imports +import "qrc:/globals" +import "qrc:/components" +import "qrc:/pages/rxmanager" + +/*! + * \brief Contains the Rx Dialog Implementation + */ +ModalDialog { id : _root + contentItem.objectName: "_RxManagerDialog" // SquishQt + onVisibleChanged: { + if (visible) { + vRxProfiles.doInitRxProfilesList() + } + } + + Rectangle {id: _rect + color: "red" + anchors { + fill: parent + } + RxManager { id: _managerDialog + anchors { + fill: parent + } + height : parent.height + width : parent.width + } + } + + + CloseButton { id : _closeButton + anchors { + right : parent.right + left : undefined + margins : 0 + } + + onClicked : _root.close() + } + +} Index: sources/gui/qml/pages/ManagerStack.qml =================================================================== diff -u -r68d99b718e64e99454955cb6d6fadf20972a6ea0 -r47e53a72dae5a817465b3ef0be9f98a9dd16f60a --- sources/gui/qml/pages/ManagerStack.qml (.../ManagerStack.qml) (revision 68d99b718e64e99454955cb6d6fadf20972a6ea0) +++ sources/gui/qml/pages/ManagerStack.qml (.../ManagerStack.qml) (revision 47e53a72dae5a817465b3ef0be9f98a9dd16f60a) @@ -22,6 +22,10 @@ import "qrc:/components" import "qrc:/pages/rxmanager" + +import "qrc:/pages/pretreatment" +import "qrc:/pages/pretreatment/create" + /*! * \brief ManagerStack is the screen * which contains the main stack for all the Trearment Manager screens @@ -30,27 +34,22 @@ */ StackItem { id : _root stackView.initialItem : _managerHome - ScreenItem { id: _managerHome - anchors { - fill : parent - topMargin : Variables.defaultMargin * 2 - leftMargin : Variables.defaultMargin * 3 - rightMargin : Variables.defaultMargin * 3 - bottomMargin: Variables.alarmDialogHeaderHeight + RxManager { id: _managerHome +// anchors { +// fill : parent +// topMargin : Variables.defaultMargin * 2 +// leftMargin : Variables.defaultMargin * 3 +// rightMargin : Variables.defaultMargin * 3 +// bottomMargin: Variables.alarmDialogHeaderHeight +// } + onAddProfile:{ + page( _createProfile) } + } - RxManagerHeader{id: _rxHeader - height: 100 //TODO: Calculate how much to give - } - RxManagerList{ - id: _rxManagerListView - anchors { - left : parent.left - right : parent.right - top : _rxHeader.bottom - } - model: vRxProfiles.rxProfiles - } + PreTreatmentCreate{id: _createProfile + header.stepNames: [] + onBackClicked: {pop(_createProfile)} //TODO: Need to transfer logic to go to higher level as the back fn is dependent on mode. } onVisibleChanged: { Index: sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateContent.qml =================================================================== diff -u -r93b7d7da5dea9e0392e139b59117eb0315d6c343 -r47e53a72dae5a817465b3ef0be9f98a9dd16f60a --- sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateContent.qml (.../PreTreatmentCreateContent.qml) (revision 93b7d7da5dea9e0392e139b59117eb0315d6c343) +++ sources/gui/qml/pages/pretreatment/create/PreTreatmentCreateContent.qml (.../PreTreatmentCreateContent.qml) (revision 47e53a72dae5a817465b3ef0be9f98a9dd16f60a) @@ -194,6 +194,7 @@ else if ( selectedItem === _root.selectRx ) { print("TODO: Open and Select from Prescription Manager") } else if ( selectedItem === _root.clearAll ) { _root.clear() } else { /*Unknown state */ } + _rxManagerDialog.open() } } Index: sources/gui/qml/pages/rxmanager/RxManager.qml =================================================================== diff -u --- sources/gui/qml/pages/rxmanager/RxManager.qml (revision 0) +++ sources/gui/qml/pages/rxmanager/RxManager.qml (revision 47e53a72dae5a817465b3ef0be9f98a9dd16f60a) @@ -0,0 +1,66 @@ + +// Qt +import QtQuick 2.12 +import QtGraphicalEffects 1.12 + +// Project +// Qml imports +import "qrc:/globals" +import "qrc:/components" +import "qrc:/pages/rxmanager" +import "qrc:/pages/pretreatment/create" + + +Item { id: _root + signal addProfile() + property bool onShow: true + property bool showCreateRx: false + + RxManagerHeader{id: _rxHeader + height: 100 + onShow: _root.onShow + visible: ! showCreateRx + onAddClicked:{ + addProfile() + } + } + RxManagerList{ + id: _rxManagerListView + anchors { + left : parent.left + right : parent.right + leftMargin : Variables.defaultMargin * 3 + rightMargin : Variables.defaultMargin * 3 + bottomMargin: Variables.alarmDialogHeaderHeight + top : _rxHeader.bottom + } + model: vRxProfiles.rxProfiles +// visible: ! showCreateRx + } + +// PreTreatmentCreateContent{id: _meow +// anchors { +// top : parent.top +// left : parent.left +// leftMargin : Variables.defaultMargin * 8 +// right : parent.right +// rightMargin : anchors.leftMargin +// bottom : parent.bottom +// bottomMargin: Variables.notificationHeight + Variables.defaultMargin +// } +// visible: showCreateRx + +// } + +// BackButton { id : _backButton +// objectName: "_backButton" +// anchors { +// top : parent.top +// left : parent.left +// } +// onClicked: showCreateRx = false +// visible: showCreateRx + +// } + +} Index: sources/gui/qml/pages/rxmanager/RxManagerHeader.qml =================================================================== diff -u -rf5805685bfe1d7dcc22799e2fd6a07b8181cd349 -r47e53a72dae5a817465b3ef0be9f98a9dd16f60a --- sources/gui/qml/pages/rxmanager/RxManagerHeader.qml (.../RxManagerHeader.qml) (revision f5805685bfe1d7dcc22799e2fd6a07b8181cd349) +++ sources/gui/qml/pages/rxmanager/RxManagerHeader.qml (.../RxManagerHeader.qml) (revision 47e53a72dae5a817465b3ef0be9f98a9dd16f60a) @@ -20,9 +20,16 @@ import "qrc:/components" Item { id: _root + property bool onShow: true + property int rxProfileCount: vRxProfiles.rxProfiles.rowCount() + property var rxProfile : vRxProfiles.rxProfiles + onRxProfileCountChanged: print(rxProfileCount) + signal addClicked() + anchors { left : parent.left right : parent.right + topMargin : Variables.defaultMargin * 2 } Row { id: _headerRow @@ -32,20 +39,22 @@ spacing: Variables.defaultMargin * 2 Text { id : headerText - text : qsTr("Saved Prescriptions") + " (" + vRxProfiles.rxProfilesList.length + "/10)" + text : qsTr("Saved Prescriptions") + (" (%1/10)").arg(_root.rxProfileCount) color : Colors.textButton font.pointSize : Fonts.fontPixelButton * 1.4 verticalAlignment : Text.AlignVCenter } BaseComboBox { id: _sortdropdown + visible : _root.onShow model : [qsTr("Favorites"), qsTr("Last Modified"), qsTr("Last Used"), qsTr("Name")] height : 70 width : 300 onActivated: { switch (currentIndex) { case 0: print("TODO: Favorites selected " ) + _root.onShow = false break case 1: print("TODO: Last modified selected " ) @@ -64,6 +73,7 @@ TouchRect { id: _orderButton + visible : _root.onShow color : Colors.highlightMedProgressBar height: 70 width : 70 @@ -82,6 +92,7 @@ } } Row { id: _rxButtons + visible : _root.onShow anchors { right : parent.right } @@ -97,6 +108,9 @@ text.text : qsTr("Add Prescription") height: 70 width: 244 + onClicked :{ + addClicked() + } } } } Index: sources/gui/qml/pages/rxmanager/RxManagerList.qml =================================================================== diff -u -r68d99b718e64e99454955cb6d6fadf20972a6ea0 -r47e53a72dae5a817465b3ef0be9f98a9dd16f60a --- sources/gui/qml/pages/rxmanager/RxManagerList.qml (.../RxManagerList.qml) (revision 68d99b718e64e99454955cb6d6fadf20972a6ea0) +++ sources/gui/qml/pages/rxmanager/RxManagerList.qml (.../RxManagerList.qml) (revision 47e53a72dae5a817465b3ef0be9f98a9dd16f60a) @@ -30,6 +30,6 @@ clip: true spacing: Variables.defaultMargin id: _listView - delegate: RxProfileContainer { } + delegate: RxProfileContainer { id: _rxProfileContainer } } } Index: sources/storage/RxProfilesController.cpp =================================================================== diff -u -r7d17385db82117c46e046e15d6d5f91a3c64c21c -r47e53a72dae5a817465b3ef0be9f98a9dd16f60a --- sources/storage/RxProfilesController.cpp (.../RxProfilesController.cpp) (revision 7d17385db82117c46e046e15d6d5f91a3c64c21c) +++ sources/storage/RxProfilesController.cpp (.../RxProfilesController.cpp) (revision 47e53a72dae5a817465b3ef0be9f98a9dd16f60a) @@ -35,8 +35,8 @@ //#define ADDTOLOG( vINDEX ) index = vINDEX; logContent += title(index) + _sep + value(index) + _sep + unit(index) + "\n"; #define ADDTOLOG_MT(vINDEX, vVALUE, vTITLES ) \ - logContent += vTITLES[vINDEX] + _sep + \ - ( vVALUE[vINDEX] ) + "\n"; + logContent += vTITLES[vINDEX] + _equal + \ + "\"" + ( vVALUE[vINDEX] ) + "\"\n"; /*! * \brief RxProfiles::RxProfiles @@ -71,6 +71,11 @@ emit didFilesList(rxProfilesPath(), { QString("*.%1").arg(_rxProfiles) }); } +//void RxProfiles::doValidateRxProfiles() +//{ +// emit didFilesList(rxProfilesPath(), { QString("*.%1").arg(_rxProfiles) }); +//} + QString RxProfiles::rxProfilesPath() { if(_rxProfilesPath.trimmed().isEmpty()){ @@ -85,7 +90,6 @@ } - RxProfilesData RxProfiles::initModel(const QFileInfo &rxProfile) { RxProfilesData rxData; @@ -309,10 +313,10 @@ QString::number( rxData.rxProfileContent.size() ))); } //below is Test to write a file -// QStringList rxDataTest = vRxProfileDataList[0].rxProfileContent; -// rxDataTest.replace(Model::RxProfilesIndex::eProfileName, QString("Written New Rx")) ; -// // rxProfileContent -// doSave(rxDataTest); + QStringList rxDataTest = vRxProfileDataList[0].rxProfileContent; + rxDataTest.replace(Model::RxProfilesIndex::eProfileName, QString("Written New Rx")) ; + // rxProfileContent + doSave(rxDataTest); emit didRxProfileList(vRxProfileDataList); } Index: sources/storage/RxProfilesController.h =================================================================== diff -u -r7d17385db82117c46e046e15d6d5f91a3c64c21c -r47e53a72dae5a817465b3ef0be9f98a9dd16f60a --- sources/storage/RxProfilesController.h (.../RxProfilesController.h) (revision 7d17385db82117c46e046e15d6d5f91a3c64c21c) +++ sources/storage/RxProfilesController.h (.../RxProfilesController.h) (revision 47e53a72dae5a817465b3ef0be9f98a9dd16f60a) @@ -43,7 +43,7 @@ int _pendingCounter = 0 ; // const int _RxLimit = 10 ; // SRS- - const QString _sep = "="; + const QString _equal = "="; const QString _underscore = "_"; QString _rxProfilesPath; @@ -67,7 +67,7 @@ QString str = ""; if (vIndex < vStringList.count()) { str = vStringList[vIndex]; - str.remove(_sep); + str.remove(_equal); } return str; } @@ -108,6 +108,8 @@ void doExport (); void doImport (); void doInitRxProfiles(); +// void doValidateRxProfiles(); + signals: void didNotification ( const QString &vNotification ); Index: sources/view/VRxProfiles.cpp =================================================================== diff -u -r7d17385db82117c46e046e15d6d5f91a3c64c21c -r47e53a72dae5a817465b3ef0be9f98a9dd16f60a --- sources/view/VRxProfiles.cpp (.../VRxProfiles.cpp) (revision 7d17385db82117c46e046e15d6d5f91a3c64c21c) +++ sources/view/VRxProfiles.cpp (.../VRxProfiles.cpp) (revision 47e53a72dae5a817465b3ef0be9f98a9dd16f60a) @@ -83,6 +83,7 @@ RxProfilesList.append(hash); } _rxProfilesModels = RxProfilesList; + emit modelChanged(); } //void VRxProfiles::onRxProfileList(const QFileInfoList &vRxProfiles) Index: sources/view/VRxProfiles.h =================================================================== diff -u -r7d17385db82117c46e046e15d6d5f91a3c64c21c -r47e53a72dae5a817465b3ef0be9f98a9dd16f60a --- sources/view/VRxProfiles.h (.../VRxProfiles.h) (revision 7d17385db82117c46e046e15d6d5f91a3c64c21c) +++ sources/view/VRxProfiles.h (.../VRxProfiles.h) (revision 47e53a72dae5a817465b3ef0be9f98a9dd16f60a) @@ -48,7 +48,7 @@ // PROPERTY(QStringList , rxProfilesList , {}) - Q_PROPERTY(MListModel* rxProfiles READ rxProfiles CONSTANT) + Q_PROPERTY(MListModel* rxProfiles READ rxProfiles NOTIFY modelChanged) VIEW_DEC_CLASS(VRxProfiles) @@ -81,6 +81,7 @@ signals: void didRxProfileList(); + void modelChanged(); private slots: void onRxProfileList(const QList &vRxProfileDataList);