file reorganization with top-level module
3
.gitignore
vendored
|
@ -4,10 +4,9 @@
|
||||||
build/
|
build/
|
||||||
dist/
|
dist/
|
||||||
*.egg/
|
*.egg/
|
||||||
/electrum.py
|
|
||||||
contrib/pyinstaller/
|
contrib/pyinstaller/
|
||||||
Electrum.egg-info/
|
Electrum.egg-info/
|
||||||
gui/qt/icons_rc.py
|
electrum/gui/qt/icons_rc.py
|
||||||
locale/
|
locale/
|
||||||
.devlocaltmp/
|
.devlocaltmp/
|
||||||
*_trial_temp
|
*_trial_temp
|
||||||
|
|
|
@ -36,7 +36,7 @@ Electrum from its root directory, without installing it on your
|
||||||
system; all the python dependencies are included in the 'packages'
|
system; all the python dependencies are included in the 'packages'
|
||||||
directory. To run Electrum from its root directory, just do::
|
directory. To run Electrum from its root directory, just do::
|
||||||
|
|
||||||
./electrum
|
./run_electrum
|
||||||
|
|
||||||
You can also install Electrum on your system, by running this command::
|
You can also install Electrum on your system, by running this command::
|
||||||
|
|
||||||
|
@ -73,12 +73,12 @@ Render the SVG icons to PNGs (optional)::
|
||||||
Compile the icons file for Qt::
|
Compile the icons file for Qt::
|
||||||
|
|
||||||
sudo apt-get install pyqt5-dev-tools
|
sudo apt-get install pyqt5-dev-tools
|
||||||
pyrcc5 icons.qrc -o gui/qt/icons_rc.py
|
pyrcc5 icons.qrc -o electrum/gui/qt/icons_rc.py
|
||||||
|
|
||||||
Compile the protobuf description file::
|
Compile the protobuf description file::
|
||||||
|
|
||||||
sudo apt-get install protobuf-compiler
|
sudo apt-get install protobuf-compiler
|
||||||
protoc --proto_path=lib/ --python_out=lib/ lib/paymentrequest.proto
|
protoc --proto_path=electrum --python_out=electrum electrum/paymentrequest.proto
|
||||||
|
|
||||||
Create translations (optional)::
|
Create translations (optional)::
|
||||||
|
|
||||||
|
|
|
@ -46,8 +46,8 @@ git submodule update
|
||||||
rm -rf $BUILDDIR > /dev/null 2>&1
|
rm -rf $BUILDDIR > /dev/null 2>&1
|
||||||
mkdir $BUILDDIR
|
mkdir $BUILDDIR
|
||||||
|
|
||||||
cp -R ./contrib/deterministic-build/electrum-locale/locale/ ./lib/locale/
|
cp -R ./contrib/deterministic-build/electrum-locale/locale/ ./electrum/locale/
|
||||||
cp ./contrib/deterministic-build/electrum-icons/icons_rc.py ./gui/qt/
|
cp ./contrib/deterministic-build/electrum-icons/icons_rc.py ./electrum/gui/qt/
|
||||||
|
|
||||||
|
|
||||||
info "Downloading libusb..."
|
info "Downloading libusb..."
|
||||||
|
|
|
@ -7,7 +7,7 @@ import os
|
||||||
|
|
||||||
PACKAGE='Electrum'
|
PACKAGE='Electrum'
|
||||||
PYPKG='electrum'
|
PYPKG='electrum'
|
||||||
MAIN_SCRIPT='electrum'
|
MAIN_SCRIPT='run_electrum'
|
||||||
ICONS_FILE='electrum.icns'
|
ICONS_FILE='electrum.icns'
|
||||||
|
|
||||||
for i, x in enumerate(sys.argv):
|
for i, x in enumerate(sys.argv):
|
||||||
|
@ -28,10 +28,9 @@ hiddenimports += collect_submodules('keepkeylib')
|
||||||
hiddenimports += collect_submodules('websocket')
|
hiddenimports += collect_submodules('websocket')
|
||||||
|
|
||||||
datas = [
|
datas = [
|
||||||
(electrum+'lib/*.json', PYPKG),
|
(electrum+'electrum/*.json', PYPKG),
|
||||||
(electrum+'lib/wordlist/english.txt', PYPKG + '/wordlist'),
|
(electrum+'electrum/wordlist/english.txt', PYPKG + '/wordlist'),
|
||||||
(electrum+'lib/locale', PYPKG + '/locale'),
|
(electrum+'electrum/locale', PYPKG + '/locale')
|
||||||
(electrum+'plugins', PYPKG + '_plugins'),
|
|
||||||
]
|
]
|
||||||
datas += collect_data_files('trezorlib')
|
datas += collect_data_files('trezorlib')
|
||||||
datas += collect_data_files('btchip')
|
datas += collect_data_files('btchip')
|
||||||
|
@ -45,21 +44,21 @@ binaries += [(electrum + "contrib/build-osx/libsecp256k1.0.dylib", ".")]
|
||||||
binaries += [b for b in collect_dynamic_libs('PyQt5') if 'macstyle' in b[0]]
|
binaries += [b for b in collect_dynamic_libs('PyQt5') if 'macstyle' in b[0]]
|
||||||
|
|
||||||
# We don't put these files in to actually include them in the script but to make the Analysis method scan them for imports
|
# We don't put these files in to actually include them in the script but to make the Analysis method scan them for imports
|
||||||
a = Analysis([electrum+MAIN_SCRIPT,
|
a = Analysis([electrum+ MAIN_SCRIPT,
|
||||||
electrum+'gui/qt/main_window.py',
|
electrum+'electrum/gui/qt/main_window.py',
|
||||||
electrum+'gui/text.py',
|
electrum+'electrum/gui/text.py',
|
||||||
electrum+'lib/util.py',
|
electrum+'electrum/util.py',
|
||||||
electrum+'lib/wallet.py',
|
electrum+'electrum/wallet.py',
|
||||||
electrum+'lib/simple_config.py',
|
electrum+'electrum/simple_config.py',
|
||||||
electrum+'lib/bitcoin.py',
|
electrum+'electrum/bitcoin.py',
|
||||||
electrum+'lib/dnssec.py',
|
electrum+'electrum/dnssec.py',
|
||||||
electrum+'lib/commands.py',
|
electrum+'electrum/commands.py',
|
||||||
electrum+'plugins/cosigner_pool/qt.py',
|
electrum+'electrum/plugins/cosigner_pool/qt.py',
|
||||||
electrum+'plugins/email_requests/qt.py',
|
electrum+'electrum/plugins/email_requests/qt.py',
|
||||||
electrum+'plugins/trezor/client.py',
|
electrum+'electrum/plugins/trezor/client.py',
|
||||||
electrum+'plugins/trezor/qt.py',
|
electrum+'electrum/plugins/trezor/qt.py',
|
||||||
electrum+'plugins/keepkey/qt.py',
|
electrum+'electrum/plugins/keepkey/qt.py',
|
||||||
electrum+'plugins/ledger/qt.py',
|
electrum+'electrum/plugins/ledger/qt.py',
|
||||||
],
|
],
|
||||||
binaries=binaries,
|
binaries=binaries,
|
||||||
datas=datas,
|
datas=datas,
|
||||||
|
|
|
@ -62,8 +62,8 @@ popd
|
||||||
rm -rf $WINEPREFIX/drive_c/electrum
|
rm -rf $WINEPREFIX/drive_c/electrum
|
||||||
cp -r electrum $WINEPREFIX/drive_c/electrum
|
cp -r electrum $WINEPREFIX/drive_c/electrum
|
||||||
cp electrum/LICENCE .
|
cp electrum/LICENCE .
|
||||||
cp -r ./electrum/contrib/deterministic-build/electrum-locale/locale $WINEPREFIX/drive_c/electrum/lib/
|
cp -r ./electrum/contrib/deterministic-build/electrum-locale/locale $WINEPREFIX/drive_c/electrum/electrum/
|
||||||
cp ./electrum/contrib/deterministic-build/electrum-icons/icons_rc.py $WINEPREFIX/drive_c/electrum/gui/qt/
|
cp ./electrum/contrib/deterministic-build/electrum-icons/icons_rc.py $WINEPREFIX/drive_c/electrum/electrum/gui/qt/
|
||||||
|
|
||||||
# Install frozen dependencies
|
# Install frozen dependencies
|
||||||
$PYTHON -m pip install -r ../../deterministic-build/requirements.txt
|
$PYTHON -m pip install -r ../../deterministic-build/requirements.txt
|
||||||
|
|
|
@ -31,10 +31,9 @@ binaries += [b for b in collect_dynamic_libs('PyQt5') if 'qwindowsvista' in b[0]
|
||||||
binaries += [('C:/tmp/libsecp256k1.dll', '.')]
|
binaries += [('C:/tmp/libsecp256k1.dll', '.')]
|
||||||
|
|
||||||
datas = [
|
datas = [
|
||||||
(home+'lib/*.json', 'electrum'),
|
(home+'electrum/*.json', 'electrum'),
|
||||||
(home+'lib/wordlist/english.txt', 'electrum/wordlist'),
|
(home+'electrum/wordlist/english.txt', 'electrum/wordlist'),
|
||||||
(home+'lib/locale', 'electrum/locale'),
|
(home+'electrum/locale', 'electrum/locale'),
|
||||||
(home+'plugins', 'electrum_plugins'),
|
|
||||||
('C:\\Program Files (x86)\\ZBar\\bin\\', '.')
|
('C:\\Program Files (x86)\\ZBar\\bin\\', '.')
|
||||||
]
|
]
|
||||||
datas += collect_data_files('trezorlib')
|
datas += collect_data_files('trezorlib')
|
||||||
|
@ -42,21 +41,21 @@ datas += collect_data_files('btchip')
|
||||||
datas += collect_data_files('keepkeylib')
|
datas += collect_data_files('keepkeylib')
|
||||||
|
|
||||||
# We don't put these files in to actually include them in the script but to make the Analysis method scan them for imports
|
# We don't put these files in to actually include them in the script but to make the Analysis method scan them for imports
|
||||||
a = Analysis([home+'electrum',
|
a = Analysis([home+'run_electrum',
|
||||||
home+'gui/qt/main_window.py',
|
home+'electrum/gui/qt/main_window.py',
|
||||||
home+'gui/text.py',
|
home+'electrum/gui/text.py',
|
||||||
home+'lib/util.py',
|
home+'electrum/util.py',
|
||||||
home+'lib/wallet.py',
|
home+'electrum/wallet.py',
|
||||||
home+'lib/simple_config.py',
|
home+'electrum/simple_config.py',
|
||||||
home+'lib/bitcoin.py',
|
home+'electrum/bitcoin.py',
|
||||||
home+'lib/dnssec.py',
|
home+'electrum/dnssec.py',
|
||||||
home+'lib/commands.py',
|
home+'electrum/commands.py',
|
||||||
home+'plugins/cosigner_pool/qt.py',
|
home+'electrum/plugins/cosigner_pool/qt.py',
|
||||||
home+'plugins/email_requests/qt.py',
|
home+'electrum/plugins/email_requests/qt.py',
|
||||||
home+'plugins/trezor/client.py',
|
home+'electrum/plugins/trezor/client.py',
|
||||||
home+'plugins/trezor/qt.py',
|
home+'electrum/plugins/trezor/qt.py',
|
||||||
home+'plugins/keepkey/qt.py',
|
home+'electrum/plugins/keepkey/qt.py',
|
||||||
home+'plugins/ledger/qt.py',
|
home+'electrum/plugins/ledger/qt.py',
|
||||||
#home+'packages/requests/utils.py'
|
#home+'packages/requests/utils.py'
|
||||||
],
|
],
|
||||||
binaries=binaries,
|
binaries=binaries,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
pushd ./gui/kivy/
|
pushd ./electrum/gui/kivy/
|
||||||
|
|
||||||
if [[ -n "$1" && "$1" == "release" ]] ; then
|
if [[ -n "$1" && "$1" == "release" ]] ; then
|
||||||
echo -n Keystore Password:
|
echo -n Keystore Password:
|
||||||
|
|
|
@ -8,8 +8,7 @@ import requests
|
||||||
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
||||||
os.chdir('..')
|
os.chdir('..')
|
||||||
|
|
||||||
code_directories = 'gui plugins lib'
|
cmd = "find electrum -type f -name '*.py' -o -name '*.kv'"
|
||||||
cmd = "find {} -type f -name '*.py' -o -name '*.kv'".format(code_directories)
|
|
||||||
|
|
||||||
files = subprocess.check_output(cmd, shell=True)
|
files = subprocess.check_output(cmd, shell=True)
|
||||||
|
|
||||||
|
@ -19,13 +18,13 @@ with open("app.fil", "wb") as f:
|
||||||
print("Found {} files to translate".format(len(files.splitlines())))
|
print("Found {} files to translate".format(len(files.splitlines())))
|
||||||
|
|
||||||
# Generate fresh translation template
|
# Generate fresh translation template
|
||||||
if not os.path.exists('lib/locale'):
|
if not os.path.exists('electrum/locale'):
|
||||||
os.mkdir('lib/locale')
|
os.mkdir('electrum/locale')
|
||||||
cmd = 'xgettext -s --from-code UTF-8 --language Python --no-wrap -f app.fil --output=lib/locale/messages.pot'
|
cmd = 'xgettext -s --from-code UTF-8 --language Python --no-wrap -f app.fil --output=electrum/locale/messages.pot'
|
||||||
print('Generate template')
|
print('Generate template')
|
||||||
os.system(cmd)
|
os.system(cmd)
|
||||||
|
|
||||||
os.chdir('lib')
|
os.chdir('electrum')
|
||||||
|
|
||||||
crowdin_identifier = 'electrum'
|
crowdin_identifier = 'electrum'
|
||||||
crowdin_file_name = 'files[electrum-client/messages.pot]'
|
crowdin_file_name = 'files[electrum-client/messages.pot]'
|
||||||
|
|
|
@ -22,6 +22,6 @@ fi
|
||||||
|
|
||||||
export PYTHONPATH="/usr/local/lib/python${PYTHON_VER}/site-packages:$PYTHONPATH"
|
export PYTHONPATH="/usr/local/lib/python${PYTHON_VER}/site-packages:$PYTHONPATH"
|
||||||
|
|
||||||
./electrum "$@"
|
./run_electrum "$@"
|
||||||
|
|
||||||
deactivate
|
deactivate
|
||||||
|
|
|
@ -10,5 +10,5 @@ from . import bitcoin
|
||||||
from . import transaction
|
from . import transaction
|
||||||
from . import daemon
|
from . import daemon
|
||||||
from .transaction import Transaction
|
from .transaction import Transaction
|
||||||
from .plugins import BasePlugin
|
from .plugin import BasePlugin
|
||||||
from .commands import Commands, known_commands
|
from .commands import Commands, known_commands
|
|
@ -28,8 +28,9 @@ import os
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from electrum import ELECTRUM_VERSION, constants
|
from .version import ELECTRUM_VERSION
|
||||||
from electrum.i18n import _
|
from .import constants
|
||||||
|
from .i18n import _
|
||||||
|
|
||||||
|
|
||||||
class BaseCrashReporter(object):
|
class BaseCrashReporter(object):
|
|
@ -35,12 +35,12 @@ from decimal import Decimal
|
||||||
|
|
||||||
from .import util, ecc
|
from .import util, ecc
|
||||||
from .util import bfh, bh2u, format_satoshis, json_decode, print_error, json_encode
|
from .util import bfh, bh2u, format_satoshis, json_decode, print_error, json_encode
|
||||||
from .import bitcoin
|
from . import bitcoin
|
||||||
from .bitcoin import is_address, hash_160, COIN, TYPE_ADDRESS
|
from .bitcoin import is_address, hash_160, COIN, TYPE_ADDRESS
|
||||||
from .i18n import _
|
from .i18n import _
|
||||||
from .transaction import Transaction, multisig_script
|
from .transaction import Transaction, multisig_script
|
||||||
from .paymentrequest import PR_PAID, PR_UNPAID, PR_UNKNOWN, PR_EXPIRED
|
from .paymentrequest import PR_PAID, PR_UNPAID, PR_UNKNOWN, PR_EXPIRED
|
||||||
from .plugins import run_hook
|
from .plugin import run_hook
|
||||||
|
|
||||||
known_commands = {}
|
known_commands = {}
|
||||||
|
|
|
@ -41,7 +41,7 @@ from .storage import WalletStorage
|
||||||
from .commands import known_commands, Commands
|
from .commands import known_commands, Commands
|
||||||
from .simple_config import SimpleConfig
|
from .simple_config import SimpleConfig
|
||||||
from .exchange_rate import FxThread
|
from .exchange_rate import FxThread
|
||||||
from .plugins import run_hook
|
from .plugin import run_hook
|
||||||
|
|
||||||
|
|
||||||
def get_lockfile(config):
|
def get_lockfile(config):
|
||||||
|
@ -307,7 +307,7 @@ class Daemon(DaemonThread):
|
||||||
gui_name = config.get('gui', 'qt')
|
gui_name = config.get('gui', 'qt')
|
||||||
if gui_name in ['lite', 'classic']:
|
if gui_name in ['lite', 'classic']:
|
||||||
gui_name = 'qt'
|
gui_name = 'qt'
|
||||||
gui = __import__('electrum_gui.' + gui_name, fromlist=['electrum_gui'])
|
gui = __import__('electrum.gui.' + gui_name, fromlist=['electrum'])
|
||||||
self.gui = gui.ElectrumGui(config, self, plugins)
|
self.gui = gui.ElectrumGui(config, self, plugins)
|
||||||
try:
|
try:
|
||||||
self.gui.main()
|
self.gui.main()
|
1
electrum/electrum
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../run_electrum
|
|
@ -10,10 +10,10 @@ prepare:
|
||||||
# running pre build setup
|
# running pre build setup
|
||||||
@cp tools/buildozer.spec ../../buildozer.spec
|
@cp tools/buildozer.spec ../../buildozer.spec
|
||||||
# copy electrum to main.py
|
# copy electrum to main.py
|
||||||
@cp ../../electrum ../../main.py
|
@cp ../../../run_electrum ../../main.py
|
||||||
@-if [ ! -d "../../.buildozer" ];then \
|
@-if [ ! -d "../../.buildozer" ];then \
|
||||||
cd ../..; buildozer android debug;\
|
cd ../..; buildozer android debug;\
|
||||||
cp -f gui/kivy/tools/blacklist.txt .buildozer/android/platform/python-for-android/src/blacklist.txt;\
|
cp -f electrum/gui/kivy/tools/blacklist.txt .buildozer/android/platform/python-for-android/src/blacklist.txt;\
|
||||||
rm -rf ./.buildozer/android/platform/python-for-android/dist;\
|
rm -rf ./.buildozer/android/platform/python-for-android/dist;\
|
||||||
fi
|
fi
|
||||||
apk:
|
apk:
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 224 B After Width: | Height: | Size: 224 B |
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
|
@ -1,7 +1,7 @@
|
||||||
#:import Clock kivy.clock.Clock
|
#:import Clock kivy.clock.Clock
|
||||||
#:import Window kivy.core.window.Window
|
#:import Window kivy.core.window.Window
|
||||||
#:import Factory kivy.factory.Factory
|
#:import Factory kivy.factory.Factory
|
||||||
#:import _ electrum_gui.kivy.i18n._
|
#:import _ electrum.gui.kivy.i18n._
|
||||||
|
|
||||||
|
|
||||||
###########################
|
###########################
|
||||||
|
@ -189,7 +189,7 @@
|
||||||
Color:
|
Color:
|
||||||
rgba: 0.192, .498, 0.745, 1
|
rgba: 0.192, .498, 0.745, 1
|
||||||
BorderImage:
|
BorderImage:
|
||||||
source: 'atlas://gui/kivy/theming/light/card_bottom'
|
source: 'atlas://electrum/gui/kivy/theming/light/card_bottom'
|
||||||
size: self.size
|
size: self.size
|
||||||
pos: self.pos
|
pos: self.pos
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@
|
||||||
Color:
|
Color:
|
||||||
rgba: 0.192, .498, 0.745, 1
|
rgba: 0.192, .498, 0.745, 1
|
||||||
BorderImage:
|
BorderImage:
|
||||||
source: 'atlas://gui/kivy/theming/light/card_bottom'
|
source: 'atlas://electrum/gui/kivy/theming/light/card_bottom'
|
||||||
size: self.size
|
size: self.size
|
||||||
pos: self.pos
|
pos: self.pos
|
||||||
|
|
||||||
|
@ -216,7 +216,7 @@
|
||||||
Color:
|
Color:
|
||||||
rgba: 0.192, .498, 0.745, 1
|
rgba: 0.192, .498, 0.745, 1
|
||||||
BorderImage:
|
BorderImage:
|
||||||
source: 'atlas://gui/kivy/theming/light/card_bottom'
|
source: 'atlas://electrum/gui/kivy/theming/light/card_bottom'
|
||||||
size: self.size
|
size: self.size
|
||||||
pos: self.pos
|
pos: self.pos
|
||||||
|
|
||||||
|
@ -326,8 +326,8 @@
|
||||||
valign: 'middle'
|
valign: 'middle'
|
||||||
bold: True
|
bold: True
|
||||||
font_size: '12.5sp'
|
font_size: '12.5sp'
|
||||||
background_normal: 'atlas://gui/kivy/theming/light/tab_btn'
|
background_normal: 'atlas://electrum/gui/kivy/theming/light/tab_btn'
|
||||||
background_down: 'atlas://gui/kivy/theming/light/tab_btn_pressed'
|
background_down: 'atlas://electrum/gui/kivy/theming/light/tab_btn_pressed'
|
||||||
|
|
||||||
|
|
||||||
<ColoredLabel@Label>:
|
<ColoredLabel@Label>:
|
||||||
|
@ -416,14 +416,14 @@ BoxLayout:
|
||||||
rgb: .6, .6, .6
|
rgb: .6, .6, .6
|
||||||
Rectangle:
|
Rectangle:
|
||||||
size: self.size
|
size: self.size
|
||||||
source: 'gui/kivy/data/background.png'
|
source: 'electrum/gui/kivy/data/background.png'
|
||||||
|
|
||||||
ActionBar:
|
ActionBar:
|
||||||
|
|
||||||
ActionView:
|
ActionView:
|
||||||
id: av
|
id: av
|
||||||
ActionPrevious:
|
ActionPrevious:
|
||||||
app_icon: 'atlas://gui/kivy/theming/light/logo'
|
app_icon: 'atlas://electrum/gui/kivy/theming/light/logo'
|
||||||
app_icon_width: '100dp'
|
app_icon_width: '100dp'
|
||||||
with_previous: False
|
with_previous: False
|
||||||
size_hint_x: None
|
size_hint_x: None
|
|
@ -7,13 +7,13 @@ import traceback
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
import electrum
|
|
||||||
from electrum.bitcoin import TYPE_ADDRESS
|
from electrum.bitcoin import TYPE_ADDRESS
|
||||||
from electrum import WalletStorage, Wallet
|
from electrum.storage import WalletStorage
|
||||||
from electrum_gui.kivy.i18n import _
|
from electrum.wallet import Wallet
|
||||||
|
from electrum.i18n import _
|
||||||
from electrum.paymentrequest import InvoiceStore
|
from electrum.paymentrequest import InvoiceStore
|
||||||
from electrum.util import profiler, InvalidPassword
|
from electrum.util import profiler, InvalidPassword
|
||||||
from electrum.plugins import run_hook
|
from electrum.plugin import run_hook
|
||||||
from electrum.util import format_satoshis, format_satoshis_plain
|
from electrum.util import format_satoshis, format_satoshis_plain
|
||||||
from electrum.paymentrequest import PR_UNPAID, PR_PAID, PR_UNKNOWN, PR_EXPIRED
|
from electrum.paymentrequest import PR_UNPAID, PR_PAID, PR_UNKNOWN, PR_EXPIRED
|
||||||
|
|
||||||
|
@ -30,10 +30,10 @@ from kivy.metrics import inch
|
||||||
from kivy.lang import Builder
|
from kivy.lang import Builder
|
||||||
|
|
||||||
## lazy imports for factory so that widgets can be used in kv
|
## lazy imports for factory so that widgets can be used in kv
|
||||||
#Factory.register('InstallWizard', module='electrum_gui.kivy.uix.dialogs.installwizard')
|
#Factory.register('InstallWizard', module='electrum.gui.kivy.uix.dialogs.installwizard')
|
||||||
#Factory.register('InfoBubble', module='electrum_gui.kivy.uix.dialogs')
|
#Factory.register('InfoBubble', module='electrum.gui.kivy.uix.dialogs')
|
||||||
#Factory.register('OutputList', 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('OutputItem', module='electrum.gui.kivy.uix.dialogs')
|
||||||
|
|
||||||
from .uix.dialogs.installwizard import InstallWizard
|
from .uix.dialogs.installwizard import InstallWizard
|
||||||
from .uix.dialogs import InfoBubble, crash_reporter
|
from .uix.dialogs import InfoBubble, crash_reporter
|
||||||
|
@ -56,16 +56,16 @@ from kivy.uix.tabbedpanel import TabbedPanel
|
||||||
from kivy.uix.label import Label
|
from kivy.uix.label import Label
|
||||||
from kivy.core.clipboard import Clipboard
|
from kivy.core.clipboard import Clipboard
|
||||||
|
|
||||||
Factory.register('TabbedCarousel', module='electrum_gui.kivy.uix.screens')
|
Factory.register('TabbedCarousel', module='electrum.gui.kivy.uix.screens')
|
||||||
|
|
||||||
# Register fonts without this you won't be able to use bold/italic...
|
# Register fonts without this you won't be able to use bold/italic...
|
||||||
# inside markup.
|
# inside markup.
|
||||||
from kivy.core.text import Label
|
from kivy.core.text import Label
|
||||||
Label.register('Roboto',
|
Label.register('Roboto',
|
||||||
'gui/kivy/data/fonts/Roboto.ttf',
|
'electrum/gui/kivy/data/fonts/Roboto.ttf',
|
||||||
'gui/kivy/data/fonts/Roboto.ttf',
|
'electrum/gui/kivy/data/fonts/Roboto.ttf',
|
||||||
'gui/kivy/data/fonts/Roboto-Bold.ttf',
|
'electrum/gui/kivy/data/fonts/Roboto-Bold.ttf',
|
||||||
'gui/kivy/data/fonts/Roboto-Bold.ttf')
|
'electrum/gui/kivy/data/fonts/Roboto-Bold.ttf')
|
||||||
|
|
||||||
|
|
||||||
from electrum.util import (base_units, NoDynamicFeeEstimates, decimal_point_to_base_unit_name,
|
from electrum.util import (base_units, NoDynamicFeeEstimates, decimal_point_to_base_unit_name,
|
||||||
|
@ -363,7 +363,7 @@ class ElectrumWindow(App):
|
||||||
memo = req.get('memo')
|
memo = req.get('memo')
|
||||||
amount = req.get('amount')
|
amount = req.get('amount')
|
||||||
fund = req.get('fund')
|
fund = req.get('fund')
|
||||||
popup = Builder.load_file('gui/kivy/uix/ui_screens/invoice.kv')
|
popup = Builder.load_file('electrum/gui/kivy/uix/ui_screens/invoice.kv')
|
||||||
popup.is_invoice = is_invoice
|
popup.is_invoice = is_invoice
|
||||||
popup.amount = amount
|
popup.amount = amount
|
||||||
popup.requestor = requestor if is_invoice else req.get('address')
|
popup.requestor = requestor if is_invoice else req.get('address')
|
||||||
|
@ -382,7 +382,7 @@ class ElectrumWindow(App):
|
||||||
from electrum.util import format_time
|
from electrum.util import format_time
|
||||||
fund = req.get('fund')
|
fund = req.get('fund')
|
||||||
isaddr = 'y'
|
isaddr = 'y'
|
||||||
popup = Builder.load_file('gui/kivy/uix/ui_screens/invoice.kv')
|
popup = Builder.load_file('electrum/gui/kivy/uix/ui_screens/invoice.kv')
|
||||||
popup.isaddr = isaddr
|
popup.isaddr = isaddr
|
||||||
popup.is_invoice = False
|
popup.is_invoice = False
|
||||||
popup.status = status
|
popup.status = status
|
||||||
|
@ -435,7 +435,7 @@ class ElectrumWindow(App):
|
||||||
currentActivity.startActivity(it)
|
currentActivity.startActivity(it)
|
||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
return Builder.load_file('gui/kivy/main.kv')
|
return Builder.load_file('electrum/gui/kivy/main.kv')
|
||||||
|
|
||||||
def _pause(self):
|
def _pause(self):
|
||||||
if platform == 'android':
|
if platform == 'android':
|
||||||
|
@ -592,7 +592,7 @@ class ElectrumWindow(App):
|
||||||
d = WalletDialog()
|
d = WalletDialog()
|
||||||
d.open()
|
d.open()
|
||||||
elif name == 'status':
|
elif name == 'status':
|
||||||
popup = Builder.load_file('gui/kivy/uix/ui_screens/'+name+'.kv')
|
popup = Builder.load_file('electrum/gui/kivy/uix/ui_screens/'+name+'.kv')
|
||||||
master_public_keys_layout = popup.ids.master_public_keys
|
master_public_keys_layout = popup.ids.master_public_keys
|
||||||
for xpub in self.wallet.get_master_public_keys()[1:]:
|
for xpub in self.wallet.get_master_public_keys()[1:]:
|
||||||
master_public_keys_layout.add_widget(TopLabel(text=_('Master Public Key')))
|
master_public_keys_layout.add_widget(TopLabel(text=_('Master Public Key')))
|
||||||
|
@ -602,7 +602,7 @@ class ElectrumWindow(App):
|
||||||
master_public_keys_layout.add_widget(ref)
|
master_public_keys_layout.add_widget(ref)
|
||||||
popup.open()
|
popup.open()
|
||||||
else:
|
else:
|
||||||
popup = Builder.load_file('gui/kivy/uix/ui_screens/'+name+'.kv')
|
popup = Builder.load_file('electrum/gui/kivy/uix/ui_screens/'+name+'.kv')
|
||||||
popup.open()
|
popup.open()
|
||||||
|
|
||||||
@profiler
|
@profiler
|
||||||
|
@ -618,9 +618,9 @@ class ElectrumWindow(App):
|
||||||
|
|
||||||
#setup lazy imports for mainscreen
|
#setup lazy imports for mainscreen
|
||||||
Factory.register('AnimatedPopup',
|
Factory.register('AnimatedPopup',
|
||||||
module='electrum_gui.kivy.uix.dialogs')
|
module='electrum.gui.kivy.uix.dialogs')
|
||||||
Factory.register('QRCodeWidget',
|
Factory.register('QRCodeWidget',
|
||||||
module='electrum_gui.kivy.uix.qrcodewidget')
|
module='electrum.gui.kivy.uix.qrcodewidget')
|
||||||
|
|
||||||
# preload widgets. Remove this if you want to load the widgets on demand
|
# preload widgets. Remove this if you want to load the widgets on demand
|
||||||
#Cache.append('electrum_widgets', 'AnimatedPopup', Factory.AnimatedPopup())
|
#Cache.append('electrum_widgets', 'AnimatedPopup', Factory.AnimatedPopup())
|
||||||
|
@ -777,7 +777,7 @@ class ElectrumWindow(App):
|
||||||
self.send_payment(address, amount=amount, label=label, message=message)
|
self.send_payment(address, amount=amount, label=label, message=message)
|
||||||
|
|
||||||
def show_error(self, error, width='200dp', pos=None, arrow_pos=None,
|
def show_error(self, error, width='200dp', pos=None, arrow_pos=None,
|
||||||
exit=False, icon='atlas://gui/kivy/theming/light/error', duration=0,
|
exit=False, icon='atlas://electrum/gui/kivy/theming/light/error', duration=0,
|
||||||
modal=False):
|
modal=False):
|
||||||
''' Show an error Message Bubble.
|
''' Show an error Message Bubble.
|
||||||
'''
|
'''
|
||||||
|
@ -789,7 +789,7 @@ class ElectrumWindow(App):
|
||||||
exit=False, duration=0, modal=False):
|
exit=False, duration=0, modal=False):
|
||||||
''' Show an Info Message Bubble.
|
''' Show an Info Message Bubble.
|
||||||
'''
|
'''
|
||||||
self.show_error(error, icon='atlas://gui/kivy/theming/light/important',
|
self.show_error(error, icon='atlas://electrum/gui/kivy/theming/light/important',
|
||||||
duration=duration, modal=modal, exit=exit, pos=pos,
|
duration=duration, modal=modal, exit=exit, pos=pos,
|
||||||
arrow_pos=arrow_pos)
|
arrow_pos=arrow_pos)
|
||||||
|
|
||||||
|
@ -829,7 +829,7 @@ class ElectrumWindow(App):
|
||||||
info_bubble.show_arrow = False
|
info_bubble.show_arrow = False
|
||||||
img.allow_stretch = True
|
img.allow_stretch = True
|
||||||
info_bubble.dim_background = True
|
info_bubble.dim_background = True
|
||||||
info_bubble.background_image = 'atlas://gui/kivy/theming/light/card'
|
info_bubble.background_image = 'atlas://electrum/gui/kivy/theming/light/card'
|
||||||
else:
|
else:
|
||||||
info_bubble.fs = False
|
info_bubble.fs = False
|
||||||
info_bubble.icon = icon
|
info_bubble.icon = icon
|
|
@ -41,4 +41,4 @@ class NFCBase(Widget):
|
||||||
NFCScanner = core_select_lib('nfc_manager', (
|
NFCScanner = core_select_lib('nfc_manager', (
|
||||||
# keep the dummy implementation as the last one to make it the fallback provider.NFCScanner = core_select_lib('nfc_scanner', (
|
# keep the dummy implementation as the last one to make it the fallback provider.NFCScanner = core_select_lib('nfc_scanner', (
|
||||||
('android', 'scanner_android', 'ScannerAndroid'),
|
('android', 'scanner_android', 'ScannerAndroid'),
|
||||||
('dummy', 'scanner_dummy', 'ScannerDummy')), True, 'electrum_gui.kivy')
|
('dummy', 'scanner_dummy', 'ScannerDummy')), True, 'electrum.gui.kivy')
|
|
@ -10,7 +10,7 @@ if platform != 'android':
|
||||||
raise ImportError
|
raise ImportError
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
from electrum_gui.kivy.nfc_scanner import NFCBase
|
from . import NFCBase
|
||||||
from jnius import autoclass, cast
|
from jnius import autoclass, cast
|
||||||
from android.runnable import run_on_ui_thread
|
from android.runnable import run_on_ui_thread
|
||||||
from android import activity
|
from android import activity
|
|
@ -1,6 +1,6 @@
|
||||||
''' Dummy NFC Provider to be used on desktops in case no other provider is found
|
''' Dummy NFC Provider to be used on desktops in case no other provider is found
|
||||||
'''
|
'''
|
||||||
from electrum_gui.kivy.nfc_scanner import NFCBase
|
from . import NFCBase
|
||||||
from kivy.clock import Clock
|
from kivy.clock import Clock
|
||||||
from kivy.logger import Logger
|
from kivy.logger import Logger
|
||||||
|
|
Before Width: | Height: | Size: 552 B After Width: | Height: | Size: 552 B |
Before Width: | Height: | Size: 188 B After Width: | Height: | Size: 188 B |
Before Width: | Height: | Size: 380 B After Width: | Height: | Size: 380 B |
Before Width: | Height: | Size: 375 B After Width: | Height: | Size: 375 B |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 683 B After Width: | Height: | Size: 683 B |
Before Width: | Height: | Size: 242 B After Width: | Height: | Size: 242 B |
Before Width: | Height: | Size: 311 B After Width: | Height: | Size: 311 B |
Before Width: | Height: | Size: 427 B After Width: | Height: | Size: 427 B |
Before Width: | Height: | Size: 362 B After Width: | Height: | Size: 362 B |
Before Width: | Height: | Size: 210 B After Width: | Height: | Size: 210 B |
Before Width: | Height: | Size: 209 B After Width: | Height: | Size: 209 B |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 866 B After Width: | Height: | Size: 866 B |
Before Width: | Height: | Size: 383 B After Width: | Height: | Size: 383 B |
Before Width: | Height: | Size: 357 B After Width: | Height: | Size: 357 B |
Before Width: | Height: | Size: 550 B After Width: | Height: | Size: 550 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 3 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 5 KiB After Width: | Height: | Size: 5 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 330 B After Width: | Height: | Size: 330 B |
Before Width: | Height: | Size: 308 B After Width: | Height: | Size: 308 B |
Before Width: | Height: | Size: 393 B After Width: | Height: | Size: 393 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 178 KiB After Width: | Height: | Size: 178 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 9.9 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 514 B After Width: | Height: | Size: 514 B |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 244 B After Width: | Height: | Size: 244 B |
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 9.1 KiB |