Skip to content

Commit 1bb8e2d

Browse files
committed
adapt trustedcoin to updated passphrase flow in wizard
1 parent 290da21 commit 1bb8e2d

File tree

3 files changed

+33
-32
lines changed

3 files changed

+33
-32
lines changed

electrum/plugins/trustedcoin/qml.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,21 @@ def extend_wizard(self, wizard: 'NewWalletWizard'):
6969
'trustedcoin_create_seed': {
7070
'gui': 'WCCreateSeed',
7171
},
72+
'trustedcoin_create_ext': {
73+
'gui': 'WCEnterExt',
74+
},
7275
'trustedcoin_confirm_seed': {
7376
'gui': 'WCConfirmSeed',
7477
},
78+
'trustedcoin_confirm_ext': {
79+
'gui': 'WCConfirmExt',
80+
},
7581
'trustedcoin_have_seed': {
7682
'gui': 'WCHaveSeed',
7783
},
84+
'trustedcoin_have_ext': {
85+
'gui': 'WCEnterExt',
86+
},
7887
'trustedcoin_keep_disable': {
7988
'gui': '../../../../plugins/trustedcoin/qml/KeepDisable',
8089
},

electrum/plugins/trustedcoin/qt.py

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,26 @@ def extend_wizard(self, wizard: 'QENewWalletWizard'):
250250
'gui': WCCreateSeed,
251251
'params': {'icon': self.icon_path('trustedcoin-wizard.png')},
252252
},
253+
'trustedcoin_create_ext': {
254+
'gui': WCEnterExt,
255+
'params': {'icon': self.icon_path('trustedcoin-wizard.png')},
256+
},
253257
'trustedcoin_confirm_seed': {
254258
'gui': WCConfirmSeed,
255259
'params': {'icon': self.icon_path('trustedcoin-wizard.png')},
256260
},
261+
'trustedcoin_confirm_ext': {
262+
'gui': WCConfirmExt,
263+
'params': {'icon': self.icon_path('trustedcoin-wizard.png')},
264+
},
257265
'trustedcoin_have_seed': {
258266
'gui': WCHaveSeed,
259267
'params': {'icon': self.icon_path('trustedcoin-wizard.png')},
260268
},
269+
'trustedcoin_have_ext': {
270+
'gui': WCEnterExt,
271+
'params': {'icon': self.icon_path('trustedcoin-wizard.png')},
272+
},
261273
'trustedcoin_keep_disable': {
262274
'gui': WCKeepDisable,
263275
'params': {'icon': self.icon_path('trustedcoin-wizard.png')},
@@ -277,35 +289,6 @@ def extend_wizard(self, wizard: 'QENewWalletWizard'):
277289
}
278290
wizard.navmap_merge(views)
279291

280-
# modify default flow, insert seed extension entry/confirm as separate views
281-
ext = {
282-
'trustedcoin_create_seed': {
283-
'next': lambda d: 'trustedcoin_create_ext' if wizard.wants_ext(d) else 'trustedcoin_confirm_seed'
284-
},
285-
'trustedcoin_create_ext': {
286-
'gui': WCEnterExt,
287-
'params': {'icon': self.icon_path('trustedcoin-wizard.png')},
288-
'next': 'trustedcoin_confirm_seed',
289-
},
290-
'trustedcoin_confirm_seed': {
291-
'next': lambda d: 'trustedcoin_confirm_ext' if wizard.wants_ext(d) else 'trustedcoin_tos'
292-
},
293-
'trustedcoin_confirm_ext': {
294-
'gui': WCConfirmExt,
295-
'params': {'icon': self.icon_path('trustedcoin-wizard.png')},
296-
'next': 'trustedcoin_tos',
297-
},
298-
'trustedcoin_have_seed': {
299-
'next': lambda d: 'trustedcoin_have_ext' if wizard.wants_ext(d) else 'trustedcoin_keep_disable'
300-
},
301-
'trustedcoin_have_ext': {
302-
'gui': WCEnterExt,
303-
'params': {'icon': self.icon_path('trustedcoin-wizard.png')},
304-
'next': 'trustedcoin_keep_disable',
305-
},
306-
}
307-
wizard.navmap_merge(ext)
308-
309292
# insert page offering choice to go online or continue on another system
310293
ext_online = {
311294
'trustedcoin_continue_online': {

electrum/plugins/trustedcoin/trustedcoin.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -586,13 +586,22 @@ def extend_wizard(self, wizard: 'NewWalletWizard'):
586586
else 'trustedcoin_have_seed'
587587
},
588588
'trustedcoin_create_seed': {
589-
'next': 'trustedcoin_confirm_seed'
589+
'next': lambda d: 'trustedcoin_create_ext' if wizard.wants_ext(d) else 'trustedcoin_confirm_seed',
590+
},
591+
'trustedcoin_create_ext': {
592+
'next': 'trustedcoin_confirm_seed',
590593
},
591594
'trustedcoin_confirm_seed': {
592-
'next': 'trustedcoin_tos'
595+
'next': lambda d: 'trustedcoin_confirm_ext' if wizard.wants_ext(d) else 'trustedcoin_tos',
596+
},
597+
'trustedcoin_confirm_ext': {
598+
'next': 'trustedcoin_tos',
593599
},
594600
'trustedcoin_have_seed': {
595-
'next': 'trustedcoin_keep_disable'
601+
'next': lambda d: 'trustedcoin_have_ext' if wizard.wants_ext(d) else 'trustedcoin_keep_disable',
602+
},
603+
'trustedcoin_have_ext': {
604+
'next': 'trustedcoin_keep_disable',
596605
},
597606
'trustedcoin_keep_disable': {
598607
'next': lambda d: 'trustedcoin_tos' if d['trustedcoin_keepordisable'] != 'disable'

0 commit comments

Comments
 (0)