GODT-1366: Simple lookup of index and select current user

This commit is contained in:
Jakub
2021-11-05 12:31:32 +01:00
parent 9984165798
commit 961742fa53
13 changed files with 106 additions and 17 deletions

View File

@ -236,13 +236,21 @@ ColumnLayout {
}
}
Button {
colorScheme: root.colorScheme
text: "Login Finished"
RowLayout {
Button {
colorScheme: root.colorScheme
text: "Login Finished"
onClicked: {
root.backend.loginFinished()
user.resetLoginRequests()
onClicked: {
root.backend.loginFinished(0+loginFinishedIndex.text)
user.resetLoginRequests()
}
}
TextField {
id: loginFinishedIndex
colorScheme: root.colorScheme
label: "Index:"
text: "0"
}
}
@ -251,7 +259,6 @@ ColumnLayout {
colorScheme: root.colorScheme
label: "used:"
text: user && user.usedBytes ? user.usedBytes : 0
validator: DoubleValidator {bottom: 1; top: 1024*1024*1024*1024*1024}
onEditingFinished: {
user.usedBytes = parseFloat(text)
}
@ -261,7 +268,6 @@ ColumnLayout {
colorScheme: root.colorScheme
label: "total:"
text: user && user.totalBytes ? user.totalBytes : 0
validator: DoubleValidator {bottom: 1; top: 1024*1024*1024*1024*1024}
onEditingFinished: {
user.totalBytes = parseFloat(text)
}

View File

@ -670,7 +670,7 @@ Window {
signal login2PasswordRequested()
signal login2PasswordError(string errorMsg)
signal login2PasswordErrorAbort(string errorMsg)
signal loginFinished()
signal loginFinished(int index)
signal internetOff()
signal internetOn()
@ -847,7 +847,7 @@ Window {
console.debug("<- login2PasswordErrorAbort")
}
onLoginFinished: {
console.debug("<- loginFinished")
console.debug("<- loginFinished", index)
}
onInternetOff: {

View File

@ -159,7 +159,6 @@ Item {
model: root.backend.users
delegate: Item {
width: leftBar.width - 2*accounts._leftRightMargins
implicitHeight: children[0].implicitHeight + children[0].anchors.topMargin + children[0].anchors.bottomMargin
implicitWidth: children[0].implicitWidth + children[0].anchors.leftMargin + children[0].anchors.rightMargin
@ -359,7 +358,13 @@ Item {
}
}
function showAccount () { rightContent.currentIndex = 0 }
function showAccount(index) {
if (index !== undefined && index >= 0){
accounts.currentIndex = index
}
rightContent.currentIndex = 0
}
function showSignIn () { rightContent.currentIndex = 1 }
function showGeneralSettings () { rightContent.currentIndex = 2 }
function showPortSettings () { rightContent.currentIndex = 3 }
@ -371,7 +376,7 @@ Item {
Connections {
target: root.backend
onLoginFinished: rightContent.showAccount()
onLoginFinished: rightContent.showAccount(index)
}
}
}

View File

@ -85,6 +85,10 @@ ApplicationWindow {
onShowMainWindow: {
root.showAndRise()
}
onLoginFinished: {
console.debug("Login finished", index)
}
}
StackLayout {