Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
changed onboarding order, fixed label in transaction overview, update…
Browse files Browse the repository at this point in the history
…d electum server presets
  • Loading branch information
xavierfiechter committed Apr 1, 2024
1 parent 4bd368b commit 694b10a
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 54 deletions.
76 changes: 38 additions & 38 deletions src/brainbow.kv
Original file line number Diff line number Diff line change
Expand Up @@ -357,83 +357,83 @@ MDScreen:
halign: "center"
on_release: app.goto_slide('login')

# ----------------------------------------------------------
# ---
MDFloatLayout:
id: startup_my_electrum
name: "startup_my_electrum"
name: "testnet_or_not"
Image:
source: "assets/dark-btc-own-node.png"
source: "assets/dark-playground.png"
pos_hint: {"center_x": .5, "center_y": .7}
size_hint: .66, .66
#size_hint: .42, .42
MDLabel:
text: "[b]Electrum Server[/b]"
text: "[b]Testnet Playground[/b]"
markup: True
pos_hint: {"center_y": .485}
halign: "center"
font_size: "25sp"
color: rgba(1, 3, 23, 225)
MDTextField:
size_hint_x: 0.85
id: dropdown_electrum_field
hint_text: "<protocol>://<hostname>:<port>"
color_mode: "accent"
write_tab: False
required: False
pos_hint: {"center_x": .5, "center_y": .38}
font_size: '21sp'
on_text: app.validate_electrum_settings()
on_text: if self.focus: app.electrum_select.dismiss()
on_focus: if self.focus: app.electrum_select.open()
MDSwitch:
active: True
size_hint: None, None
size: "48dp", "48dp"
pos_hint: {"center_x": .5, "center_y": .4}
on_active: app.testnet_on_off_switch(*args)
MDLabel:
margin: "8dp"
pos_hint: {"center_y": .22}
pos_hint: {"center_y": .225}
opacity: 0.95
halign: 'center'
font_size: '16sp'
text: "Brainbow connects to the given Electrum Server.\n\nWhen using a preset, Brainbow connects to a\npublic server that can view your transactions."
text: "By disabling 'Testnet', Brainbow will\noperate using valuable bitcoin and\nconnect to the Bitcoin mainnet.\nThis is still early BETA software.\nTerms of Service: https://brainbow.space\n\nDon't be reckless!"
MDTextButton:
text: "SKIP AND CONNECT TO BITCOIN"
font_size: '18sp'
pos_hint: {"center_x": .5, "center_y": .081}
halign: "center"
on_release: app.goto_slide('login')
# ------------------

# ----------------------------------------------------------
MDFloatLayout:
name: "testnet_or_not"
id: startup_my_electrum
name: "startup_my_electrum"
Image:
source: "assets/dark-playground.png"
source: "assets/dark-btc-own-node.png"
pos_hint: {"center_x": .5, "center_y": .7}
size_hint: .66, .66
#size_hint: .42, .42
MDLabel:
text: "[b]Testnet Playground[/b]"
text: "[b]Electrum Server[/b]"
markup: True
pos_hint: {"center_y": .485}
halign: "center"
font_size: "25sp"
color: rgba(1, 3, 23, 225)
MDSwitch:
active: True
size_hint: None, None
size: "48dp", "48dp"
pos_hint: {"center_x": .5, "center_y": .4}
on_active: app.testnet_on_off_switch(*args)
MDTextField:
size_hint_x: 0.85
id: dropdown_electrum_field
hint_text: "<protocol>://<hostname>:<port>"
color_mode: "accent"
write_tab: False
required: False
pos_hint: {"center_x": .5, "center_y": .38}
font_size: '21sp'
on_text: app.validate_electrum_settings()
on_text: if self.focus: app.electrum_select.dismiss()
on_focus: if self.focus: app.electrum_select.open()
MDLabel:
margin: "8dp"
pos_hint: {"center_y": .225}
pos_hint: {"center_y": .22}
opacity: 0.95
halign: 'center'
font_size: '16sp'
text: "By disabling 'Testnet', Brainbow will\noperate using valuable bitcoin and\nconnect to the Bitcoin mainnet.\nThis is still early BETA software.\nTerms of Service: https://brainbow.space\n\nDon't be reckless!"
text: "Brainbow connects to the given Electrum Server.\n\nWhen using a preset, Brainbow connects to a\npublic server that can view your transactions."
MDTextButton:
text: "SKIP AND CONNECT TO BITCOIN"
font_size: '18sp'
pos_hint: {"center_x": .5, "center_y": .081}
halign: "center"
on_release: app.goto_slide('login')

