0021208: EDF 1138 SMESH: Performance issue when loading SMESH with an hdf file containing a big mesh

Show message in the status bar on mesh loading operation
This commit is contained in:
vsr 2012-03-15 16:10:52 +00:00
parent d2f2237450
commit 05189ca91b
4 changed files with 48 additions and 1 deletions

View File

@ -139,6 +139,7 @@
// Qt includes
// #define INCLUDE_MENUITEM_DEF // VSR commented ????????
#include <QApplication>
#include <QMenu>
#include <QTextStream>
@ -5946,6 +5947,35 @@ void SMESHGUI::onViewClosed( SUIT_ViewWindow* pview ) {
#endif
}
void SMESHGUI::message( const QString& msg )
{
// dispatch message
QStringList data = msg.split("/");
if ( data.count() > 0 ) {
if ( data.first() == "mesh_loading" ) {
// get mesh entry
QString entry = data.count() > 1 ? data[1] : QString();
if ( entry.isEmpty() )
return;
// get study
_PTR(Study) study = dynamic_cast<SalomeApp_Study*>( application()->activeStudy() )->studyDS();
// get mesh name
_PTR(SObject) obj = study->FindObjectID( entry.toLatin1().constData() );
QString name;
if ( obj )
name = obj->GetName().c_str();
if ( name.isEmpty() )
return;
if ( data.last() == "stop" )
application()->putInfo( tr( "MESH_LOADING_MSG_FINISHED" ).arg( name ) );
else
application()->putInfo( tr( "MESH_LOADING_MSG" ).arg( name ) );
QApplication::processEvents();
}
}
}
/*!
\brief Connects or disconnects signals about activating and cloning view on the module slots
\param pview view which is connected/disconnected

View File

@ -137,6 +137,8 @@ public :
virtual void createPreferences();
virtual void preferencesChanged( const QString&, const QString& );
virtual void message( const QString& );
virtual void update( const int );
static SALOMEDS::Color getUniqueColor( const QList<SALOMEDS::Color>& );
@ -158,7 +160,6 @@ public slots:
virtual void studyClosed( SUIT_Study* );
void onViewClosed( SUIT_ViewWindow* );
private slots:
void OnGUIEvent();
void onViewManagerActivated( SUIT_ViewManager* );

View File

@ -3657,6 +3657,14 @@ Input value precision can be adjusted using
<source>SMESH_PLUGINS_OTHER</source>
<translation>SMESH plugins</translation>
</message>
<message>
<source>MESH_LOADING_MSG</source>
<translation>Loading mesh %0 in progress</translation>
</message>
<message>
<source>MESH_LOADING_MSG_FINISHED</source>
<translation>Mesh %0 loading done</translation>
</message>
</context>
<context>
<name>SMESHGUI_GroupDlg</name>

View File

@ -3729,6 +3729,14 @@ avec le paramètre &apos;%1&apos; des préférences du module Mesh.</translation
<source>SMESH_PLUGINS_OTHER</source>
<translation>Extensions SMESH</translation>
</message>
<message>
<source>MESH_LOADING_MSG</source>
<translation type="unfinished">Loading mesh %0 in progress</translation>
</message>
<message>
<source>MESH_LOADING_MSG_FINISHED</source>
<translation type="unfinished">Mesh %0 loading done</translation>
</message>
</context>
<context>
<name>SMESHGUI_GroupDlg</name>