From ab935594a0a30533f9160c62cafd1aec3839fa30 Mon Sep 17 00:00:00 2001 From: apo Date: Thu, 25 Oct 2007 08:26:15 +0000 Subject: [PATCH] To restore "Build Min/Max" customization --- src/VISUGUI/VisuGUI_BuildProgressDlg.cxx | 27 ++++++++++++++++++++---- src/VISUGUI/VisuGUI_BuildProgressDlg.h | 3 +++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/VISUGUI/VisuGUI_BuildProgressDlg.cxx b/src/VISUGUI/VisuGUI_BuildProgressDlg.cxx index 0c40d8e2..e1dace81 100644 --- a/src/VISUGUI/VisuGUI_BuildProgressDlg.cxx +++ b/src/VISUGUI/VisuGUI_BuildProgressDlg.cxx @@ -129,6 +129,14 @@ VisuGUI_BuildProgressDlg::VisuGUI_BuildProgressDlg( QWidget* theParent ): myBuildFieldsButton->setPaletteBackgroundColor( Qt::red ); connect( myBuildFieldsCheckBox, SIGNAL( clicked() ), this, SLOT( onBuildCheckBoxClicked() ) ); + myBuildMinMaxCheckBox = new QCheckBox( tr( "BUILD_MINMAX" ), myProgressBox ); + myBuildMinMaxCheckBox->setChecked( aResourceMgr->booleanValue( "VISU", "build_min_max", true ) ); + myBuildMinMaxButton = new QPushButton( myProgressBox ); + myBuildMinMaxButton->setEnabled( false ); + myBuildMinMaxButton->setFixedSize( 30, 30 ); + myBuildMinMaxButton->setPaletteBackgroundColor( Qt::red ); + connect( myBuildMinMaxCheckBox, SIGNAL( clicked() ), this, SLOT( onBuildCheckBoxClicked() ) ); + myBuildGroupsCheckBox = new QCheckBox( tr( "BUILD_GROUPS" ), myProgressBox ); myBuildGroupsCheckBox->setChecked( aResourceMgr->booleanValue( "VISU", "build_groups", true ) ); myBuildGroupsButton = new QPushButton( myProgressBox ); @@ -141,8 +149,10 @@ VisuGUI_BuildProgressDlg::VisuGUI_BuildProgressDlg( QWidget* theParent ): aProgressLayout->addWidget( myBuildEntitiesButton, 0, 1 ); aProgressLayout->addWidget( myBuildFieldsCheckBox, 1, 0 ); aProgressLayout->addWidget( myBuildFieldsButton, 1, 1 ); - aProgressLayout->addWidget( myBuildGroupsCheckBox, 2, 0 ); - aProgressLayout->addWidget( myBuildGroupsButton, 2, 1 ); + aProgressLayout->addWidget( myBuildMinMaxCheckBox, 2, 0 ); + aProgressLayout->addWidget( myBuildMinMaxButton, 2, 1 ); + aProgressLayout->addWidget( myBuildGroupsCheckBox, 3, 0 ); + aProgressLayout->addWidget( myBuildGroupsButton, 3, 1 ); // Time myTimeBox = new QGroupBox( tr( "IMPORT_TIME" ), this ); @@ -222,7 +232,7 @@ void VisuGUI_BuildProgressDlg::onStart() tr("BUT_OK")); onClose(); }else{ - myResult->SetBuildFields( myBuildFieldsCheckBox->isChecked(), true ); + myResult->SetBuildFields( myBuildFieldsCheckBox->isChecked(), myBuildMinMaxCheckBox->isChecked() ); myResult->SetBuildGroups( myBuildGroupsCheckBox->isChecked() ); //setModal( false ); @@ -309,7 +319,8 @@ void VisuGUI_BuildProgressDlg::onTimer() bool isGroupsDone = myResult->IsGroupsDone(); updateButton( myBuildEntitiesButton, isEntitiesDone ); - updateButton( myBuildFieldsButton, isFieldsDone && isMinMaxDone); + updateButton( myBuildFieldsButton, isFieldsDone ); + updateButton( myBuildMinMaxButton, isMinMaxDone ); updateButton( myBuildGroupsButton, isGroupsDone ); } @@ -395,6 +406,14 @@ void VisuGUI_BuildProgressDlg::onBuildCheckBoxClicked() else if( aCheckBox == myBuildFieldsCheckBox ) { myBuildFieldsButton->setPaletteBackgroundColor( aColor ); + if( !anIsChecked && myBuildMinMaxCheckBox->isChecked() ) + myBuildMinMaxCheckBox->animateClick(); + } + else if( aCheckBox == myBuildMinMaxCheckBox ) + { + myBuildMinMaxButton->setPaletteBackgroundColor( aColor ); + if( anIsChecked && !myBuildFieldsCheckBox->isChecked() ) + myBuildFieldsCheckBox->animateClick(); } else if( aCheckBox == myBuildGroupsCheckBox ) myBuildGroupsButton->setPaletteBackgroundColor( aColor ); diff --git a/src/VISUGUI/VisuGUI_BuildProgressDlg.h b/src/VISUGUI/VisuGUI_BuildProgressDlg.h index 3eb7c1a1..8284c52d 100644 --- a/src/VISUGUI/VisuGUI_BuildProgressDlg.h +++ b/src/VISUGUI/VisuGUI_BuildProgressDlg.h @@ -95,6 +95,9 @@ private: QCheckBox* myBuildFieldsCheckBox; QPushButton* myBuildFieldsButton; + QCheckBox* myBuildMinMaxCheckBox; + QPushButton* myBuildMinMaxButton; + QCheckBox* myBuildGroupsCheckBox; QPushButton* myBuildGroupsButton; -- 2.39.2