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-12 14:44:52 +02:00
|
|
|
SendCoinsDialog::SendCoinsDialog(QWidget *parent) :
|
|
|
|
QDialog(parent),
|
|
|
|
ui(new Ui::SendCoinsDialog)
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
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()
|
|
|
|
{
|
|
|
|
accept();
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
}
|