danicoinwallet/src/gui/ReceiveFrame.cpp

36 lines
998 B
C++
Raw Normal View History

2015-04-29 17:03:08 +00:00
// Copyright (c) 2011-2015 The Cryptonote developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <QClipboard>
#include "ReceiveFrame.h"
#include "WalletAdapter.h"
#include "ui_receiveframe.h"
namespace WalletGui {
ReceiveFrame::ReceiveFrame(QWidget* _parent) : QFrame(_parent), m_ui(new Ui::ReceiveFrame) {
m_ui->setupUi(this);
connect(&WalletAdapter::instance(), &WalletAdapter::updateWalletAddressSignal, this, &ReceiveFrame::updateWalletAddress);
connect(&WalletAdapter::instance(), &WalletAdapter::walletCloseCompletedSignal, this, &ReceiveFrame::reset);
}
ReceiveFrame::~ReceiveFrame() {
}
void ReceiveFrame::updateWalletAddress(const QString& _address) {
m_ui->m_addressEdit->setText(_address);
}
void ReceiveFrame::reset() {
m_ui->m_addressEdit->clear();
}
void ReceiveFrame::copyAddress() {
QApplication::clipboard()->setText(m_ui->m_addressEdit->text());
}
}