Skip to content

Commit

Permalink
Merge pull request #154 from kdmukai/ui_overhaul
Browse files Browse the repository at this point in the history
v0.5.0 Pre-Release 1
  • Loading branch information
SeedSigner authored Mar 2, 2022
2 parents aed3c48 + 8b4d1ab commit 47fc38c
Show file tree
Hide file tree
Showing 82 changed files with 7,928 additions and 3,557 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
__pycache__/
src/seedsigner.egg-info/
.nova
.vscode
src/seedsigner/models/settings_definition.json
21 changes: 21 additions & 0 deletions docs/code_structure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Code Structure

SeedSigner roughly follows a Model-View-Controller approach. Like in a typical web app (e.g. Flask) the `View`s can be called as needed like individual web urls. After completing display and interaction with the user, the `View` then decides where to route the user next, analogous to a web app returning a `response.redirect(url)`.

The `Controller` then ends up being quite stripped down. For example, there's no need for a web app's `urls.py` since there are no mappings from url to `View` to maintain since we're not actually using a url/http routing approach.

`View`s have to handle user interaction so there are `while True` loops that cycle between waiting for user input, gathering data, and then updating the UI components accordingly. You wouldn't find this kind of cycle in a web app because this sort of interactive user input is handled in the browser at the html/css/js level.



* `Model`s: Store the persistent settings, the in-memory seeds, current wallet information, etc.
* `Controller`: Manages the state of the world and controls access to global resources.
* `View`s: Implementation of each screen. Prepares relevant data for display. Must also instantiate the display objects that will actually render the UI.
* `gui.screens`: Re-usable formatted UI renderers.
* `gui.components`: Basic individual UI elements that are used by the `templates` such as the top nav, buttons, button lists, text displays.

In an typical webserver context the `View` would send data to an html template (e.g. Jinja) which would then dynamically populate the page with html elements like `<input>`, `<button>`, `<img>`, etc. This is analgous to our `gui.screens` constructing a UI renderer by piecing together various `gui.components` as needed.



`Controller` is a global singleton that any `View` can access and update as needed.
67 changes: 67 additions & 0 deletions docs/feature_roadmap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Feature Roadmap

Current focus: v0.5.0 preview releases.

*Note: It may or may not make sense to do minor bugfix preview releases along the way (e.g. 1.0 -> 1.1).*


## v0.5.0 Pre-Release 1.x
* Scan SeedQR / CompactSeedQR
* Add/Edit passphrase
* View seed words w/configurable warnings
* Export xpub w/configurable warnings and flow determined by Settings
* Scan PSBT
* Full PSBT review screens
* "Full Spend" (no change) warning
* Fully verify PSBT change addrs
* Send signed PSBT via QR
* QR display dimming/brightness UP/DOWN
* Subset of configurable Settings; persistent Settings storage
* SettingsQR integration proof-of-concept

Screens will be functional but not necessarily in their final presentation state (icons, text, positioning, etc).


## v0.5.0 Pre-Release 2.x
* Existing screen refinement (visual presentation, text, etc)
* Create new seed via image entropy
* Manual mnemonic seed word entry
* 12th/24th word calc
* SeedQR/CompactSeedQR manual transcription UI w/configurable UI style (dots vs grid)
* Single sig address scan and verification
* SettingsQR standalone UI refinement
* Fix broken tests
* All GUI Components support scrollable Screens


## v0.5.0 Pre-Release 3.x
* Further existing screen refinement
* "Final" bugfixes
* Create new seed via dice rolls
* Custom derivation paths in xpub export flow
* QR display dimming/brightness, framerate, density(?) controls in transparent overlay
* HRF partner logo on startup
* Improve test suite coverage


## Initial v0.5.0 Release
All of the above!


## Beyond v0.5.0
These features will not be included in the initial v0.5.0 release and will have varying degrees of priority for subsequent releases (or possibly not at all).

* Multisig wallet descriptor QR scan(?) and addr verification(?)
* Multi-language support (Transifex free for open source projects)
* Multisig: sign PSBT with multiple keys at once.
* Custom OS, possibly with swappable SD card PSBT and multisig wallet descriptor storage
* Decoy game mode at launch (Snake, Tetris, Sudoku...?)
* BIP-39 wordlists in additional languages
* Address message signing
* UI color scheme customization


# v0.6 and Beyond...?
* Alternate hardware profile / touchscreen
* PGP signer
* Liquid?
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="seedsigner",
version="0.4.4",
version="0.5.0",
author="SeedSigner",
author_email="[email protected]",
description="Build an offline, airgapped Bitcoin signing device for less than $50!",
Expand Down
16 changes: 0 additions & 16 deletions src/default_settings.ini

This file was deleted.

14 changes: 1 addition & 13 deletions src/main.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
import configparser
import sys
import time

from seedsigner.controller import Controller


config = configparser.ConfigParser()
config.read("settings.ini")

# One-time setup to intialize the one and only Controller
Controller.configure_instance(config)

# Get the one and only Controller instance and start our main loop
controller = Controller.get_instance()
controller.start()
Controller.get_instance().start()
1 change: 1 addition & 0 deletions src/seedsigner/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .controller import Controller
6 changes: 4 additions & 2 deletions src/seedsigner/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

from picamera import PiCamera
from PIL import Image
from seedsigner.helpers import PiVideoStream, Singleton
from seedsigner.models import Singleton
from seedsigner.helpers import PiVideoStream
from seedsigner.models.settings import SettingsConstants



Expand All @@ -18,7 +20,7 @@ def get_instance(cls):
from seedsigner.models import Settings
if cls._instance is None:
cls._instance = cls.__new__(cls)
cls._instance._camera_rotation = Settings.get_instance().camera_rotation
cls._instance._camera_rotation = int(Settings.get_instance().get_value(SettingsConstants.SETTING__CAMERA_ROTATION))
return cls._instance


Expand Down
Loading

0 comments on commit 47fc38c

Please sign in to comment.