Check-in [9b227877fc]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Auto-show new id generation if no key is available
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:9b227877fc4e9fd639154035d127460c60b0e28f
User & Date: bernd 2019-01-06 11:34:39
Context
2019-01-06
19:39
Add passphrase entropy estimation check-in: cbf210fda5 user: bernd tags: trunk
11:34
Auto-show new id generation if no key is available check-in: 9b227877fc user: bernd tags: trunk
2019-01-05
16:29
create new ID works check-in: d38bac7a07 user: bernd tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to gui.fs.

231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
...
315
316
317
318
319
320
321
322
323
324
325

326
327
328
329
330
331
332
...
845
846
847
848
849
850
851
852




853
854
855
856
857
858
859
	\footnote cbl dark-blue net2o-version }}text /center
	{{
	    {{
		glue*ll }}glue
		\large "👤" }}text \normal
		{{
		    glue*l pw-bg-col# font-size# f2/ f2/ }}frame dup .button3
		    transp# to x-color
		    "f(g" }}text /left 25%b
		    {{
			nt
			white# to x-color \bold
			"nick" }}edit 25%b dup to nick-field
			glue*lll }}glue \regular
		    }}h bx-tab nick-field ' nick-done edit[]
		}}z box[] blackish
................................................................................
			create-new-id /hflip
			plus-login /flop
			minus-login /flip
			nick-edit /vflip
			0e nick-edit >o to baseline o>
		    THEN +resize +lang ;
		\normal
	    }}z ' id-show-hide false toggle[]
	    glue-sright }}glue
	    glue*lll }}glue
	}}h box[] \skip >bl

	{{  \small dark-blue !i18n
	    l" Enter passphrase to unlock" }}text' /center dup to phrase-unlock
	    l" Create new ID" }}text' /center dup to create-new-id /hflip
	    l" Enter new passphrase" }}text' /center dup to phrase-first /hflip
	    l" Enter new passphrase again" }}text' /center dup to phrase-again /hflip
	    !lit
	}}z box[] /center >bl
................................................................................
: net2o-gui ( -- )
    n2o-frame to top-widget
    "PASSPHRASE" getenv 2dup d0= IF  2drop
    ELSE
	>passphrase +key  read-keys
	"PASSPHRASE" getenv erase \ erase passphrase after use!
    THEN
    secret-keys# IF  show-nicks  THEN




    1config  !widgets
    get-order n>r ['] /chat >body 1 set-order
    ['] widgets-loop catch
    nr> set-order throw ;

' net2o-gui is run-gui








<
<







 







|



>







 







|
>
>
>
>







231
232
233
234
235
236
237


238
239
240
241
242
243
244
...
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
...
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
	\footnote cbl dark-blue net2o-version }}text /center
	{{
	    {{
		glue*ll }}glue
		\large "👤" }}text \normal
		{{
		    glue*l pw-bg-col# font-size# f2/ f2/ }}frame dup .button3


		    {{
			nt
			white# to x-color \bold
			"nick" }}edit 25%b dup to nick-field
			glue*lll }}glue \regular
		    }}h bx-tab nick-field ' nick-done edit[]
		}}z box[] blackish
................................................................................
			create-new-id /hflip
			plus-login /flop
			minus-login /flip
			nick-edit /vflip
			0e nick-edit >o to baseline o>
		    THEN +resize +lang ;
		\normal
	    }}z ' id-show-hide false toggle[] dup Value id-toggler
	    glue-sright }}glue
	    glue*lll }}glue
	}}h box[] \skip >bl
	\ Advices, context sensitive
	{{  \small dark-blue !i18n
	    l" Enter passphrase to unlock" }}text' /center dup to phrase-unlock
	    l" Create new ID" }}text' /center dup to create-new-id /hflip
	    l" Enter new passphrase" }}text' /center dup to phrase-first /hflip
	    l" Enter new passphrase again" }}text' /center dup to phrase-again /hflip
	    !lit
	}}z box[] /center >bl
................................................................................
: net2o-gui ( -- )
    n2o-frame to top-widget
    "PASSPHRASE" getenv 2dup d0= IF  2drop
    ELSE
	>passphrase +key  read-keys
	"PASSPHRASE" getenv erase \ erase passphrase after use!
    THEN
    secret-keys# IF  show-nicks  ELSE
	has-key?  IF
	    0e 0 [: drop k-enter id-toggler .act .ekeyed ;] >animate
	THEN
    THEN
    1config  !widgets
    get-order n>r ['] /chat >body 1 set-order
    ['] widgets-loop catch
    nr> set-order throw ;

' net2o-gui is run-gui

Changes to keys.fs.

1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335



1336
1337
1338
1339
1340
1341
1342
    ELSE  ." ==== opened in " .time ." ====" cr choose-key  THEN
    >raw-key ?rsk read-chatgroups  r> op-vector ! ;

scope: n2o
Forward help
}scope

: get-my-key ( -- xt )
    gen-keys-dir  "seckeys.k2o" .keys/ 2dup file-status nip
    0= IF  r/o open-file throw >r r@ file-size throw d0=
	r> close-file throw  ELSE  true  THEN



    IF  [: ." Generate a new keypair:" cr
	  get-nick dup 0= #-56 and throw \ empty nick: pretend to quit
	  new-key .keys ?rsk read-chatgroups ;]
    ELSE  ['] get-skc  THEN ;

: .keyinfo ( -- )
    <warn> ." ==== No key opened ====" cr







|


|
>
>
>







1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
    ELSE  ." ==== opened in " .time ." ====" cr choose-key  THEN
    >raw-key ?rsk read-chatgroups  r> op-vector ! ;

scope: n2o
Forward help
}scope

: has-key? ( -- flag )
    gen-keys-dir  "seckeys.k2o" .keys/ 2dup file-status nip
    0= IF  r/o open-file throw >r r@ file-size throw d0=
	r> close-file throw  ELSE  true  THEN ;

: get-my-key ( -- xt )
    has-key?
    IF  [: ." Generate a new keypair:" cr
	  get-nick dup 0= #-56 and throw \ empty nick: pretend to quit
	  new-key .keys ?rsk read-chatgroups ;]
    ELSE  ['] get-skc  THEN ;

: .keyinfo ( -- )
    <warn> ." ==== No key opened ====" cr