Skip to content

Commit

Permalink
Show an error message if model_info.json file is not found.
Browse files Browse the repository at this point in the history
Show the source when opening TransformationsWidget.
  • Loading branch information
adeas31 committed Jan 13, 2017
1 parent c067dd3 commit 5d4e26e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions OMEdit/OMEditGUI/Simulation/SimulationOutputWidget.cpp
Expand Up @@ -49,6 +49,7 @@
#include <QDesktopWidget>
#include <QClipboard>
#include <QTcpSocket>
#include <QMessageBox>

/*!
* \class SimulationOutputTree
Expand Down Expand Up @@ -381,7 +382,7 @@ void SimulationOutputWidget::writeSimulationMessage(SimulationMessage *pSimulati
mpSimulationOutputTextBrowser->insertPlainText(error);
/* write the error link */
if (!pSimulationMessage->mIndex.isEmpty()) {
mpSimulationOutputTextBrowser->insertHtml("&nbsp;<a href=\"omedittransformationsbrowser://" + QUrl::fromLocalFile(mSimulationOptions.getWorkingDirectory() + "/" + mSimulationOptions.getFileNamePrefix() + "_info.json").path() + "?index=" + pSimulationMessage->mIndex + "\">Debug more</a><br />");
mpSimulationOutputTextBrowser->insertHtml("&nbsp;<a href=\"omedittransformationsbrowser://" + QUrl::fromLocalFile(mSimulationOptions.getWorkingDirectory() + "/" + mSimulationOptions.getOutputFileName() + "_info.json").path() + "?index=" + pSimulationMessage->mIndex + "\">Debug more</a><br />");
} else {
mpSimulationOutputTextBrowser->insertPlainText("\n");
}
Expand Down Expand Up @@ -649,6 +650,8 @@ void SimulationOutputWidget::openTransformationBrowser(QUrl url)
}
pTransformationsWidget->fetchEquationData(equationIndex);
} else {
/* TODO: Display error-message */
QMessageBox::critical(this, QString("%1 - %2").arg(Helper::applicationName, Helper::error), QString("%1<br />%2")
.arg(GUIMessages::getMessage(GUIMessages::FILE_NOT_FOUND).arg(fileName))
.arg(tr("Url is <b>%1</b>").arg(url.toString())), Helper::ok);
}
}
Expand Up @@ -881,6 +881,7 @@ void TransformationsWidget::loadTransformations()
fetchEquations();
hasOperationsEnabled = mpInfoXMLFileHandler->hasOperationsEnabled;
}
fetchVariableData(mpTVariableTreeProxyModel->index(0, 0));
}

void TransformationsWidget::fetchDefinedInEquations(const OMVariable &variable)
Expand Down

0 comments on commit 5d4e26e

Please sign in to comment.