connect( myEditHyp[ i ], SIGNAL( clicked() ), SLOT( onEditHyp() ) );
connect( myHyp[ i ], SIGNAL( activated( int ) ), SLOT( onHyp( int ) ) );
}
+ connect( myHyp[ Algo ], SIGNAL( activated( int ) ), SLOT( onHyp( int ) ) );
// Initialize controls
void SMESHGUI_MeshTab::setAvailableHyps( const int theId, const QStringList& theHyps )
{
myAvailableHyps[ theId ] = theHyps;
+
+ bool enable = ! theHyps.isEmpty();
if ( theId == Algo )
{
myHyp[ Algo ]->clear();
myHyp[ Algo ]->insertStringList( theHyps );
myHyp[ Algo ]->setCurrentItem( 0 );
}
+ else {
+ myCreateHyp[ theId ]->setEnabled( enable );
+ myEditHyp[ theId ]->setEnabled( false );
+ }
+ myHyp[ theId ]->setEnabled( enable );
}
//================================================================================
/*!
* \brief Updates "Edit hypothesis" button state
*
- * SLOT called when current hypothesis changed disables "Edit hypothesis" button
- * if current hypothesis is <None>, enables otherwise
+ * SLOT called when current hypothesis changed. Disables "Edit hypothesis" button
+ * if current hypothesis is <None>, enables otherwise.
+ * If an algorithm changed, emits selectAlgo( theIndex ) signal
*/
//================================================================================
void SMESHGUI_MeshTab::onHyp( int theIndex )
{
const QObject* aSender = sender();
- int anIndex = aSender == myHyp[ MainHyp ] ? MainHyp : AddHyp;
- myEditHyp[ anIndex ]->setEnabled( theIndex > 0 );
+ if ( aSender == myHyp[ Algo ] )
+ emit selectAlgo( theIndex - 1 ); // - 1 because there is NONE on the top
+ else {
+ int anIndex = aSender == myHyp[ MainHyp ] ? MainHyp : AddHyp;
+ myEditHyp[ anIndex ]->setEnabled( theIndex > 0 );
+ }
}
//================================================================================
myTabs[ Dim1D ] = new SMESHGUI_MeshTab( myTabWg );
myTabs[ Dim2D ] = new SMESHGUI_MeshTab( myTabWg );
myTabs[ Dim3D ] = new SMESHGUI_MeshTab( myTabWg );
- myTabWg->addTab( myTabs[ Dim1D ], tr( "DIM_1D" ) );
- myTabWg->addTab( myTabs[ Dim2D ], tr( "DIM_2D" ) );
myTabWg->addTab( myTabs[ Dim3D ], tr( "DIM_3D" ) );
+ myTabWg->addTab( myTabs[ Dim2D ], tr( "DIM_2D" ) );
+ myTabWg->addTab( myTabs[ Dim1D ], tr( "DIM_1D" ) );
// Hypotheses Sets
myHypoSetPopup = new QPopupMenu();
//================================================================================
void SMESHGUI_MeshDlg::setCurrentTab( const int theId )
{
- myTabWg->setCurrentPage( theId );
+ myTabWg->setCurrentPage( Dim3D - theId );
}
//================================================================================