mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-19 18:18:38 +00:00
use status.keycard
This commit is contained in:
parent
2508b6b6f1
commit
0535886e6c
@ -1,19 +1,16 @@
|
|||||||
import NimQml, chronicles, std/wrapnils
|
import NimQml, chronicles, std/wrapnils
|
||||||
import status/status
|
import status/status
|
||||||
import status/keycard as keycardlib
|
|
||||||
import view
|
import view
|
||||||
|
|
||||||
type KeycardController* = ref object
|
type KeycardController* = ref object
|
||||||
view*: KeycardView
|
view*: KeycardView
|
||||||
variant*: QVariant
|
variant*: QVariant
|
||||||
status: Status
|
status: Status
|
||||||
keycard: KeycardModel
|
|
||||||
|
|
||||||
proc newController*(status: Status): KeycardController =
|
proc newController*(status: Status): KeycardController =
|
||||||
result = KeycardController()
|
result = KeycardController()
|
||||||
result.status = status
|
result.status = status
|
||||||
result.keycard = keycardlib.newKeycardModel()
|
result.view = newKeycardView(status)
|
||||||
result.view = newKeycardView(status, result.keycard)
|
|
||||||
result.variant = newQVariant(result.view)
|
result.variant = newQVariant(result.view)
|
||||||
|
|
||||||
proc delete*(self: KeycardController) =
|
proc delete*(self: KeycardController) =
|
||||||
|
@ -8,7 +8,6 @@ logScope:
|
|||||||
QtObject:
|
QtObject:
|
||||||
type KeycardView* = ref object of QObject
|
type KeycardView* = ref object of QObject
|
||||||
status*: Status
|
status*: Status
|
||||||
keycard: KeycardModel
|
|
||||||
|
|
||||||
proc setup(self: KeycardView) =
|
proc setup(self: KeycardView) =
|
||||||
self.QObject.setup
|
self.QObject.setup
|
||||||
@ -16,10 +15,9 @@ QtObject:
|
|||||||
proc delete*(self: KeycardView) =
|
proc delete*(self: KeycardView) =
|
||||||
self.QObject.delete
|
self.QObject.delete
|
||||||
|
|
||||||
proc newKeycardView*(status: Status, keycard: KeycardModel): KeycardView =
|
proc newKeycardView*(status: Status): KeycardView =
|
||||||
new(result, delete)
|
new(result, delete)
|
||||||
result.status = status
|
result.status = status
|
||||||
result.keycard = keycard
|
|
||||||
result.setup
|
result.setup
|
||||||
|
|
||||||
proc cardConnected*(self: KeycardView) {.signal.}
|
proc cardConnected*(self: KeycardView) {.signal.}
|
||||||
@ -33,6 +31,6 @@ QtObject:
|
|||||||
self.cardConnected()
|
self.cardConnected()
|
||||||
|
|
||||||
proc testConnection*(self: KeycardView) {.slot.} =
|
proc testConnection*(self: KeycardView) {.slot.} =
|
||||||
info "Connecting Keycard ", msg = self.keycard.start()
|
info "Connecting Keycard ", msg = self.status.keycard.start()
|
||||||
info "Selecting applet ", msg = self.keycard.select()
|
info "Selecting applet ", msg = self.status.keycard.select()
|
||||||
info "Disconnecting Keycard ", msg = self.keycard.stop()
|
info "Disconnecting Keycard ", msg = self.status.keycard.stop()
|
Loading…
x
Reference in New Issue
Block a user