mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-04-07 07:47:28 +05:00
0020976: EDF 1471 SMESH: New ergonomy to display quality controls
Make Quality Info dialog look same as Quality Info tab of Mesh Info dialog: add Help and Dump buttons
This commit is contained in:
parent
eeba8f9c90
commit
7608df4ad1
@ -3518,16 +3518,29 @@ SMESHGUI_CtrlInfoDlg::SMESHGUI_CtrlInfoDlg( QWidget* parent )
|
|||||||
okBtn->setAutoDefault( true );
|
okBtn->setAutoDefault( true );
|
||||||
okBtn->setDefault( true );
|
okBtn->setDefault( true );
|
||||||
okBtn->setFocus();
|
okBtn->setFocus();
|
||||||
|
QPushButton* dumpBtn = new QPushButton( tr( "BUT_DUMP_MESH" ), this );
|
||||||
|
dumpBtn->setAutoDefault( true );
|
||||||
|
QPushButton* helpBtn = new QPushButton( tr( "SMESH_BUT_HELP" ), this );
|
||||||
|
helpBtn->setAutoDefault( true );
|
||||||
|
|
||||||
QGridLayout* l = new QGridLayout ( this );
|
QHBoxLayout* btnLayout = new QHBoxLayout;
|
||||||
|
btnLayout->setSpacing( SPACING );
|
||||||
|
btnLayout->setMargin( 0 );
|
||||||
|
|
||||||
|
btnLayout->addWidget( okBtn );
|
||||||
|
btnLayout->addWidget( dumpBtn );
|
||||||
|
btnLayout->addStretch( 10 );
|
||||||
|
btnLayout->addWidget( helpBtn );
|
||||||
|
|
||||||
|
QVBoxLayout* l = new QVBoxLayout ( this );
|
||||||
l->setMargin( MARGIN );
|
l->setMargin( MARGIN );
|
||||||
l->setSpacing( SPACING );
|
l->setSpacing( SPACING );
|
||||||
l->addWidget( myCtrlInfo, 0, 0, 1, 3 );
|
l->addWidget( myCtrlInfo );
|
||||||
l->addWidget( okBtn, 1, 1 );
|
l->addLayout( btnLayout );
|
||||||
l->setColumnStretch( 0, 5 );
|
|
||||||
l->setColumnStretch( 2, 5 );
|
|
||||||
|
|
||||||
connect( okBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
|
connect( okBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
|
||||||
|
connect( dumpBtn, SIGNAL( clicked() ), this, SLOT( dump() ) );
|
||||||
|
connect( helpBtn, SIGNAL( clicked() ), this, SLOT( help() ) );
|
||||||
connect( SMESHGUI::GetSMESHGUI(), SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( deactivate() ) );
|
connect( SMESHGUI::GetSMESHGUI(), SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( deactivate() ) );
|
||||||
connect( SMESHGUI::GetSMESHGUI(), SIGNAL( SignalCloseAllDialogs() ), this, SLOT( reject() ) );
|
connect( SMESHGUI::GetSMESHGUI(), SIGNAL( SignalCloseAllDialogs() ), this, SLOT( reject() ) );
|
||||||
|
|
||||||
@ -3606,4 +3619,49 @@ void SMESHGUI_CtrlInfoDlg::deactivate()
|
|||||||
disconnect( SMESHGUI::selectionMgr(), SIGNAL( currentSelectionChanged() ), this, SLOT( updateInfo() ) );
|
disconnect( SMESHGUI::selectionMgr(), SIGNAL( currentSelectionChanged() ), this, SLOT( updateInfo() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Dump contents into a file
|
||||||
|
*/
|
||||||
|
void SMESHGUI_CtrlInfoDlg::dump()
|
||||||
|
{
|
||||||
|
SUIT_Application* app = SUIT_Session::session()->activeApplication();
|
||||||
|
if ( !app ) return;
|
||||||
|
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study *>( app->activeStudy() );
|
||||||
|
if ( !appStudy ) return;
|
||||||
|
_PTR( Study ) aStudy = appStudy->studyDS();
|
||||||
|
|
||||||
|
QStringList aFilters;
|
||||||
|
aFilters.append( tr( "TEXT_FILES" ) );
|
||||||
|
|
||||||
|
DumpFileDlg fd( this );
|
||||||
|
fd.setWindowTitle( tr( "SAVE_INFO" ) );
|
||||||
|
fd.setFilters( aFilters );
|
||||||
|
fd.myBaseChk->hide();
|
||||||
|
fd.myElemChk->hide();
|
||||||
|
fd.myAddChk ->hide();
|
||||||
|
fd.myCtrlChk->hide();
|
||||||
|
if ( fd.exec() == QDialog::Accepted )
|
||||||
|
{
|
||||||
|
QString aFileName = fd.selectedFile();
|
||||||
|
if ( !aFileName.isEmpty() ) {
|
||||||
|
QFileInfo aFileInfo( aFileName );
|
||||||
|
if ( aFileInfo.isDir() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
QFile aFile( aFileName );
|
||||||
|
if ( !aFile.open( QIODevice::WriteOnly | QIODevice::Text ) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
QTextStream out( &aFile );
|
||||||
|
myCtrlInfo->saveInfo( out );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Show help
|
||||||
|
*/
|
||||||
|
void SMESHGUI_CtrlInfoDlg::help()
|
||||||
|
{
|
||||||
|
SMESH::ShowHelpFile("mesh_infos_page.html#mesh_quality_info_anchor");
|
||||||
|
}
|
||||||
|
@ -401,6 +401,8 @@ private slots:
|
|||||||
void activate();
|
void activate();
|
||||||
void deactivate();
|
void deactivate();
|
||||||
void updateSelection();
|
void updateSelection();
|
||||||
|
void help();
|
||||||
|
void dump();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SMESHGUI_CtrlInfo* myCtrlInfo;
|
SMESHGUI_CtrlInfo* myCtrlInfo;
|
||||||
|
@ -7247,6 +7247,18 @@ as they are of improper type:
|
|||||||
<source>CTRL_INFO</source>
|
<source>CTRL_INFO</source>
|
||||||
<translation>Quality Info</translation>
|
<translation>Quality Info</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>BUT_DUMP_MESH</source>
|
||||||
|
<translation>&Dump</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>TEXT_FILES</source>
|
||||||
|
<translation>Text files (*.txt)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>SAVE_INFO</source>
|
||||||
|
<translation>Save info</translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>SMESHGUI_MinDistance</name>
|
<name>SMESHGUI_MinDistance</name>
|
||||||
|
@ -7228,6 +7228,18 @@ en raison de leurs types incompatibles:
|
|||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>SMESHGUI_CtrlInfoDlg</name>
|
<name>SMESHGUI_CtrlInfoDlg</name>
|
||||||
|
<message>
|
||||||
|
<source>SAVE_INFO</source>
|
||||||
|
<translation type="unfinished">Save info</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>TEXT_FILES</source>
|
||||||
|
<translation type="unfinished">Text files (*.txt)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>BUT_DUMP_MESH</source>
|
||||||
|
<translation type="unfinished">&Dump</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>CTRL_INFO</source>
|
<source>CTRL_INFO</source>
|
||||||
<translation type="unfinished">Quality Info</translation>
|
<translation type="unfinished">Quality Info</translation>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user