Changeset View
Changeset View
Standalone View
Standalone View
src/qt/guiutil.cpp
Show First 20 Lines • Show All 153 Lines • ▼ Show 20 Lines | |||||
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); | ||||
widget->setAlignment(Qt::AlignRight | Qt::AlignVCenter); | widget->setAlignment(Qt::AlignRight | Qt::AlignVCenter); | ||||
} | } | ||||
QString bitcoinURIScheme(const CChainParams ¶ms, bool useCashAddr) { | |||||
if (!useCashAddr) { | |||||
return "bitcoincash"; | |||||
} | |||||
return QString::fromStdString(params.CashAddrPrefix()); | |||||
} | |||||
QString bitcoinURIScheme(const Config &config) { | |||||
return bitcoinURIScheme(config.GetChainParams(), | |||||
config.UseCashAddrEncoding()); | |||||
} | |||||
static bool IsCashAddrEncoded(const QUrl &uri) { | static bool IsCashAddrEncoded(const QUrl &uri) { | ||||
const std::string addr = (uri.scheme() + ":" + uri.path()).toStdString(); | const std::string addr = (uri.scheme() + ":" + uri.path()).toStdString(); | ||||
auto decoded = cashaddr::Decode(addr, ""); | auto decoded = cashaddr::Decode(addr, ""); | ||||
return !decoded.first.empty(); | return !decoded.first.empty(); | ||||
} | } | ||||
bool parseBitcoinURI(const QString &scheme, const QUrl &uri, | bool parseBitcoinURI(const QString &scheme, const QUrl &uri, | ||||
SendCoinsRecipient *out) { | SendCoinsRecipient *out) { | ||||
▲ Show 20 Lines • Show All 851 Lines • Show Last 20 Lines |