ThomasV 8 years ago
parent
commit
8d82e66eee
  1. 13
      gui/qt/main_window.py

13
gui/qt/main_window.py

@ -52,6 +52,10 @@ from electrum import Transaction, mnemonic
from electrum import util, bitcoin, commands, coinchooser from electrum import util, bitcoin, commands, coinchooser
from electrum import SimpleConfig, paymentrequest from electrum import SimpleConfig, paymentrequest
from electrum.wallet import Wallet, Multisig_Wallet from electrum.wallet import Wallet, Multisig_Wallet
try:
from electrum.plot import plot_history
except:
plot_history = None
from amountedit import AmountEdit, BTCAmountEdit, MyLineEdit, BTCkBEdit from amountedit import AmountEdit, BTCAmountEdit, MyLineEdit, BTCkBEdit
from qrcodewidget import QRCodeWidget, QRDialog from qrcodewidget import QRCodeWidget, QRDialog
@ -465,7 +469,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
invoices_menu = wallet_menu.addMenu(_("Invoices")) invoices_menu = wallet_menu.addMenu(_("Invoices"))
invoices_menu.addAction(_("Import"), lambda: self.invoice_list.import_invoices()) invoices_menu.addAction(_("Import"), lambda: self.invoice_list.import_invoices())
hist_menu = wallet_menu.addMenu(_("&History")) hist_menu = wallet_menu.addMenu(_("&History"))
hist_menu.addAction("Plot", self.plot_history_dialog) hist_menu.addAction("Plot", self.plot_history_dialog).setEnabled(plot_history is not None)
hist_menu.addAction("Export", self.export_history_dialog) hist_menu.addAction("Export", self.export_history_dialog)
wallet_menu.addSeparator() wallet_menu.addSeparator()
@ -2229,16 +2233,13 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
self.show_message(_("Your wallet history has been successfully exported.")) self.show_message(_("Your wallet history has been successfully exported."))
def plot_history_dialog(self): def plot_history_dialog(self):
try: if plot_history is None:
from electrum.plot import plot_history return
wallet = self.wallet wallet = self.wallet
history = wallet.get_history() history = wallet.get_history()
if len(history) > 0: if len(history) > 0:
plt = plot_history(self.wallet, history) plt = plot_history(self.wallet, history)
plt.show() plt.show()
except BaseException as e:
self.show_error(str(e))
return
def do_export_history(self, wallet, fileName, is_csv): def do_export_history(self, wallet, fileName, is_csv):
history = wallet.get_history() history = wallet.get_history()

Loading…
Cancel
Save