From 4c99eb3ce7a8bbac7d7825a27f0df0a4e6404a7a Mon Sep 17 00:00:00 2001 From: Adeel Asghar Date: Thu, 11 Jul 2019 09:41:36 +0200 Subject: [PATCH] Improved the error message of multiple top level entities Tell the user that its not possible to load a model saved with `saveTotalModel`. --- OMEdit/OMEdit/OMEditGUI/Modeling/LibraryTreeWidget.cpp | 2 +- OMEdit/OMEdit/OMEditGUI/Util/Helper.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/OMEdit/OMEdit/OMEditGUI/Modeling/LibraryTreeWidget.cpp b/OMEdit/OMEdit/OMEditGUI/Modeling/LibraryTreeWidget.cpp index f991ddfe0bb..94e3a05e9f8 100644 --- a/OMEdit/OMEdit/OMEditGUI/Modeling/LibraryTreeWidget.cpp +++ b/OMEdit/OMEdit/OMEditGUI/Modeling/LibraryTreeWidget.cpp @@ -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))); diff --git a/OMEdit/OMEdit/OMEditGUI/Util/Helper.cpp b/OMEdit/OMEdit/OMEditGUI/Util/Helper.cpp index ae9ff3626f4..f3a602f29b7 100644 --- a/OMEdit/OMEdit/OMEditGUI/Util/Helper.cpp +++ b/OMEdit/OMEdit/OMEditGUI/Util/Helper.cpp @@ -759,7 +759,9 @@ QString GUIMessages::getMessage(int type) case REDEFINING_EXISTING_CLASSES: return tr("Redefining class(es) %1 which already exist(s)."); case MULTIPLE_TOP_LEVEL_CLASSES: - return tr("Only single nonstructured entity is allowed to be stored in the file. %1 contains following classes %2."); + return tr("Only single nonstructured entity is allowed to be stored in the file.
" + "If the file was generated by the API function saveTotalModel(), you can only load it with the API function loadFile() in a script or in the interactive environment, not in OMEdit." + "

%1 contains following classes %2."); case DIAGRAM_VIEW_DROP_MSG: return tr("You cannot insert %1, it is a %2. Only model, class, connector, record or block is allowed on the diagram layer."); case ICON_VIEW_DROP_MSG: