]> SALOME platform Git repositories - modules/superv.git/commitdiff
Salome HOME
Modifications for fixing bugs:
authormkr <mkr@opencascade.com>
Thu, 8 Dec 2005 14:23:28 +0000 (14:23 +0000)
committermkr <mkr@opencascade.com>
Thu, 8 Dec 2005 14:23:28 +0000 (14:23 +0000)
1) IPAL10825 : Background color is changed after dataflow import.
2) IPAL10829 : Default background color is set as color for the "Status" area in table view.

src/SUPERVGUI/SUPERVGUI.cxx
src/SUPERVGUI/SUPERVGUI.h
src/SUPERVGUI/SUPERVGUI_ArrayView.cxx
src/SUPERVGUI/SUPERVGUI_Canvas.cxx
src/SUPERVGUI/SUPERVGUI_CanvasArray.cxx
src/SUPERVGUI/SUPERVGUI_CanvasCellNodePrs.cxx
src/SUPERVGUI/SUPERVGUI_CanvasView.cxx

index cd78482843acd3da7c6eb370e7d8bf33b7c61d49..9da02d6ab6ff9b1861ca02e51429a584bfb4274e 100644 (file)
@@ -78,7 +78,8 @@ SUPERVGUI::SUPERVGUI()
        browser(0),
        myFirstActivation(true),
        myAllGraphsClosed(false),
