Changeset View
Changeset View
Standalone View
Standalone View
src/qt/guiutil.cpp
Show First 20 Lines • Show All 138 Lines • ▼ Show 20 Lines | std::string DummyAddress(const CChainParams ¶ms, const Config &cfg) { | ||||
const CTxDestination dstKey = CKeyID(uint160(dummydata)); | const CTxDestination dstKey = CKeyID(uint160(dummydata)); | ||||
return MakeAddrInvalid(EncodeDestination(dstKey, params, cfg)); | return MakeAddrInvalid(EncodeDestination(dstKey, params, cfg)); | ||||
} | } | ||||
void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent) { | void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent) { | ||||
parent->setFocusProxy(widget); | parent->setFocusProxy(widget); | ||||
widget->setFont(fixedPitchFont()); | widget->setFont(fixedPitchFont()); | ||||
const CChainParams ¶ms = Params(); | |||||
#if QT_VERSION >= 0x040700 | #if QT_VERSION >= 0x040700 | ||||
// We don't want translators to use own addresses in translations | // We don't want translators to use own addresses in translations | ||||
// and this is the only place, where this address is supplied. | // and this is the only place, where this address is supplied. | ||||
widget->setPlaceholderText(QObject::tr("Enter a Bitcoin address (e.g. %1)") | widget->setPlaceholderText( | ||||
.arg(QString::fromStdString(DummyAddress( | QObject::tr("Enter a Bitcoin address (e.g. %1)") | ||||
Params(), GlobalConfig())))); | .arg(QString::fromStdString(DummyAddress(params, GetConfig())))); | ||||
#endif | #endif | ||||
widget->setValidator(new BitcoinAddressEntryValidator(parent)); | widget->setValidator( | ||||
new BitcoinAddressEntryValidator(params.CashAddrPrefix(), parent)); | |||||
widget->setCheckValidator(new BitcoinAddressCheckValidator(parent)); | widget->setCheckValidator(new BitcoinAddressCheckValidator(parent)); | ||||
} | } | ||||
void setupAmountWidget(QLineEdit *widget, QWidget *parent) { | void setupAmountWidget(QLineEdit *widget, QWidget *parent) { | ||||
QDoubleValidator *amountValidator = new QDoubleValidator(parent); | QDoubleValidator *amountValidator = new QDoubleValidator(parent); | ||||
amountValidator->setDecimals(8); | amountValidator->setDecimals(8); | ||||
amountValidator->setBottom(0.0); | amountValidator->setBottom(0.0); | ||||
widget->setValidator(amountValidator); | widget->setValidator(amountValidator); | ||||
▲ Show 20 Lines • Show All 834 Lines • Show Last 20 Lines |