forked from Silverfish/proton-bridge
GODT-1325: Add "already logged in" notification
This commit is contained in:
@ -26,6 +26,7 @@ ColumnLayout {
|
||||
id: root
|
||||
|
||||
property var user
|
||||
property var userIndex
|
||||
property var backend
|
||||
|
||||
spacing : 5
|
||||
@ -250,7 +251,25 @@ ColumnLayout {
|
||||
id: loginFinishedIndex
|
||||
colorScheme: root.colorScheme
|
||||
label: "Index:"
|
||||
text: "0"
|
||||
text: root.userIndex
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Button {
|
||||
colorScheme: root.colorScheme
|
||||
text: "Already logged in"
|
||||
|
||||
onClicked: {
|
||||
root.backend.loginAlreadyLoggedIn(0+loginAlreadyLoggedInIndex.text)
|
||||
user.resetLoginRequests()
|
||||
}
|
||||
}
|
||||
TextField {
|
||||
id: loginAlreadyLoggedInIndex
|
||||
colorScheme: root.colorScheme
|
||||
label: "Index:"
|
||||
text: root.userIndex
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -436,6 +436,7 @@ Window {
|
||||
colorScheme: root.colorScheme
|
||||
backend: root
|
||||
user: ((root.usersTest.count > usersListView.currentIndex) && usersListView.currentIndex != -1) ? root.usersTest.get(usersListView.currentIndex) : undefined
|
||||
userIndex: usersListView.currentIndex - 1 // -1 because 0 index is fake user
|
||||
}
|
||||
}
|
||||
|
||||
@ -671,6 +672,7 @@ Window {
|
||||
signal login2PasswordError(string errorMsg)
|
||||
signal login2PasswordErrorAbort(string errorMsg)
|
||||
signal loginFinished(int index)
|
||||
signal loginAlreadyLoggedIn(int index)
|
||||
|
||||
signal internetOff()
|
||||
signal internetOn()
|
||||
@ -849,6 +851,9 @@ Window {
|
||||
onLoginFinished: {
|
||||
console.debug("<- loginFinished", index)
|
||||
}
|
||||
onLoginAlreadyLoggedIn: {
|
||||
console.debug("<- loginAlreadyLoggedIn", index)
|
||||
}
|
||||
|
||||
onInternetOff: {
|
||||
console.debug("<- internetOff")
|
||||
|
||||
@ -377,6 +377,7 @@ Item {
|
||||
target: root.backend
|
||||
|
||||
onLoginFinished: rightContent.showAccount(index)
|
||||
onLoginAlreadyLoggedIn: rightContent.showAccount(index)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -57,6 +57,7 @@ QtObject {
|
||||
root.updateIsLatestVersion,
|
||||
root.loginConnectionError,
|
||||
root.onlyPaidUsers,
|
||||
root.alreadyLoggedIn,
|
||||
root.enableBeta,
|
||||
root.bugReportSendSuccess,
|
||||
root.bugReportSendError,
|
||||
@ -414,6 +415,29 @@ QtObject {
|
||||
]
|
||||
}
|
||||
|
||||
property Notification alreadyLoggedIn: Notification {
|
||||
text: qsTr("This account is already signed it.")
|
||||
icon: "./icons/ic-exclamation-circle-filled.svg"
|
||||
type: Notification.NotificationType.Info
|
||||
group: Notifications.Group.Configuration
|
||||
|
||||
Connections {
|
||||
target: root.backend
|
||||
onLoginAlreadyLoggedIn: {
|
||||
root.alreadyLoggedIn.active = true
|
||||
}
|
||||
}
|
||||
|
||||
action: [
|
||||
Action {
|
||||
text: qsTr("OK")
|
||||
onTriggered: {
|
||||
root.alreadyLoggedIn.active = false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
// Bug reports
|
||||
property Notification bugReportSendSuccess: Notification {
|
||||
text: qsTr("Thank you for the report. We'll get back to you as soon as we can.")
|
||||
|
||||
Reference in New Issue
Block a user