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:
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user