-       myInitialViewFrame(0)
+       myInitialViewFrame(0),
+       myIVFBackgroundColor(QColor())
   //info(0)
 {
     Trace("SUPERVGUI::SUPERVGUI")
@@ -280,7 +281,7 @@ SUIT_ViewWindow* SUPERVGUI::createGraph() {
   (( SalomeApp_Application* )application())->addViewManager( aVM );
   SUPERVGraph_ViewFrame* aVW = dynamic_cast<SUPERVGraph_ViewFrame*>( aVM->createViewWindow() );
   if ( aVW ) {
-    QColor back = getApp()->resourceMgr()->colorValue( "SUPERVGraph", "Background", aVW->backgroundColor() );
+    QColor back = getApp()->resourceMgr()->colorValue( "SUPERVGraph", "Background", DEF_MAIN_COLOR );
     qDebug( QString( "background: %1 %2 %3" ).arg( back.red() ).arg( back.green() ).arg( back.blue() ) );
     aVW->setBackgroundColor( back );
     connect( aVM,
@@ -420,6 +421,7 @@ void SUPERVGUI::onGraphClosed(SUIT_ViewWindow* theViewWindow) {
     myAllGraphsClosed = true;
     myFirstActivation = true;
     myInitialViewFrame = 0;
+    myIVFBackgroundColor = QColor();
     main = 0;
   }
 }
@@ -487,7 +489,6 @@ void SUPERVGUI::displayDataflow() {
     else {
       // second case : get empty initial view frame as new ViewFrame object
       aViewFrame = myInitialViewFrame;
-      myInitialViewFrame = 0;
     }
 
     if( aViewFrame ) {
@@ -495,6 +496,11 @@ void SUPERVGUI::displayDataflow() {
       registerGraph( aIORName, main );
       aViewFrame->show();
     }
+
+    if ( myInitialViewFrame ) {
+      myInitialViewFrame = 0;
+      myIVFBackgroundColor = QColor();
+    }
 }
 
 
@@ -672,7 +678,6 @@ bool SUPERVGUI::createDataflow( const NEW_DF_MODE mode, bool theInitialDF ) {
   else {
     // 2. get empty initial view frame as new ViewFrame object
     aViewFrame = myInitialViewFrame;
-    myInitialViewFrame = 0;
   }
 
   if ( aViewFrame ) {
@@ -680,7 +685,7 @@ bool SUPERVGUI::createDataflow( const NEW_DF_MODE mode, bool theInitialDF ) {
     // 3. bind Graph and ViewFrame == create SUPERVGUI_Main object
     main = new SUPERVGUI_Main( aViewFrame, application()->desktop(), aGraph );
     if ( mode == New ) {
-      if ( !theInitialDF )
+      if ( !theInitialDF )     
         main->addNode();
       else
         myInitialViewFrame = aViewFrame;
@@ -691,6 +696,11 @@ bool SUPERVGUI::createDataflow( const NEW_DF_MODE mode, bool theInitialDF ) {
     aViewFrame->show();
   }
 
+  if ( !theInitialDF ) {
+    myInitialViewFrame = 0;
+    myIVFBackgroundColor = QColor();
+  }
+
   return true;
 }
 
index 84e7bbcd5fb22c3aa666d1762e080f1959a20383..2092a9f526ec74f7382da45f8b8062b7f09f4386 100644 (file)
@@ -118,6 +118,10 @@ class SUPERVGUI: public SalomeApp_Module {
      */
     void nullifyInitialVF() { if ( myInitialViewFrame ) myInitialViewFrame = 0; }
 
+    // mkr : IPAL10825
+    QColor getIVFBackgroundColor() { return myIVFBackgroundColor; }
+    void   setIVFBackgroundColor( QColor theColor ) { if ( myInitialViewFrame ) myIVFBackgroundColor = theColor; }
+
   signals:
     void KillMainThread(bool theValue);
 
@@ -166,6 +170,7 @@ class SUPERVGUI: public SalomeApp_Module {
     bool                   myFirstActivation;
     bool                   myAllGraphsClosed;
     SUPERVGraph_ViewFrame* myInitialViewFrame;
+    QColor                 myIVFBackgroundColor; // mkr : IPAL10825
 };
 
 #endif
index b8c2be47d487280da4787b8b39afc49f371c4ff5..08477e5477f5cf04eed7ef11b2bf72a2c168c4d1 100644 (file)
@@ -8,6 +8,7 @@
 
 
 using namespace std;
+#include "SUPERVGUI.h"
 #include "SUPERVGUI_ArrayView.h"
 #include "SUPERVGUI_Main.h"
 #include "SUPERVGUI_CanvasCellNodePrs.h"
@@ -107,6 +108,15 @@ void SUPERVGUI_ArrayView::changeBackground()
     // change background color for canvas view
     getMain()->getCanvasView()->canvas()->setBackgroundColor(aColor);
     getMain()->getCanvasView()->setPaletteBackgroundColor(aColor.light(120));
+
+    // mkr : IPAL10825 -->
+    SUPERVGUI* aSupMod = SUPERVGUI::Supervision();
+    if ( !aSupMod ) {
+      MESSAGE("NULL Supervision module!");
+      return;
+    }
+    aSupMod->setIVFBackgroundColor(aColor);
+    // <--
   }
 }
 
index a299cdd2649542a0ea1014d654763499be43c0bd..776849d0db5c10190448fa418f7d3d5c371554e1 100644 (file)
@@ -7,6 +7,7 @@
 //  Module : SUPERV
 
 using namespace std;
+#include "SUPERVGUI.h"
 #include "SUPERVGUI_Def.h"
 #include "SUPERVGUI_Main.h"
 #include "SUPERVGUI_CanvasNode.h"
@@ -89,7 +90,17 @@ SUPERVGUI_Canvas::SUPERVGUI_Canvas( SUPERVGUI_Main* m, SUIT_ResourceMgr* mgr ):
   resize(1050, 750);
   setDoubleBuffering(true);
 
-  QColor aColor = mgr->colorValue( "SUPERVGraph", "Background", DEF_MAIN_COLOR );
+  // mkr : IPAL10825 -->
+  SUPERVGUI* aSupMod = SUPERVGUI::Supervision();
+  if ( !aSupMod ) {
+    MESSAGE("NULL Supervision module!");
+    return;
+  }
+  QColor aColor =  aSupMod->getIVFBackgroundColor();
+  if ( !aColor.isValid() )
+    aColor = mgr->colorValue( "SUPERVGraph", "Background", DEF_MAIN_COLOR );
+  // <--
+     
   //aColor = QColor(SUIT_Session::session()->resourceMgr()->integerValue( "SUPERVGraph", "BackgroundColorRed" ), 
   //             SUIT_Session::session()->resourceMgr()->integerValue( "SUPERVGraph", "BackgroundColorGreen" ), 
   //             SUIT_Session::session()->resourceMgr()->integerValue( "SUPERVGraph", "BackgroundColorBlue" ) );
index bd3d1219f669464415f3b260989c0534b9c9c6d0..19d07d227521aa716a8a2df355a4b9ed07116bfe 100644 (file)
@@ -7,6 +7,7 @@
 //  Module : SUPERV
 
 using namespace std;
+#include "SUPERVGUI.h"
 #include "SUPERVGUI_CanvasArray.h"
 #include "SUPERVGUI_Main.h"
 #include "SUPERVGUI_BrowseNodeDlg.h"
@@ -86,7 +87,17 @@ SUPERVGUI_CanvasArray::SUPERVGUI_CanvasArray(SUPERVGUI_Main* m, SUIT_ResourceMgr
   resize(1000, 725);
   setDoubleBuffering(true);
 
-  QColor aColor = mgr->colorValue( "SUPERVGraph", "Background", DEF_MAIN_COLOR );
+  // mkr : IPAL10825 -->
+  SUPERVGUI* aSupMod = SUPERVGUI::Supervision();
+  if ( !aSupMod ) {
+    MESSAGE("NULL Supervision module!");
+    return;
+  }
+  QColor aColor =  aSupMod->getIVFBackgroundColor();
+  if ( !aColor.isValid() )
+    aColor = mgr->colorValue( "SUPERVGraph", "Background", DEF_MAIN_COLOR );
+  // <--
+  
   //aColor = QColor(SUIT_Session::session()->resourceMgr()->integerValue( "SUPERVGraph", "BackgroundColorRed" ), 
   //             SUIT_Session::session()->resourceMgr()->integerValue( "SUPERVGraph", "BackgroundColorGreen" ), 
   //             SUIT_Session::session()->resourceMgr()->integerValue( "SUPERVGraph", "BackgroundColorBlue" ) );
index b9eeaffc5d04ebd3807b59bfe8bb9d48718be83f..ccf9f06afc66148a26c9fb6d90df537d6a6c13b7 100644 (file)
@@ -204,7 +204,7 @@ void SUPERVGUI_CanvasCellNodePrs::setState(SUPERV::GraphState theState)
 
   default:
     setStatus("No Status");
-    setStatusColor( resMgr()->colorValue( "SUPERVGraph", "Background", DEF_MAIN_BACK ) );
+    setStatusColor( resMgr()->colorValue( "SUPERVGraph", "NodeBody", DEF_MAIN_BACK ) ); // mkr : IPAL10829
     break;
   }
 
index 3e52a413e50c30ef05fade6d30c8c11a45b760d8..c33671658d7ee0419d38d0ac5c85d2243ea95aca 100644 (file)
@@ -10,6 +10,7 @@
 
 using namespace std;
 
+#include "SUPERVGUI.h"
 #include "SUPERVGUI_CanvasView.h"
 #include "SUPERVGUI_Main.h"
 #include "SUPERVGUI_CanvasNode.h"
@@ -571,6 +572,15 @@ void SUPERVGUI_CanvasView::changeBackground()
     // change background color for array view
     getMain()->getArrayView()->canvas()->setBackgroundColor(aColor);
     getMain()->getArrayView()->setPaletteBackgroundColor(aColor.light(120));
+
+    // mkr : IPAL10825 -->
+    SUPERVGUI* aSupMod = SUPERVGUI::Supervision();
+    if ( !aSupMod ) {
+      MESSAGE("NULL Supervision module!");
+      return;
+    }
+    aSupMod->setIVFBackgroundColor(aColor); 
+    // <--
   }
 }