#26 Disallow blank memos to zboard

This commit is contained in:
adityapk00
2018-11-06 08:04:44 -08:00
parent 23018c19cd
commit dad6c3b636

View File

@@ -492,6 +492,14 @@ void MainWindow::postToZBoard() {
zb.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
zb.memoSize->setStyleSheet("color: red;");
}
// Disallow blank memos
if (zb.memoTxt->toPlainText().trimmed().isEmpty()) {
zb.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
}
else {
zb.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
}
};
// Memo text changed
@@ -499,6 +507,7 @@ void MainWindow::postToZBoard() {
QObject::connect(zb.postAs, &QLineEdit::textChanged, fnUpdateMemoSize);
zb.memoTxt->setFocus();
fnUpdateMemoSize();
if (d.exec() == QDialog::Accepted) {
// Create a transaction.