Add support for opening bitcoin: URIs directly.

This commit is contained in:
Matt Corallo
2011-12-23 20:27:12 -08:00
parent 9a93c4c024
commit 7d145a0f59
15 changed files with 202 additions and 5 deletions

View File

@@ -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)