Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/visu.git] / src / VISUGUI / VisuGUI_BuildProgressDlg.cxx
index 210bbcdd5d52b982555de98f82967f2edba7ea77..6102b6b6da1e1165b74bed1353b797ce832bd3ad 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  VISU VISUGUI : GUI of VISU component
 //  File   : VisuGUI_BuildProgressDlg.cxx
 //  Author : Oleg UVAROV
@@ -129,7 +130,7 @@ VisuGUI_BuildProgressDlg::VisuGUI_BuildProgressDlg( QWidget* theParent ):
   myBuildFieldsButton->setEnabled( false );
   myBuildFieldsButton->setFixedSize( 30, 30 );
   aPal = myBuildFieldsButton->palette();
-  aPal.setColor( myBuildFieldsButton->backgroundRole(), Qt::red );
+  aPal.setColor( myBuildFieldsButton->backgroundRole(), myBuildFieldsCheckBox->isChecked() ? Qt::red : Qt::gray );
   myBuildFieldsButton->setPalette( aPal );
 
   connect( myBuildFieldsCheckBox, SIGNAL( clicked() ), this, SLOT( onBuildCheckBoxClicked() ) );
@@ -140,7 +141,7 @@ VisuGUI_BuildProgressDlg::VisuGUI_BuildProgressDlg( QWidget* theParent ):
   myBuildMinMaxButton->setEnabled( false );
   myBuildMinMaxButton->setFixedSize( 30, 30 );
   aPal = myBuildMinMaxButton->palette();
-  aPal.setColor( myBuildMinMaxButton->backgroundRole(), Qt::red );
+  aPal.setColor( myBuildMinMaxButton->backgroundRole(), myBuildMinMaxCheckBox->isChecked() ? Qt::red : Qt::gray );
   myBuildMinMaxButton->setPalette( aPal );
   
   connect( myBuildMinMaxCheckBox, SIGNAL( clicked() ), this, SLOT( onBuildCheckBoxClicked() ) );
@@ -151,7 +152,7 @@ VisuGUI_BuildProgressDlg::VisuGUI_BuildProgressDlg( QWidget* theParent ):
   myBuildGroupsButton->setEnabled( false );
   myBuildGroupsButton->setFixedSize( 30, 30 );
   aPal = myBuildGroupsButton->palette();
-  aPal.setColor( myBuildGroupsButton->backgroundRole(), Qt::red );
+  aPal.setColor( myBuildGroupsButton->backgroundRole(), myBuildGroupsCheckBox->isChecked() ? Qt::red : Qt::gray );
   myBuildGroupsButton->setPalette( aPal );
 
   connect( myBuildGroupsCheckBox, SIGNAL( clicked() ), this, SLOT( onBuildCheckBoxClicked() ) );
@@ -262,7 +263,7 @@ void VisuGUI_BuildProgressDlg::onStart()
     if( aBuildAtOnce )
     {
       QApplication::setOverrideCursor( Qt::WaitCursor );
-      myCurrentTime = vtkTimerLog::GetCurrentTime();
+      myCurrentTime = vtkTimerLog::GetUniversalTime();
     }
 
     myTime.setHMS( 0, 0, 0 );
@@ -287,11 +288,11 @@ void VisuGUI_BuildProgressDlg::onHelp()
     app->onHelpContextModule(aVisuGUI ? app->moduleName(aVisuGUI->moduleName()) : QString(""), aHelpFileName);
   }
   else {
-               QString platform;
+                QString platform;
 #ifdef WIN32
-               platform = "winapplication";
+                platform = "winapplication";
 #else
-               platform = "application";
+                platform = "application";
 #endif
     SUIT_MessageBox::warning(0, ("WRN_WARNING"),
                              tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
@@ -329,7 +330,7 @@ void VisuGUI_BuildProgressDlg::onTimer()
     {
       myTime = myTime.addMSecs( 100 );
       if( myTime.minute() > 9 && myTimeLCDNumber->numDigits() < 9 )
-       myTimeLCDNumber->setNumDigits( 9 );
+        myTimeLCDNumber->setNumDigits( 9 );
       myTimeLCDNumber->display( myTime.toString( "m:ss.zzz" ) );
 
       bool isEntitiesDone = myResult->IsEntitiesDone();
@@ -349,25 +350,25 @@ void VisuGUI_BuildProgressDlg::onTimer()
 
       if( aBuildAtOnce )
       {
-       updateButton( myBuildEntitiesButton, true );
-       updateButton( myBuildFieldsButton, true );
-       updateButton( myBuildMinMaxButton, true );
-       updateButton( myBuildGroupsButton, true );
-
-       QApplication::restoreOverrideCursor();
-
-       QTime aTime;
-       int mSecs = ( int )( 1000 * ( vtkTimerLog::GetCurrentTime() - myCurrentTime ) );
-       aTime = aTime.addMSecs( mSecs );
-       if( aTime.minute() > 9 )
-         myTimeLCDNumber->setNumDigits( 9 );
-       myTimeLCDNumber->display( aTime.toString( "m:ss.zzz" ) );
+        updateButton( myBuildEntitiesButton, true );
+        updateButton( myBuildFieldsButton, true );
+        updateButton( myBuildMinMaxButton, true );
+        updateButton( myBuildGroupsButton, true );
+
+        QApplication::restoreOverrideCursor();
+
+        QTime aTime;
+        int mSecs = ( int )( 1000 * ( vtkTimerLog::GetUniversalTime() - myCurrentTime ) );
+        aTime = aTime.addMSecs( mSecs );
+        if( aTime.minute() > 9 )
+          myTimeLCDNumber->setNumDigits( 9 );
+        myTimeLCDNumber->display( aTime.toString( "m:ss.zzz" ) );
       }
 
       if( myCloseCheckBox->isChecked() )
-       done( 0 );
+        done( 0 );
       else
-       SUIT_MessageBox::warning( this,
+        SUIT_MessageBox::warning( this,
                                   tr( "INF_VISU" ),
                                   tr( "IMPORT_DONE" ),
                                   tr( "BUT_OK" ) );