mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-27 07:23:25 +00:00
pay to many
This commit is contained in:
parent
f88d767dea
commit
f02b95c81a
2 changed files with 14 additions and 25 deletions
|
@ -395,9 +395,7 @@ class ElectrumWindow(QMainWindow):
|
||||||
tools_menu.addAction(_("&Encrypt/decrypt message"), self.encrypt_message)
|
tools_menu.addAction(_("&Encrypt/decrypt message"), self.encrypt_message)
|
||||||
tools_menu.addSeparator()
|
tools_menu.addSeparator()
|
||||||
|
|
||||||
csv_transaction_menu = tools_menu.addMenu(_("&Create transaction"))
|
paytomany_menu = tools_menu.addAction(_("&Pay to many"), self.paytomany)
|
||||||
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)
|
|
||||||
|
|
||||||
raw_transaction_menu = tools_menu.addMenu(_("&Load transaction"))
|
raw_transaction_menu = tools_menu.addMenu(_("&Load transaction"))
|
||||||
raw_transaction_menu.addAction(_("&From file"), self.do_process_from_file)
|
raw_transaction_menu.addAction(_("&From file"), self.do_process_from_file)
|
||||||
|
@ -1437,6 +1435,9 @@ class ElectrumWindow(QMainWindow):
|
||||||
self.set_pay_from( addrs )
|
self.set_pay_from( addrs )
|
||||||
self.tabs.setCurrentIndex(1)
|
self.tabs.setCurrentIndex(1)
|
||||||
|
|
||||||
|
def paytomany(self):
|
||||||
|
self.tabs.setCurrentIndex(1)
|
||||||
|
self.payto_e.paytomany()
|
||||||
|
|
||||||
def payto(self, addr):
|
def payto(self, addr):
|
||||||
if not addr:
|
if not addr:
|
||||||
|
@ -2213,28 +2214,6 @@ class ElectrumWindow(QMainWindow):
|
||||||
|
|
||||||
self.show_transaction(tx)
|
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
|
@protected
|
||||||
def export_privkeys_dialog(self, password):
|
def export_privkeys_dialog(self, password):
|
||||||
|
|
|
@ -163,6 +163,16 @@ class PayToEdit(ScanQRTextEdit):
|
||||||
def is_multiline(self):
|
def is_multiline(self):
|
||||||
return len(self.lines()) > 1
|
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):
|
def update_size(self):
|
||||||
docHeight = self.document().size().height()
|
docHeight = self.document().size().height()
|
||||||
|
|
Loading…
Add table
Reference in a new issue