Browse Source

fix #5733

hard-fail-on-bad-server-string
ThomasV 5 years ago
parent
commit
6c62fb03ac
  1. 10
      electrum/gui/qt/__init__.py
  2. 4
      electrum/gui/qt/main_window.py

10
electrum/gui/qt/__init__.py

@ -155,8 +155,12 @@ class ElectrumGui(Logger):
else:
m = self.tray.contextMenu()
m.clear()
m.addAction(_("Lightning"), self.show_lightning_dialog)
m.addAction(_("Watchtower"), self.show_watchtower_dialog)
network = self.daemon.network
m.addAction(_("Network"), self.show_network_dialog)
if network.lngossip:
m.addAction(_("Lightning Network"), self.show_lightning_dialog)
if network.local_watchtower:
m.addAction(_("Local Watchtower"), self.show_watchtower_dialog)
for window in self.windows:
name = window.wallet.basename()
submenu = m.addMenu(name)
@ -210,7 +214,7 @@ class ElectrumGui(Logger):
self.watchtower_dialog = WatchtowerDialog(self)
self.watchtower_dialog.bring_to_top()
def show_network_dialog(self, parent):
def show_network_dialog(self):
if not self.daemon.network:
parent.show_warning(_('You are using Electrum in offline mode; restart Electrum if you want to get connected'), title=_('Offline'))
return

4
electrum/gui/qt/main_window.py

@ -639,7 +639,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
# Settings / Preferences are all reserved keywords in macOS using this as work around
tools_menu.addAction(_("Electrum preferences") if sys.platform == 'darwin' else _("Preferences"), self.settings_dialog)
tools_menu.addAction(_("&Network"), lambda: self.gui_object.show_network_dialog(self))
tools_menu.addAction(_("&Network"), self.gui_object.show_network_dialog)
if self.wallet.has_lightning():
tools_menu.addAction(_("&Lightning"), self.gui_object.show_lightning_dialog)
tools_menu.addAction(_("&Watchtower"), self.gui_object.show_watchtower_dialog)
@ -1999,7 +1999,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
if self.wallet.has_lightning():
self.lightning_button = StatusBarButton(read_QIcon("lightning.png"), _("Lightning Network"), self.gui_object.show_lightning_dialog)
sb.addPermanentWidget(self.lightning_button)
self.status_button = StatusBarButton(read_QIcon("status_disconnected.png"), _("Network"), lambda: self.gui_object.show_network_dialog(self))
self.status_button = StatusBarButton(read_QIcon("status_disconnected.png"), _("Network"), self.gui_object.show_network_dialog)
sb.addPermanentWidget(self.status_button)
run_hook('create_status_bar', sb)
self.setStatusBar(sb)

Loading…
Cancel
Save