1
0

Have plugins object track the window set

No need for self.gui nor init_qt hook any more.  This makes
plugins more independent of window and gui types.
This commit is contained in:
Neil Booth
2015-09-04 09:12:11 +09:00
parent ec3b7ba5ee
commit 8ce2a95695
4 changed files with 23 additions and 25 deletions

View File

@@ -231,6 +231,7 @@ class ElectrumGui:
w.show()
self.windows.append(w)
self.build_tray_menu()
self.plugins.on_new_window(w)
if uri:
w.pay_to_URI(uri)
@@ -240,6 +241,7 @@ class ElectrumGui:
def close_window(self, window):
self.windows.remove(window)
self.build_tray_menu()
self.plugins.on_close_window(window)
def main(self):
self.timer.start()

View File

@@ -2835,11 +2835,6 @@ class ElectrumWindow(QMainWindow):
def do_toggle(cb, name, w):
p = plugins.toggle_enabled(self.config, name)
if p:
# FIXME: this is hosed for multiple windows
p.wallet = self.wallet
p.load_wallet(self.wallet, self)
p.init_qt(self.gui_object)
enabled = p is not None
cb.setChecked(enabled)
if w: w.setEnabled(enabled)