From 05189ca91b2a16174ae9a3e774f723b8c680508e Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 15 Mar 2012 16:10:52 +0000 Subject: [PATCH] 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 --- src/SMESHGUI/SMESHGUI.cxx | 30 ++++++++++++++++++++++++++++++ src/SMESHGUI/SMESHGUI.h | 3 ++- src/SMESHGUI/SMESH_msg_en.ts | 8 ++++++++ src/SMESHGUI/SMESH_msg_fr.ts | 8 ++++++++ 4 files changed, 48 insertions(+), 1 deletion(-) diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 6de6c06a1..37994bfd3 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -139,6 +139,7 @@ // Qt includes // #define INCLUDE_MENUITEM_DEF // VSR commented ???????? +#include #include #include @@ -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( 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 diff --git a/src/SMESHGUI/SMESHGUI.h b/src/SMESHGUI/SMESHGUI.h index 4c7e0ef15..86ebc053e 100644 --- a/src/SMESHGUI/SMESHGUI.h +++ b/src/SMESHGUI/SMESHGUI.h @@ -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& ); @@ -158,7 +160,6 @@ public slots: virtual void studyClosed( SUIT_Study* ); void onViewClosed( SUIT_ViewWindow* ); - private slots: void OnGUIEvent(); void onViewManagerActivated( SUIT_ViewManager* ); diff --git a/src/SMESHGUI/SMESH_msg_en.ts b/src/SMESHGUI/SMESH_msg_en.ts index d58f9cb85..377b5b6a5 100644 --- a/src/SMESHGUI/SMESH_msg_en.ts +++ b/src/SMESHGUI/SMESH_msg_en.ts @@ -3657,6 +3657,14 @@ Input value precision can be adjusted using SMESH_PLUGINS_OTHER SMESH plugins + + MESH_LOADING_MSG + Loading mesh %0 in progress + + + MESH_LOADING_MSG_FINISHED + Mesh %0 loading done + SMESHGUI_GroupDlg diff --git a/src/SMESHGUI/SMESH_msg_fr.ts b/src/SMESHGUI/SMESH_msg_fr.ts index 7f23f5af5..95b185513 100755 --- a/src/SMESHGUI/SMESH_msg_fr.ts +++ b/src/SMESHGUI/SMESH_msg_fr.ts @@ -3729,6 +3729,14 @@ avec le paramètre '%1' des préférences du module Mesh.SMESH_PLUGINS_OTHER Extensions SMESH + + MESH_LOADING_MSG + Loading mesh %0 in progress + + + MESH_LOADING_MSG_FINISHED + Mesh %0 loading done + SMESHGUI_GroupDlg