Zcash changes to gui/kivy
This commit is contained in:
parent
e77f58d815
commit
fe602c2499
|
@ -20,3 +20,8 @@ bin/
|
|||
# tox files
|
||||
.cache/
|
||||
.coverage
|
||||
|
||||
electrum_data/
|
||||
gui/kivy/theming/light-0.png
|
||||
gui/kivy/theming/light.atlas
|
||||
Electrum_DASH.egg-info/
|
||||
|
|
|
@ -35,7 +35,7 @@ class _(str):
|
|||
@staticmethod
|
||||
def switch_lang(lang):
|
||||
# get the right locales directory, and instanciate a gettext
|
||||
from electrum.i18n import LOCALE_DIR
|
||||
from electrum_zcash.i18n import LOCALE_DIR
|
||||
locales = gettext.translation('electrum', LOCALE_DIR, languages=[lang], fallback=True)
|
||||
_.lang = locales.gettext
|
||||
for label in _.observers:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#:import Clock kivy.clock.Clock
|
||||
#:import Window kivy.core.window.Window
|
||||
#:import Factory kivy.factory.Factory
|
||||
#:import _ electrum_gui.kivy.i18n._
|
||||
#:import _ electrum_zcash_gui.kivy.i18n._
|
||||
|
||||
|
||||
###########################
|
||||
|
|
|
@ -7,15 +7,15 @@ import traceback
|
|||
from decimal import Decimal
|
||||
import threading
|
||||
|
||||
import electrum
|
||||
from electrum.bitcoin import TYPE_ADDRESS
|
||||
from electrum import WalletStorage, Wallet
|
||||
from electrum_gui.kivy.i18n import _
|
||||
from electrum.paymentrequest import InvoiceStore
|
||||
from electrum.util import profiler, InvalidPassword
|
||||
from electrum.plugins import run_hook
|
||||
from electrum.util import format_satoshis, format_satoshis_plain
|
||||
from electrum.paymentrequest import PR_UNPAID, PR_PAID, PR_UNKNOWN, PR_EXPIRED
|
||||
import electrum_zcash
|
||||
from electrum_zcash.bitcoin import TYPE_ADDRESS
|
||||
from electrum_zcash import WalletStorage, Wallet
|
||||
from electrum_zcash_gui.kivy.i18n import _
|
||||
from electrum_zcash.paymentrequest import InvoiceStore
|
||||
from electrum_zcash.util import profiler, InvalidPassword
|
||||
from electrum_zcash.plugins import run_hook
|
||||
from electrum_zcash.util import format_satoshis, format_satoshis_plain
|
||||
from electrum_zcash.paymentrequest import PR_UNPAID, PR_PAID, PR_UNKNOWN, PR_EXPIRED
|
||||
|
||||
from kivy.app import App
|
||||
from kivy.core.window import Window
|
||||
|
@ -30,10 +30,10 @@ from kivy.metrics import inch
|
|||
from kivy.lang import Builder
|
||||
|
||||
## lazy imports for factory so that widgets can be used in kv
|
||||
#Factory.register('InstallWizard', module='electrum_gui.kivy.uix.dialogs.installwizard')
|
||||
#Factory.register('InfoBubble', module='electrum_gui.kivy.uix.dialogs')
|
||||
#Factory.register('OutputList', module='electrum_gui.kivy.uix.dialogs')
|
||||
#Factory.register('OutputItem', module='electrum_gui.kivy.uix.dialogs')
|
||||
#Factory.register('InstallWizard', module='electrum_zcash_gui.kivy.uix.dialogs.installwizard')
|
||||
#Factory.register('InfoBubble', module='electrum_zcash_gui.kivy.uix.dialogs')
|
||||
#Factory.register('OutputList', module='electrum_zcash_gui.kivy.uix.dialogs')
|
||||
#Factory.register('OutputItem', module='electrum_zcash_gui.kivy.uix.dialogs')
|
||||
|
||||
from .uix.dialogs.installwizard import InstallWizard
|
||||
from .uix.dialogs import InfoBubble
|
||||
|
@ -48,14 +48,14 @@ util = False
|
|||
|
||||
# register widget cache for keeping memory down timeout to forever to cache
|
||||
# the data
|
||||
Cache.register('electrum_widgets', timeout=0)
|
||||
Cache.register('electrum_zcash_widgets', timeout=0)
|
||||
|
||||
from kivy.uix.screenmanager import Screen
|
||||
from kivy.uix.tabbedpanel import TabbedPanel
|
||||
from kivy.uix.label import Label
|
||||
from kivy.core.clipboard import Clipboard
|
||||
|
||||
Factory.register('TabbedCarousel', module='electrum_gui.kivy.uix.screens')
|
||||
Factory.register('TabbedCarousel', module='electrum_zcash_gui.kivy.uix.screens')
|
||||
|
||||
# Register fonts without this you won't be able to use bold/italic...
|
||||
# inside markup.
|
||||
|
@ -67,7 +67,7 @@ Label.register('Roboto',
|
|||
'gui/kivy/data/fonts/Roboto-Bold.ttf')
|
||||
|
||||
|
||||
from electrum.util import base_units
|
||||
from electrum_zcash.util import base_units
|
||||
|
||||
|
||||
class ElectrumWindow(App):
|
||||
|
@ -95,7 +95,7 @@ class ElectrumWindow(App):
|
|||
from .uix.dialogs.choice_dialog import ChoiceDialog
|
||||
protocol = 's'
|
||||
def cb2(host):
|
||||
from electrum.bitcoin import NetworkConstants
|
||||
from electrum_zcash.bitcoin import NetworkConstants
|
||||
pp = servers.get(host, NetworkConstants.DEFAULT_PORTS)
|
||||
port = pp.get(protocol, '')
|
||||
popup.ids.host.text = host
|
||||
|
@ -128,7 +128,7 @@ class ElectrumWindow(App):
|
|||
self.send_screen.set_URI(uri)
|
||||
|
||||
def on_new_intent(self, intent):
|
||||
if intent.getScheme() != 'bitcoin':
|
||||
if intent.getScheme() != 'zcash':
|
||||
return
|
||||
uri = intent.getDataString()
|
||||
self.set_URI(uri)
|
||||
|
@ -150,7 +150,7 @@ class ElectrumWindow(App):
|
|||
self._trigger_update_history()
|
||||
|
||||
def _get_bu(self):
|
||||
return self.electrum_config.get('base_unit', 'mBTC')
|
||||
return self.electrum_config.get('base_unit', 'mZEC')
|
||||
|
||||
def _set_bu(self, value):
|
||||
assert value in base_units.keys()
|
||||
|
@ -237,7 +237,7 @@ class ElectrumWindow(App):
|
|||
|
||||
App.__init__(self)#, **kwargs)
|
||||
|
||||
title = _('Electrum App')
|
||||
title = _('Electrum-Zcash App')
|
||||
self.electrum_config = config = kwargs.get('config', None)
|
||||
self.language = config.get('language', 'en')
|
||||
self.network = network = kwargs.get('network', None)
|
||||
|
@ -290,17 +290,17 @@ class ElectrumWindow(App):
|
|||
self.send_screen.do_clear()
|
||||
|
||||
def on_qr(self, data):
|
||||
from electrum.bitcoin import base_decode, is_address
|
||||
from electrum_zcash.bitcoin import base_decode, is_address
|
||||
data = data.strip()
|
||||
if is_address(data):
|
||||
self.set_URI(data)
|
||||
return
|
||||
if data.startswith('bitcoin:'):
|
||||
if data.startswith('zcash:'):
|
||||
self.set_URI(data)
|
||||
return
|
||||
# try to decode transaction
|
||||
from electrum.transaction import Transaction
|
||||
from electrum.util import bh2u
|
||||
from electrum_zcash.transaction import Transaction
|
||||
from electrum_zcash.util import bh2u
|
||||
try:
|
||||
text = bh2u(base_decode(data, None, base=43))
|
||||
tx = Transaction(text)
|
||||
|
@ -337,7 +337,7 @@ class ElectrumWindow(App):
|
|||
self.receive_screen.screen.address = addr
|
||||
|
||||
def show_pr_details(self, req, status, is_invoice):
|
||||
from electrum.util import format_time
|
||||
from electrum_zcash.util import format_time
|
||||
requestor = req.get('requestor')
|
||||
exp = req.get('exp')
|
||||
memo = req.get('memo')
|
||||
|
@ -359,7 +359,7 @@ class ElectrumWindow(App):
|
|||
popup.open()
|
||||
|
||||
def show_addr_details(self, req, status):
|
||||
from electrum.util import format_time
|
||||
from electrum_zcash.util import format_time
|
||||
fund = req.get('fund')
|
||||
isaddr = 'y'
|
||||
popup = Builder.load_file('gui/kivy/uix/ui_screens/invoice.kv')
|
||||
|
@ -440,7 +440,7 @@ class ElectrumWindow(App):
|
|||
self.fiat_unit = self.fx.ccy if self.fx.is_enabled() else ''
|
||||
# default tab
|
||||
self.switch_to('history')
|
||||
# bind intent for bitcoin: URI scheme
|
||||
# bind intent for zcash: URI scheme
|
||||
if platform == 'android':
|
||||
from android import activity
|
||||
from jnius import autoclass
|
||||
|
@ -483,7 +483,7 @@ class ElectrumWindow(App):
|
|||
self.load_wallet(wallet)
|
||||
self.on_resume()
|
||||
else:
|
||||
Logger.debug('Electrum: Wallet not found. Launching install wizard')
|
||||
Logger.debug('Electrum-Zcash: Wallet not found. Launching install wizard')
|
||||
storage = WalletStorage(path)
|
||||
wizard = Factory.InstallWizard(self.electrum_config, storage)
|
||||
wizard.bind(on_wizard_complete=self.on_wizard_complete)
|
||||
|
@ -558,13 +558,13 @@ class ElectrumWindow(App):
|
|||
|
||||
#setup lazy imports for mainscreen
|
||||
Factory.register('AnimatedPopup',
|
||||
module='electrum_gui.kivy.uix.dialogs')
|
||||
module='electrum_zcash_gui.kivy.uix.dialogs')
|
||||
Factory.register('QRCodeWidget',
|
||||
module='electrum_gui.kivy.uix.qrcodewidget')
|
||||
module='electrum_zcash_gui.kivy.uix.qrcodewidget')
|
||||
|
||||
# preload widgets. Remove this if you want to load the widgets on demand
|
||||
#Cache.append('electrum_widgets', 'AnimatedPopup', Factory.AnimatedPopup())
|
||||
#Cache.append('electrum_widgets', 'QRCodeWidget', Factory.QRCodeWidget())
|
||||
#Cache.append('electrum_zcash_widgets', 'AnimatedPopup', Factory.AnimatedPopup())
|
||||
#Cache.append('electrum_zcash_widgets', 'QRCodeWidget', Factory.QRCodeWidget())
|
||||
|
||||
# load and focus the ui
|
||||
self.root.manager = self.root.ids['manager']
|
||||
|
@ -576,7 +576,7 @@ class ElectrumWindow(App):
|
|||
self.receive_screen = None
|
||||
self.requests_screen = None
|
||||
self.address_screen = None
|
||||
self.icon = "icons/electrum.png"
|
||||
self.icon = "icons/electrum-zcash.png"
|
||||
self.tabs = self.root.ids['tabs']
|
||||
|
||||
def update_interfaces(self, dt):
|
||||
|
@ -665,7 +665,7 @@ class ElectrumWindow(App):
|
|||
from plyer import notification
|
||||
icon = (os.path.dirname(os.path.realpath(__file__))
|
||||
+ '/../../' + self.icon)
|
||||
notification.notify('Electrum', message,
|
||||
notification.notify('Electrum-Zcash', message,
|
||||
app_icon=icon, app_name='Electrum')
|
||||
except ImportError:
|
||||
Logger.Error('Notification: needs plyer; `sudo pip install plyer`')
|
||||
|
|
|
@ -41,4 +41,4 @@ class NFCBase(Widget):
|
|||
NFCScanner = core_select_lib('nfc_manager', (
|
||||
# keep the dummy implementtation as the last one to make it the fallback provider.NFCScanner = core_select_lib('nfc_scanner', (
|
||||
('android', 'scanner_android', 'ScannerAndroid'),
|
||||
('dummy', 'scanner_dummy', 'ScannerDummy')), True, 'electrum_gui.kivy')
|
||||
('dummy', 'scanner_dummy', 'ScannerDummy')), True, 'electrum_zcash_gui.kivy')
|
||||
|
|
|
@ -10,7 +10,7 @@ if platform != 'android':
|
|||
raise ImportError
|
||||
import threading
|
||||
|
||||
from electrum_gui.kivy.nfc_scanner import NFCBase
|
||||
from electrum_zcash_gui.kivy.nfc_scanner import NFCBase
|
||||
from jnius import autoclass, cast
|
||||
from android.runnable import run_on_ui_thread
|
||||
from android import activity
|
||||
|
@ -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-zcash.kivy"))
|
||||
|
||||
def create_TNF_EXTERNAL(self, data):
|
||||
'''Create our actual payload record.
|
||||
'''
|
||||
if BUILDVERSION >= 14:
|
||||
domain = "org.electrum"
|
||||
domain = "org.electrum-zcash"
|
||||
stype = "externalType"
|
||||
extRecord = NdefRecord.createExternal(domain, stype, data)
|
||||
else:
|
||||
# Creating the NdefRecord manually:
|
||||
extRecord = NdefRecord(
|
||||
NdefRecord.TNF_EXTERNAL_TYPE,
|
||||
"org.electrum:externalType",
|
||||
"org.electrum-zcash: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-zcash.kivy', '', data)
|
||||
|
||||
# Create message
|
||||
ndef_message = NdefMessage([ndef_record])
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
''' Dummy NFC Provider to be used on desktops in case no other provider is found
|
||||
'''
|
||||
from electrum_gui.kivy.nfc_scanner import NFCBase
|
||||
from electrum_zcash_gui.kivy.nfc_scanner import NFCBase
|
||||
from kivy.clock import Clock
|
||||
from kivy.logger import Logger
|
||||
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
<action android:name="android.nfc.action.NDEF_DISCOVERED"/>
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="bitcoin" />
|
||||
<data android:scheme="zcash" />
|
||||
</intent-filter>
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
[app]
|
||||
|
||||
# (str) Title of your application
|
||||
title = Electrum
|
||||
title = Electrum-Zcash
|
||||
|
||||
# (str) Package name
|
||||
package.name = Electrum
|
||||
package.name = Electrum-Zcash
|
||||
|
||||
# (str) Package domain (needed for android/ios packaging)
|
||||
package.domain = org.electrum
|
||||
package.domain = org.electrum-zcash
|
||||
|
||||
# (str) Source code where the main.py live
|
||||
source.dir = .
|
||||
|
|
|
@ -8,7 +8,7 @@ from kivy.lang import Builder
|
|||
from kivy.factory import Factory
|
||||
from kivy.clock import Clock
|
||||
|
||||
from electrum_gui.kivy.i18n import _
|
||||
from electrum_zcash_gui.kivy.i18n import _
|
||||
|
||||
Builder.load_string('''
|
||||
<MenuItem@Button>
|
||||
|
|
|
@ -4,7 +4,7 @@ from kivy.factory import Factory
|
|||
from kivy.properties import NumericProperty, StringProperty, BooleanProperty
|
||||
from kivy.core.window import Window
|
||||
|
||||
from electrum_gui.kivy.i18n import _
|
||||
from electrum_zcash_gui.kivy.i18n import _
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -3,8 +3,8 @@ from kivy.factory import Factory
|
|||
from kivy.properties import ObjectProperty
|
||||
from kivy.lang import Builder
|
||||
|
||||
from electrum.util import fee_levels
|
||||
from electrum_gui.kivy.i18n import _
|
||||
from electrum_zcash.util import fee_levels
|
||||
from electrum_zcash_gui.kivy.i18n import _
|
||||
|
||||
Builder.load_string('''
|
||||
<FeeDialog@Popup>
|
||||
|
|
|
@ -66,7 +66,7 @@ from kivy.uix.checkbox import CheckBox
|
|||
from kivy.uix.widget import Widget
|
||||
from kivy.clock import Clock
|
||||
|
||||
from electrum_gui.kivy.i18n import _
|
||||
from electrum_zcash_gui.kivy.i18n import _
|
||||
from functools import partial
|
||||
|
||||
class FxDialog(Factory.Popup):
|
||||
|
|
|
@ -14,7 +14,7 @@ from kivy.core.window import Window
|
|||
from kivy.clock import Clock
|
||||
from kivy.utils import platform
|
||||
|
||||
from electrum.base_wizard import BaseWizard
|
||||
from electrum_zcash.base_wizard import BaseWizard
|
||||
|
||||
|
||||
from . import EventsDialog
|
||||
|
@ -28,7 +28,7 @@ test_xpub = "xpub661MyMwAqRbcEbvVtRRSjqxVnaWVUMewVzMiURAKyYratih4TtBpMypzzefmv8z
|
|||
|
||||
Builder.load_string('''
|
||||
#:import Window kivy.core.window.Window
|
||||
#:import _ electrum_gui.kivy.i18n._
|
||||
#:import _ electrum_zcash_gui.kivy.i18n._
|
||||
|
||||
|
||||
<WizardTextInput@TextInput>
|
||||
|
@ -559,8 +559,8 @@ class RestoreSeedDialog(WizardDialog):
|
|||
def __init__(self, wizard, **kwargs):
|
||||
super(RestoreSeedDialog, self).__init__(wizard, **kwargs)
|
||||
self._test = kwargs['test']
|
||||
from electrum.mnemonic import Mnemonic
|
||||
from electrum.old_mnemonic import words as old_wordlist
|
||||
from electrum_zcash.mnemonic import Mnemonic
|
||||
from electrum_zcash.old_mnemonic import words as old_wordlist
|
||||
self.words = set(Mnemonic('en').wordlist).union(set(old_wordlist))
|
||||
self.ids.text_input_seed.text = test_seed if is_test else ''
|
||||
self.message = _('Please type your seed phrase using the virtual keyboard.')
|
||||
|
|
|
@ -8,7 +8,7 @@ class NFCTransactionDialog(AnimatedPopup):
|
|||
# Delayed Init
|
||||
global NFCSCanner
|
||||
if NFCSCanner is None:
|
||||
from electrum_gui.kivy.nfc_scanner import NFCScanner
|
||||
from electrum_zcash_gui.kivy.nfc_scanner import NFCScanner
|
||||
self.scanner = NFCSCanner
|
||||
|
||||
super(NFCTransactionDialog, self).__init__(**kwargs)
|
||||
|
|
|
@ -2,7 +2,7 @@ from kivy.app import App
|
|||
from kivy.factory import Factory
|
||||
from kivy.lang import Builder
|
||||
|
||||
Factory.register('QRScanner', module='electrum_gui.kivy.qr_scanner')
|
||||
Factory.register('QRScanner', module='electrum_zcash_gui.kivy.qr_scanner')
|
||||
|
||||
class QrScannerDialog(Factory.AnimatedPopup):
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ from kivy.uix.checkbox import CheckBox
|
|||
from kivy.uix.label import Label
|
||||
from kivy.uix.widget import Widget
|
||||
|
||||
from electrum_gui.kivy.i18n import _
|
||||
from electrum_zcash_gui.kivy.i18n import _
|
||||
|
||||
Builder.load_string('''
|
||||
<Question@Popup>
|
||||
|
|
|
@ -3,22 +3,22 @@ from kivy.factory import Factory
|
|||
from kivy.properties import ObjectProperty
|
||||
from kivy.lang import Builder
|
||||
|
||||
from electrum.util import base_units
|
||||
from electrum.i18n import languages
|
||||
from electrum_gui.kivy.i18n import _
|
||||
from electrum.plugins import run_hook
|
||||
from electrum import coinchooser
|
||||
from electrum.util import fee_levels
|
||||
from electrum_zcash.util import base_units
|
||||
from electrum_zcash.i18n import languages
|
||||
from electrum_zcash_gui.kivy.i18n import _
|
||||
from electrum_zcash.plugins import run_hook
|
||||
from electrum_zcash import coinchooser
|
||||
from electrum_zcash.util import fee_levels
|
||||
|
||||
from .choice_dialog import ChoiceDialog
|
||||
|
||||
Builder.load_string('''
|
||||
#:import partial functools.partial
|
||||
#:import _ electrum_gui.kivy.i18n._
|
||||
#:import _ electrum_zcash_gui.kivy.i18n._
|
||||
|
||||
<SettingsDialog@Popup>
|
||||
id: settings
|
||||
title: _('Electrum Settings')
|
||||
title: _('Electrum-Zcash Settings')
|
||||
disable_pin: False
|
||||
use_encryption: False
|
||||
BoxLayout:
|
||||
|
@ -46,13 +46,13 @@ Builder.load_string('''
|
|||
SettingsItem:
|
||||
bu: app.base_unit
|
||||
title: _('Denomination') + ': ' + self.bu
|
||||
description: _("Base unit for Bitcoin amounts.")
|
||||
description: _("Base unit for Zcash amounts.")
|
||||
action: partial(root.unit_dialog, self)
|
||||
CardSeparator
|
||||
SettingsItem:
|
||||
status: root.fee_status()
|
||||
title: _('Fees') + ': ' + self.status
|
||||
description: _("Fees paid to the Bitcoin miners.")
|
||||
description: _("Fees paid to the Zcash miners.")
|
||||
action: partial(root.fee_dialog, self)
|
||||
CardSeparator
|
||||
SettingsItem:
|
||||
|
|
|
@ -5,9 +5,9 @@ from kivy.lang import Builder
|
|||
from kivy.clock import Clock
|
||||
from kivy.uix.label import Label
|
||||
|
||||
from electrum_gui.kivy.i18n import _
|
||||
from electrum_zcash_gui.kivy.i18n import _
|
||||
from datetime import datetime
|
||||
from electrum.util import InvalidPassword
|
||||
from electrum_zcash.util import InvalidPassword
|
||||
|
||||
Builder.load_string('''
|
||||
|
||||
|
@ -144,7 +144,7 @@ class TxDialog(Factory.Popup):
|
|||
self.app.broadcast(self.tx)
|
||||
|
||||
def show_qr(self):
|
||||
from electrum.bitcoin import base_encode, bfh
|
||||
from electrum_zcash.bitcoin import base_encode, bfh
|
||||
text = bfh(str(self.tx))
|
||||
text = base_encode(text, base=43)
|
||||
self.app.qr_dialog(_("Raw Transaction"), text)
|
||||
|
|
|
@ -5,7 +5,7 @@ from kivy.factory import Factory
|
|||
from kivy.properties import ObjectProperty
|
||||
from kivy.lang import Builder
|
||||
|
||||
from electrum.util import base_units
|
||||
from electrum_zcash.util import base_units
|
||||
|
||||
from ...i18n import _
|
||||
from .label_dialog import LabelDialog
|
||||
|
|
|
@ -7,7 +7,7 @@ from kivy.uix.bubble import Bubble, BubbleButton
|
|||
from kivy.properties import ListProperty
|
||||
from kivy.uix.widget import Widget
|
||||
|
||||
from electrum_gui.i18n import _
|
||||
from electrum_zcash_gui.i18n import _
|
||||
|
||||
class ContextMenuItem(Widget):
|
||||
'''abstract class
|
||||
|
|
|
@ -17,15 +17,15 @@ from kivy.lang import Builder
|
|||
from kivy.factory import Factory
|
||||
from kivy.utils import platform
|
||||
|
||||
from electrum.util import profiler, parse_URI, format_time, InvalidPassword, NotEnoughFunds
|
||||
from electrum import bitcoin
|
||||
from electrum.util import timestamp_to_datetime
|
||||
from electrum.paymentrequest import PR_UNPAID, PR_PAID, PR_UNKNOWN, PR_EXPIRED
|
||||
from electrum_zcash.util import profiler, parse_URI, format_time, InvalidPassword, NotEnoughFunds
|
||||
from electrum_zcash import bitcoin
|
||||
from electrum_zcash.util import timestamp_to_datetime
|
||||
from electrum_zcash.paymentrequest import PR_UNPAID, PR_PAID, PR_UNKNOWN, PR_EXPIRED
|
||||
|
||||
from .context_menu import ContextMenu
|
||||
|
||||
|
||||
from electrum_gui.kivy.i18n import _
|
||||
from electrum_zcash_gui.kivy.i18n import _
|
||||
|
||||
class EmptyLabel(Factory.Label):
|
||||
pass
|
||||
|
@ -176,11 +176,11 @@ class SendScreen(CScreen):
|
|||
payment_request = None
|
||||
|
||||
def set_URI(self, text):
|
||||
import electrum
|
||||
import electrum_zcash
|
||||
try:
|
||||
uri = electrum.util.parse_URI(text, self.app.on_pr)
|
||||
uri = electrum_zcash.util.parse_URI(text, self.app.on_pr)
|
||||
except:
|
||||
self.app.show_info(_("Not a Bitcoin URI"))
|
||||
self.app.show_info(_("Not a Zcash URI"))
|
||||
return
|
||||
amount = uri.get('amount')
|
||||
self.screen.address = uri.get('address', '')
|
||||
|
@ -218,7 +218,7 @@ class SendScreen(CScreen):
|
|||
# it sould be already saved
|
||||
return
|
||||
# save address as invoice
|
||||
from electrum.paymentrequest import make_unsigned_request, PaymentRequest
|
||||
from electrum_zcash.paymentrequest import make_unsigned_request, PaymentRequest
|
||||
req = {'address':self.screen.address, 'memo':self.screen.message}
|
||||
amount = self.app.get_amount(self.screen.amount) if self.screen.amount else 0
|
||||
req['amount'] = amount
|
||||
|
@ -250,10 +250,10 @@ class SendScreen(CScreen):
|
|||
else:
|
||||
address = str(self.screen.address)
|
||||
if not address:
|
||||
self.app.show_error(_('Recipient not specified.') + ' ' + _('Please scan a Bitcoin address or a payment request'))
|
||||
self.app.show_error(_('Recipient not specified.') + ' ' + _('Please scan a Zcash address or a payment request'))
|
||||
return
|
||||
if not bitcoin.is_address(address):
|
||||
self.app.show_error(_('Invalid Bitcoin Address') + ':\n' + address)
|
||||
self.app.show_error(_('Invalid Zcash Address') + ':\n' + address)
|
||||
return
|
||||
try:
|
||||
amount = self.app.get_amount(self.screen.amount)
|
||||
|
@ -347,7 +347,7 @@ class ReceiveScreen(CScreen):
|
|||
Clock.schedule_once(lambda dt: self.update_qr())
|
||||
|
||||
def get_URI(self):
|
||||
from electrum.util import create_URI
|
||||
from electrum_zcash.util import create_URI
|
||||
amount = self.screen.amount
|
||||
if amount:
|
||||
a, u = self.screen.amount.split()
|
||||
|
@ -363,7 +363,7 @@ class ReceiveScreen(CScreen):
|
|||
|
||||
def do_share(self):
|
||||
uri = self.get_URI()
|
||||
self.app.do_share(uri, _("Share Bitcoin Request"))
|
||||
self.app.do_share(uri, _("Share Zcash Request"))
|
||||
|
||||
def do_copy(self):
|
||||
uri = self.get_URI()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#:import VERSION electrum.version.ELECTRUM_VERSION
|
||||
#:import VERSION electrum_zcash.version.ELECTRUM_VERSION
|
||||
|
||||
Popup:
|
||||
title: _("About Electrum")
|
||||
title: _("About Electrum-Zcash")
|
||||
BoxLayout:
|
||||
orientation: 'vertical'
|
||||
spacing: '10dp'
|
||||
|
@ -26,10 +26,10 @@ Popup:
|
|||
size_hint_x: 0.4
|
||||
TopLabel:
|
||||
markup: True
|
||||
text: '[color=6666ff][ref=x]https://electrum.org[/ref][/color]'
|
||||
text: '[color=6666ff][ref=x]https://electrum-zcash.org[/ref][/color]'
|
||||
on_ref_press:
|
||||
import webbrowser
|
||||
webbrowser.open("https://electrum.org")
|
||||
webbrowser.open("https://electrum-zcash.org")
|
||||
size_hint_x: 0.6
|
||||
TopLabel:
|
||||
text: _('Developers')
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#:import _ electrum_gui.kivy.i18n._
|
||||
#:import _ electrum_zcash_gui.kivy.i18n._
|
||||
#:import Decimal decimal.Decimal
|
||||
#:set btc_symbol chr(171)
|
||||
#:set mbtc_symbol chr(187)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#:import _ electrum_gui.kivy.i18n._
|
||||
#:import _ electrum_zcash_gui.kivy.i18n._
|
||||
#:import Factory kivy.factory.Factory
|
||||
#:set font_light 'gui/kivy/data/fonts/Roboto-Condensed.ttf'
|
||||
#:set btc_symbol chr(171)
|
||||
|
|
|
@ -13,7 +13,7 @@ Popup:
|
|||
SettingsItem:
|
||||
value: _("%d connections.")% app.num_nodes if app.num_nodes else _("Not connected")
|
||||
title: _("Status") + ': ' + self.value
|
||||
description: _("Connections with Electrum servers")
|
||||
description: _("Connections with Electrum-Zcash servers")
|
||||
action: lambda x: None
|
||||
|
||||
CardSeparator
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#:import _ electrum_gui.kivy.i18n._
|
||||
#:import _ electrum_zcash_gui.kivy.i18n._
|
||||
#:import Decimal decimal.Decimal
|
||||
#:set btc_symbol chr(171)
|
||||
#:set mbtc_symbol chr(187)
|
||||
|
@ -68,7 +68,7 @@ ReceiveScreen:
|
|||
pos_hint: {'center_y': .5}
|
||||
BlueButton:
|
||||
id: address_label
|
||||
text: s.address if s.address else _('Bitcoin Address')
|
||||
text: s.address if s.address else _('Zcash Address')
|
||||
shorten: True
|
||||
disabled: True
|
||||
CardSeparator:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#:import _ electrum_gui.kivy.i18n._
|
||||
#:import _ electrum_zcash_gui.kivy.i18n._
|
||||
#:import Decimal decimal.Decimal
|
||||
#:set btc_symbol chr(171)
|
||||
#:set mbtc_symbol chr(187)
|
||||
|
|
|
@ -6,7 +6,7 @@ Popup:
|
|||
padding: '10dp'
|
||||
spacing: '10dp'
|
||||
TopLabel:
|
||||
text: _("Electrum requests your transaction history from a single server. The returned history is checked against blockchain headers sent by other nodes, using Simple Payment Verification (SPV).")
|
||||
text: _("Electrum-Zcash requests your transaction history from a single server. The returned history is checked against blockchain headers sent by other nodes, using Simple Payment Verification (SPV).")
|
||||
font_size: '6pt'
|
||||
Widget:
|
||||
size_hint: 1, 0.8
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Popup:
|
||||
title: "Electrum"
|
||||
title: "Electrum-Zcash"
|
||||
confirmed: 0
|
||||
unconfirmed: 0
|
||||
unmatured: 0
|
||||
|
|
Loading…
Reference in New Issue