Example #1
0
    def set_it(idx, text):
        value = ch[idx][0]
        settings.set('sens', value)
        numpad.sensitivity = value

        # save also for next login time.
        from main import pa
        from nvstore import SettingsObject

        if not pa.is_secondary:
            tmp = SettingsObject()
            tmp.set('sens', value)
            tmp.save()
            del tmp
Example #2
0
async def pick_nickname(*a):
    # from settings menu, enter a nickname
    from nvstore import SettingsObject

    # Value is not stored with normal settings, it's part of "prelogin" settings
    # which are encrypted with zero-key.
    s = SettingsObject()
    nick = s.get('nick', '')

    if not nick:
        ch = await ux_show_story('''\
You can give this Coldcard a nickname and it will be shown before login.''')
        if ch != 'y': return

    from seed import spinner_edit
    nn = await spinner_edit(nick, confirm_exit=False)

    nn = nn.strip() if nn else None
    s.set('nick', nn)
    s.save()
    del s
Example #3
0
 def set(idx, text):
     # save it, but "outside" of login PIN
     s = SettingsObject()
     s.set('rngk', idx)
     s.save()
     del s
Example #4
0
 def set_it(idx, text):
     # save on key0, not normal settings
     s = SettingsObject()
     s.set(tag, va[idx])
     s.save()
     del s