GUI and unique identification for packaging

This commit is contained in:
Vivek Teega 2019-01-30 13:38:16 +00:00
parent eb418f1d3e
commit e89ec0d1d5
13 changed files with 39 additions and 32 deletions

View File

@ -108,9 +108,8 @@ class BaseWizard(object):
]) ])
wallet_kinds = [ wallet_kinds = [
('standard', _("Standard wallet")), ('standard', _("Standard wallet")),
('2fa', _("Wallet with two-factor authentication")),
('multisig', _("Multi-signature wallet")), ('multisig', _("Multi-signature wallet")),
('imported', _("Import Bitcoin addresses or private keys")), ('imported', _("Import FLO addresses or private keys")),
] ]
choices = [pair for pair in wallet_kinds if pair[0] in wallet_types] choices = [pair for pair in wallet_kinds if pair[0] in wallet_types]
self.choice_dialog(title=title, message=message, choices=choices, run_next=self.on_wallet_type) self.choice_dialog(title=title, message=message, choices=choices, run_next=self.on_wallet_type)
@ -183,8 +182,8 @@ class BaseWizard(object):
def import_addresses_or_keys(self): def import_addresses_or_keys(self):
v = lambda x: keystore.is_address_list(x) or keystore.is_private_key_list(x) v = lambda x: keystore.is_address_list(x) or keystore.is_private_key_list(x)
title = _("Import Bitcoin Addresses") title = _("Import FLO Addresses")
message = _("Enter a list of Bitcoin addresses (this will create a watching-only wallet), or a list of private keys.") message = _("Enter a list of FLO addresses (this will create a watching-only wallet), or a list of private keys.")
self.add_xpub_dialog(title=title, message=message, run_next=self.on_import, self.add_xpub_dialog(title=title, message=message, run_next=self.on_import,
is_valid=v, allow_multi=True, show_wif_help=True) is_valid=v, allow_multi=True, show_wif_help=True)
@ -554,14 +553,10 @@ class BaseWizard(object):
title = _('Choose Seed type') title = _('Choose Seed type')
if message is None: if message is None:
message = ' '.join([ message = ' '.join([
_("The type of addresses used by your wallet will depend on your seed."), _("The type of addresses used by your wallet will depend on your seed.")
_("Segwit wallets use bech32 addresses, defined in BIP173."),
_("Please note that websites and other wallets may not support these addresses yet."),
_("Thus, you might want to keep using a non-segwit wallet in order to be able to receive bitcoins during the transition period.")
]) ])
if choices is None: if choices is None:
choices = [ choices = [
('create_segwit_seed', _('Segwit')),
('create_standard_seed', _('Legacy')), ('create_standard_seed', _('Legacy')),
] ]
self.choice_dialog(title=title, message=message, choices=choices, run_next=self.run) self.choice_dialog(title=title, message=message, choices=choices, run_next=self.run)

View File

@ -267,7 +267,7 @@ class Blockchain(util.PrintError):
@classmethod @classmethod
def verify_header(cls, header: dict, prev_hash: str, target: int, expected_header_hash: str=None) -> None: def verify_header(cls, header: dict, prev_hash: str, target: int, expected_header_hash: str=None) -> None:
_hash = hash_header(header) _hash = hash_header(header)
_powhash = pow_hash_header(header) #_powhash = pow_hash_header(header)
if expected_header_hash and expected_header_hash != _hash: if expected_header_hash and expected_header_hash != _hash:
raise Exception("hash mismatches with expected: {} vs {}".format(expected_header_hash, _hash)) raise Exception("hash mismatches with expected: {} vs {}".format(expected_header_hash, _hash))
if prev_hash != header.get('prev_block_hash'): if prev_hash != header.get('prev_block_hash'):
@ -279,9 +279,9 @@ class Blockchain(util.PrintError):
if bits != header.get('bits'): if bits != header.get('bits'):
raise Exception("bits mismatch: %s vs %s" % (bits, header.get('bits'))) raise Exception("bits mismatch: %s vs %s" % (bits, header.get('bits')))
block_hash_as_num = int.from_bytes(bfh(_hash), byteorder='big') block_hash_as_num = int.from_bytes(bfh(_hash), byteorder='big')
target_val = cls.bits_to_target(bits) #target_val = cls.bits_to_target(bits)
if int('0x' + _powhash, 16) > target_val: #if int('0x' + _powhash, 16) > target_val:
raise Exception("insufficient proof of work: %s vs target %s" % (int('0x' + _hash, 16), target_val)) # raise Exception("insufficient proof of work: %s vs target %s" % (int('0x' + _hash, 16), target_val))
def verify_chunk(self, index: int, data: bytes) -> None: def verify_chunk(self, index: int, data: bytes) -> None:
num = len(data) // HEADER_SIZE num = len(data) // HEADER_SIZE

