Show wallet basename in tray tooltip for those of us using multiple wallets
Move basename (and title) logic to the wallet and use those member functions.
This commit is contained in:
parent
1b868a9753
commit
889174ae19
|
@ -211,9 +211,7 @@ class ElectrumWindow(QMainWindow):
|
||||||
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 ' + self.wallet.electrum_version + ' - ' + os.path.basename(self.wallet.storage.path)
|
self.setWindowTitle( self.wallet.title() )
|
||||||
if self.wallet.is_watching_only(): title += ' [%s]' % (_('watching only'))
|
|
||||||
self.setWindowTitle( title )
|
|
||||||
self.update_history_tab()
|
self.update_history_tab()
|
||||||
self.update_wallet()
|
self.update_wallet()
|
||||||
# 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
|
||||||
|
@ -536,7 +534,7 @@ class ElectrumWindow(QMainWindow):
|
||||||
text += "%s"%quote
|
text += "%s"%quote
|
||||||
|
|
||||||
if self.tray:
|
if self.tray:
|
||||||
self.tray.setToolTip(text)
|
self.tray.setToolTip("%s (%s)" % (text, self.wallet.basename()))
|
||||||
icon = QIcon(":icons/status_connected.png")
|
icon = QIcon(":icons/status_connected.png")
|
||||||
else:
|
else:
|
||||||
text = _("Not connected")
|
text = _("Not connected")
|
||||||
|
|
|
@ -109,6 +109,9 @@ class WalletStorage(object):
|
||||||
self.data[key] = value
|
self.data[key] = value
|
||||||
self.file_exists = True
|
self.file_exists = True
|
||||||
|
|
||||||
|
def basename(self):
|
||||||
|
return os.path.basename(self.path)
|
||||||
|
|
||||||
def get(self, key, default=None):
|
def get(self, key, default=None):
|
||||||
with self.lock:
|
with self.lock:
|
||||||
v = self.data.get(key)
|
v = self.data.get(key)
|
||||||
|
@ -231,6 +234,15 @@ class Abstract_Wallet(object):
|
||||||
def get_action(self):
|
def get_action(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def basename(self):
|
||||||
|
return self.storage.basename()
|
||||||
|
|
||||||
|
def title(self):
|
||||||
|
s = 'Electrum %s - %s' % (self.electrum_version, self.basename())
|
||||||
|
if self.is_watching_only():
|
||||||
|
s += ' [%s]' % (_('watching only'))
|
||||||
|
return s
|
||||||
|
|
||||||
def convert_imported_keys(self, password):
|
def convert_imported_keys(self, password):
|
||||||
for k, v in self.imported_keys.items():
|
for k, v in self.imported_keys.items():
|
||||||
sec = pw_decode(v, password)
|
sec = pw_decode(v, password)
|
||||||
|
|
Loading…
Reference in New Issue