Commit 65bf3aff authored by Karel Slaný's avatar Karel Slaný

Using a StackView for locking the application with PIN screen.

parent 5f6f2142
This diff is collapsed.
......@@ -28,6 +28,11 @@ Component {
id: aboutApp
Item {
id: aboutLayout
/* These properties must be set by caller. */
property var pageView
property var statusBar
property int myWidht: aboutLayout.width - 2 * defaultMargin
Rectangle {
id: header
......
......@@ -30,6 +30,8 @@ Component {
id: acntDetailPage
/* These properties must be set by caller. */
property var pageView
property var statusBar
property string acntName
property string userName
......
......@@ -38,6 +38,16 @@ Component {
id: pageAccountList
Item {
id: mainPage
/* These properties must be set by caller. */
//property var pageView
//property var statusBar
/*
* TODO -- Is there a way how to pas the pageView as a property?
* This pageView property is not passed because the page is created
* within the StackView.
*/
Component.onCompleted: {
if (accountList.count == 0) {
accountList.visible = false
......@@ -62,7 +72,10 @@ Component {
MouseArea {
anchors.fill: parent
onClicked: {
pageView.push(pageAboutApp, StackView.Immediate)
pageView.push(pageAboutApp, {
"pageView": pageView,
"statusBar": statusBar
}, StackView.Immediate)
}
}
}
......@@ -92,7 +105,10 @@ Component {
MouseArea {
anchors.fill: parent
onClicked: {
pageView.push(pageMenuDatovkaSettings, StackView.Immediate)
pageView.push(pageMenuDatovkaSettings, {
"pageView": pageView,
"statusBar": statusBar
}, StackView.Immediate)
}
}
}
......@@ -108,7 +124,12 @@ Component {
MouseArea {
anchors.fill: parent
onClicked: {
pageView.push(pageSettingsAccount, {"acntName": "", "userName": ""}, StackView.Immediate)
pageView.push(pageSettingsAccount, {
"pageView": pageView,
"statusBar": statusBar,
"acntName": "",
"userName": ""
}, StackView.Immediate)
}
}
}
......@@ -200,7 +221,12 @@ Component {
anchors.fill: parent
onClicked: {
statusBar.visible = false
pageView.push(pageMenuAccount, {"acntName": rAcntName, "userName": rUserName}, StackView.Immediate)
pageView.push(pageMenuAccount, {
"pageView": pageView,
"statusBar": statusBar,
"acntName": rAcntName,
"userName": rUserName
}, StackView.Immediate)
}
}
}
......@@ -282,7 +308,13 @@ Component {
anchors.fill: parent
onClicked: {
statusBar.visible = false
pageView.push(pageMessageList, {"acntName": rAcntName, "userName": rUserName, "msgType": MessageType.TYPE_RECEIVED}, StackView.Immediate)
pageView.push(pageMessageList, {
"pageView": pageView,
"statusBar": statusBar,
"acntName": rAcntName,
"userName": rUserName,
"msgType": MessageType.TYPE_RECEIVED
}, StackView.Immediate)
}
}
Rectangle {
......@@ -344,7 +376,13 @@ Component {
anchors.fill: parent
onClicked: {
statusBar.visible = false
pageView.push(pageMessageList, {"acntName": rAcntName, "userName": rUserName, "msgType": MessageType.TYPE_SENT}, StackView.Immediate)
pageView.push(pageMessageList, {
"pageView": pageView,
"statusBar": statusBar,
"acntName": rAcntName,
"userName": rUserName,
"msgType": MessageType.TYPE_SENT
}, StackView.Immediate)
}
}
Rectangle {
......
......@@ -34,6 +34,8 @@ Component {
id: mainLayout
/* These properties must be set by caller. */
property var pageView
property var statusBar
property string acntName
property string userName
......@@ -170,9 +172,19 @@ Component {
anchors.fill: parent
onClicked: {
if (index == 0) {
pageView.replace(pageSettingsAccount, {"acntName": acntName, "userName": userName}, StackView.Immediate)
pageView.replace(pageSettingsAccount, {
"pageView": pageView,
"statusBar": statusBar,
"acntName": acntName,
"userName": userName
}, StackView.Immediate)
} else if (index == 1) {
pageView.replace(pageAccountDetail, {"acntName": acntName, "userName": userName}, StackView.Immediate)
pageView.replace(pageAccountDetail, {
"pageView": pageView,
"statusBar": statusBar,
"acntName": acntName,
"userName": userName
}, StackView.Immediate)
} else if (index == 2) {
files.deleteFileDb(userName)
} else if (index == 3) {
......
......@@ -32,6 +32,11 @@ Component {
id: menuDatovkamainSettings
Item {
id: mainLayout
/* These properties must be set by caller. */
property var pageView
property var statusBar
property int myWidht: mainLayout.width - 2 * defaultMargin
Rectangle {
id: header
......@@ -157,15 +162,32 @@ Component {
anchors.fill: parent
onClicked: {
if (index == 1) {
pageView.replace(pageSettingsAccount, {"acntName": "", "userName": ""}, StackView.Immediate)
pageView.replace(pageSettingsAccount, {
"pageView": pageView,
"statusBar": statusBar,
"acntName": "",
"userName": ""
}, StackView.Immediate)
} else if (index == 2) {
pageView.replace(pageSettingsGeneral, StackView.Immediate)
pageView.replace(pageSettingsGeneral, {
"pageView": pageView,
"statusBar": statusBar
}, StackView.Immediate)
} else if (index == 3) {
pageView.replace(pageSettingsSync, StackView.Immediate)
pageView.replace(pageSettingsSync, {
"pageView": pageView,
"statusBar": statusBar
}, StackView.Immediate)
} else if (index == 4) {
pageView.replace(pageSettingsStorage, StackView.Immediate)
pageView.replace(pageSettingsStorage, {
"pageView": pageView,
"statusBar": statusBar
}, StackView.Immediate)
} else if (index == 5) {
pageView.replace(pageSettingsPin, StackView.Immediate)
pageView.replace(pageSettingsPin, {
"pageView": pageView,
"statusBar": statusBar
}, StackView.Immediate)
} else {
pageView.pop(StackView.Immediate)
}
......
......@@ -35,6 +35,8 @@ Component {
id: mainLayout
/* These properties must be set by caller. */
property var pageView
property var statusBar
property string acntName
property string userName
property int msgType
......
......@@ -35,6 +35,8 @@ Component {
id: mainLayout
/* These properties must be set by caller. */
property var pageView
property var statusBar
property string acntName
property string userName
property int msgType
......
......@@ -35,6 +35,8 @@ Component {
id: mainLayout
/* These properties must be set by caller. */
property var pageView
property var statusBar
property string acntName
property string userName
property int msgType
......
......@@ -35,6 +35,8 @@ Component {
id: msgDetailPage
/* These properties must be set by caller. */
property var pageView
property var statusBar
property string acntName
property string userName
property int msgType
......@@ -126,7 +128,14 @@ Component {
MouseArea {
anchors.fill: parent
onClicked: {
pageView.push(pageMenuMessageDetail, {"acntName": acntName, "userName": userName, "msgType": msgType, "msgId": msgId}, StackView.Immediate)
pageView.push(pageMenuMessageDetail, {
"pageView": pageView,
"statusBar": statusBar,
"acntName": acntName,
"userName": userName,
"msgType": msgType,
"msgId": msgId
}, StackView.Immediate)
}
}
}
......@@ -170,7 +179,11 @@ Component {
target: files
onPushNewMessageDeatilPage: {
statusBar.visible = false
pageView.push(pageZfoMessageDetail, {"zfoId": zfoId}, StackView.Immediate)
pageView.push(pageZfoMessageDetail, {
"pageView": pageView,
"statusBar": statusBar,
"zfoId": zfoId
}, StackView.Immediate)
}
}
}
......
......@@ -40,6 +40,8 @@ Component {
id: msgListPage
/* These properties must be set by caller. */
property var pageView
property var statusBar
property string acntName
property string userName
property int msgType
......@@ -115,7 +117,13 @@ Component {
anchors.fill: parent
onClicked: {
statusBar.visible = false
pageView.push(pageMenuMessageList, {"acntName": acntName, "userName": userName, "msgType": msgType}, StackView.Immediate)
pageView.push(pageMenuMessageList, {
"pageView": pageView,
"statusBar": statusBar,
"acntName": acntName,
"userName": userName,
"msgType": msgType
}, StackView.Immediate)
}
}
}
......@@ -272,11 +280,26 @@ Component {
anchors.fill: parent
onClicked: {
statusBar.visible = false
pageView.push(pageMessageDetail, {"acntName": acntName, "userName": userName, "msgType": msgType, "msgId": rMsgId}, StackView.Immediate)
pageView.push(pageMessageDetail, {
"pageView": pageView,
"statusBar": statusBar,
"acntName": acntName,
"userName": userName,
"msgType": msgType,
"msgId": rMsgId
}, StackView.Immediate)
}
onPressAndHold: {
statusBar.visible = false
pageView.push(pageMenuMessage, {"acntName": acntName, "userName": userName, "msgType": msgType, "msgId": rMsgId, "canDeleteMsg": compareMsgDate(rDelivTime)}, StackView.Immediate)
pageView.push(pageMenuMessage, {
"pageView": pageView,
"statusBar": statusBar,
"acntName": acntName,
"userName": userName,
"msgType": msgType,
"msgId": rMsgId,
"canDeleteMsg": compareMsgDate(rDelivTime)
}, StackView.Immediate)
}
}
Rectangle {
......
......@@ -31,6 +31,8 @@ Component {
id: mainLayout
/* These properties must be set by caller. */
property var pageView
property var statusBar
property string acntName
property string userName
......
......@@ -28,6 +28,11 @@ Component {
id: settingsGeneral
Item {
id: mainLayout
/* These properties must be set by caller. */
property var pageView
property var statusBar
property string sectionName: "general"
Component.onCompleted: {
settings.loadSettings(sectionName)
......
......@@ -29,6 +29,11 @@ Component {
id: settingsPin
Item {
id: mainItem
/* These properties must be set by caller. */
property var pageView
property var statusBar
Component.onCompleted: {
currentPIN = settings.pinValue()
actionName = "unspecified" /* Causes onChanged() to fire. */
......
......@@ -29,6 +29,11 @@ Component {
id: settingsStorage
Item {
id: mainLayout
/* These properties must be set by caller. */
property var pageView
property var statusBar
property string sectionName: "storage"
Component.onCompleted: {
settings.loadSettings(sectionName)
......
......@@ -28,6 +28,11 @@ Component {
id: settingsSync
Item {
id: mainLayout
/* These properties must be set by caller. */
property var pageView
property var statusBar
property string sectionName: "sync"
Component.onCompleted: {
settings.loadSettings(sectionName)
......
......@@ -30,8 +30,13 @@ Component {
id: pageZfoMessageDetail
Item {
id: msgZfoDetailPage
/* These properties are set from cpp. */
/* These properties must be set by caller. */
property var pageView
property var statusBar
property string zfoId
/* These properties are set from cpp. */
property string eSubject
property string eBody
Rectangle {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment