Better handling of watching only
Avoid unnecessary message at startup. It can now be dynamic and menus, title bar update properly.
This commit is contained in:
parent
638bdc23f2
commit
e0aab69e67
|
@ -256,36 +256,42 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
||||||
self.dummy_address = a[0] if a else None
|
self.dummy_address = a[0] if a else None
|
||||||
self.accounts_expanded = self.wallet.storage.get('accounts_expanded',{})
|
self.accounts_expanded = self.wallet.storage.get('accounts_expanded',{})
|
||||||
self.current_account = self.wallet.storage.get("current_account", None)
|
self.current_account = self.wallet.storage.get("current_account", None)
|
||||||
title = 'Electrum %s - %s' % (self.wallet.electrum_version, self.wallet.basename())
|
|
||||||
if self.wallet.is_watching_only():
|
|
||||||
title += ' [%s]' % (_('watching only'))
|
|
||||||
self.setWindowTitle( title )
|
|
||||||
self.history_list.update()
|
self.history_list.update()
|
||||||
self.need_update.set()
|
self.need_update.set()
|
||||||
# Once GUI has been initialized check if we want to announce something since the callback has been called before the GUI was initialized
|
# Once GUI has been initialized check if we want to announce something since the callback has been called before the GUI was initialized
|
||||||
self.notify_transactions()
|
self.notify_transactions()
|
||||||
# update menus
|
# update menus
|
||||||
self.update_new_account_menu()
|
self.update_new_account_menu()
|
||||||
self.export_menu.setEnabled(not self.wallet.is_watching_only())
|
|
||||||
self.password_menu.setEnabled(self.wallet.can_change_password())
|
|
||||||
self.seed_menu.setEnabled(self.wallet.has_seed())
|
self.seed_menu.setEnabled(self.wallet.has_seed())
|
||||||
self.mpk_menu.setEnabled(self.wallet.is_deterministic())
|
self.mpk_menu.setEnabled(self.wallet.is_deterministic())
|
||||||
self.import_menu.setVisible(self.wallet.can_import())
|
|
||||||
self.export_menu.setEnabled(self.wallet.can_export())
|
|
||||||
self.update_lock_icon()
|
self.update_lock_icon()
|
||||||
self.update_buttons_on_seed()
|
self.update_buttons_on_seed()
|
||||||
self.update_console()
|
self.update_console()
|
||||||
self.clear_receive_tab()
|
self.clear_receive_tab()
|
||||||
self.receive_list.update()
|
self.receive_list.update()
|
||||||
self.tabs.show()
|
self.tabs.show()
|
||||||
|
|
||||||
# set geometry
|
# set geometry
|
||||||
try:
|
try:
|
||||||
self.setGeometry(*self.wallet.storage.get("winpos-qt"))
|
self.setGeometry(*self.wallet.storage.get("winpos-qt"))
|
||||||
except:
|
except:
|
||||||
self.setGeometry(100, 100, 840, 400)
|
self.setGeometry(100, 100, 840, 400)
|
||||||
|
self.watching_only_changed()
|
||||||
self.show()
|
self.show()
|
||||||
self.warn_if_watching_only()
|
|
||||||
run_hook('load_wallet', wallet, self)
|
run_hook('load_wallet', wallet, self)
|
||||||
|
self.warn_if_watching_only()
|
||||||
|
|
||||||
|
def watching_only_changed(self):
|
||||||
|
self.saved_wwo = self.wallet.is_watching_only()
|
||||||
|
title = 'Electrum %s - %s' % (self.wallet.electrum_version,
|
||||||
|
self.wallet.basename())
|
||||||
|
if self.wallet.is_watching_only():
|
||||||
|
title += ' [%s]' % (_('watching only'))
|
||||||
|
self.setWindowTitle(title)
|
||||||
|
self.export_menu.setEnabled(not self.wallet.is_watching_only())
|
||||||
|
self.password_menu.setEnabled(self.wallet.can_change_password())
|
||||||
|
self.import_menu.setVisible(self.wallet.can_import())
|
||||||
|
self.export_menu.setEnabled(self.wallet.can_export())
|
||||||
|
|
||||||
def warn_if_watching_only(self):
|
def warn_if_watching_only(self):
|
||||||
if self.wallet.is_watching_only():
|
if self.wallet.is_watching_only():
|
||||||
|
@ -519,6 +525,8 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
||||||
if self.require_fee_update:
|
if self.require_fee_update:
|
||||||
self.do_update_fee()
|
self.do_update_fee()
|
||||||
self.require_fee_update = False
|
self.require_fee_update = False
|
||||||
|
if self.saved_wwo != self.wallet.is_watching_only():
|
||||||
|
self.watching_only_changed()
|
||||||
run_hook('timer_actions')
|
run_hook('timer_actions')
|
||||||
|
|
||||||
def format_amount(self, x, is_diff=False, whitespaces=False):
|
def format_amount(self, x, is_diff=False, whitespaces=False):
|
||||||
|
|
Loading…
Reference in New Issue