View File

@ -291,7 +291,7 @@
pos: self.pos pos: self.pos
<ClickableLabel@ButtonBehavior+Label>: <ClickableLabel@ButtonBehavior+Label>:
padding: '5dp', '5dp' padding: '10dp', '10dp'
text_color: self.foreground_color text_color: self.foreground_color
disabled_color: 1, 1, 1, 1 disabled_color: 1, 1, 1, 1
foreground_color: 1, 1, 1, 1 foreground_color: 1, 1, 1, 1

View File

@ -165,20 +165,20 @@ class ScannerAndroid(NFCBase):
def create_AAR(self): def create_AAR(self):
'''Create the record responsible for linking our application to the tag. '''Create the record responsible for linking our application to the tag.
''' '''
return NdefRecord.createApplicationRecord(JString("org.electrum.kivy")) return NdefRecord.createApplicationRecord(JString("org.electrum_flo.kivy"))
def create_TNF_EXTERNAL(self, data): def create_TNF_EXTERNAL(self, data):
'''Create our actual payload record. '''Create our actual payload record.
''' '''
if BUILDVERSION >= 14: if BUILDVERSION >= 14:
domain = "org.electrum" domain = "org.electrum_flo"
stype = "externalType" stype = "externalType"
extRecord = NdefRecord.createExternal(domain, stype, data) extRecord = NdefRecord.createExternal(domain, stype, data)
else: else:
# Creating the NdefRecord manually: # Creating the NdefRecord manually:
extRecord = NdefRecord( extRecord = NdefRecord(
NdefRecord.TNF_EXTERNAL_TYPE, NdefRecord.TNF_EXTERNAL_TYPE,
"org.electrum:externalType", "org.electrum_flo:externalType",
'', '',
data) data)
return extRecord return extRecord
@ -213,7 +213,7 @@ class ScannerAndroid(NFCBase):
# Create record # Create record
ndef_record = NdefRecord( ndef_record = NdefRecord(
NdefRecord.TNF_MIME_MEDIA, NdefRecord.TNF_MIME_MEDIA,
'org.electrum.kivy', '', data) 'org.electrum_flo.kivy', '', data)
# Create message # Create message
ndef_message = NdefMessage([ndef_record]) ndef_message = NdefMessage([ndef_record])

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View File

@ -1,13 +1,13 @@
[app] [app]
# (str) Title of your application # (str) Title of your application
title = Electrum title = FLO-Electrum
# (str) Package name # (str) Package name
package.name = Electrum package.name = Electrum
# (str) Package domain (needed for android/ios packaging) # (str) Package domain (needed for android/ios packaging)
package.domain = org.electrum package.domain = org.electrum_flo
# (str) Source code where the main.py live # (str) Source code where the main.py live
source.dir = . source.dir = .

View File

