#34 - Fix memo address validation
This commit is contained in:
@@ -92,7 +92,7 @@ private:
|
|||||||
|
|
||||||
void restoreSavedStates();
|
void restoreSavedStates();
|
||||||
|
|
||||||
QString addressFromAddressField(const QString& lblAddr) { return lblAddr.split("/").last(); }
|
QString addressFromAddressField(const QString& lblAddr) { return lblAddr.trimmed().split("/").last(); }
|
||||||
|
|
||||||
RPC* rpc = nullptr;
|
RPC* rpc = nullptr;
|
||||||
QCompleter* labelCompleter = nullptr;
|
QCompleter* labelCompleter = nullptr;
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ void MainWindow::setMemoEnabled(int number, bool enabled) {
|
|||||||
void MainWindow::memoButtonClicked(int number) {
|
void MainWindow::memoButtonClicked(int number) {
|
||||||
// Memos can only be used with zAddrs. So check that first
|
// Memos can only be used with zAddrs. So check that first
|
||||||
auto addr = ui->sendToWidgets->findChild<QLineEdit*>(QString("Address") + QString::number(number));
|
auto addr = ui->sendToWidgets->findChild<QLineEdit*>(QString("Address") + QString::number(number));
|
||||||
if (!addr->text().trimmed().startsWith("z")) {
|
if (!addressFromAddressField(addr->text()).startsWith("z")) {
|
||||||
QMessageBox msg(QMessageBox::Critical, "Memos can only be used with z-addresses",
|
QMessageBox msg(QMessageBox::Critical, "Memos can only be used with z-addresses",
|
||||||
"The memo field can only be used with a z-address.\n" + addr->text() + "\ndoesn't look like a z-address",
|
"The memo field can only be used with a z-address.\n" + addr->text() + "\ndoesn't look like a z-address",
|
||||||
QMessageBox::Ok, this);
|
QMessageBox::Ok, this);
|
||||||
|
|||||||
Reference in New Issue
Block a user