selecting among multiple accounts on login added
This commit is contained in:
parent
30f11c06d4
commit
8974a8db5e
|
@ -1,63 +0,0 @@
|
||||||
import NimQml
|
|
||||||
|
|
||||||
QtObject:
|
|
||||||
type AccountItem* = ref object of QObject
|
|
||||||
name: string
|
|
||||||
identicon: string
|
|
||||||
keyUid: string
|
|
||||||
thumbnailImage: string
|
|
||||||
largeImage: string
|
|
||||||
|
|
||||||
proc setup(self: AccountItem) =
|
|
||||||
self.QObject.setup
|
|
||||||
|
|
||||||
proc delete*(self: AccountItem) =
|
|
||||||
self.QObject.delete
|
|
||||||
|
|
||||||
proc setAccountItemData*(self: AccountItem, name, identicon, keyUid,
|
|
||||||
thumbnailImage, largeImage: string) =
|
|
||||||
self.name = name
|
|
||||||
self.identicon = identicon
|
|
||||||
self.keyUid = keyUid
|
|
||||||
self.thumbnailImage = thumbnailImage
|
|
||||||
self.largeImage = largeImage
|
|
||||||
|
|
||||||
proc newAccountItem*(): AccountItem =
|
|
||||||
new(result, delete)
|
|
||||||
result.setup
|
|
||||||
|
|
||||||
proc newAccountItem*(name, identicon, keyUid, thumbnailImage,
|
|
||||||
largeImage: string): AccountItem =
|
|
||||||
new(result, delete)
|
|
||||||
result.setup
|
|
||||||
result.setAccountItemData(name, identicon, keyUid, thumbnailImage, largeImage)
|
|
||||||
|
|
||||||
proc getName(self: AccountItem): string {.slot.} =
|
|
||||||
result = self.name
|
|
||||||
|
|
||||||
QtProperty[string] name:
|
|
||||||
read = getName
|
|
||||||
|
|
||||||
proc getIdenticon(self: AccountItem): string {.slot.} =
|
|
||||||
result = self.identicon
|
|
||||||
|
|
||||||
QtProperty[string] identicon:
|
|
||||||
read = getIdenticon
|
|
||||||
|
|
||||||
proc getKeyUid(self: AccountItem): string {.slot.} =
|
|
||||||
result = self.keyUid
|
|
||||||
|
|
||||||
QtProperty[string] keyUid:
|
|
||||||
read = getKeyUid
|
|
||||||
|
|
||||||
proc getThumbnailImage(self: AccountItem): string {.slot.} =
|
|
||||||
result = self.thumbnailImage
|
|
||||||
|
|
||||||
QtProperty[string] thumbnailImage:
|
|
||||||
read = getThumbnailImage
|
|
||||||
|
|
||||||
proc getLargeImage(self: AccountItem): string {.slot.} =
|
|
||||||
result = self.largeImage
|
|
||||||
|
|
||||||
QtProperty[string] largeImage:
|
|
||||||
read = getLargeImage
|
|
|
@ -14,6 +14,7 @@ type
|
||||||
delegate: io_interface.AccessInterface
|
delegate: io_interface.AccessInterface
|
||||||
appService: AppService
|
appService: AppService
|
||||||
accountsService: accounts_service.ServiceInterface
|
accountsService: accounts_service.ServiceInterface
|
||||||
|
selectedAccountKeyUid: string
|
||||||
|
|
||||||
proc newController*(delegate: io_interface.AccessInterface,
|
proc newController*(delegate: io_interface.AccessInterface,
|
||||||
appService: AppService,
|
appService: AppService,
|
||||||
|
@ -27,9 +28,6 @@ proc newController*(delegate: io_interface.AccessInterface,
|
||||||
method delete*(self: Controller) =
|
method delete*(self: Controller) =
|
||||||
discard
|
discard
|
||||||
|
|
||||||
method getOpenedAccounts*(self: Controller): seq[AccountDto] =
|
|
||||||
return self.accountsService.openedAccounts()
|
|
||||||
|
|
||||||
method init*(self: Controller) =
|
method init*(self: Controller) =
|
||||||
self.appService.status.events.on(SignalType.NodeStopped.event) do(e:Args):
|
self.appService.status.events.on(SignalType.NodeStopped.event) do(e:Args):
|
||||||
echo "-NEW-LOGIN-- NodeStopped: ", repr(e)
|
echo "-NEW-LOGIN-- NodeStopped: ", repr(e)
|
||||||
|
@ -43,3 +41,9 @@ method init*(self: Controller) =
|
||||||
self.appService.status.events.on(SignalType.NodeLogin.event) do(e:Args):
|
self.appService.status.events.on(SignalType.NodeLogin.event) do(e:Args):
|
||||||
echo "-NEW-LOGIN-- NodeLogin: ", repr(e)
|
echo "-NEW-LOGIN-- NodeLogin: ", repr(e)
|
||||||
#self.handleNodeLogin(NodeSignal(e))
|
#self.handleNodeLogin(NodeSignal(e))
|
||||||
|
|
||||||
|
method getOpenedAccounts*(self: Controller): seq[AccountDto] =
|
||||||
|
return self.accountsService.openedAccounts()
|
||||||
|
|
||||||
|
method setSelectedAccountKeyUid*(self: Controller, keyUid: string) =
|
||||||
|
self.selectedAccountKeyUid = keyUid
|
|
@ -12,3 +12,6 @@ method init*(self: AccessInterface) {.base.} =
|
||||||
|
|
||||||
method getOpenedAccounts*(self: AccessInterface): seq[AccountDto] {.base.} =
|
method getOpenedAccounts*(self: AccessInterface): seq[AccountDto] {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
method setSelectedAccountKeyUid*(self: AccessInterface, keyUid: string) {.base.} =
|
||||||
|
raise newException(ValueError, "No implementation available")
|
|
@ -0,0 +1,30 @@
|
||||||
|
type
|
||||||
|
Item* = object
|
||||||
|
name: string
|
||||||
|
identicon: string
|
||||||
|
thumbnailImage: string
|
||||||
|
largeImage: string
|
||||||
|
keyUid: string
|
||||||
|
|
||||||
|
proc initItem*(name, identicon, thumbnailImage, largeImage, keyUid: string):
|
||||||
|
Item =
|
||||||
|
result.name = name
|
||||||
|
result.identicon = identicon
|
||||||
|
result.thumbnailImage = thumbnailImage
|
||||||
|
result.largeImage = largeImage
|
||||||
|
result.keyUid = keyUid
|
||||||
|
|
||||||
|
proc getName*(self: Item): string =
|
||||||
|
return self.name
|
||||||
|
|
||||||
|
proc getIdenticon*(self: Item): string =
|
||||||
|
return self.identicon
|
||||||
|
|
||||||
|
proc getThumbnailImage*(self: Item): string =
|
||||||
|
result = self.thumbnailImage
|
||||||
|
|
||||||
|
proc getLargeImage*(self: Item): string =
|
||||||
|
result = self.largeImage
|
||||||
|
|
||||||
|
proc getKeyUid*(self: Item): string =
|
||||||
|
return self.keyUid
|
|
@ -1,15 +1,19 @@
|
||||||
import NimQml, Tables, strutils, strformat
|
import NimQml, Tables, strutils, strformat
|
||||||
|
|
||||||
import account_item
|
import item
|
||||||
|
|
||||||
type
|
type
|
||||||
ModelRole {.pure.} = enum
|
ModelRole {.pure.} = enum
|
||||||
Account = UserRole + 1
|
Name = UserRole + 1
|
||||||
|
Identicon
|
||||||
|
ThumbnailImage
|
||||||
|
LargeImage
|
||||||
|
KeyUid
|
||||||
|
|
||||||
QtObject:
|
QtObject:
|
||||||
type
|
type
|
||||||
Model* = ref object of QAbstractListModel
|
Model* = ref object of QAbstractListModel
|
||||||
items: seq[AccountItem]
|
items: seq[Item]
|
||||||
|
|
||||||
proc delete(self: Model) =
|
proc delete(self: Model) =
|
||||||
self.items = @[]
|
self.items = @[]
|
||||||
|
@ -22,21 +26,16 @@ QtObject:
|
||||||
new(result, delete)
|
new(result, delete)
|
||||||
result.setup
|
result.setup
|
||||||
|
|
||||||
proc countChanged*(self: Model) {.signal.}
|
|
||||||
|
|
||||||
proc count*(self: Model): int {.slot.} =
|
|
||||||
self.items.len
|
|
||||||
|
|
||||||
QtProperty[int] count:
|
|
||||||
read = count
|
|
||||||
notify = countChanged
|
|
||||||
|
|
||||||
method rowCount(self: Model, index: QModelIndex = nil): int =
|
method rowCount(self: Model, index: QModelIndex = nil): int =
|
||||||
return self.items.len
|
return self.items.len
|
||||||
|
|
||||||
method roleNames(self: Model): Table[int, string] =
|
method roleNames(self: Model): Table[int, string] =
|
||||||
{
|
{
|
||||||
ModelRole.Account.int:"account"
|
ModelRole.Name.int:"username",
|
||||||
|
ModelRole.Identicon.int:"identicon",
|
||||||
|
ModelRole.ThumbnailImage.int:"thumbnailImage",
|
||||||
|
ModelRole.LargeImage.int:"largeImage",
|
||||||
|
ModelRole.KeyUid.int:"keyUid"
|
||||||
}.toTable
|
}.toTable
|
||||||
|
|
||||||
method data(self: Model, index: QModelIndex, role: int): QVariant =
|
method data(self: Model, index: QModelIndex, role: int): QVariant =
|
||||||
|
@ -50,11 +49,24 @@ QtObject:
|
||||||
let enumRole = role.ModelRole
|
let enumRole = role.ModelRole
|
||||||
|
|
||||||
case enumRole:
|
case enumRole:
|
||||||
of ModelRole.Account:
|
of ModelRole.Name:
|
||||||
result = newQVariant(item)
|
result = newQVariant(item.getName())
|
||||||
|
of ModelRole.Identicon:
|
||||||
|
result = newQVariant(item.getIdenticon())
|
||||||
|
of ModelRole.ThumbnailImage:
|
||||||
|
result = newQVariant(item.getThumbnailImage())
|
||||||
|
of ModelRole.LargeImage:
|
||||||
|
result = newQVariant(item.getLargeImage())
|
||||||
|
of ModelRole.KeyUid:
|
||||||
|
result = newQVariant(item.getKeyUid())
|
||||||
|
|
||||||
proc setItems*(self: Model, items: seq[AccountItem]) =
|
proc setItems*(self: Model, items: seq[Item]) =
|
||||||
self.beginResetModel()
|
self.beginResetModel()
|
||||||
self.items = items
|
self.items = items
|
||||||
self.endResetModel()
|
self.endResetModel()
|
||||||
self.countChanged()
|
|
||||||
|
proc getItemAtIndex*(self: Model, index: int): Item =
|
||||||
|
if(index < 0 or index >= self.items.len):
|
||||||
|
return
|
||||||
|
|
||||||
|
return self.items[index]
|
|
@ -1,7 +1,7 @@
|
||||||
import NimQml
|
import NimQml
|
||||||
import io_interface
|
import io_interface
|
||||||
import ../io_interface as delegate_interface
|
import ../io_interface as delegate_interface
|
||||||
import view, controller, account_item
|
import view, controller, item
|
||||||
import ../../../../app/boot/global_singleton
|
import ../../../../app/boot/global_singleton
|
||||||
|
|
||||||
import ../../../../app_service/[main]
|
import ../../../../app_service/[main]
|
||||||
|
@ -50,24 +50,18 @@ method load*(self: Module) =
|
||||||
|
|
||||||
let openedAccounts = self.controller.getOpenedAccounts()
|
let openedAccounts = self.controller.getOpenedAccounts()
|
||||||
if(openedAccounts.len > 0):
|
if(openedAccounts.len > 0):
|
||||||
var accounts: seq[AccountItem]
|
var items: seq[Item]
|
||||||
for acc in openedAccounts:
|
for acc in openedAccounts:
|
||||||
var thumbnailImage: string
|
var thumbnailImage: string
|
||||||
var largeImage: string
|
var largeImage: string
|
||||||
self.extractImages(acc, thumbnailImage, largeImage)
|
self.extractImages(acc, thumbnailImage, largeImage)
|
||||||
accounts.add(newAccountItem(acc.name, acc.identicon, acc.keyUid,
|
items.add(initItem(acc.name, acc.identicon, thumbnailImage, largeImage,
|
||||||
thumbnailImage, largeImage))
|
acc.keyUid))
|
||||||
|
|
||||||
self.view.setAccountsList(accounts)
|
self.view.setModelItems(items)
|
||||||
|
|
||||||
# set the first account as a slected one
|
# set the first account as slected one
|
||||||
let selected = openedAccounts[0]
|
self.setSelectedAccount(items[0])
|
||||||
var thumbnailImage: string
|
|
||||||
var largeImage: string
|
|
||||||
self.extractImages(selected, thumbnailImage, largeImage)
|
|
||||||
|
|
||||||
self.view.setSelectedAccount(selected.name, selected.identicon, selected.keyUid,
|
|
||||||
thumbnailImage, largeImage)
|
|
||||||
|
|
||||||
method isLoaded*(self: Module): bool =
|
method isLoaded*(self: Module): bool =
|
||||||
return self.moduleLoaded
|
return self.moduleLoaded
|
||||||
|
@ -75,3 +69,7 @@ method isLoaded*(self: Module): bool =
|
||||||
method viewDidLoad*(self: Module) =
|
method viewDidLoad*(self: Module) =
|
||||||
self.moduleLoaded = true
|
self.moduleLoaded = true
|
||||||
self.delegate.loginDidLoad()
|
self.delegate.loginDidLoad()
|
||||||
|
|
||||||
|
method setSelectedAccount*(self: Module, item: Item) =
|
||||||
|
self.controller.setSelectedAccountKeyUid(item.getKeyUid())
|
||||||
|
self.view.setSelectedAccount(item)
|
|
@ -1,2 +1,7 @@
|
||||||
|
import ../item
|
||||||
|
|
||||||
method viewDidLoad*(self: AccessInterface) {.base.} =
|
method viewDidLoad*(self: AccessInterface) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
method setSelectedAccount*(self: AccessInterface, item: Item) {.base.} =
|
||||||
|
raise newException(ValueError, "No implementation available")
|
|
@ -0,0 +1,49 @@
|
||||||
|
import NimQml
|
||||||
|
import item
|
||||||
|
|
||||||
|
QtObject:
|
||||||
|
type SelectedAccount* = ref object of QObject
|
||||||
|
item: Item
|
||||||
|
|
||||||
|
proc setup(self: SelectedAccount) =
|
||||||
|
self.QObject.setup
|
||||||
|
|
||||||
|
proc delete*(self: SelectedAccount) =
|
||||||
|
self.QObject.delete
|
||||||
|
|
||||||
|
proc newSelectedAccount*(): SelectedAccount =
|
||||||
|
new(result, delete)
|
||||||
|
result.setup
|
||||||
|
|
||||||
|
proc setSelectedAccountData*(self: SelectedAccount, item: Item) =
|
||||||
|
self.item = item
|
||||||
|
|
||||||
|
proc getName(self: SelectedAccount): string {.slot.} =
|
||||||
|
return self.item.getName()
|
||||||
|
|
||||||
|
QtProperty[string] username:
|
||||||
|
read = getName
|
||||||
|
|
||||||
|
proc getIdenticon(self: SelectedAccount): string {.slot.} =
|
||||||
|
return self.item.getIdenticon()
|
||||||
|
|
||||||
|
QtProperty[string] identicon:
|
||||||
|
read = getIdenticon
|
||||||
|
|
||||||
|
proc getKeyUid(self: SelectedAccount): string {.slot.} =
|
||||||
|
return self.item.getKeyUid()
|
||||||
|
|
||||||
|
QtProperty[string] keyUid:
|
||||||
|
read = getKeyUid
|
||||||
|
|
||||||
|
proc getThumbnailImage(self: SelectedAccount): string {.slot.} =
|
||||||
|
return self.item.getThumbnailImage()
|
||||||
|
|
||||||
|
QtProperty[string] thumbnailImage:
|
||||||
|
read = getThumbnailImage
|
||||||
|
|
||||||
|
proc getLargeImage(self: SelectedAccount): string {.slot.} =
|
||||||
|
return self.item.getLargeImage()
|
||||||
|
|
||||||
|
QtProperty[string] largeImage:
|
||||||
|
read = getLargeImage
|
|
@ -1,12 +1,12 @@
|
||||||
import NimQml
|
import NimQml
|
||||||
import account_item, model
|
import model, item, selected_account
|
||||||
import io_interface
|
import io_interface
|
||||||
|
|
||||||
QtObject:
|
QtObject:
|
||||||
type
|
type
|
||||||
View* = ref object of QObject
|
View* = ref object of QObject
|
||||||
delegate: io_interface.AccessInterface
|
delegate: io_interface.AccessInterface
|
||||||
selectedAccount: AccountItem
|
selectedAccount: SelectedAccount
|
||||||
selectedAccountVariant: QVariant
|
selectedAccountVariant: QVariant
|
||||||
model: Model
|
model: Model
|
||||||
modelVariant: QVariant
|
modelVariant: QVariant
|
||||||
|
@ -22,7 +22,7 @@ QtObject:
|
||||||
new(result, delete)
|
new(result, delete)
|
||||||
result.QObject.setup
|
result.QObject.setup
|
||||||
result.delegate = delegate
|
result.delegate = delegate
|
||||||
result.selectedAccount = newAccountItem()
|
result.selectedAccount = newSelectedAccount()
|
||||||
result.selectedAccountVariant = newQVariant(result.selectedAccount)
|
result.selectedAccountVariant = newQVariant(result.selectedAccount)
|
||||||
result.model = newModel()
|
result.model = newModel()
|
||||||
result.modelVariant = newQVariant(result.model)
|
result.modelVariant = newQVariant(result.model)
|
||||||
|
@ -35,12 +35,14 @@ QtObject:
|
||||||
proc getSelectedAccount(self: View): QVariant {.slot.} =
|
proc getSelectedAccount(self: View): QVariant {.slot.} =
|
||||||
return self.selectedAccountVariant
|
return self.selectedAccountVariant
|
||||||
|
|
||||||
proc setSelectedAccount*(self: View, name, identicon, keyUid, thumbnailImage,
|
proc setSelectedAccount*(self: View, item: Item) =
|
||||||
largeImage: string) =
|
self.selectedAccount.setSelectedAccountData(item)
|
||||||
self.selectedAccount.setAccountItemData(name, identicon, keyUid, thumbnailImage,
|
|
||||||
largeImage)
|
|
||||||
self.selectedAccountChanged()
|
self.selectedAccountChanged()
|
||||||
|
|
||||||
|
proc setSelectedAccountByIndex*(self: View, index: int) {.slot.} =
|
||||||
|
let item = self.model.getItemAtIndex(index)
|
||||||
|
self.delegate.setSelectedAccount(item)
|
||||||
|
|
||||||
QtProperty[QVariant] selectedAccount:
|
QtProperty[QVariant] selectedAccount:
|
||||||
read = getSelectedAccount
|
read = getSelectedAccount
|
||||||
notify = selectedAccountChanged
|
notify = selectedAccountChanged
|
||||||
|
@ -50,7 +52,7 @@ QtObject:
|
||||||
proc getModel(self: View): QVariant {.slot.} =
|
proc getModel(self: View): QVariant {.slot.} =
|
||||||
return self.modelVariant
|
return self.modelVariant
|
||||||
|
|
||||||
proc setAccountsList*(self: View, accounts: seq[AccountItem]) =
|
proc setModelItems*(self: View, accounts: seq[Item]) =
|
||||||
self.model.setItems(accounts)
|
self.model.setItems(accounts)
|
||||||
self.modelChanged()
|
self.modelChanged()
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
import json
|
|
||||||
|
|
||||||
type
|
type
|
||||||
Item* = object
|
Item* = object
|
||||||
id: string
|
id: string
|
||||||
|
|
|
@ -22,9 +22,9 @@ ModalPopup {
|
||||||
id: accountList
|
id: accountList
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
model: LoginStore.loginModelInst
|
model: LoginStore.loginModul.accountsModel
|
||||||
isSelected: function (index, keyUid) {
|
isSelected: function (index, keyUid) {
|
||||||
return LoginStore.loginModelInst.currentAccount.keyUid === keyUid
|
return LoginStore.currentAccount.keyUid === keyUid
|
||||||
}
|
}
|
||||||
|
|
||||||
onAccountSelect: function(index) {
|
onAccountSelect: function(index) {
|
||||||
|
|
|
@ -3,11 +3,11 @@ pragma Singleton
|
||||||
import QtQuick 2.13
|
import QtQuick 2.13
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
property var loginModelInst: loginModel
|
property var loginModul: loginModule
|
||||||
property var currentAccount: loginModel.currentAccount
|
property var currentAccount: loginModule.selectedAccount
|
||||||
|
|
||||||
function login(password) {
|
function login(password) {
|
||||||
loginModel.login(password)
|
loginModul.login(password)
|
||||||
}
|
}
|
||||||
|
|
||||||
function tryToObtainPassword() {
|
function tryToObtainPassword() {
|
||||||
|
@ -15,10 +15,10 @@ QtObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
function setCurrentAccount(index) {
|
function setCurrentAccount(index) {
|
||||||
loginModel.setCurrentAccount(index)
|
loginModul.setSelectedAccountByIndex(index)
|
||||||
}
|
}
|
||||||
|
|
||||||
function rowCount() {
|
function rowCount() {
|
||||||
return loginModel.rowCount()
|
return loginModul.accountsModel.rowCount()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,8 @@ Item {
|
||||||
|
|
||||||
loading = true
|
loading = true
|
||||||
LoginStore.login(password)
|
LoginStore.login(password)
|
||||||
applicationWindow.checkForStoringPassToKeychain(LoginStore.currentAccount.username, password, false)
|
// NEED TO HANDLE IT
|
||||||
|
//applicationWindow.checkForStoringPassToKeychain(LoginStore.currentAccount.username, password, false)
|
||||||
txtPassword.textField.clear()
|
txtPassword.textField.clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,21 +54,22 @@ Item {
|
||||||
resetLogin()
|
resetLogin()
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections{
|
// NEED TO HANDLE IT
|
||||||
id: connection
|
// Connections{
|
||||||
target: LoginStore.loginModelInst
|
// id: connection
|
||||||
|
// target: LoginStore.loginModelInst
|
||||||
|
|
||||||
onObtainingPasswordError: {
|
// onObtainingPasswordError: {
|
||||||
enabled = false
|
// enabled = false
|
||||||
obtainingPasswordErrorNotification.confirmationText = errorDescription
|
// obtainingPasswordErrorNotification.confirmationText = errorDescription
|
||||||
obtainingPasswordErrorNotification.open()
|
// obtainingPasswordErrorNotification.open()
|
||||||
}
|
// }
|
||||||
|
|
||||||
onObtainingPasswordSuccess: {
|
// onObtainingPasswordSuccess: {
|
||||||
enabled = false
|
// enabled = false
|
||||||
doLogin(password)
|
// doLogin(password)
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
ConfirmationDialog {
|
ConfirmationDialog {
|
||||||
id: obtainingPasswordErrorNotification
|
id: obtainingPasswordErrorNotification
|
||||||
|
@ -93,7 +95,8 @@ Item {
|
||||||
StatusSmartIdenticon {
|
StatusSmartIdenticon {
|
||||||
id: userImage
|
id: userImage
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
image.source : LoginStore.currentAccount.thumbnailImage
|
image.source: LoginStore.currentAccount.thumbnailImage ||
|
||||||
|
LoginStore.currentAccount.identicon
|
||||||
image.isIdenticon: true
|
image.isIdenticon: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -224,24 +227,25 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
// NEED TO HANDLE IT
|
||||||
target: LoginStore.loginModelInst
|
// Connections {
|
||||||
ignoreUnknownSignals: true
|
// target: LoginStore.loginModelInst
|
||||||
onLoginResponseChanged: {
|
// ignoreUnknownSignals: true
|
||||||
if (error) {
|
// onLoginResponseChanged: {
|
||||||
// SQLITE_NOTADB: "file is not a database"
|
// if (error) {
|
||||||
if (error === "file is not a database") {
|
// // SQLITE_NOTADB: "file is not a database"
|
||||||
errMsg.text = errMsg.incorrectPasswordMsg
|
// if (error === "file is not a database") {
|
||||||
} else {
|
// errMsg.text = errMsg.incorrectPasswordMsg
|
||||||
//% "Login failed: %1"
|
// } else {
|
||||||
errMsg.text = qsTrId("login-failed---1").arg(error.toUpperCase())
|
// //% "Login failed: %1"
|
||||||
}
|
// errMsg.text = qsTrId("login-failed---1").arg(error.toUpperCase())
|
||||||
errMsg.visible = true
|
// }
|
||||||
loading = false
|
// errMsg.visible = true
|
||||||
txtPassword.textField.forceActiveFocus()
|
// loading = false
|
||||||
}
|
// txtPassword.textField.forceActiveFocus()
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
StatusQControls.StatusFlatButton {
|
StatusQControls.StatusFlatButton {
|
||||||
id: generateKeysLinkText
|
id: generateKeysLinkText
|
||||||
|
|
Loading…
Reference in New Issue