@ -20,7 +20,7 @@ Builder.load_string('''
padding: '5dp' padding: '5dp'
size_hint: 1, 1 size_hint: 1, 1
height: '27dp' height: '27dp'
max_characters: 527 max_characters: 1022
pos_hint: {'center_y':.5} pos_hint: {'center_y':.5}
text:'' text:''
multiline: True multiline: True

View File

@ -1,7 +1,7 @@
#:import VERSION electrum.version.ELECTRUM_VERSION #:import VERSION electrum.version.ELECTRUM_VERSION
Popup: Popup:
title: _("About Electrum") title: _("About FLO-Electrum")
BoxLayout: BoxLayout:
orientation: 'vertical' orientation: 'vertical'
spacing: '10dp' spacing: '10dp'
@ -26,19 +26,25 @@ Popup:
size_hint_x: 0.4 size_hint_x: 0.4
TopLabel: TopLabel:
markup: True markup: True
text: '[color=6666ff][ref=x]https://electrum.org[/ref][/color]' text: '[color=6666ff][ref=x]Ranchi Mall Github[/ref][/color]'
on_ref_press: on_ref_press:
import webbrowser import webbrowser
webbrowser.open("https://electrum.org") webbrowser.open("https://github.com/ranchimall/flo-electrum")
size_hint_x: 0.6 size_hint_x: 0.6
TopLabel: TopLabel:
text: _('Developers') text: _('FLO-Electrum Developers')
size_hint_x: 0.4
TopLabel:
text: '\n'.join(['Vivek Teega', 'Bitspill', 'Rohit Tripathy', 'Akhil Bharti'])
size_hint_x: 0.6
TopLabel:
text: _('BTC-Electrum Developers')
size_hint_x: 0.4 size_hint_x: 0.4
TopLabel: TopLabel:
text: '\n'.join(['Thomas Voegtlin', 'Neil Booth', 'Akshay Arora']) text: '\n'.join(['Thomas Voegtlin', 'Neil Booth', 'Akshay Arora'])
size_hint_x: 0.6 size_hint_x: 0.6
TopLabel: TopLabel:
text: _('Distributed by Electrum Technologies GmbH') text: _('Developed by Ranchi Mall FLO Blockchain Contract')
padding: '0dp', '20dp' padding: '0dp', '20dp'
Widget: Widget:
size_hint: None, 0.5 size_hint: None, 0.5

View File

@ -101,17 +101,17 @@ SendScreen:
height: dp(84) height: dp(84)
spacing: '5dp' spacing: '5dp'
Image: Image:
source: 'atlas://electrum/gui/kivy/theming/light/star_big_inactive' source: 'atlas://electrum/gui/kivy/theming/light/page-pen'
opacity: 0.7 opacity: 0.7
size_hint: None, None size_hint: None, None
size: '22dp', '22dp' size: '22dp', '22dp'
pos_hint: {'center_y': .5} pos_hint: {'center_y': .5}
ScrollView: ScrollView:
ClickableLabel: ClickableLabel:
text: s.flodata if s.flodata else (_('No FLO data') if root.is_pr else _(' FLO Data')) text: s.flodata if s.flodata else (_('No FLO data') if root.is_pr else _('FLO data'))
text_size: self.width, None text_size: (self.width, None) if s.flodata else (self.width,self.height/2)
size_hint_y: None size_hint_y: None if s.flodata else 1
height: max(self.height, self.texture_size[1]) height: max(dp(82), self.texture_size[1])
on_release: Clock.schedule_once(lambda dt: app.flodata_dialog(s)) on_release: Clock.schedule_once(lambda dt: app.flodata_dialog(s))
BoxLayout: BoxLayout:
size_hint: 1, None size_hint: 1, None

View File

@ -4,5 +4,11 @@
"s": "50002", "s": "50002",
"t": "50001", "t": "50001",
"version": "1.4" "version": "1.4"
},
"ranchimall1.duckdns.org": {
"pruning": "-",
"s": "50002",
"t": "50001",
"version": "1.4"
} }
} }

View File

@ -78,7 +78,7 @@ class SynchronizerBase(NetworkJobOnDefaultServer):
asyncio.run_coroutine_threadsafe(self._add_address(addr), self.asyncio_loop) asyncio.run_coroutine_threadsafe(self._add_address(addr), self.asyncio_loop)
async def _add_address(self, addr: str): async def _add_address(self, addr: str):
if not is_address(addr): raise ValueError(f"invalid bitcoin address {addr}") if not is_address(addr): raise ValueError(f"invalid FLO address {addr}")
if addr in self.requested_addrs: return if addr in self.requested_addrs: return
self.requested_addrs.add(addr) self.requested_addrs.add(addr)
await self.add_queue.put(addr) await self.add_queue.put(addr)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 26 KiB