Salome HOME
Merge from V6_4_BR 05/12/2011
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_AddMeshElementDlg.cxx
index 6e25fd08fb1b22c8a8078c26bdafbc69d9648d0d..0de69046ad5285ebdf416e6208cbbdd9b1d9888e 100644 (file)
@@ -243,7 +243,8 @@ SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI* theModule,
                                                         int nbNodes )
   : QDialog( SMESH::GetDesktop( theModule ) ),
     mySMESHGUI( theModule ),
-    mySelectionMgr( SMESH::GetSelectionMgr( theModule ) )
+    mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
+    myBusy ( false )
 {
   setModal( false );
   setAttribute( Qt::WA_DeleteOnClose, true );
@@ -371,6 +372,7 @@ SMESHGUI_AddMeshElementDlg::SMESHGUI_AddMeshElementDlg( SMESHGUI* theModule,
   TextLabel_GroupName = new QLabel( tr( "SMESH_GROUP" ), GroupGroups );
   ComboBox_GroupName = new QComboBox( GroupGroups );
   ComboBox_GroupName->setEditable( true );
+  ComboBox_GroupName->setInsertPolicy( QComboBox::NoInsert );
 
   GroupGroupsLayout->addWidget( TextLabel_GroupName );
   GroupGroupsLayout->addWidget( ComboBox_GroupName, 1 );
@@ -496,7 +498,7 @@ void SMESHGUI_AddMeshElementDlg::ClickOnApply()
         if ( aGroupName == aName && ( i == ComboBox_GroupName->currentIndex() || idx == 0 ) )
           idx = i;
       }
-      if ( idx > 0 ) {
+      if ( idx > 0 && idx < myGroups.count() ) {
         SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( myGroups[idx-1] );
         if ( !aGeomGroup->_is_nil() ) {
           int res = SUIT_MessageBox::question( this, tr( "SMESH_WRN_WARNING" ),