#34 Properly validate address field when there is a label
This commit is contained in:
@@ -92,6 +92,8 @@ private:
|
|||||||
|
|
||||||
void restoreSavedStates();
|
void restoreSavedStates();
|
||||||
|
|
||||||
|
QString addressFromAddressField(const QString& lblAddr) { return lblAddr.split("/").last(); }
|
||||||
|
|
||||||
RPC* rpc = nullptr;
|
RPC* rpc = nullptr;
|
||||||
QCompleter* labelCompleter = nullptr;
|
QCompleter* labelCompleter = nullptr;
|
||||||
|
|
||||||
|
|||||||
@@ -244,7 +244,8 @@ void MainWindow::addAddressSection() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::addressChanged(int itemNumber, const QString& text) {
|
void MainWindow::addressChanged(int itemNumber, const QString& text) {
|
||||||
setMemoEnabled(itemNumber, text.startsWith("z"));
|
auto addr = addressFromAddressField(text);
|
||||||
|
setMemoEnabled(itemNumber, addr.startsWith("z"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::amountChanged(int item, const QString& text) {
|
void MainWindow::amountChanged(int item, const QString& text) {
|
||||||
@@ -376,7 +377,7 @@ Tx MainWindow::createTxFromSendPage() {
|
|||||||
for (int i=0; i < totalItems; i++) {
|
for (int i=0; i < totalItems; i++) {
|
||||||
QString addr = ui->sendToWidgets->findChild<QLineEdit*>(QString("Address") % QString::number(i+1))->text().trimmed();
|
QString addr = ui->sendToWidgets->findChild<QLineEdit*>(QString("Address") % QString::number(i+1))->text().trimmed();
|
||||||
// Remove label if it exists
|
// Remove label if it exists
|
||||||
addr = addr.split("/").last();
|
addr = addressFromAddressField(addr);
|
||||||
|
|
||||||
double amt = ui->sendToWidgets->findChild<QLineEdit*>(QString("Amount") % QString::number(i+1))->text().trimmed().toDouble();
|
double amt = ui->sendToWidgets->findChild<QLineEdit*>(QString("Amount") % QString::number(i+1))->text().trimmed().toDouble();
|
||||||
QString memo = ui->sendToWidgets->findChild<QLabel*>(QString("MemoTxt") % QString::number(i+1))->text().trimmed();
|
QString memo = ui->sendToWidgets->findChild<QLabel*>(QString("MemoTxt") % QString::number(i+1))->text().trimmed();
|
||||||
|
|||||||
Reference in New Issue
Block a user