summary refs log tree commit diff
path: root/resources/qml/UserProfile.qml
diff options
context:
space:
mode:
authorCH Chethan Reddy <40890937+Chethan2k1@users.noreply.github.com>2020-07-05 21:33:27 +0530
committerCH Chethan Reddy <40890937+Chethan2k1@users.noreply.github.com>2020-07-30 22:10:27 +0530
commit1103cc15cfe59b35e540855090af381b0f2e5f8e (patch)
treec838d383d8221eb5387abcacf7c885b2c2dd686f /resources/qml/UserProfile.qml
parentRefactor UserProfile (diff)
downloadnheko-1103cc15cfe59b35e540855090af381b0f2e5f8e.tar.xz
Adding icons to UserProfile
Diffstat (limited to 'resources/qml/UserProfile.qml')
-rw-r--r--resources/qml/UserProfile.qml81
1 files changed, 47 insertions, 34 deletions
diff --git a/resources/qml/UserProfile.qml b/resources/qml/UserProfile.qml

index df54367b..5bdccb4d 100644 --- a/resources/qml/UserProfile.qml +++ b/resources/qml/UserProfile.qml
@@ -17,6 +17,13 @@ ApplicationWindow{ Layout.alignment: Qt.AlignHCenter palette: colors + Connections{ + target: deviceVerificationList + onUpdateProfile: { + profile.fetchDeviceList(profile.userid) + } + } + Component { id: deviceVerificationDialog DeviceVerification {} @@ -139,20 +146,12 @@ ApplicationWindow{ top : 50 } ColumnLayout{ - RowLayout{ - Text{ - Layout.fillWidth: true - color: colors.text - font.bold: true - Layout.alignment: Qt.AlignLeft - text: model.deviceId - } - Text{ - Layout.fillWidth: true - color:colors.text - Layout.alignment: Qt.AlignLeft - text: (model.verificationStatus == VerificationStatus.VERIFIED?"V":(model.verificationStatus == VerificationStatus.UNVERIFIED?"NV":"B")) - } + Text{ + Layout.fillWidth: true + color: colors.text + font.bold: true + Layout.alignment: Qt.AlignLeft + text: model.deviceId } Text{ Layout.fillWidth: true @@ -161,27 +160,41 @@ ApplicationWindow{ text: model.deviceName } } - Button{ - id: verifyButton - text:"Verify" - onClicked: { - var newFlow = deviceVerificationFlow.createObject(userProfileDialog, - {userId : profile.userid, sender: true, deviceId : model.deviceID}); - deviceVerificationList.add(newFlow.tranId); - var dialog = deviceVerificationDialog.createObject(userProfileDialog, {flow: newFlow}); - dialog.show(); + RowLayout{ + Image{ + Layout.preferredWidth: 20 + Layout.preferredHeight: 20 + source: ((model.verificationStatus == VerificationStatus.VERIFIED)?"image://colorimage/:/icons/icons/ui/lock.png?green": + ((model.verificationStatus == VerificationStatus.UNVERIFIED)?"image://colorimage/:/icons/icons/ui/unlock.png?yellow": + "image://colorimage/:/icons/icons/ui/unlock.png?red")) } - Layout.margins:{ - right: 10 - } - palette { - button: "white" - } - contentItem: Text { - text: verifyButton.text - color: "black" - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter + Button{ + id: verifyButton + text:(model.verificationStatus != VerificationStatus.VERIFIED)?"Verify":"Unverify" + onClicked: { + var newFlow = deviceVerificationFlow.createObject(userProfileDialog, + {userId : profile.userid, sender: true, deviceId : model.deviceId}); + if(model.verificationStatus == VerificationStatus.VERIFIED){ + newFlow.unverify(); + deviceVerificationList.updateProfile(newFlow.userId); + }else{ + deviceVerificationList.add(newFlow.tranId); + var dialog = deviceVerificationDialog.createObject(userProfileDialog, {flow: newFlow}); + dialog.show(); + } + } + Layout.margins:{ + right: 10 + } + palette { + button: "white" + } + contentItem: Text { + text: verifyButton.text + color: "black" + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + } } } }