thandle plugin dependency - electrum - Electrum Bitcoin wallet
HTML git clone https://git.parazyd.org/electrum
DIR Log
DIR Files
DIR Refs
DIR Submodules
---
DIR commit d70087a0f57acb57b454d1a0807206c75f794fdc
DIR parent 294ac1f711793446a83189453016b970239b4815
HTML Author: ThomasV <thomasv@gitorious>
Date: Wed, 16 Oct 2013 14:11:28 +0200
handle plugin dependency
Diffstat:
M plugins/exchange_rate.py | 1 +
M plugins/pointofsale.py | 10 +++++++++-
2 files changed, 10 insertions(+), 1 deletion(-)
---
DIR diff --git a/plugins/exchange_rate.py b/plugins/exchange_rate.py
t@@ -80,6 +80,7 @@ class Plugin(BasePlugin):
# Do price discovery
self.exchanger = Exchanger(self)
self.exchanger.start()
+ self.gui.exchanger = self.exchanger #
def set_currencies(self, quote_currencies):
self.currencies = sorted(quote_currencies.keys())
DIR diff --git a/plugins/pointofsale.py b/plugins/pointofsale.py
t@@ -98,7 +98,7 @@ class Plugin(BasePlugin):
return 'Point of Sale'
def description(self):
- return _('Show QR code window and amounts requested for each address. Add menu item to request amount.')
+ return _('Show QR code window and amounts requested for each address. Add menu item to request amount. Note: This requires the exchange rate plugin to be installed.')
def init(self):
self.window = self.gui.main_window
t@@ -112,6 +112,14 @@ class Plugin(BasePlugin):
self.requested_amounts = {}
self.toggle_QR_window(True)
+ def enable(self):
+ if not self.config.get('use_exchange_rate'):
+ self.gui.main_window.show_message("Please enable exchange rates first!")
+ return False
+
+ return BasePlugin.enable(self)
+
+
def load_wallet(self, wallet):
self.wallet = wallet
self.requested_amounts = self.wallet.storage.get('requested_amounts',{})