generalize plugins to all guis
[electrum-nvc.git] / gui / gui_classic / __init__.py
index cf20dda..101535a 100644 (file)
@@ -19,6 +19,7 @@
 import sys, time, datetime, re, threading
 from electrum.i18n import _, set_language
 from electrum.util import print_error, print_msg, parse_url
+from electrum.plugins import run_hook
 import os.path, json, ast, traceback
 import shutil
 
@@ -43,7 +44,7 @@ except:
 
 from qt_util import *
 from main_window import ElectrumWindow
-
+from electrum.plugins import init_plugins
 
 class Timer(QtCore.QThread):
     def run(self):
@@ -75,6 +76,10 @@ class ElectrumGui:
             self.app = QApplication(sys.argv)
         self.app.installEventFilter(self.efilter)
 
+        init_plugins(self)
+
+
+
     def expand(self):
         """Hide the lite mode window and show pro-mode."""
         self.config.set_key('lite_mode', False, True)
@@ -128,12 +133,17 @@ class ElectrumGui:
 
         wallet.start_threads(self.network)
 
-        s = Timer()
-        s.start()
             
-        w = ElectrumWindow(self.config, self.network, self.minimize)
+        self.main_window = w = ElectrumWindow(self.config, self.network, self.minimize)
+
+        # plugins that need to change the GUI do it here
+        run_hook('init')
+
         w.load_wallet(wallet)
 
+        s = Timer()
+        s.start()
+
         self.windows.append(w)
         if url: w.set_url(url)
         w.app = self.app