Skip to content

Commit

Permalink
Updated the screen shots in user manual and added the page numbers.
Browse files Browse the repository at this point in the history
Changed the Open Modelica to OpenModelica in OMEdit source code.
Added the new keywords to syntax highlighter class.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7179 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Nov 24, 2010
1 parent dce2c55 commit 7f254f1
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 19 deletions.
4 changes: 2 additions & 2 deletions OMEdit/OMEditGUI/Helper.cpp
Expand Up @@ -35,7 +35,7 @@

QString Helper::applicationName = "OMEdit";
QString Helper::applicationVersion = "1.0";
QString Helper::applicationIntroText = "Open Modelica Connection Editor";
QString Helper::applicationIntroText = "OpenModelica Connection Editor";
QString Helper::OpenModelicaHome = getenv("OPENMODELICAHOME");
QString Helper::omcServerName = "OMEdit";
QString Helper::omFileTypes = "*.mo";
Expand Down Expand Up @@ -100,7 +100,7 @@ QString GUIMessages::getMessage(int type)
case UNDO_OR_FIX_ERRORS:
return "\n\nFor normal users it is recommended to choose 'Undo changes'. You can also choose 'Let me fix errors' if you want to fix them by your own.";
case NO_OPEN_MODELICA_KEYWORDS:
return "Please make sure you are not using any Open Modelica Keywords like (model, package, record, class etc.)";
return "Please make sure you are not using any OpenModelica Keywords like (model, package, record, class etc.)";
case INCOMPATIBLE_CONNECTORS:
return "Incompatible types for the connectors.";
case SAVE_CHANGES:
Expand Down
12 changes: 10 additions & 2 deletions OMEdit/OMEditGUI/ModelicaEditor.cpp
Expand Up @@ -138,8 +138,16 @@ void ModelicaTextHighlighter::initializeSettings()

mKeywordFormat.setForeground(mpModelicaTextSettings->getKeywordRuleColor());
QStringList keywordPatterns;
keywordPatterns << "\\bextends\\b" << "\\bpublic\\b" << "\\bReal\\b" << "\\bBoolean\\b" << "\\bequation\\b"
<< "\\bvoid\\b" << "\\bend\\b";
keywordPatterns << "\\balgorithm\\b" << "\\band\\b" << "\\bannotation\\b" << "\\bassert\\b" << "\\bbreak\\b"
<< "\\bBoolean\\b" << "\\bconnect\\b" <<"\\bconstant\\b" << "\\bconstrainedby\\b" << "\\bder\\b" << "\\bdiscrete\\b"
<< "\\beach\\b" << "\\belse\\b" << "\\belseif\\b" "\\belsewhen\\b" << "\\bencapsulated\\b"
<< "\\bend\\b" << "\\benumeration\\b" << "\\bequation\\b" << "\\bexpandable\\b" << "\\bextends\\b"
<< "\\bexternal\\b" << "\\bfalse\\b" << "\\bfinal\\b" << "\\bflow\\b" << "\\bfor\\b"
<< "\\bif\\b" << "\\bimport\\b" << "\\bin\\b" << "\\binitial\\b" << "\\binner\\b" << "\\binput\\b"
<< "\\bloop\\b" << "\\bnot\\b" << "\\boperator\\b" << "\\bor\\b" << "\\bouter\\b"
<< "\\boutput\\b" << "\\bpartial\\b" << "\\bpublic\\b" << "\\bReal\\b" << "\\bredeclare\\b"
<< "\\breplaceable\\b" << "\\breturn\\b" << "\\bstream\\b" << "\\bthen\\b" << "\\btrue\\b"
<< "\\bwhen\\b" << "\\bwhile\\b" << "\\bwithin\\b";
foreach (const QString &pattern, keywordPatterns)
{
rule.mPattern = QRegExp(pattern);
Expand Down
12 changes: 6 additions & 6 deletions OMEdit/OMEditGUI/OMCProxy.cpp
Expand Up @@ -35,7 +35,7 @@
//! @author Sonia Tariq <sonta273@student.liu.se>
//! @date 2010-06-25

//! @brief Contains functions used for communication with Open Modelica Compiler.
//! @brief Contains functions used for communication with OpenModelica Compiler.

#include <stdexcept>
#include <stdlib.h>
Expand All @@ -46,7 +46,7 @@
#include <omniORB4/CORBA.h>

//! @class OMCProxy
//! @brief The OMCProxy is a singleton class. It contains the reference of the CORBA object used to communicate with the Open Modelica Compiler.
//! @brief The OMCProxy is a singleton class. It contains the reference of the CORBA object used to communicate with the OpenModelica Compiler.

//! Constructor
//! @param mOMC is the CORBA object.
Expand Down Expand Up @@ -111,7 +111,7 @@ void OMCProxy::getNextCommand()
mCommandsList.removeFirst();
}

