Skip to content

Commit

Permalink
Fixes #3663. Renamed View Class to Open Class.
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Feb 4, 2016
1 parent 7cd899b commit 5f95f7e
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 26 deletions.
19 changes: 11 additions & 8 deletions OMEdit/OMEditGUI/Component/Component.cpp
Expand Up @@ -1158,10 +1158,10 @@ void Component::createActions()
mpAttributesAction = new QAction(Helper::attributes, mpGraphicsView);
mpAttributesAction->setStatusTip(tr("Shows the component attributes"));
connect(mpAttributesAction, SIGNAL(triggered()), SLOT(showAttributes()));
// View Class Action
mpViewClassAction = new QAction(QIcon(":/Resources/icons/model.svg"), Helper::viewClass, mpGraphicsView);
mpViewClassAction->setStatusTip(Helper::viewClassTip);
connect(mpViewClassAction, SIGNAL(triggered()), SLOT(viewClass()));
// Open Class Action
mpOpenClassAction = new QAction(QIcon(":/Resources/icons/model.svg"), Helper::openClass, mpGraphicsView);
mpOpenClassAction->setStatusTip(Helper::openClassTip);
connect(mpOpenClassAction, SIGNAL(triggered()), SLOT(openClass()));
// View Documentation Action
mpViewDocumentationAction = new QAction(QIcon(":/Resources/icons/info-icon.svg"), Helper::viewDocumentation, mpGraphicsView);
mpViewDocumentationAction->setStatusTip(Helper::viewDocumentationTip);
Expand Down Expand Up @@ -2028,8 +2028,11 @@ void Component::showAttributes()
pComponentAttributes->exec();
}

