Skip to content

Commit

Permalink
added functionality so OMNotebook and OMShell check version from OMC.…
Browse files Browse the repository at this point in the history
… //Anders Fernström

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@2468 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
x05andfe committed Aug 17, 2006
1 parent 6aeb384 commit f9e52cf
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
5 changes: 3 additions & 2 deletions OMNotebook/OMNotebookQT4/notebook.cpp
Expand Up @@ -2327,8 +2327,9 @@ namespace IAEX
*/
void NotebookWindow::aboutQTNotebook()
{
QString abouttext = QString("OMNotebook version 2.0 (for OpenModelica v1.4.0)\r\n") +
QString("Copyright 2004-2006, PELAB, Linkoping University\r\n\r\n") +
QString version = OmcInteractiveEnvironment::OMCVersion();
QString abouttext = QString("OMNotebook version 2.0 (for OpenModelica ") + version +
QString(")\r\n") + QString("Copyright 2004-2006, PELAB, Linkoping University\r\n\r\n") +
QString("Created by Ingemar Axelsson (2004-2005) and Anders Fernström (2005-2006) as part of their final theses.");

QMessageBox::about( this, "OMNotebook", abouttext );
Expand Down
26 changes: 26 additions & 0 deletions OMNotebook/OMNotebookQT4/omcinteractiveenvironment.cpp
Expand Up @@ -309,4 +309,30 @@ namespace IAEX

return flag;
}

/*!
* \author Anders Fernström
* \date 2006-08-17
*
*\brief Ststic method for returning the version of omc
*/
QString OmcInteractiveEnvironment::OMCVersion()
{
QString version( "(version)" );

try
{
OmcInteractiveEnvironment *env = new OmcInteractiveEnvironment();
env->evalExpression( QString( "getVersion()" ));
version = env->getResult();
version.remove( "\"" );
delete env;
}
catch( exception &e )
{
QMessageBox::critical( 0, "OMC Error", "Unable to get OMC version, OMC is not started." );
}

return version;
}
}
1 change: 1 addition & 0 deletions OMNotebook/OMNotebookQT4/omcinteractiveenvironment.h
Expand Up @@ -68,6 +68,7 @@ namespace IAEX
virtual void reconnect(); // Added 2006-02-02 AF
virtual bool startDelegate(); // Added 2006-02-09 AF
static bool startOMC(); // Added 2006-02-09 AF
static QString OMCVersion(); // Added 2006-08-17 AF



Expand Down

0 comments on commit f9e52cf

Please sign in to comment.