Skip to content

Commit

Permalink
- Only try to remove connection if we have a valid ModelWidget.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@22984 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Oct 27, 2014
1 parent 78dc30a commit 74a3c79
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
19 changes: 12 additions & 7 deletions OMEdit/OMEditGUI/MainWindow.cpp
Expand Up @@ -1716,14 +1716,19 @@ void MainWindow::toggleShapesButton()
{
QAction *clickedAction = qobject_cast<QAction*>(const_cast<QObject*>(sender()));
QList<QAction*> shapeActions = mpShapesActionGroup->actions();
foreach (QAction *shapeAction, shapeActions)
if (shapeAction != clickedAction)
foreach (QAction *shapeAction, shapeActions) {
if (shapeAction != clickedAction) {
shapeAction->setChecked(false);

// cancel connection if another tools is chosen
GraphicsView *pGraphicsView = mpModelWidgetContainer->getCurrentModelWidget()->getDiagramGraphicsView();
if (pGraphicsView->isCreatingConnection())
pGraphicsView->removeConnection();
}
}
// cancel connection if another tool is chosen
ModelWidget *pModelWidget = mpModelWidgetContainer->getCurrentModelWidget();
if (pModelWidget) {
GraphicsView *pGraphicsView = pModelWidget->getDiagramGraphicsView();
if (pGraphicsView->isCreatingConnection()) {
pGraphicsView->removeConnection();
}
}
}

void MainWindow::openRecentModelWidget()
Expand Down
2 changes: 1 addition & 1 deletion OMEdit/OMEditGUI/Resources/icons/ellipse-shape.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 74a3c79

Please sign in to comment.