]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
InfoPanel introduction v2.
authorvsr <vsr@opencascade.com>
Wed, 18 Nov 2020 12:50:18 +0000 (15:50 +0300)
committervsr <vsr@opencascade.com>
Wed, 18 Nov 2020 12:50:18 +0000 (15:50 +0300)
src/LightApp/LightApp_Application.cxx
src/LightApp/resources/LightApp_msg_en.ts
src/LightApp/resources/LightApp_msg_fr.ts
src/LightApp/resources/LightApp_msg_ja.ts

index 6a62b70e48278fe2f1a9187566c99720211c38b7..67b1112136c51ef5bcb46c244a90c4ececed9a44 100644 (file)
@@ -527,6 +527,9 @@ bool LightApp_Application::activateModule( const QString& modName )
 
   saveDockWindowsState();
 
+  if ( infoPanel() )
+    infoPanel()->clear();
+
   bool status = CAM_Application::activateModule( modName );
 
   updateModuleActions();
@@ -1370,9 +1373,17 @@ void LightApp_Application::insertDockWindow( const int id, QWidget* wid )
   myWin.insert( id, wid );
 
   QtxDockWidget* dock = new QtxDockWidget( true, desktop() );
+  if ( id == WT_InfoPanel ) {
+    // Info panel's position is strongly limited to the right area;
+    // It is not movable and not floatable.
+    dock->setAllowedAreas( Qt::RightDockWidgetArea );
+    dock->setFeatures( QDockWidget::DockWidgetClosable );
+  }
+  else {
+    dock->setFeatures( QDockWidget::AllDockWidgetFeatures );
+  }
   connect( dock, SIGNAL(  destroyed( QObject* ) ), this, SLOT( onWCDestroyed( QObject* ) ) );
 
-  dock->setFeatures( QDockWidget::AllDockWidgetFeatures );
   dock->setObjectName( wid->objectName().isEmpty() ? QString( "window_%1" ).arg( id ) :
                        QString( "%1Dock" ).arg( wid->objectName() ) );
   dock->setWidget( wid );
@@ -2181,6 +2192,7 @@ void LightApp_Application::defaultWindows( QMap<int, int>& aMap ) const
 #endif
   if ( activeStudy() ) {
     aMap.insert( WT_ObjectBrowser, Qt::LeftDockWidgetArea );
+    aMap.insert( WT_InfoPanel, Qt::RightDockWidgetArea );
     //  aMap.insert( WT_LogWindow, Qt::DockBottom );
   }
 }
@@ -4141,6 +4153,11 @@ void LightApp_Application::updateWindows()
   }
 
   loadDockWindowsState();
+
+  if (!activeModule() && infoPanel() ) {
+    infoPanel()->clear();
+    infoPanel()->addAction( action(ModulesListId) );
+  }
 }
 
 /*!
index 55249ed3f20d887cf51e6adca00e046feaa80f98..c19044846a1a8307c0f5ebe42f847115655062ee 100644 (file)
@@ -168,6 +168,10 @@ The changes will be applied on the next application session.</translation>
         <source>OBJECT_BROWSER</source>
         <translation>Object Browser</translation>
     </message>
+    <message>
+        <source>INFO_PANEL</source>
+        <translation>Help panel</translation>
+    </message>
     <message>
         <source>PRP_DESK_PREFERENCES</source>
         <translation>Allow to change the preferences</translation>
index 3667f6b0dd512f7f32de37f184f6c56174f0ff7f..9bc1562180a18ede5fda40e53c1c12d3bfa73a1d 100644 (file)
@@ -168,6 +168,10 @@ Les modifications seront appliquées à la prochaine session.</translation>
         <source>OBJECT_BROWSER</source>
         <translation>Arbre d&apos;étude</translation>
     </message>
+    <message>
+        <source>INFO_PANEL</source>
+        <translation type="unfinished">Help panel</translation>
+    </message>
     <message>
         <source>PRP_DESK_PREFERENCES</source>
         <translation>Permettre de changer les préférences</translation>
index 0d83e623c6fe15d58aad1bb0eca8310a8d5294b8..fc99440c00b7fc1829187680c2571843661f866c 100644 (file)
@@ -167,6 +167,10 @@ Pythonファイルは、文字、数字、アンダースコアが含まれて
       <source>OBJECT_BROWSER</source>
       <translation>オブジェクトブラウザー</translation>
     </message>
+    <message>
+        <source>INFO_PANEL</source>
+        <translation type="unfinished">Help panel</translation>
+    </message>
     <message>
       <source>PRP_DESK_PREFERENCES</source>
       <translation>設定を変更することができます。</translation>