Exemplo n.º 1
0
    def btnBatchSendCSVClicked(self):
        wc = wallet.controller
        QMB = QtGui.QMessageBox

        # get send many entries
        msg = 'Select CSV file'
        path = QtGui.QFileDialog.getOpenFileName(self, msg)
        if not path:
            return  # canceled file dialog

        # confirm send coins
        options = QMB.Yes | QMB.Cancel
        title = 'Confirm send many.'
        msg = 'Are you sure you want to send:'
        entries = sanitize.sendmanycsv(wc.model, path)
        for asset, amount in wc.sendmany_sums(entries).items():
            msg += "<p>Total of <b>{value} {moniker}</b></p>".format(
                **{
                    'value': asset.format_value(amount),
                    'moniker': asset.get_monikers()[0],
                })

        if QMB.question(self, title, msg, options, QMB.Cancel) != QMB.Yes:
            return

        wc.sendmany_coins(entries)
Exemplo n.º 2
0
    def sendmanycsv(self, path):
        """Send amounts in csv file with format 'moniker,coloraddress,amount'.
        All entries must use the same color scheme.
        """

        # sanitize inputs
        sendmany_entries = sanitize.sendmanycsv(self.model, path)

        return _print(self.controller.sendmany_coins(sendmany_entries))
Exemplo n.º 3
0
    def sendmanycsv(self, path):
        """Send amounts in csv file with format 'moniker,coloraddress,amount'.
        All entries must use the same color scheme.
        """

        # sanitize inputs
        sendmany_entries = sanitize.sendmanycsv(self.model, path)

        return _print(self.controller.sendmany_coins(sendmany_entries))
Exemplo n.º 4
0
    def btnBatchSendCSVClicked(self):
        wc = wallet.controller
        QMB = QtGui.QMessageBox

        # get send many entries
        msg = "Select CSV file"
        path = QtGui.QFileDialog.getOpenFileName(self, msg)
        if not path:
            return  # canceled file dialog

        # confirm send coins
        options = QMB.Yes | QMB.Cancel
        title = "Confirm send many."
        msg = "Are you sure you want to send:"
        entries = sanitize.sendmanycsv(wc.model, path)
        for asset, amount in wc.sendmany_sums(entries).items():
            msg += "<p>Total of <b>{value} {moniker}</b></p>".format(
                **{"value": asset.format_value(amount), "moniker": asset.get_monikers()[0]}
            )

        if QMB.question(self, title, msg, options, QMB.Cancel) != QMB.Yes:
            return

        wc.sendmany_coins(entries)