bitcoin/gui/src/sendcoinsdialog.cpp

58 lines
1.2 KiB
C++
Raw Normal View History

2011-05-12 08:49:42 -04:00
#include "sendcoinsdialog.h"
2011-05-12 08:44:52 -04:00
#include "ui_sendcoinsdialog.h"
2011-05-12 11:55:24 -04:00
#include "addressbookdialog.h"
2011-05-13 16:00:27 -04:00
#include "bitcoinaddressvalidator.h"
2011-05-12 11:55:24 -04:00
2011-05-12 14:16:42 -04:00
#include <QApplication>
#include <QClipboard>
2011-05-14 11:25:05 -04:00
#include "base58.h"
2011-05-12 08:44:52 -04:00
SendCoinsDialog::SendCoinsDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::SendCoinsDialog)
{
ui->setupUi(this);
2011-05-14 05:18:39 -04:00
ui->payTo->setMaxLength(BitcoinAddressValidator::MaxAddressLength);
2011-05-13 16:00:27 -04:00
ui->payTo->setValidator(new BitcoinAddressValidator(this));
ui->payAmount->setValidator(new QDoubleValidator(this));
2011-05-12 08:44:52 -04:00
}
SendCoinsDialog::~SendCoinsDialog()
{
delete ui;
}
2011-05-12 11:55:24 -04:00
void SendCoinsDialog::on_sendButton_clicked()
{
2011-05-14 11:25:05 -04:00
QByteArray payTo = ui->payTo->text().toUtf8();
uint160 payToHash = 0;
if(AddressToHash160(payTo.constData(), payToHash))
{
accept();
}
else
{
}
2011-05-12 11:55:24 -04:00
}
void SendCoinsDialog::on_pasteButton_clicked()
{
2011-05-12 14:16:42 -04:00
/* Paste text from clipboard into recipient field */
ui->payTo->setText(QApplication::clipboard()->text());
2011-05-12 11:55:24 -04:00
}
void SendCoinsDialog::on_addressBookButton_clicked()
{
AddressBookDialog dlg;
dlg.exec();
2011-05-13 16:00:27 -04:00
ui->payTo->setText(dlg.getReturnValue());
}
void SendCoinsDialog::on_buttonBox_rejected()
{
reject();
2011-05-12 11:55:24 -04:00
}