Skip to content

Commit

Permalink
Improve messages in incorrect editor modes for better feedback
Browse files Browse the repository at this point in the history
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 885f4f7 see issue
#1438
  • Loading branch information
mgrojo committed Jun 20, 2018
1 parent 885f4f7 commit 614068a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/EditDialog.cpp
Expand Up @@ -194,15 +194,17 @@ 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;

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;
Expand Down Expand Up @@ -258,15 +260,17 @@ 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;

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;

Expand Down

0 comments on commit 614068a

Please sign in to comment.