Skip to content

Commit

Permalink
Improved the error message of multiple top level entities
Browse files Browse the repository at this point in the history
Tell the user that its not possible to load a model saved with `saveTotalModel`.
  • Loading branch information
adeas31 committed Jul 11, 2019
1 parent 529511b commit 4c99eb3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion OMEdit/OMEdit/OMEditGUI/Modeling/LibraryTreeWidget.cpp
Expand Up @@ -4699,7 +4699,7 @@ bool LibraryWidget::multipleTopLevelClasses(const QStringList &classesList, cons
*/
if (classesList.size() > 1) {
QMessageBox *pMessageBox = new QMessageBox(MainWindow::instance());
pMessageBox->setWindowTitle(QString("%1 - %2)").arg(Helper::applicationName, Helper::error));
pMessageBox->setWindowTitle(QString("%1 - %2").arg(Helper::applicationName, Helper::error));
pMessageBox->setIcon(QMessageBox::Critical);
pMessageBox->setAttribute(Qt::WA_DeleteOnClose);
pMessageBox->setText(QString(GUIMessages::getMessage(GUIMessages::UNABLE_TO_LOAD_FILE).arg(fileName)));
Expand Down
4 changes: 3 additions & 1 deletion OMEdit/OMEdit/OMEditGUI/Util/Helper.cpp
Expand Up @@ -759,7 +759,9 @@ QString GUIMessages::getMessage(int type)
case REDEFINING_EXISTING_CLASSES:
return tr("Redefining class(es) <b>%1</b> which already exist(s).");
case MULTIPLE_TOP_LEVEL_CLASSES:
return tr("Only single nonstructured entity is allowed to be stored in the file. <b>%1</b> contains following classes <b>%2</b>.");
return tr("Only single nonstructured entity is allowed to be stored in the file.<br />"
"If the file was generated by the API function <b>saveTotalModel()</b>, you can only load it with the API function <b>loadFile()</b> in a script or in the interactive environment, not in OMEdit."
"<br /><br /><b>%1</b> contains following classes <b>%2</b>.");
case DIAGRAM_VIEW_DROP_MSG:
return tr("You cannot insert <b>%1</b>, it is a <b>%2</b>. Only <b>model</b>, <b>class</b>, <b>connector</b>, <b>record</b> or <b>block</b> is allowed on the diagram layer.");
case ICON_VIEW_DROP_MSG:
Expand Down

0 comments on commit 4c99eb3

Please sign in to comment.