Skip to content

Commit 7864f66

Browse files
committed
- Save as for meta models
1 parent 4b6af89 commit 7864f66

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

OMEdit/OMEditGUI/Modeling/LibraryTreeWidget.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3139,8 +3139,17 @@ void LibraryWidget::saveAsLibraryTreeItem(LibraryTreeItem *pLibraryTreeItem)
31393139
if (pLibraryTreeItem->getModelWidget() && !pLibraryTreeItem->getModelWidget()->validateText(&pLibraryTreeItem)) {
31403140
return;
31413141
}
3142-
DuplicateClassDialog *pDuplicateClassDialog = new DuplicateClassDialog(true, pLibraryTreeItem, mpMainWindow);
3143-
pDuplicateClassDialog->exec();
3142+
if (pLibraryTreeItem->getLibraryType() == LibraryTreeItem::Modelica) {
3143+
DuplicateClassDialog *pDuplicateClassDialog = new DuplicateClassDialog(true, pLibraryTreeItem, mpMainWindow);
3144+
pDuplicateClassDialog->exec();
3145+
} else if (pLibraryTreeItem->getLibraryType() == LibraryTreeItem::MetaModel) {
3146+
saveMetaModelLibraryTreeItem(pLibraryTreeItem);
3147+
} else if (pLibraryTreeItem->getLibraryType() == LibraryTreeItem::Text) {
3148+
saveMetaModelLibraryTreeItem(pLibraryTreeItem);
3149+
} else {
3150+
QMessageBox::information(this, Helper::applicationName + " - " + Helper::error, GUIMessages::getMessage(GUIMessages::ERROR_OCCURRED)
3151+
.arg(tr("Unable to save the file, unknown library type.")), Helper::ok);
3152+
}
31443153
}
31453154

31463155
/*!

0 commit comments

Comments
 (0)