electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit f02b95c81a5daeacf5ad9e7d4265065b3cc4e223
parent f88d767dea2ef9d40d8cb9c2604a38bd6099b317
Author: ThomasV <thomasv@gitorious>
Date:   Sun, 26 Apr 2015 13:16:09 +0200

pay to many

Diffstat:
Mgui/qt/main_window.py | 29++++-------------------------
Mgui/qt/paytoedit.py | 10++++++++++
2 files changed, 14 insertions(+), 25 deletions(-)

diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py @@ -395,9 +395,7 @@ class ElectrumWindow(QMainWindow): tools_menu.addAction(_("&Encrypt/decrypt message"), self.encrypt_message) tools_menu.addSeparator() - csv_transaction_menu = tools_menu.addMenu(_("&Create transaction")) - csv_transaction_menu.addAction(_("&From CSV file"), self.do_process_from_csv_file) - csv_transaction_menu.addAction(_("&From CSV text"), self.do_process_from_csv_text) + paytomany_menu = tools_menu.addAction(_("&Pay to many"), self.paytomany) raw_transaction_menu = tools_menu.addMenu(_("&Load transaction")) raw_transaction_menu.addAction(_("&From file"), self.do_process_from_file) @@ -1437,6 +1435,9 @@ class ElectrumWindow(QMainWindow): self.set_pay_from( addrs ) self.tabs.setCurrentIndex(1) + def paytomany(self): + self.tabs.setCurrentIndex(1) + self.payto_e.paytomany() def payto(self, addr): if not addr: @@ -2213,28 +2214,6 @@ class ElectrumWindow(QMainWindow): self.show_transaction(tx) - def do_process_from_csv_file(self): - fileName = self.getOpenFileName(_("Select your transaction CSV"), "*.csv") - if not fileName: - return - try: - with open(fileName, "r") as f: - csvReader = csv.reader(f) - self.do_process_from_csvReader(csvReader) - except (ValueError, IOError, os.error), reason: - QMessageBox.critical(None, _("Unable to read file or no transaction found"), _("Electrum was unable to open your transaction file") + "\n" + str(reason)) - return - - def do_process_from_csv_text(self): - text = text_dialog(self, _('Input CSV'), _("Please enter a list of outputs.") + '\n' \ - + _("Format: address, amount. One output per line"), _("Load CSV")) - if not text: - return - f = StringIO.StringIO(text) - csvReader = csv.reader(f) - self.do_process_from_csvReader(csvReader) - - @protected def export_privkeys_dialog(self, password): diff --git a/gui/qt/paytoedit.py b/gui/qt/paytoedit.py @@ -163,6 +163,16 @@ class PayToEdit(ScanQRTextEdit): def is_multiline(self): return len(self.lines()) > 1 + def paytomany(self): + from electrum.i18n import _ + self.setText("\n\n\n") + self.update_size() + msg = '\n'.join([ + _('Please enter a list of outputs.'), + _('Format: address, amount.'), + _('One output per line.') + ]) + QMessageBox.warning(self, _('Pay to many'), msg, _('OK')) def update_size(self): docHeight = self.document().size().height()