From 614068a57a86c5b903984a6735ae9a3cba3c7e88 Mon Sep 17 00:00:00 2001 From: mgrojo Date: Thu, 21 Jun 2018 00:24:34 +0200 Subject: [PATCH] Improve messages in incorrect editor modes for better feedback The messages in the invalid modes for the current data type in "Edit Database Cell" are improved for giving hint to the user about the correct modes. For this commit and 885f4f7847a46d85f45501ff67bde089830e81f6 see issue #1438 --- src/EditDialog.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/EditDialog.cpp b/src/EditDialog.cpp index f74d2b12..e2fafbb5 100644 --- a/src/EditDialog.cpp +++ b/src/EditDialog.cpp @@ -194,7 +194,8 @@ void EditDialog::loadData(const QByteArray& data) case TextEditor: // Disable text editing, and use a warning message as the contents ui->editorText->setText(QString("" % - tr("Image data can't be viewed with the text editor") % + tr("Image data can't be viewed in this mode.") % "
" % + tr("Try switching to Image or Binary mode.") % "
")); ui->editorText->setEnabled(false); break; @@ -202,7 +203,8 @@ void EditDialog::loadData(const QByteArray& data) case XmlEditor: case JsonEditor: // Disable text editing, and use a warning message as the contents - sciEdit->setText(tr("Image data can't be viewed with this editor")); + sciEdit->setText(tr("Image data can't be viewed in this mode.") % '\n' % + tr("Try switching to Image or Binary mode.")); sciEdit->setEnabled(false); break; @@ -258,7 +260,8 @@ void EditDialog::loadData(const QByteArray& data) case TextEditor: // Disable text editing, and use a warning message as the contents ui->editorText->setText(QString("" % - tr("Binary data can't be viewed with the text editor") % + tr("Binary data can't be viewed in this mode.") % "
" % + tr("Try switching to Binary mode.") % "
")); ui->editorText->setEnabled(false); break; @@ -266,7 +269,8 @@ void EditDialog::loadData(const QByteArray& data) case JsonEditor: case XmlEditor: // Disable text editing, and use a warning message as the contents - sciEdit->setText(QString(tr("Binary data can't be viewed with this editor"))); + sciEdit->setText(QString(tr("Binary data can't be viewed in this mode.") % '\n' % + tr("Try switching to Binary mode."))); sciEdit->setEnabled(false); break;