aboutsummaryrefslogtreecommitdiff
path: root/src/qt/sendcoinsdialog.cpp
diff options
context:
space:
mode:
authorMatt Corallo <matt@bluematt.me>2011-12-23 20:27:12 -0800
committerMatt Corallo <matt@bluematt.me>2012-01-05 00:29:28 -0500
commit7d145a0f591dab109eae9adcfaf59303cce0431a (patch)
tree95fbe9a79ca7c5ebf393a7121530c903e37dec38 /src/qt/sendcoinsdialog.cpp
parent9a93c4c02471fea7acb4882efaebaaefc1733466 (diff)
downloadbitcoin-7d145a0f591dab109eae9adcfaf59303cce0431a.tar.xz
Add support for opening bitcoin: URIs directly.
Diffstat (limited to 'src/qt/sendcoinsdialog.cpp')
-rw-r--r--src/qt/sendcoinsdialog.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp
index 6d32891172..0d9a604d3b 100644
--- a/src/qt/sendcoinsdialog.cpp
+++ b/src/qt/sendcoinsdialog.cpp
@@ -30,6 +30,8 @@ SendCoinsDialog::SendCoinsDialog(QWidget *parent) :
connect(ui->addButton, SIGNAL(clicked()), this, SLOT(addEntry()));
connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(clear()));
+
+ fNewRecipientAllowed = true;
}
void SendCoinsDialog::setModel(WalletModel *model)
@@ -92,6 +94,8 @@ void SendCoinsDialog::on_sendButton_clicked()
formatted.append(tr("<b>%1</b> to %2 (%3)").arg(BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, rcp.amount), Qt::escape(rcp.label), rcp.address));
}
+ fNewRecipientAllowed = false;
+
QMessageBox::StandardButton retval = QMessageBox::question(this, tr("Confirm send coins"),
tr("Are you sure you want to send %1?").arg(formatted.join(tr(" and "))),
QMessageBox::Yes|QMessageBox::Cancel,
@@ -99,6 +103,7 @@ void SendCoinsDialog::on_sendButton_clicked()
if(retval != QMessageBox::Yes)
{
+ fNewRecipientAllowed = true;
return;
}
@@ -106,6 +111,7 @@ void SendCoinsDialog::on_sendButton_clicked()
if(!ctx.isValid())
{
// Unlock wallet was cancelled
+ fNewRecipientAllowed = true;
return;
}
@@ -152,6 +158,7 @@ void SendCoinsDialog::on_sendButton_clicked()
accept();
break;
}
+ fNewRecipientAllowed = true;
}
void SendCoinsDialog::clear()
@@ -236,6 +243,9 @@ QWidget *SendCoinsDialog::setupTabChain(QWidget *prev)
void SendCoinsDialog::pasteEntry(const SendCoinsRecipient &rv)
{
+ if (!fNewRecipientAllowed)
+ return;
+
SendCoinsEntry *entry = 0;
// Replace the first entry if it is still unused
if(ui->entries->count() == 1)