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 = [
('standard', _("Standard wallet")),
('2fa', _("Wallet with two-factor authentication")),
('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]
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):
v = lambda x: keystore.is_address_list(x) or keystore.is_private_key_list(x)
title = _("Import Bitcoin Addresses")
message = _("Enter a list of Bitcoin addresses (this will create a watching-only wallet), or a list of private keys.")
title = _("Import FLO Addresses")
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,
is_valid=v, allow_multi=True, show_wif_help=True)
@ -554,14 +553,10 @@ class BaseWizard(object):
title = _('Choose Seed type')
if message is None:
message = ' '.join([
_("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.")
_("The type of addresses used by your wallet will depend on your seed.")
])
if choices is None:
choices = [
('create_segwit_seed', _('Segwit')),
('create_standard_seed', _('Legacy')),
]
self.choice_dialog(title=title, message=message, choices=choices, run_next=self.run)

View File

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

View File

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

View File

@ -165,20 +165,20 @@ class ScannerAndroid(NFCBase):
def create_AAR(self):
'''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):
'''Create our actual payload record.
'''
if BUILDVERSION >= 14:
domain = "org.electrum"
domain = "org.electrum_flo"
stype = "externalType"
extRecord = NdefRecord.createExternal(domain, stype, data)
else:
# Creating the NdefRecord manually:
extRecord = NdefRecord(
NdefRecord.TNF_EXTERNAL_TYPE,
"org.electrum:externalType",
"org.electrum_flo:externalType",
'',
data)
return extRecord
@ -213,7 +213,7 @@ class ScannerAndroid(NFCBase):
# Create record
ndef_record = NdefRecord(
NdefRecord.TNF_MIME_MEDIA,
'org.electrum.kivy', '', data)
'org.electrum_flo.kivy', '', data)
# Create message
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]
# (str) Title of your application
title = Electrum
title = FLO-Electrum
# (str) Package name
package.name = Electrum
# (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
source.dir = .

View File

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

View File

@ -1,7 +1,7 @@
#:import VERSION electrum.version.ELECTRUM_VERSION
Popup:
title: _("About Electrum")
title: _("About FLO-Electrum")
BoxLayout:
orientation: 'vertical'
spacing: '10dp'
@ -26,19 +26,25 @@ Popup:
size_hint_x: 0.4
TopLabel:
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:
import webbrowser
webbrowser.open("https://electrum.org")
webbrowser.open("https://github.com/ranchimall/flo-electrum")
size_hint_x: 0.6
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
TopLabel:
text: '\n'.join(['Thomas Voegtlin', 'Neil Booth', 'Akshay Arora'])
size_hint_x: 0.6
TopLabel:
text: _('Distributed by Electrum Technologies GmbH')
text: _('Developed by Ranchi Mall FLO Blockchain Contract')
padding: '0dp', '20dp'
Widget:
size_hint: None, 0.5

View File

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

View File

@ -4,5 +4,11 @@
"s": "50002",
"t": "50001",
"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)
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
self.requested_addrs.add(addr)
await self.add_queue.put(addr)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 26 KiB