@ -161,9 +161,9 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
self . utxo_tab = self . create_utxo_tab ( )
self . utxo_tab = self . create_utxo_tab ( )
self . console_tab = self . create_console_tab ( )
self . console_tab = self . create_console_tab ( )
self . contacts_tab = self . create_contacts_tab ( )
self . contacts_tab = self . create_contacts_tab ( )
tabs . addTab ( self . create_history_tab ( ) , QIcon ( " :icons/ tab_history.png" ) , _ ( ' History ' ) )
tabs . addTab ( self . create_history_tab ( ) , read_ QIcon( " tab_history.png " ) , _ ( ' History ' ) )
tabs . addTab ( self . send_tab , QIcon ( " :icons/ tab_send.png" ) , _ ( ' Send ' ) )
tabs . addTab ( self . send_tab , read_ QIcon( " tab_send.png " ) , _ ( ' Send ' ) )
tabs . addTab ( self . receive_tab , QIcon ( " :icons/ tab_receive.png" ) , _ ( ' Receive ' ) )
tabs . addTab ( self . receive_tab , read_ QIcon( " tab_receive.png " ) , _ ( ' Receive ' ) )
def add_optional_tab ( tabs , tab , icon , description , name ) :
def add_optional_tab ( tabs , tab , icon , description , name ) :
tab . tab_icon = icon
tab . tab_icon = icon
@ -173,10 +173,10 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
if self . config . get ( ' show_ {} _tab ' . format ( name ) , False ) :
if self . config . get ( ' show_ {} _tab ' . format ( name ) , False ) :
tabs . addTab ( tab , icon , description . replace ( " & " , " " ) )
tabs . addTab ( tab , icon , description . replace ( " & " , " " ) )
add_optional_tab ( tabs , self . addresses_tab , QIcon ( " :icons/ tab_addresses.png" ) , _ ( " &Addresses " ) , " addresses " )
add_optional_tab ( tabs , self . addresses_tab , read_ QIcon( " tab_addresses.png " ) , _ ( " &Addresses " ) , " addresses " )
add_optional_tab ( tabs , self . utxo_tab , QIcon ( " :icons/ tab_coins.png" ) , _ ( " Co&ins " ) , " utxo " )
add_optional_tab ( tabs , self . utxo_tab , read_ QIcon( " tab_coins.png " ) , _ ( " Co&ins " ) , " utxo " )
add_optional_tab ( tabs , self . contacts_tab , QIcon ( " :icons/ tab_contacts.png" ) , _ ( " Con&tacts " ) , " contacts " )
add_optional_tab ( tabs , self . contacts_tab , read_ QIcon( " tab_contacts.png " ) , _ ( " Con&tacts " ) , " contacts " )
add_optional_tab ( tabs , self . console_tab , QIcon ( " :icons/ tab_console.png" ) , _ ( " Con&sole " ) , " console " )
add_optional_tab ( tabs , self . console_tab , read_ QIcon( " tab_console.png " ) , _ ( " Con&sole " ) , " console " )
tabs . setSizePolicy ( QSizePolicy . Expanding , QSizePolicy . Expanding )
tabs . setSizePolicy ( QSizePolicy . Expanding , QSizePolicy . Expanding )
self . setCentralWidget ( tabs )
self . setCentralWidget ( tabs )
@ -184,7 +184,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
if self . config . get ( " is_maximized " ) :
if self . config . get ( " is_maximized " ) :
self . showMaximized ( )
self . showMaximized ( )
self . setWindowIcon ( QIcon ( " :icons/ electrum.png" ) )
self . setWindowIcon ( read_ QIcon( " electrum.png " ) )
self . init_menubar ( )
self . init_menubar ( )
wrtabs = weakref . proxy ( tabs )
wrtabs = weakref . proxy ( tabs )
@ -675,7 +675,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
if self . tray :
if self . tray :
try :
try :
# this requires Qt 5.9
# this requires Qt 5.9
self . tray . showMessage ( " Electrum " , message , QIcon ( " :icons/ electrum_dark_icon" ) , 20000 )
self . tray . showMessage ( " Electrum " , message , read_ QIcon( " electrum_dark_icon " ) , 20000 )
except TypeError :
except TypeError :
self . tray . showMessage ( " Electrum " , message , QSystemTrayIcon . Information , 20000 )
self . tray . showMessage ( " Electrum " , message , QSystemTrayIcon . Information , 20000 )
@ -773,7 +773,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
if self . network is None :
if self . network is None :
text = _ ( " Offline " )
text = _ ( " Offline " )
icon = QIcon ( " :icons/ status_disconnected.png" )
icon = read_ QIcon( " status_disconnected.png " )
elif self . network . is_connected ( ) :
elif self . network . is_connected ( ) :
server_height = self . network . get_server_height ( )
server_height = self . network . get_server_height ( )
@ -784,10 +784,10 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
# Display the synchronizing message in that case.
# Display the synchronizing message in that case.
if not self . wallet . up_to_date or server_height == 0 :
if not self . wallet . up_to_date or server_height == 0 :
text = _ ( " Synchronizing... " )
text = _ ( " Synchronizing... " )
icon = QIcon ( " :icons/ status_waiting.png" )
icon = read_ QIcon( " status_waiting.png " )
elif server_lag > 1 :
elif server_lag > 1 :
text = _ ( " Server is lagging ( {} blocks) " ) . format ( server_lag )
text = _ ( " Server is lagging ( {} blocks) " ) . format ( server_lag )
icon = QIcon ( " :icons/ status_lagging%s .png " % fork_str )
icon = read_ QIcon( " status_lagging %s .png " % fork_str )
else :
else :
c , u , x = self . wallet . get_balance ( )
c , u , x = self . wallet . get_balance ( )
text = _ ( " Balance " ) + " : %s " % ( self . format_amount_and_units ( c ) )
text = _ ( " Balance " ) + " : %s " % ( self . format_amount_and_units ( c ) )
@ -801,15 +801,15 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
text + = self . fx . get_fiat_status_text ( c + u + x ,
text + = self . fx . get_fiat_status_text ( c + u + x ,
self . base_unit ( ) , self . get_decimal_point ( ) ) or ' '
self . base_unit ( ) , self . get_decimal_point ( ) ) or ' '
if not self . network . proxy :
if not self . network . proxy :
icon = QIcon ( " :icons/ status_connected%s .png " % fork_str )
icon = read_ QIcon( " status_connected %s .png " % fork_str )
else :
else :
icon = QIcon ( " :icons/ status_connected_proxy%s .png " % fork_str )
icon = read_ QIcon( " status_connected_proxy %s .png " % fork_str )
else :
else :
if self . network . proxy :
if self . network . proxy :
text = " {} ( {} ) " . format ( _ ( " Not connected " ) , _ ( " proxy enabled " ) )
text = " {} ( {} ) " . format ( _ ( " Not connected " ) , _ ( " proxy enabled " ) )
else :
else :
text = _ ( " Not connected " )
text = _ ( " Not connected " )
icon = QIcon ( " :icons/ status_disconnected.png" )
icon = read_ QIcon( " status_disconnected.png " )
self . tray . setToolTip ( " %s ( %s ) " % ( text , self . wallet . basename ( ) ) )
self . tray . setToolTip ( " %s ( %s ) " % ( text , self . wallet . basename ( ) ) )
self . balance_label . setText ( text )
self . balance_label . setText ( text )
@ -1237,7 +1237,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
_ ( ' Also, when batching RBF transactions, BIP 125 imposes a lower bound on the fee. ' ) )
_ ( ' Also, when batching RBF transactions, BIP 125 imposes a lower bound on the fee. ' ) )
QMessageBox . information ( self , ' Fee rounding ' , text )
QMessageBox . information ( self , ' Fee rounding ' , text )
self . feerounding_icon = QPushButton ( QIcon ( ' :icons/ info.png' ) , ' ' )
self . feerounding_icon = QPushButton ( read_ QIcon( ' info.png ' ) , ' ' )
self . feerounding_icon . setFixedWidth ( 20 )
self . feerounding_icon . setFixedWidth ( 20 )
self . feerounding_icon . setFlat ( True )
self . feerounding_icon . setFlat ( True )
self . feerounding_icon . clicked . connect ( feerounding_onclick )
self . feerounding_icon . clicked . connect ( feerounding_onclick )
@ -2038,24 +2038,23 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
self . update_check_button = QPushButton ( " " )
self . update_check_button = QPushButton ( " " )
self . update_check_button . setFlat ( True )
self . update_check_button . setFlat ( True )
self . update_check_button . setCursor ( QCursor ( Qt . PointingHandCursor ) )
self . update_check_button . setCursor ( QCursor ( Qt . PointingHandCursor ) )
self . update_check_button . setIcon ( QIcon ( " :icons/ update.png" ) )
self . update_check_button . setIcon ( read_ QIcon( " update.png " ) )
self . update_check_button . hide ( )
self . update_check_button . hide ( )
sb . addPermanentWidget ( self . update_check_button )
sb . addPermanentWidget ( self . update_check_button )
self . lock_icon = QIcon ( )
self . password_button = StatusBarButton ( QIcon ( ) , _ ( " Password " ) , self . change_password_dialog )
self . password_button = StatusBarButton ( self . lock_icon , _ ( " Password " ) , self . change_password_dialog )
sb . addPermanentWidget ( self . password_button )
sb . addPermanentWidget ( self . password_button )
sb . addPermanentWidget ( StatusBarButton ( QIcon ( " :icons/ preferences.png" ) , _ ( " Preferences " ) , self . settings_dialog ) )
sb . addPermanentWidget ( StatusBarButton ( read_ QIcon( " preferences.png " ) , _ ( " Preferences " ) , self . settings_dialog ) )
self . seed_button = StatusBarButton ( QIcon ( " :icons/ seed.png" ) , _ ( " Seed " ) , self . show_seed_dialog )
self . seed_button = StatusBarButton ( read_ QIcon( " seed.png " ) , _ ( " Seed " ) , self . show_seed_dialog )
sb . addPermanentWidget ( self . seed_button )
sb . addPermanentWidget ( self . seed_button )
self . status_button = StatusBarButton ( QIcon ( " :icons/ status_disconnected.png" ) , _ ( " Network " ) , lambda : self . gui_object . show_network_dialog ( self ) )
self . status_button = StatusBarButton ( read_ QIcon( " status_disconnected.png " ) , _ ( " Network " ) , lambda : self . gui_object . show_network_dialog ( self ) )
sb . addPermanentWidget ( self . status_button )
sb . addPermanentWidget ( self . status_button )
run_hook ( ' create_status_bar ' , sb )
run_hook ( ' create_status_bar ' , sb )
self . setStatusBar ( sb )
self . setStatusBar ( sb )
def update_lock_icon ( self ) :
def update_lock_icon ( self ) :
icon = QIcon ( " :icons/ lock.png" ) if self . wallet . has_password ( ) else QIcon ( " :icons/ unlock.png" )
icon = read_ QIcon( " lock.png " ) if self . wallet . has_password ( ) else read_ QIcon( " unlock.png " )
self . password_button . setIcon ( icon )
self . password_button . setIcon ( icon )
def update_buttons_on_seed ( self ) :
def update_buttons_on_seed ( self ) :
@ -3356,5 +3355,5 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
msg = ( _ ( " Transaction added to wallet history. " ) + ' \n \n ' +
msg = ( _ ( " Transaction added to wallet history. " ) + ' \n \n ' +
_ ( " Note: this is an offline transaction, if you want the network "
_ ( " Note: this is an offline transaction, if you want the network "
" to see it, you need to broadcast it. " ) )
" to see it, you need to broadcast it. " ) )
win . msg_box ( QPixmap ( " :icons/ offline_tx.png" ) , None , _ ( ' Success ' ) , msg )
win . msg_box ( QPixmap ( icon_path ( " offline_tx.png " ) ) , None , _ ( ' Success ' ) , msg )
return True
return True