#26 Disallow blank memos to zboard
This commit is contained in:
@@ -492,6 +492,14 @@ void MainWindow::postToZBoard() {
|
|||||||
zb.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
|
zb.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
|
||||||
zb.memoSize->setStyleSheet("color: red;");
|
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
|
// Memo text changed
|
||||||
@@ -499,6 +507,7 @@ void MainWindow::postToZBoard() {
|
|||||||
QObject::connect(zb.postAs, &QLineEdit::textChanged, fnUpdateMemoSize);
|
QObject::connect(zb.postAs, &QLineEdit::textChanged, fnUpdateMemoSize);
|
||||||
|
|
||||||
zb.memoTxt->setFocus();
|
zb.memoTxt->setFocus();
|
||||||
|
fnUpdateMemoSize();
|
||||||
|
|
||||||
if (d.exec() == QDialog::Accepted) {
|
if (d.exec() == QDialog::Accepted) {
|
||||||
// Create a transaction.
|
// Create a transaction.
|
||||||
|
|||||||
Reference in New Issue
Block a user