small refactor

open add new cred dialog is now a function
This commit is contained in:
Dag Heyman 2017-03-16 14:59:30 +01:00
parent 7d9ceb70ae
commit 146d55b838
No known key found for this signature in database
GPG Key ID: 06FC004369E7D338

View File

@ -44,15 +44,7 @@ ApplicationWindow {
menuBar: MainMenuBar {
slotMode: settings.slotMode
hasDevice: device.hasDevice
onOpenAddCredential: {
if (settings.slotMode) {
addCredentialSlot.clear()
device.getSlotStatus(addCredentialSlot.open)
} else {
addCredential.clear()
addCredential.open()
}
}
onOpenAddCredential: openClearAddCredential()
onOpenSetPassword: setPassword.open()
onOpenReset: reset.open()
onOpenSettings: settingsDialog.open()
@ -559,4 +551,14 @@ ApplicationWindow {
function getDigits(slot) {
return getSlotDigitsSettings()[slot - 1]
}
function openClearAddCredential() {
if (settings.slotMode) {
addCredentialSlot.clear()
device.getSlotStatus(addCredentialSlot.open)
} else {
addCredential.clear()
addCredential.open()
}
}
}