lbrycrd/gui/src/sendcoinsdialog.cpp

58 lines
1.2 KiB
C++
Raw Normal View History

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