Skip to content

Commit

Permalink
fix path to OMNotebookHelp.onb on OS X
Browse files Browse the repository at this point in the history
  • Loading branch information
hkiel committed Dec 20, 2016
1 parent 484baa8 commit 4b750e7
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions OMNotebook/OMNotebookGUI/notebook.cpp
Expand Up @@ -2633,24 +2633,16 @@ void NotebookWindow::helpText()
try
{
QDir dir;
QString help( getenv( "OPENMODELICAHOME" ) );
if( help.isEmpty() )
QMessageBox::critical( 0, "OpenModelica Error", "Could not find environment variable OPENMODELICAHOME; OMNotebook will therefore not work correctly" );
QString helpFile = OmcInteractiveEnvironment::OpenModelicaHome() + "/share/omnotebook/OMNotebookHelp.onb";

if( !help.endsWith("/") && !help.endsWith( "\\") )
help += "/";
help += "share/omnotebook/";

QString helpFile = "OMNotebookHelp.onb";
dir.setPath( help );
if( dir.exists( helpFile ) )
{
application()->commandCenter()->executeCommand(
new OpenFileCommand( help + helpFile ));
new OpenFileCommand( helpFile ));
}
else
{
QString msg = QString( "Could not find the help doucment: OMNotebookHelp.onb in path: " ) + dir.path();
QString msg = QString( "Could not find the help document OMNotebookHelp.onb" );
QMessageBox::warning( 0, "Warning", msg, "OK" );
}
}
Expand Down

0 comments on commit 4b750e7

Please sign in to comment.