Plot plugin for multiple windows.

This commit is contained in:
Neil Booth 2015-09-04 17:43:07 +09:00
parent 89fbda30e0
commit 6372a3f6ce
1 changed files with 4 additions and 11 deletions

View File

@ -17,9 +17,6 @@ except:
flag_matlib=False flag_matlib=False
class Plugin(BasePlugin): class Plugin(BasePlugin):
def is_available(self): def is_available(self):
@ -29,17 +26,13 @@ class Plugin(BasePlugin):
return False return False
@hook @hook
def init_qt(self, gui): def export_history_dialog(self, window, hbox):
self.win = gui.main_window wallet = window.wallet
history = wallet.get_history()
@hook
def export_history_dialog(self, d,hbox):
self.wallet = d.wallet
history = self.wallet.get_history()
if len(history) > 0: if len(history) > 0:
b = QPushButton(_("Preview plot")) b = QPushButton(_("Preview plot"))
hbox.addWidget(b) hbox.addWidget(b)
b.clicked.connect(lambda: self.do_plot(self.wallet, history)) b.clicked.connect(lambda: self.do_plot(wallet, history))
else: else:
b = QPushButton(_("No history to plot")) b = QPushButton(_("No history to plot"))
hbox.addWidget(b) hbox.addWidget(b)