plugins: on_close method
This commit is contained in:
@@ -288,7 +288,6 @@ class FxPlugin(BasePlugin, ThreadJob):
|
||||
def show_history(self):
|
||||
return self.config_history() and self.exchange.history_ccys()
|
||||
|
||||
|
||||
def set_exchange(self, name):
|
||||
class_ = self.exchanges.get(name) or self.exchanges.values()[0]
|
||||
name = class_.__name__
|
||||
|
||||
@@ -2,14 +2,26 @@ from exchange_rate import FxPlugin
|
||||
from electrum.plugins import hook
|
||||
|
||||
class Plugin(FxPlugin):
|
||||
@hook
|
||||
def load_wallet(self, wallet, window):
|
||||
self.window = window
|
||||
|
||||
def on_quotes(self):
|
||||
self.print_error("on quotes", self.ccy)
|
||||
self.window.fiat_unit = self.ccy
|
||||
|
||||
def on_history(self):
|
||||
self.print_error("on history")
|
||||
self.window.history_screen.update()
|
||||
|
||||
def on_close(self):
|
||||
self.print_error("on close")
|
||||
self.window.fiat_unit = ''
|
||||
self.window.history_screen.update()
|
||||
|
||||
@hook
|
||||
def init_kivy(self, window):
|
||||
self.window = window
|
||||
self.window.fiat_unit = self.ccy
|
||||
self.window.history_screen.update()
|
||||
|
||||
@hook
|
||||
def load_wallet(self, wallet, window):
|
||||
self.window = window
|
||||
self.window.fiat_unit = self.ccy
|
||||
|
||||
@@ -49,9 +49,7 @@ class Plugin(FxPlugin):
|
||||
def do_clear(self, window):
|
||||
window.fiat_send_e.setText('')
|
||||
|
||||
def close(self):
|
||||
# Get rid of hooks before updating status bars.
|
||||
FxPlugin.close(self)
|
||||
def on_close(self):
|
||||
self.app.emit(SIGNAL('close_fx_plugin'))
|
||||
|
||||
def restore_window(self, window):
|
||||
|
||||
Reference in New Issue
Block a user