//! Starts the Open Modelica Compiler.
//! Starts the OpenModelica Compiler.
bool OMCProxy::startServer()
{
try
Expand Down Expand Up @@ -250,7 +250,7 @@ bool OMCProxy::startServer()
return true;
}

//! Stops the Open Modelica Compiler. Kill the process omc and also deletes the CORBA reference file.
//! Stops the OpenModelica Compiler. Kill the process omc and also deletes the CORBA reference file.
//! @see startServer
void OMCProxy::stopServer()
{
Expand Down Expand Up @@ -446,7 +446,7 @@ QString OMCProxy::getEnvironmentVar(QString name)
return getResult();
}

//! Loads the Open Modelica Standard Library.
//! Loads the OpenModelica Standard Library.
void OMCProxy::loadStandardLibrary()
{
sendCommand("loadModel(Modelica)");
Expand All @@ -464,7 +464,7 @@ void OMCProxy::loadStandardLibrary()
}
}

//! Checks whether the Open Modelica Standard Library is loaded or not.
//! Checks whether the OpenModelica Standard Library is loaded or not.
bool OMCProxy::isStandardLibraryLoaded()
{
return mIsStandardLibraryLoaded;
Expand Down
2 changes: 1 addition & 1 deletion OMEdit/OMEditGUI/OMCThread.cpp
Expand Up @@ -35,7 +35,7 @@
//! @author Sonia Tariq <sonta273@student.liu.se>
//! @date 2010-07-09

//! @brief Used to send the command to Open Modelica Compiler in a thread.
//! @brief Used to send the command to OpenModelica Compiler in a thread.

#include "OMCThread.h"

Expand Down
4 changes: 3 additions & 1 deletion OMEdit/OMEditGUI/OptionsWidget.cpp
Expand Up @@ -305,7 +305,8 @@ void OptionsWidget::setUpDialog()
mpOptionsList = new QListWidget;
mpOptionsList->setViewMode(QListView::ListMode);
mpOptionsList->setMovement(QListView::Static);
mpOptionsList->setMaximumWidth(128);
mpOptionsList->setIconSize(Helper::iconSize);
mpOptionsList->setMaximumWidth(150);
mpOptionsList->setCurrentRow(0, QItemSelectionModel::Select);
connect(mpOptionsList, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)),
SLOT(changePage(QListWidgetItem*,QListWidgetItem*)));
Expand Down Expand Up @@ -343,6 +344,7 @@ void OptionsWidget::setUpDialog()
void OptionsWidget::addListItems()
{
QListWidgetItem *modelicaTextEditorItem = new QListWidgetItem(mpOptionsList);
modelicaTextEditorItem->setIcon(QIcon(":/Resources/icons/modeltext.png"));
modelicaTextEditorItem->setText(tr("Modelica Text Editor"));
}