# ------------------

MDFloatLayout:
Expand Down Expand Up @@ -1377,12 +1377,6 @@ MDScreen:
#MDNavigationDrawerItem:
# icon: "toggle-switch-off"
# text: "Offline Mode"
MDNavigationDrawerItem:
text_color: "#c9c9c9"
selected_color: [0.97, 0.58, 0.10, 1.0]
icon: "toggle-switch-off"
text: "Private Electrum Server"
on_release: app.goto_slide('startup_my_electrum')
MDNavigationDrawerItem:
text_color: "#c9c9c9"
selected_color: [0.97, 0.58, 0.10, 1.0]
Expand All @@ -1395,6 +1389,12 @@ MDScreen:
icon: "toggle-switch-off"
text: "Offline Mode"
on_release: app.goto_slide('offline_or_not')
MDNavigationDrawerItem:
text_color: "#c9c9c9"
selected_color: [0.97, 0.58, 0.10, 1.0]
icon: "toggle-switch-off"
text: "Private Electrum Server"
on_release: app.goto_slide('startup_my_electrum')
MDNavigationDrawerItem:
text_color: "#c9c9c9"
selected_color: [0.97, 0.58, 0.10, 1.0]
Expand Down
23 changes: 7 additions & 16 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@

top_blk = {'height', 0}

__version__ = "0.1.150"
__version__ = "0.1.151"

if platform == "android":
Window.softinput_mode = "below_target"
Expand Down Expand Up @@ -316,8 +316,9 @@ def __init__(self, loop):
]
self.electrum_server_presets_mainnet = [
#"ssl://electrum.blockstream.info:50002", Disconnects after a few seconds..
"ssl://bitcoin.lu.ke:50002",
#"ssl://bitcoin.lu.ke:50002",
"ssl://electrum.emzy.de:50002",
"ssl://fulcrum.sethforprivacy.com:50002",
"ssl://electrum.bitaroo.net:50002",
]
#TODO: when switching to mainnet instead of testnet
Expand Down Expand Up @@ -591,9 +592,11 @@ def testnet_on_off_switch(self, switch, on_off):
if self._wallet_ready is False:
if on_off:
self.chain = nowallet.TBTC
self.units = "TBTC"
self.electrum_server_presets = self.electrum_server_presets_testnet
else:
self.chain = nowallet.BTC
self.units = "BTC"
self.electrum_server_presets = self.electrum_server_presets_mainnet
self.set_electrum_preset_chooser()

Expand Down Expand Up @@ -1623,12 +1626,6 @@ def display_offline_message(self, is_offline, tab_id, message):
else:
self.root.ids[tab_id].opacity = 1







def update_balance_screen(self):
if self.is_offline_mode:
self.display_offline_message(True, 'main_tabs_balance', self.n_a_offline_mode_msg)
Expand Down Expand Up @@ -1982,25 +1979,19 @@ def build(self):
android_setflag()

self.is_darkmode = True # Force dark mode for all

# Theme settings
self.theme_cls.material_style = "M2"
if self.is_darkmode:
self.theme_cls.theme_style = "Dark"
else:
self.theme_cls.theme_style = "Light"
#self.theme_cls.primary_hue = "200" # "500"
#self.theme_cls.secondary_palette = "Red"
#self.theme_cls.primary_hue = "200" # "500"
#self.theme_cls.theme_style_switch_animation = True
#self.theme_cls.theme_style_switch_animation_duration = 0.8

self.drawer_bg_color = self.root.ids.nav_drawer.md_bg_color
self.use_kivy_settings = False
self.rbf = self.config.getboolean("brainbow", "rbf")
self.units = self.config.get("brainbow", "units")
print(self.config.get("brainbow", "units"))
self.update_unit()
self.currency = "BTC"# disable by default self.config.get("brainbow", "currency")
self.currency = "BTC" # disable by default self.config.get("brainbow", "currency")
self._hide_fiat_fields()
self.explorer = self.config.get("brainbow", "explorer")

Expand Down

0 comments on commit 694b10a

Please sign in to comment.