1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2025-09-04 01:42:44 +00:00

Added user details and somewhat imporved error handling

* [UI] Improved: error handling should be slightly better
* [UI] Improved: settings now show the user name and picture instead of the user id if network is available.
This commit is contained in:
Chris Josten 2020-10-10 15:56:04 +02:00
parent 8a683df2a2
commit d3a7c17586
11 changed files with 240 additions and 80 deletions

View file

@ -48,24 +48,54 @@ Page {
text: qsTr("Session")
}
PlainLabel {
text: qsTr("Server")
}
Item {
anchors {
left: parent.left
leftMargin: Theme.horizontalPageMargin
right: parent.right
rightMargin: Theme.horizontalPageMargin
}
height: user.implicitHeight + server.implicitHeight + Theme.paddingMedium
User {
id: loggedInUser
apiClient: ApiClient
}
Image {
id: userIcon
width: height
anchors {
left: parent.left
top: parent.top
bottom: parent.bottom
}
source: ApiClient.baseUrl + "/Users/" + ApiClient.userId + "/Images/Primary?tag=" + loggedInUser.primaryImageTag
}
PlainLabel {
text: ApiClient.baseUrl
color: Theme.secondaryHighlightColor
}
Label {
id: user
anchors {
left: userIcon.right
leftMargin: Theme.paddingLarge
bottom: parent.verticalCenter
right: parent.right
}
text: loggedInUser.status == User.Ready ? loggedInUser.name : ApiClient.userId
color: Theme.highlightColor
}
Item { width: 1; height: Theme.paddingMedium; }
Label {
id: server
anchors {
left: userIcon.right
leftMargin: Theme.paddingLarge
top: parent.verticalCenter
right: parent.right
}
text: ApiClient.baseUrl
color: Theme.secondaryHighlightColor
}
PlainLabel {
text: qsTr("User id")
}
PlainLabel {
text: ApiClient.userId
color: Theme.secondaryHighlightColor
}
Item { width: 1; height: Theme.paddingLarge; }