Fabcoin Core  0.16.2
P2P Digital Currency
receivetokenpage.cpp
Go to the documentation of this file.
1 #include <receivetokenpage.h>
2 #include <ui_receivetokenpage.h>
3 
4 #include <guiutil.h>
5 #include <guiconstants.h>
6 #include <receiverequestdialog.h>
7 #include <platformstyle.h>
8 
9 ReceiveTokenPage::ReceiveTokenPage(const PlatformStyle *_platformStyle, QWidget *parent) :
10  QWidget(parent),
11  ui(new Ui::ReceiveTokenPage),
12  platformStyle(_platformStyle)
13 {
14  ui->setupUi(this);
15  connect(ui->copyAddressButton, SIGNAL(clicked()), this, SLOT(on_copyAddressClicked()));
17  ui->copyAddressButton->setVisible(false);
18  setAddress("");
19 }
20 
22 {
23  delete ui;
24 }
25 
27 {
29  createQRCode();
30 }
31 
32 void ReceiveTokenPage::setSymbol(QString symbol)
33 {
34  QString addressText = symbol.isEmpty() ? "" : (QString("%1 ").arg(symbol) + tr("Address"));
35  ui->labelTokenAddressText->setText(addressText);
36 }
37 
39 {
40  if(!m_address.isEmpty())
42 }
43 
45 {
46  SendCoinsRecipient info;
47  if(!m_address.isEmpty())
48  {
49  info.address = m_address;
51  {
52  ui->lblQRCode->setVisible(true);
53  ui->lblQRCode->setScaledContents(true);
54  }
55  else
56  {
57  ui->lblQRCode->setVisible(false);
58  }
59  ui->labelTokenAddress->setText(m_address);
60  ui->copyAddressButton->setVisible(true);
61  }
62  else
63  {
64  ui->lblQRCode->clear();
65  ui->labelTokenAddress->setText("");
66  ui->labelTokenAddressText->setText("");
67  ui->copyAddressButton->setVisible(false);
68  }
69 }
QToolButton * copyAddressButton
ReceiveTokenPage(const PlatformStyle *platformStyle, QWidget *parent=0)
void setAddress(QString address)
Ui::ReceiveTokenPage * ui
void setClipboard(const QString &str)
Definition: guiutil.cpp:858
static bool createQRCode(QLabel *label, SendCoinsRecipient info, bool showAddress=false)
void setupUi(QWidget *ReceiveTokenPage)
void setSymbol(QString symbol)
const PlatformStyle * platformStyle
QIcon MultiStatesIcon(const QString &resourcename, StateType type=NavBar, QColor color=Qt::white, QColor colorAlt=0x2d2d2d) const
Get multi-states icon.
struct evm_uint160be address(struct evm_env *env)
Definition: capi.c:13