Salome HOME
0021208: EDF 1138 SMESH: Performance issue when loading SMESH with an hdf file contai...
authorvsr <vsr@opencascade.com>
Thu, 15 Mar 2012 16:10:52 +0000 (16:10 +0000)
committervsr <vsr@opencascade.com>
Thu, 15 Mar 2012 16:10:52 +0000 (16:10 +0000)
Show message in the status bar on mesh loading operation

src/SMESHGUI/SMESHGUI.cxx
src/SMESHGUI/SMESHGUI.h
src/SMESHGUI/SMESH_msg_en.ts
src/SMESHGUI/SMESH_msg_fr.ts

index 6de6c06a18232f2bedc8ae76677a535c062ca788..37994bfd33a4e44c054e511e6240a4274d83797c 100644 (file)
 
 // 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
index 4c7e0ef1569784c2bc9bb49f5daba03fb2002baf..86ebc053e7b79f2be38abaf09b6a011eafff8b38 100644 (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* );
index d58f9cb853819bfd9bd28286fb52558914ade684..377b5b6a585b5b3c0dd7b0f58d10f8bc21816d13 100644 (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>
index 7f23f5af5e94db29cd8306718b262a536aeb56a7..95b185513ad271adeeb9418d58d3b2e342fe91e3 100755 (executable)
@@ -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>