6 #include "ui_requestdialog.h"
20 this->setStyleSheet(parent->styleSheet());
45 ui->stack->setCurrentIndex(
pos);
48 ui->labelAddress->setText(tr(
"Error"));
58 connect(
ui->btnCancel, &QPushButton::clicked,
this, &RequestDialog::close);
59 connect(
ui->btnEsc, &QPushButton::clicked,
this, &RequestDialog::close);
76 ui->labelMessage->setText(tr(
"Creates an address to receive coin delegations and be able to stake them."));
77 ui->labelTitle->setText(tr(
"New Cold Staking Address"));
78 ui->labelSubtitleAmount->setText(tr(
"Amount (optional)"));
85 QString labelStr =
ui->lineEditLabel->text();
89 if (labelStr.isEmpty()) {
90 inform(tr(
"Address label cannot be empty"));
96 auto value =
ui->lineEditAmount->text().isEmpty() ? 0 :
97 GUIUtil::parseValue(
ui->lineEditAmount->text(), displayUnit);
100 inform(tr(
"Invalid amount"));
114 if (this->isPaymentRequest) {
119 title = tr(
"Cold Staking Address Generated");
129 ui->labelTitle->setText(title);
133 ui->buttonsStack->setVisible(
false);
135 ui->stack->setCurrentIndex(
pos);
159 if (
ui->lineEditAmount)
ui->lineEditAmount->setFocus();
165 ui->labelQrImg->setText(
"");
168 if (!pixmap.isNull()) {
169 ui->labelQrImg->setPixmap(pixmap.scaled(
ui->labelQrImg->width(),
ui->labelQrImg->height()));
171 ui->labelQrImg->setText(!
error.isEmpty() ?
error :
"Error encoding address");
static QString format(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard, bool cleanRemainderZeros=true)
Format as string.
static QString name(int unit, bool isZpiv=false)
Short name.
const Optional< T > & getObjResult() const
RequestDialog(QWidget *parent=nullptr)
void updateQr(const QString &str)
void setWalletModel(WalletModel *model)
WalletModel * walletModel
void showEvent(QShowEvent *event) override
void inform(const QString &text)
void setPaymentRequest(bool _isPaymentRequest)
SendCoinsRecipient * info
void setText(const QString &text)
Interface to PIVX wallet from Qt view code.
CallResult< Destination > getNewAddress(const std::string &label="") const
OptionsModel * getOptionsModel()
CallResult< Destination > getNewStakingAddress(const std::string &label="") const
Return a new address used to receive for delegated cold stake purpose.
void setupAmountWidget(QLineEdit *widget, QWidget *parent)
QString formatBitcoinURI(const SendCoinsRecipient &info)
void setClipboard(const QString &str)
void setCssEditLineDialog(QLineEdit *edit, bool isValid, bool forceUpdate)
void setCssProperty(std::initializer_list< QWidget * > args, const QString &value)
QPixmap encodeToQr(const QString &str, QString &errorStr, const QColor &qrColor)
void setCssBtnPrimary(QPushButton *btn, bool forceUpdate)
bool openDialog(QDialog *widget, QWidget *gui)
bool error(const char *fmt, const Args &... args)