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 885f4f7847 see issue
#1438
This commit is contained in:
mgrojo
2018-06-21 00:24:34 +02:00
parent 885f4f7847
commit 614068a57a

View File

@@ -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("<i>" %
tr("Image data can't be viewed with the text editor") %
tr("Image data can't be viewed in this mode.") % "<br/>" %
tr("Try switching to Image or Binary mode.") %
"</i>"));
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("<i>" %
tr("Binary data can't be viewed with the text editor") %
tr("Binary data can't be viewed in this mode.") % "<br/>" %
tr("Try switching to Binary mode.") %
"</i>"));
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;