From 49e6733dac99a292a4288bffbebfeaf4984169d4 Mon Sep 17 00:00:00 2001 From: Martin Kleusberg Date: Fri, 1 Sep 2017 12:05:45 +0200 Subject: [PATCH] dbhub: Enforce name and commit message length limits in push dialog See issue #1097. --- src/RemotePushDialog.cpp | 3 +++ src/RemotePushDialog.ui | 22 +++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/RemotePushDialog.cpp b/src/RemotePushDialog.cpp index 53655fe8..2c810a27 100644 --- a/src/RemotePushDialog.cpp +++ b/src/RemotePushDialog.cpp @@ -42,6 +42,9 @@ void RemotePushDialog::checkInput() if(ui->editName->text().trimmed().isEmpty()) valid = false; + if(ui->editCommitMessage->toPlainText().size() > 1024) + valid = false; + ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(valid); } diff --git a/src/RemotePushDialog.ui b/src/RemotePushDialog.ui index af60604b..96951ebe 100644 --- a/src/RemotePushDialog.ui +++ b/src/RemotePushDialog.ui @@ -27,7 +27,11 @@ - + + + 256 + + @@ -172,6 +176,22 @@ p, li { white-space: pre-wrap; } + + editCommitMessage + textChanged() + RemotePushDialog + checkInput() + + + 175 + 113 + + + 91 + 111 + + + checkInput()