Skip to content

Commit

Permalink
- Display warning if model_init.xml file not found.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@23833 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Dec 17, 2014
1 parent e89c071 commit 212febd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion OMEdit/OMEditGUI/Modeling/LibraryTreeWidget.cpp
Expand Up @@ -169,7 +169,7 @@ void ItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
if (!icon.isNull()) {
// adjust the decorationRect for multiline items. So that icon remains at top.
if (mDrawRichText) {
decorationRect = QRect(decorationRect.left(), displayRect.top() + 3, decorationRect.width(), decorationRect.height());
decorationRect = QRect(decorationRect.left(), displayRect.top() + 4, decorationRect.width(), decorationRect.height());
}
icon.paint(painter, decorationRect, option.decorationAlignment, QIcon::Normal, QIcon::Off);
} else {
Expand Down
9 changes: 3 additions & 6 deletions OMEdit/OMEditGUI/Plotting/VariablesWidget.cpp
Expand Up @@ -437,18 +437,15 @@ void VariablesTreeModel::insertVariablesItems(QString fileName, QString filePath
/* open the model_init.xml file for reading */
QString initFileName = QString(fileName).replace(resultTypeRegExp, "_init.xml");
QFile initFile(QString(filePath).append(QDir::separator()).append(initFileName));
if (initFile.open(QIODevice::ReadOnly))
{
if (initFile.open(QIODevice::ReadOnly)) {
QXmlStreamReader initXmlReader(&initFile);
parseInitXml(initXmlReader);
initFile.close();
}
else
{
} else {
MessagesWidget *pMessagesWidget = mpVariablesTreeView->getVariablesWidget()->getMainWindow()->getMessagesWidget();
pMessagesWidget->addGUIMessage(new MessageItem("", false, 0, 0, 0, 0,
GUIMessages::getMessage(GUIMessages::ERROR_OPENING_FILE).arg(initFile.fileName())
.arg(initFile.errorString()),Helper::scriptingKind, Helper::errorLevel, 0));
.arg(initFile.errorString()),Helper::scriptingKind, Helper::warningLevel, 0));
}
/* open the .mat file */
ModelicaMatReader matReader;
Expand Down

0 comments on commit 212febd

Please sign in to comment.