From 6f519715fe7379ff6c6625d765dcf8765bc18ee0 Mon Sep 17 00:00:00 2001 From: mkr Date: Tue, 18 Jul 2006 11:54:58 +0000 Subject: [PATCH] Fix for bug IPAL12512 : It is possible create ports with equal names. --- src/SUPERVGUI/SUPERVGUI_ManagePortsDlg.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/SUPERVGUI/SUPERVGUI_ManagePortsDlg.cxx b/src/SUPERVGUI/SUPERVGUI_ManagePortsDlg.cxx index 9e195ec..c11d116 100644 --- a/src/SUPERVGUI/SUPERVGUI_ManagePortsDlg.cxx +++ b/src/SUPERVGUI/SUPERVGUI_ManagePortsDlg.cxx @@ -652,6 +652,19 @@ bool isEditingItem( const QListBoxItem* item, const QListBox* theLB ) { * the last selected by user item in myInList or myOutList (myLastItem) */ void SUPERVGUI_ManagePortsDlg::nameChanged( const QString& name ) { + // mkr: IPAL12512 + if ( isEditingItem( myLastItem, myInList ) && myInList->findItem( QString( "%1 (%2)" ).arg( name ).arg( ((PortListItem*)myLastItem)->PortType )) + || + isEditingItem( myLastItem, myOutList ) && myOutList->findItem( QString( "%1 (%2)" ).arg( name ).arg( ((PortListItem*)myLastItem)->PortType ))) { + disconnect( myNameEdt, SIGNAL(textChanged(const QString&)), this, SLOT(nameChanged(const QString&))); + + myNameEdt->setText( ((PortListItem*)myLastItem)->PortName ); + + connect( myNameEdt, SIGNAL(textChanged(const QString&)), this, SLOT(nameChanged(const QString&))); + QMessageBox::warning( this, tr("ERROR"), tr("MSG_PORT_EXIST") ); + return; + } + if ( isEditingItem( myLastItem, myInList ) || isEditingItem( myLastItem, myOutList ) ) { ((PortListItem*)myLastItem)->PortName = name; //myLastItem->listBox()->repaint( true ); -- 2.39.2