From: ouv Date: Thu, 24 Nov 2005 16:17:28 +0000 (+0000) Subject: Build Progress Dialog was updated. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=568a328342027256c43946dc05696fd881e2f983;p=modules%2Fvisu.git Build Progress Dialog was updated. --- diff --git a/src/VISUGUI/VISUM_msg_en.po b/src/VISUGUI/VISUM_msg_en.po index 015083b9..1868fa51 100644 --- a/src/VISUGUI/VISUM_msg_en.po +++ b/src/VISUGUI/VISUM_msg_en.po @@ -235,14 +235,53 @@ msgstr "Gauss Points Properties" msgid "VisuGUI_BuildProgressDlg::DLG_BUILD_PROGRESS_TITLE" msgstr "Build progress" +msgid "VisuGUI_BuildProgressDlg::IMPORT_SETTINGS" +msgstr "Settings" + +msgid "VisuGUI_BuildProgressDlg::FILE_NAME" +msgstr "Import file : " + +msgid "VisuGUI_BuildProgressDlg::BUILD_AT_ONCE" +msgstr "Build at once" + +msgid "VisuGUI_BuildProgressDlg::BUILD_ALL" +msgstr "Build all" + +msgid "VisuGUI_BuildProgressDlg::IMPORT_PROGRESS" +msgstr "Import progress" + +msgid "VisuGUI_BuildProgressDlg::BUILD_ENTITIES" +msgstr "Build entities" + msgid "VisuGUI_BuildProgressDlg::BUILD_FIELDS" -msgstr "Building fields..." +msgstr "Build fields" msgid "VisuGUI_BuildProgressDlg::BUILD_GROUPS" -msgstr "Building groups..." +msgstr "Build groups" msgid "VisuGUI_BuildProgressDlg::BUILD_MINMAX" -msgstr "Building min/max..." +msgstr "Build min/max" + +msgid "VisuGUI_BuildProgressDlg::IMPORT_TIME" +msgstr "Time" + +msgid "VisuGUI_BuildProgressDlg::TIME" +msgstr "Elapsed time : " + +msgid "VisuGUI_BuildProgressDlg::IMPORT_FROM_FILE" +msgstr "Import from File" + +msgid "VisuGUI_BuildProgressDlg::FLT_ALL_FILES" +msgstr "All Files (*.*)" + +msgid "VisuGUI_BuildProgressDlg::FLT_MED_FILES" +msgstr "MED Files (*.med)" + +msgid "VisuGUI_BuildProgressDlg::START" +msgstr "Start" + +msgid "VisuGUI_BuildProgressDlg::CLOSE" +msgstr "Close" msgid "VVTK_ViewManager::VTK_VIEW_TITLE" msgstr "VISU scene:%1 - viewer:%2" diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index d1acbbc1..bb06d575 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -164,68 +164,10 @@ OnImportFromFile() { if(MYDEBUG) MESSAGE("VisuGUI::OnImportFromFile()"); CheckLock(GetCStudy(GetAppStudy(this))); - SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); - - QStringList aFilter; - aFilter.append( tr("FLT_MED_FILES") ); - aFilter.append( tr("FLT_ALL_FILES") ); - QFileInfo aFileInfo = - SUIT_FileDlg::getFileName(GetDesktop(this), - "", - aFilter, - tr("MEN_IMPORT_FROM_FILE"), - true); - if(aFileInfo.exists()) { - application()->putInfo( "Importing From File " + aFileInfo.filePath() + "...", -1 ); - double initialTime = vtkTimerLog::GetCPUTime(); - - VisuGUI_BuildProgressDlg* aBuildProgressDlg; - QString aFileName = aFileInfo.fileName(); - - VISU::Result_var aResult; - bool anIsBuild = aResourceMgr->booleanValue("VISU", "full_med_loading", false); - if (VisuGUI_FileDlg::IsBuild) { - aResult = GetVisuGen(this)->ImportFile(aFileInfo.filePath()); - - aBuildProgressDlg = new VisuGUI_BuildProgressDlg( GetDesktop(this), aResult, aFileName ); - aBuildProgressDlg->start(); - - if (!CORBA::is_nil(aResult.in())) - if (Result_i* aRes = dynamic_cast(GetServant(aResult).in())) { - if (!aRes->IsPossible()) - SUIT_MessageBox::warn1(GetDesktop(this), - tr("WRN_VISU"), - tr("ERR_CANT_BUILD_PRESENTATION"), - tr("BUT_OK")); - else - aRes->BuildAll(); - } - } else { - aResourceMgr->setValue("VISU", "full_med_loading", false); - aResult = GetVisuGen(this)->ImportFile(aFileInfo.filePath()); - aResourceMgr->setValue("VISU", "full_med_loading", anIsBuild); - - aBuildProgressDlg = new VisuGUI_BuildProgressDlg( GetDesktop(this), aResult, aFileName ); - aBuildProgressDlg->start(); - } - - if (CORBA::is_nil(aResult.in())) { - SUIT_MessageBox::warn1(GetDesktop(this), - tr("WRN_VISU"), - tr("ERR_ERROR_IN_THE_FILE"), - tr("BUT_OK")); - }else{ - INFOS( "VisuGUI::OnImportFromFile() : File importing done in " << - vtkTimerLog::GetCPUTime() - initialTime << " seconds" ); - - QTime aTime; - int mSecs = ( int )( 1000 * ( vtkTimerLog::GetCPUTime() - initialTime ) ); - aTime = aTime.addMSecs( mSecs ); - application()->putInfo( aFileInfo.filePath() + tr( "INF_DONE" ) + " in " + - aTime.toString( "m:ss.zzz" ), -1 ); - } - } + VisuGUI_BuildProgressDlg* aBuildProgressDlg = new VisuGUI_BuildProgressDlg( GetDesktop(this) ); + aBuildProgressDlg->setGenerator( GetVisuGen(this) ); + aBuildProgressDlg->show(); } diff --git a/src/VISUGUI/VisuGUI_BuildProgressDlg.cxx b/src/VISUGUI/VisuGUI_BuildProgressDlg.cxx index d2a10a21..1bc199d0 100644 --- a/src/VISUGUI/VisuGUI_BuildProgressDlg.cxx +++ b/src/VISUGUI/VisuGUI_BuildProgressDlg.cxx @@ -29,66 +29,165 @@ #include "VisuGUI_Tools.h" +#include "SUIT_ResourceMgr.h" +#include "SUIT_FileDlg.h" + +#include + +#include #include #include #include +#include +#include #include #include /*! * Constructor */ -VisuGUI_BuildProgressDlg::VisuGUI_BuildProgressDlg( QWidget* theParent, - VISU::Result_var theResult, - const QString& theFileName ): - QDialog( theParent ), - myResult( theResult ) +VisuGUI_BuildProgressDlg::VisuGUI_BuildProgressDlg( QWidget* theParent ): + QDialog( theParent, "VisuGUI_BuildProgressBar", false ), + myIsRaiseColor( false ) { - setName( "VisuGUI_BuildProgressBar" ); setCaption( tr( "DLG_BUILD_PROGRESS_TITLE" ) ); - setSizeGripEnabled( true ); SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); QVBoxLayout* aTopLayout = new QVBoxLayout( this ); - //aTopLayout->setSpacing( 6 ); + aTopLayout->setSpacing( 6 ); aTopLayout->setMargin( 6 ); aTopLayout->setAutoAdd( true ); - QString aCaption = QString( "Importing " ) + theFileName; - QGroupBox* aBox = new QGroupBox( aCaption, this ); - aBox->setColumnLayout(0, Qt::Vertical ); - aBox->layout()->setSpacing( 0 ); - aBox->layout()->setMargin( 0 ); + // Settings + mySettingsBox = new QGroupBox( tr( "IMPORT_SETTINGS" ), this ); + mySettingsBox->setColumnLayout( 0, Qt::Vertical ); + mySettingsBox->layout()->setSpacing( 0 ); + mySettingsBox->layout()->setMargin( 0 ); + + QGridLayout* aSettingsLayout = new QGridLayout( mySettingsBox->layout() ); + aSettingsLayout->setSpacing( 6 ); + aSettingsLayout->setMargin( 11 ); + + QLabel* aFileNameLabel = new QLabel( tr( "FILE_NAME" ), mySettingsBox ); + myFileNameLineEdit = new QLineEdit( mySettingsBox ); + myFileNameLineEdit->setMinimumWidth( 250 ); + + QPushButton* aFileNameButton = new QPushButton( mySettingsBox ); + aFileNameButton->setAutoDefault( false ); + aFileNameButton->setPixmap( aResourceMgr->loadPixmap( "VISU", tr( "ICON_LOAD_TEXTURE" ) ) ); + connect( aFileNameButton, SIGNAL( clicked() ), this, SLOT( onBrowseFile() ) ); + + myBuildAllCheckBox = new QCheckBox( tr( "BUILD_ALL" ), mySettingsBox ); + myBuildAllCheckBox->setChecked( aResourceMgr->booleanValue( "VISU", "full_med_loading", false ) ); + connect( myBuildAllCheckBox, SIGNAL( clicked() ), this, SLOT( onBuildCheckBoxClicked() ) ); + + myBuildAtOnceCheckBox = new QCheckBox( tr( "BUILD_AT_ONCE" ), mySettingsBox ); + myBuildAtOnceCheckBox->setChecked( aResourceMgr->booleanValue( "VISU", "build_at_once", true ) ); + connect( myBuildAtOnceCheckBox, SIGNAL( clicked() ), this, SLOT( onBuildCheckBoxClicked() ) ); + + aSettingsLayout->addWidget( aFileNameLabel, 0, 0 ); + aSettingsLayout->addMultiCellWidget( myFileNameLineEdit, 1, 1, 0, 1 ); + aSettingsLayout->addWidget( aFileNameButton, 1, 2 ); + aSettingsLayout->addWidget( myBuildAllCheckBox, 2, 0 ); + aSettingsLayout->addWidget( myBuildAtOnceCheckBox, 2, 1 ); + + // Progress + myProgressBox = new QGroupBox( tr( "IMPORT_PROGRESS" ), this ); + myProgressBox->setColumnLayout( 0, Qt::Vertical ); + myProgressBox->layout()->setSpacing( 0 ); + myProgressBox->layout()->setMargin( 0 ); + + QGridLayout* aProgressLayout = new QGridLayout( myProgressBox->layout() ); + aProgressLayout->setSpacing( 6 ); + aProgressLayout->setMargin( 11 ); - QGridLayout* aGridLayout = new QGridLayout( aBox->layout() ); - aGridLayout->setSpacing( 6 ); - aGridLayout->setMargin( 11 ); + myBuildEntitiesCheckBox = new QCheckBox( tr( "BUILD_ENTITIES" ), myProgressBox ); + myBuildEntitiesCheckBox->setChecked( true ); + myBuildEntitiesCheckBox->setEnabled( false ); + myBuildEntitiesButton = new QPushButton( myProgressBox ); + myBuildEntitiesButton->setEnabled( false ); + myBuildEntitiesButton->setFixedSize( 30, 30 ); + myBuildEntitiesButton->setPaletteBackgroundColor( Qt::red ); + connect( myBuildEntitiesCheckBox, SIGNAL( clicked() ), this, SLOT( onBuildCheckBoxClicked() ) ); - QLabel* BuildFieldsLabel = new QLabel( tr( "BUILD_FIELDS" ), aBox ); - myBuildFieldsButton = new QPushButton( aBox ); + myBuildFieldsCheckBox = new QCheckBox( tr( "BUILD_FIELDS" ), myProgressBox ); + myBuildFieldsCheckBox->setChecked( true ); + myBuildFieldsButton = new QPushButton( myProgressBox ); myBuildFieldsButton->setEnabled( false ); myBuildFieldsButton->setFixedSize( 30, 30 ); myBuildFieldsButton->setPaletteBackgroundColor( Qt::red ); + connect( myBuildFieldsCheckBox, SIGNAL( clicked() ), this, SLOT( onBuildCheckBoxClicked() ) ); - QLabel* BuildGroupsLabel = new QLabel( tr( "BUILD_GROUPS" ), aBox ); - myBuildGroupsButton = new QPushButton( aBox ); + myBuildMinMaxCheckBox = new QCheckBox( tr( "BUILD_MINMAX" ), myProgressBox ); + myBuildMinMaxCheckBox->setChecked( 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( true ); + myBuildGroupsButton = new QPushButton( myProgressBox ); myBuildGroupsButton->setEnabled( false ); myBuildGroupsButton->setFixedSize( 30, 30 ); myBuildGroupsButton->setPaletteBackgroundColor( Qt::red ); + connect( myBuildGroupsCheckBox, SIGNAL( clicked() ), this, SLOT( onBuildCheckBoxClicked() ) ); - QLabel* BuildMinMaxLabel = new QLabel( tr( "BUILD_MINMAX" ), aBox ); - myBuildMinMaxButton = new QPushButton( aBox ); - myBuildMinMaxButton->setEnabled( false ); - myBuildMinMaxButton->setFixedSize( 30, 30 ); - myBuildMinMaxButton->setPaletteBackgroundColor( Qt::red ); + aProgressLayout->addWidget( myBuildEntitiesCheckBox, 0, 0 ); + aProgressLayout->addWidget( myBuildEntitiesButton, 0, 1 ); + aProgressLayout->addWidget( myBuildFieldsCheckBox, 1, 0 ); + aProgressLayout->addWidget( myBuildFieldsButton, 1, 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 ); + myTimeBox->setColumnLayout( 0, Qt::Vertical ); + myTimeBox->layout()->setSpacing( 0 ); + myTimeBox->layout()->setMargin( 0 ); + + QGridLayout* aTimeLayout = new QGridLayout( myTimeBox->layout() ); + aTimeLayout->setSpacing( 6 ); + aTimeLayout->setMargin( 11 ); - aGridLayout->addWidget( BuildFieldsLabel, 0, 0 ); - aGridLayout->addWidget( myBuildFieldsButton, 0, 1 ); - aGridLayout->addWidget( BuildGroupsLabel, 1, 0 ); - aGridLayout->addWidget( myBuildGroupsButton, 1, 1 ); - aGridLayout->addWidget( BuildMinMaxLabel, 2, 0 ); - aGridLayout->addWidget( myBuildMinMaxButton, 2, 1 ); + QLabel* aTimeLabel = new QLabel( tr( "TIME" ), myTimeBox ); + + myTimeLCDNumber = new QLCDNumber( myTimeBox ); + myTimeLCDNumber->setSegmentStyle( QLCDNumber::Filled ); + myTimeLCDNumber->setPaletteBackgroundColor( Qt::black ); + myTimeLCDNumber->setPaletteForegroundColor( Qt::white ); + myTimeLCDNumber->setNumDigits( 8 ); + myTimeLCDNumber->display( myTime.toString( "hh:mm:ss.zzz" ) ); + + aTimeLayout->addWidget( aTimeLabel, 0, 0 ); + aTimeLayout->addWidget( myTimeLCDNumber, 0, 1 ); + + // Start / Close + QGroupBox* CommonGroup = new QGroupBox( this ); + CommonGroup->setColumnLayout(0, Qt::Vertical ); + CommonGroup->layout()->setSpacing( 0 ); + CommonGroup->layout()->setMargin( 0 ); + QGridLayout* CommonGroupLayout = new QGridLayout( CommonGroup->layout() ); + CommonGroupLayout->setAlignment( Qt::AlignTop ); + CommonGroupLayout->setSpacing( 6 ); + CommonGroupLayout->setMargin( 11 ); + + myStartButton = new QPushButton( tr( "START" ), CommonGroup ); + myStartButton->setAutoDefault( true ); + myStartButton->setDefault( true ); + CommonGroupLayout->addWidget( myStartButton, 0, 0 ); + CommonGroupLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 ); + + QPushButton* aCloseButton = new QPushButton( tr( "CLOSE" ), CommonGroup ); + aCloseButton->setAutoDefault( true ); + CommonGroupLayout->addWidget( aCloseButton, 0, 2 ); + + connect( myStartButton, SIGNAL( clicked() ), this, SLOT( onStart() ) ); + connect( aCloseButton, SIGNAL( clicked() ), this, SLOT( onClose() ) ); myTimer = new QTimer( this ); connect( myTimer, SIGNAL( timeout() ), this, SLOT( onTimer() ) ); @@ -98,25 +197,112 @@ VisuGUI_BuildProgressDlg::~VisuGUI_BuildProgressDlg() { } -void VisuGUI_BuildProgressDlg::start() +void VisuGUI_BuildProgressDlg::show() +{ + if( onBrowseFile() ) + QWidget::show(); +} + +void VisuGUI_BuildProgressDlg::onStart() { + if( myFileName.isNull() ) + return; + + bool aBuildAll = myBuildAllCheckBox->isChecked(); + bool aBuildAtOnce = myBuildAtOnceCheckBox->isChecked(); + + myResult = myGenerator->CreateResult( myFileName ); + + myResult->SetBuildFields( myBuildFieldsCheckBox->isChecked(), myBuildMinMaxCheckBox->isChecked() ); + myResult->SetBuildGroups( myBuildGroupsCheckBox->isChecked() ); + + myResult->Build( aBuildAll, aBuildAtOnce ); + + //if( aBuildAtOnce ) + // onClose(); + + //setModal( false ); + myFileNameLineEdit->setReadOnly( true ); + /* + myBuildAllCheckBox->setNoChange(); + myBuildAtOnceCheckBox->setNoChange(); + myBuildEntitiesCheckBox->setNoChange(); + myBuildFieldsCheckBox->setNoChange(); + myBuildMinMaxCheckBox->setNoChange(); + myBuildGroupsCheckBox->setNoChange(); + */ + + myStartButton->setEnabled( false ); + + myCurrentTime = vtkTimerLog::GetCurrentTime(); + + myTime.setHMS( 0, 0, 0 ); myTimer->start( 100 ); - show(); +} + +void VisuGUI_BuildProgressDlg::onClose() +{ + done( 0 ); +} + +bool VisuGUI_BuildProgressDlg::onBrowseFile() +{ + QString aRootDir = QString( getenv( "VISU_ROOT_DIR") ); + + QStringList aFilter; + aFilter.append( tr( "FLT_MED_FILES" ) ); + aFilter.append( tr( "FLT_ALL_FILES" ) ); + + QFileInfo aFileInfo = SUIT_FileDlg::getFileName( this, "", aFilter, tr( "IMPORT_FROM_FILE" ), true ); + QString aFileName = aFileInfo.filePath(); + + if( aFileName.isNull() ) + return false; + + myFileName = aFileName; + myFileNameLineEdit->setText( aFileName.section( '/', -1 ) ); + + return true; } void VisuGUI_BuildProgressDlg::onTimer() { try { + bool aBuildAtOnce = myBuildAtOnceCheckBox->isChecked(); + + if( !aBuildAtOnce ) + { + myTime = myTime.addMSecs( 100 ); + if( myTime.minute() > 9 && myTimeLCDNumber->numDigits() < 9 ) + myTimeLCDNumber->setNumDigits( 9 ); + myTimeLCDNumber->display( myTime.toString( "m:ss.zzz" ) ); + } + + bool isEntitiesDone = myResult->IsEntitiesDone(); bool isFieldsDone = myResult->IsFieldsDone(); - bool isGroupsDone = myResult->IsGroupsDone(); bool isMinMaxDone = myResult->IsMinMaxDone(); + bool isGroupsDone = myResult->IsGroupsDone(); + updateButton( myBuildEntitiesButton, isEntitiesDone ); updateButton( myBuildFieldsButton, isFieldsDone ); - updateButton( myBuildGroupsButton, isGroupsDone ); updateButton( myBuildMinMaxButton, isMinMaxDone ); + updateButton( myBuildGroupsButton, isGroupsDone ); + + if( myResult->IsDone() ) + { + myTimer->stop(); - if( isFieldsDone && isGroupsDone && isMinMaxDone ) - done( 0 ); + if( aBuildAtOnce ) + { + cout << myCurrentTime << " -> " << vtkTimerLog::GetCurrentTime() << endl; + 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" ) ); + } + } } catch( ... ) { done( 1 ); @@ -126,13 +312,23 @@ void VisuGUI_BuildProgressDlg::onTimer() void VisuGUI_BuildProgressDlg::updateButton( QPushButton* theButton, bool theIsDone ) { QColor aCurrentColor = theButton->paletteBackgroundColor(); + if( aCurrentColor == Qt::gray || aCurrentColor == Qt::green ) + return; + QColor aNewColor = Qt::green; if( !theIsDone ) { - aNewColor = Qt::red; - if( aCurrentColor == Qt::red ) - aNewColor = Qt::yellow; + int r, g, b; + aCurrentColor.getRgb( &r, &g, &b ); + if( g == 0 ) + myIsRaiseColor = true; + else if( g == 255 ) + myIsRaiseColor = false; + + int gNew = g + ( myIsRaiseColor ? 1 : -1 ) * 51; + + aNewColor.setRgb( 255, gNew, 0 ); } theButton->setPaletteBackgroundColor( aNewColor ); @@ -143,3 +339,40 @@ void VisuGUI_BuildProgressDlg::done( int r ) myTimer->stop(); QDialog::done( r ); } + +void VisuGUI_BuildProgressDlg::onBuildCheckBoxClicked() +{ + QCheckBox* aCheckBox = ( QCheckBox* )sender(); + if( !aCheckBox ) + return; + + bool anIsChecked = aCheckBox->isChecked(); + + QColor aColor = anIsChecked ? Qt::red : Qt::gray; + + if( aCheckBox == myBuildAllCheckBox ) + { + if( anIsChecked && !myBuildAtOnceCheckBox->isChecked() ) + myBuildAtOnceCheckBox->animateClick(); + } + else if( aCheckBox == myBuildAtOnceCheckBox ) + { + if( !anIsChecked && myBuildAllCheckBox->isChecked() ) + myBuildAllCheckBox->animateClick(); + } + 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 9fec674e..5388b509 100644 --- a/src/VISUGUI/VisuGUI_BuildProgressDlg.h +++ b/src/VISUGUI/VisuGUI_BuildProgressDlg.h @@ -31,8 +31,13 @@ #include "VISU_Gen_i.hh" +#include #include +class QCheckBox; +class QGroupBox; +class QLCDNumber; +class QLineEdit; class QPushButton; class QTimer; @@ -42,26 +47,63 @@ class VisuGUI_BuildProgressDlg : public QDialog Q_OBJECT public: - VisuGUI_BuildProgressDlg( QWidget*, VISU::Result_var, const QString& ); + VisuGUI_BuildProgressDlg( QWidget* ); ~VisuGUI_BuildProgressDlg(); - void start(); + virtual void setGenerator( VISU::VISU_Gen_i* theGenerator ) { myGenerator = theGenerator; } + virtual void show(); + + QString fileName() const { return myFileName; } protected slots: void done( int ); + + void onStart(); + void onClose(); + + bool onBrowseFile(); void onTimer(); + void onBuildCheckBoxClicked(); + private: void updateButton( QPushButton*, bool ); private: VISU::Result_var myResult; + VISU::VISU_Gen_i* myGenerator; + QString myFileName; + QTime myTime; QTimer* myTimer; + QGroupBox* mySettingsBox; + + QLineEdit* myFileNameLineEdit; + QCheckBox* myBuildAllCheckBox; + QCheckBox* myBuildAtOnceCheckBox; + + QGroupBox* myProgressBox; + + QCheckBox* myBuildEntitiesCheckBox; + QPushButton* myBuildEntitiesButton; + + QCheckBox* myBuildFieldsCheckBox; QPushButton* myBuildFieldsButton; - QPushButton* myBuildGroupsButton; + + QCheckBox* myBuildMinMaxCheckBox; QPushButton* myBuildMinMaxButton; + + QCheckBox* myBuildGroupsCheckBox; + QPushButton* myBuildGroupsButton; + + QGroupBox* myTimeBox; + QLCDNumber* myTimeLCDNumber; + + QPushButton* myStartButton; + + double myCurrentTime; + bool myIsRaiseColor; }; #endif