From a4d91a0d951080c016d7be93fa368abc9fc1c926 Mon Sep 17 00:00:00 2001 From: mkr Date: Tue, 30 May 2006 12:44:22 +0000 Subject: [PATCH] Fixes for the following bugs: 1) IPAL12503: REGR: crash on close study from SUPERVISOR; 2) PAL12448: In Edit Ports, can't unselect a name. --- src/SUPERVGUI/SUPERVGUI.cxx | 2 +- src/SUPERVGUI/SUPERVGUI_ManagePortsDlg.cxx | 14 ++++++++++++-- src/SUPERVGUI/SUPERVGUI_ManagePortsDlg.h | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/SUPERVGUI/SUPERVGUI.cxx b/src/SUPERVGUI/SUPERVGUI.cxx index 743e9c1..2e0b2c7 100644 --- a/src/SUPERVGUI/SUPERVGUI.cxx +++ b/src/SUPERVGUI/SUPERVGUI.cxx @@ -376,7 +376,7 @@ void SUPERVGUI::onGraphClosed(SUIT_ViewWindow* theViewWindow) { SUPERVGUI_Main* aGraph = dynamic_cast(view); if ( aGraph ) { // mkr: PAL12449 ---> - if ( !aGraph->isDataflowInStudy() ) { + if ( (( SalomeApp_Study* )(aGraph->getStudy()))->studyDS() && !aGraph->isDataflowInStudy() ) { const int aWarnResult = QMessageBox::information(application()->desktop(), tr("MSG_INFO"), tr("MSG_GRAPH_UNSAVED"), QMessageBox::Yes, QMessageBox::No); diff --git a/src/SUPERVGUI/SUPERVGUI_ManagePortsDlg.cxx b/src/SUPERVGUI/SUPERVGUI_ManagePortsDlg.cxx index bbf2d1e..5e17544 100644 --- a/src/SUPERVGUI/SUPERVGUI_ManagePortsDlg.cxx +++ b/src/SUPERVGUI/SUPERVGUI_ManagePortsDlg.cxx @@ -273,6 +273,10 @@ void SUPERVGUI_ManagePortsDlg::init() connect( myNameEdt, SIGNAL(textChanged(const QString&)), this, SLOT(nameChanged(const QString&))); connect( myTypeCombo, SIGNAL(activated(const QString&)), this, SLOT(typeChanged(const QString&))); + // mkr: PAL12448 + connect( myInList,SIGNAL(rightButtonClicked(QListBoxItem*, const QPoint&)), this, SLOT(itemDeselect(QListBoxItem*, const QPoint&))); + connect( myOutList,SIGNAL(rightButtonClicked(QListBoxItem*, const QPoint&)), this, SLOT(itemDeselect(QListBoxItem*, const QPoint&))); + myNode->getMain()->lockedGraph( true ); // asv : 11.01.05 : if a node is a loop node, then only INPUT ports can be added/removed @@ -682,8 +686,14 @@ void SUPERVGUI_ManagePortsDlg::itemChanged( QListBoxItem * item ) { connect( myTypeCombo, SIGNAL(activated(const QString&)), this, SLOT(typeChanged(const QString&))); } - - +/*! + * Deselect the current selected item + */ +void SUPERVGUI_ManagePortsDlg::itemDeselect(QListBoxItem* item, const QPoint& point) { + // mkr: PAL12448 + if ( item->isSelected() ) + item->listBox()->setSelected(item, false); +} /*! * Port parameters dialog definition (taken from SUPERVGUI_Node.cxx without change) diff --git a/src/SUPERVGUI/SUPERVGUI_ManagePortsDlg.h b/src/SUPERVGUI/SUPERVGUI_ManagePortsDlg.h index 1e3506b..8e9c6ea 100644 --- a/src/SUPERVGUI/SUPERVGUI_ManagePortsDlg.h +++ b/src/SUPERVGUI/SUPERVGUI_ManagePortsDlg.h @@ -63,6 +63,7 @@ protected slots: void nameChanged( const QString& name ); void typeChanged( const QString& type ); void itemChanged( QListBoxItem * item ); + void itemDeselect(QListBoxItem* item, const QPoint& point); // mkr: PAL12448 protected: virtual void showEvent( QShowEvent* theEvent ); -- 2.39.2