//! Slot that opens up the component Modelica class in a new tab/window.
void Component::viewClass()
/*!
* \brief Component::openClass
* Slot that opens up the component Modelica class in a new tab/window.
*/
void Component::openClass()
{
MainWindow *pMainWindow = mpGraphicsView->getModelWidget()->getModelWidgetContainer()->getMainWindow();
pMainWindow->getLibraryWidget()->openLibraryTreeItem(mpLibraryTreeItem->getNameStructure());
Expand Down Expand Up @@ -2096,7 +2099,7 @@ void Component::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
menu.addAction(pComponent->getParametersAction());
menu.addAction(pComponent->getAttributesAction());
menu.addSeparator();
menu.addAction(pComponent->getViewClassAction());
menu.addAction(pComponent->getOpenClassAction());
menu.addAction(pComponent->getViewDocumentationAction());
menu.addSeparator();
LibraryTreeItem *pLibraryTreeItem = mpGraphicsView->getModelWidget()->getLibraryTreeItem();
Expand All @@ -2108,7 +2111,7 @@ void Component::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
menu.addAction(pComponent->getParametersAction());
menu.addAction(pComponent->getAttributesAction());
menu.addSeparator();
menu.addAction(pComponent->getViewClassAction());
menu.addAction(pComponent->getOpenClassAction());
menu.addAction(pComponent->getViewDocumentationAction());
menu.addSeparator();
if (pComponent->isInheritedComponent()) {
Expand Down
6 changes: 3 additions & 3 deletions OMEdit/OMEditGUI/Component/Component.h
Expand Up @@ -166,7 +166,7 @@ class Component : public QObject, public QGraphicsItem
OriginItem* getOriginItem() {return mpOriginItem;}
QAction* getParametersAction() {return mpParametersAction;}
QAction* getAttributesAction() {return mpAttributesAction;}
QAction* getViewClassAction() {return mpViewClassAction;}
QAction* getOpenClassAction() {return mpOpenClassAction;}
QAction* getViewDocumentationAction() {return mpViewDocumentationAction;}
QAction* getTLMAttributesAction() {return mpTLMAttributesAction;}
ComponentInfo* getComponentInfo() {return mpComponentInfo;}
Expand Down Expand Up @@ -222,7 +222,7 @@ class Component : public QObject, public QGraphicsItem
TextAnnotation *mpDefaultComponentText;
QAction *mpParametersAction;
QAction *mpAttributesAction;
QAction *mpViewClassAction;
QAction *mpOpenClassAction;
QAction *mpViewDocumentationAction;
QAction *mpTLMAttributesAction;
ResizerItem *mpBottomLeftResizerItem;
Expand Down Expand Up @@ -307,7 +307,7 @@ public slots:
void moveCtrlRight();
void showParameters();
void showAttributes();
void viewClass();
void openClass();
void viewDocumentation();
void showTLMAttributes();
protected:
Expand Down
14 changes: 7 additions & 7 deletions OMEdit/OMEditGUI/Modeling/LibraryTreeWidget.cpp
Expand Up @@ -2105,10 +2105,10 @@ LibraryTreeView::LibraryTreeView(LibraryWidget *pLibraryWidget)
*/
void LibraryTreeView::createActions()
{
// show Model Action
mpViewClassAction = new QAction(QIcon(":/Resources/icons/modeling.png"), Helper::viewClass, this);
mpViewClassAction->setStatusTip(Helper::viewClassTip);
connect(mpViewClassAction, SIGNAL(triggered()), SLOT(viewClass()));
// open class action
mpOpenClassAction = new QAction(QIcon(":/Resources/icons/modeling.png"), Helper::openClass, this);
mpOpenClassAction->setStatusTip(Helper::openClassTip);
connect(mpOpenClassAction, SIGNAL(triggered()), SLOT(openClass()));
// view documentation Action
mpViewDocumentationAction = new QAction(QIcon(":/Resources/icons/info-icon.svg"), Helper::viewDocumentation, this);
mpViewDocumentationAction->setStatusTip(Helper::viewDocumentationTip);
Expand Down Expand Up @@ -2297,7 +2297,7 @@ void LibraryTreeView::showContextMenu(QPoint point)
switch (pLibraryTreeItem->getLibraryType()) {
case LibraryTreeItem::Modelica:
default:
menu.addAction(mpViewClassAction);
menu.addAction(mpOpenClassAction);
menu.addAction(mpViewDocumentationAction);
if (!pLibraryTreeItem->isSystemLibrary()) {
menu.addSeparator();
Expand Down Expand Up @@ -2364,10 +2364,10 @@ void LibraryTreeView::showContextMenu(QPoint point)
}

/*!
* \brief LibraryTreeView::viewClass
* \brief LibraryTreeView::openClass
* Shows the class view of the selected LibraryTreeItem.
*/
void LibraryTreeView::viewClass()
void LibraryTreeView::openClass()
{
LibraryTreeItem *pLibraryTreeItem = getSelectedLibraryTreeItem();
if (pLibraryTreeItem) {
Expand Down
4 changes: 2 additions & 2 deletions OMEdit/OMEditGUI/Modeling/LibraryTreeWidget.h
Expand Up @@ -272,7 +272,7 @@ class LibraryTreeView : public QTreeView
LibraryWidget* getLibraryWidget() {return mpLibraryWidget;}
private:
LibraryWidget *mpLibraryWidget;
QAction *mpViewClassAction;
QAction *mpOpenClassAction;
QAction *mpViewDocumentationAction;
QAction *mpNewModelicaClassAction;
QAction *mpSaveAction;
Expand Down Expand Up @@ -304,7 +304,7 @@ class LibraryTreeView : public QTreeView
public slots:
void libraryTreeItemExpanded(QModelIndex index);
void showContextMenu(QPoint point);
void viewClass();
void openClass();
void viewDocumentation();
void createNewModelicaClass();
void saveClass();
Expand Down
8 changes: 4 additions & 4 deletions OMEdit/OMEditGUI/Util/Helper.cpp
Expand Up @@ -254,8 +254,8 @@ QString Helper::center;
QString Helper::right;
QString Helper::createConnection;
QString Helper::findVariables;
QString Helper::viewClass;
QString Helper::viewClassTip;
QString Helper::openClass;
QString Helper::openClassTip;
QString Helper::viewDocumentation;
QString Helper::viewDocumentationTip;
QString Helper::dontShowThisMessageAgain;
Expand Down Expand Up @@ -444,8 +444,8 @@ void Helper::initHelperVariables()
Helper::right = tr("Right");
Helper::createConnection = tr("Create Connection");
Helper::findVariables = tr("Find Variables");
Helper::viewClass = tr("View Class");
Helper::viewClassTip = tr("Opens the class details");
Helper::openClass = tr("Open Class");
Helper::openClassTip = tr("Opens the class details");
Helper::viewDocumentation = tr("View Documentation");
Helper::viewDocumentationTip = tr("Opens the class documentation");
Helper::dontShowThisMessageAgain = tr("Don't show this message again");
Expand Down
4 changes: 2 additions & 2 deletions OMEdit/OMEditGUI/Util/Helper.h
Expand Up @@ -261,8 +261,8 @@ class Helper : public QObject
static QString right;
static QString createConnection;
static QString findVariables;
static QString viewClass;
static QString viewClassTip;
static QString openClass;
static QString openClassTip;
static QString viewDocumentation;
static QString viewDocumentationTip;
static QString dontShowThisMessageAgain;
Expand Down

0 comments on commit 5f95f7e

Please sign in to comment.