Expand Down
19 changes: 16 additions & 3 deletions OMEdit/OMEditGUI/ProjectTabWidget.cpp
Expand Up @@ -70,8 +70,21 @@ GraphicsView::GraphicsView(int iconType, ProjectTab *parent)
this->createActions();
this->createMenus();

if (mIconType == StringHandler::ICON)
this->setStyleSheet("background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 lightGray, stop: 1 gray);");
// if user is viewing some readonly component then dont draw backgrounds.
if (!mpParentProjectTab->isReadOnly())
{
if (mIconType == StringHandler::ICON)
{
this->setStyleSheet(QString("background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1")
.append(", stop: 0 lightGray, stop: 1 gray);"));
}
// change the background shade if user is in Icon View
else if (mIconType == StringHandler::DIAGRAM)
{
this->setStyleSheet(QString("background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1")
.append(", stop: 0 gray, stop: 1 lightGray);"));
}
}

connect(mpParentProjectTab->mpParentProjectTabWidget->mpParentMainWindow->gridLinesAction,
SIGNAL(toggled(bool)), this, SLOT(showGridLines(bool)));
Expand All @@ -81,7 +94,7 @@ void GraphicsView::drawBackground(QPainter *painter, const QRectF &rect)
{
Q_UNUSED(rect);

if (mIconType == StringHandler::DIAGRAM)
if (mpParentProjectTab->isReadOnly())
return;

// draw scene rectangle
Expand Down
2 changes: 1 addition & 1 deletion OMEdit/OMEditGUI/StringHandler.cpp
Expand Up @@ -35,7 +35,7 @@
//! @author Syed Adeel Asghar <syeas460@student.liu.se>
//! @date 2010-07-12

//! @brief Contains functions used for parsing results obtained from Open Modelica Compiler.
//! @brief Contains functions used for parsing results obtained from OpenModelica Compiler.

#include "StringHandler.h"

Expand Down
6 changes: 3 additions & 3 deletions OMEdit/OMEditGUI/mainwindow.cpp
Expand Up @@ -77,7 +77,7 @@ MainWindow::MainWindow(SplashScreen *splashScreen, QWidget *parent)
addDockWidget(Qt::BottomDockWidgetArea, messagedock);
mpMessageWidget->printGUIMessage("OMEdit, Version: " + Helper::applicationVersion);
if (!mExitApplication)
mpMessageWidget->printGUIInfoMessage("Open Modelica, Version: " + mpOMCProxy->getVersion());
mpMessageWidget->printGUIInfoMessage("OpenModelica, Version: " + mpOMCProxy->getVersion());

//Create a dock for the componentslibrary
libdock = new QDockWidget(tr(" Components"), this);
Expand Down Expand Up @@ -221,7 +221,7 @@ void MainWindow::createActions()

openAction = new QAction(QIcon(":/Resources/icons/open.png"), tr("Open"), this);
openAction->setShortcut(QKeySequence("Ctrl+o"));
openAction->setStatusTip(tr("Opens Open Modelica file"));
openAction->setStatusTip(tr("Opens OpenModelica file"));

saveAction = new QAction(QIcon(":/Resources/icons/save.png"), tr("Save"), this);
saveAction->setShortcut(QKeySequence("Ctrl+s"));
Expand Down Expand Up @@ -267,7 +267,7 @@ void MainWindow::createActions()
connect(omcLoggerAction, SIGNAL(triggered()), this->mpOMCProxy, SLOT(openOMCLogger()));

openOMShellAction = new QAction(QIcon(":/Resources/icons/OMS.bmp"), tr("OMShell"), this);
openOMShellAction->setStatusTip(tr("Opens Open Modelica Shell (OMShell)"));
openOMShellAction->setStatusTip(tr("Opens OpenModelica Shell (OMShell)"));
connect(openOMShellAction, SIGNAL(triggered()), SLOT(openOMShell()));

openOptions = new QAction(tr("Options"), this);
Expand Down

0 comments on commit 7f254f1

Please sign in to comment.