23
23
from electrum .interface import PREFERRED_NETWORK_PROTOCOL , ServerAddr
24
24
from electrum .logging import Logger
25
25
from .i18n import _
26
+ from . import KIVY_GUI_PATH
26
27
27
28
from kivy .app import App
28
29
from kivy .core .window import Window
68
69
# Register fonts without this you won't be able to use bold/italic...
69
70
# inside markup.
70
71
from kivy .core .text import Label
71
- Label .register ('Roboto' ,
72
- 'electrum/gui/kivy/data/fonts/Roboto.ttf' ,
73
- 'electrum/gui/kivy/data/fonts/Roboto.ttf' ,
74
- 'electrum/gui/kivy/data/fonts/Roboto-Bold.ttf' ,
75
- 'electrum/gui/kivy/data/fonts/Roboto-Bold.ttf' )
72
+ Label .register (
73
+ 'Roboto' ,
74
+ KIVY_GUI_PATH + '/data/fonts/Roboto.ttf' ,
75
+ KIVY_GUI_PATH + '/data/fonts/Roboto.ttf' ,
76
+ KIVY_GUI_PATH + '/data/fonts/Roboto-Bold.ttf' ,
77
+ KIVY_GUI_PATH + '/data/fonts/Roboto-Bold.ttf' ,
78
+ )
76
79
77
80
78
81
from electrum .util import (NoDynamicFeeEstimates , NotEnoughFunds ,
@@ -530,7 +533,7 @@ def do_share(self, data, title):
530
533
currentActivity .startActivity (it )
531
534
532
535
def build (self ):
533
- return Builder .load_file ('electrum/gui/kivy /main.kv' )
536
+ return Builder .load_file (KIVY_GUI_PATH + ' /main.kv' )
534
537
535
538
def _pause (self ):
536
539
if platform == 'android' :
@@ -724,7 +727,7 @@ def popup_dialog(self, name):
724
727
elif name == 'wallets' :
725
728
self .wallets_dialog ()
726
729
elif name == 'status' :
727
- popup = Builder .load_file ('electrum/gui/kivy/ uix/ui_screens/' + name + ' .kv' )
730
+ popup = Builder .load_file (KIVY_GUI_PATH + f'/ uix/ui_screens/{ name } .kv' )
728
731
master_public_keys_layout = popup .ids .master_public_keys
729
732
for xpub in self .wallet .get_master_public_keys ()[1 :]:
730
733
master_public_keys_layout .add_widget (TopLabel (text = _ ('Master Public Key' )))
@@ -736,7 +739,7 @@ def popup_dialog(self, name):
736
739
elif name .endswith ("_dialog" ):
737
740
getattr (self , name )()
738
741
else :
739
- popup = Builder .load_file ('electrum/gui/kivy/ uix/ui_screens/' + name + ' .kv' )
742
+ popup = Builder .load_file (KIVY_GUI_PATH + f'/ uix/ui_screens/{ name } .kv' )
740
743
popup .open ()
741
744
742
745
@profiler
@@ -766,7 +769,7 @@ def init_ui(self):
766
769
self .history_screen = None
767
770
self .send_screen = None
768
771
self .receive_screen = None
769
- self .icon = "electrum/gui /icons/electrum.png"
772
+ self .icon = os . path . dirname ( KIVY_GUI_PATH ) + " /icons/electrum.png"
770
773
self .tabs = self .root .ids ['tabs' ]
771
774
772
775
def update_interfaces (self , dt ):
@@ -968,7 +971,7 @@ def on_ref_label(self, label):
968
971
self .qr_dialog (label .name , label .data , True )
969
972
970
973
def show_error (self , error , width = '200dp' , pos = None , arrow_pos = None ,
971
- exit = False , icon = 'atlas://electrum/gui/kivy /theming/light/error' , duration = 0 ,
974
+ exit = False , icon = f 'atlas://{ KIVY_GUI_PATH } /theming/light/error' , duration = 0 ,
972
975
modal = False ):
973
976
''' Show an error Message Bubble.
974
977
'''
@@ -980,7 +983,7 @@ def show_info(self, error, width='200dp', pos=None, arrow_pos=None,
980
983
exit = False , duration = 0 , modal = False ):
981
984
''' Show an Info Message Bubble.
982
985
'''
983
- self .show_error (error , icon = 'atlas://electrum/gui/kivy /theming/light/important' ,
986
+ self .show_error (error , icon = f 'atlas://{ KIVY_GUI_PATH } /theming/light/important' ,
984
987
duration = duration , modal = modal , exit = exit , pos = pos ,
985
988
arrow_pos = arrow_pos )
986
989
@@ -1021,7 +1024,7 @@ def show_info_bubble(self, text=_('Hello World'), pos=None, duration=0,
1021
1024
info_bubble .show_arrow = False
1022
1025
img .allow_stretch = True
1023
1026
info_bubble .dim_background = True
1024
- info_bubble .background_image = 'atlas://electrum/gui/kivy /theming/light/card'
1027
+ info_bubble .background_image = f 'atlas://{ KIVY_GUI_PATH } /theming/light/card'
1025
1028
else :
1026
1029
info_bubble .fs = False
1027
1030
info_bubble .icon = icon
0 commit comments