From 4aeeefceb0567b6f906511de1eba13772424d168 Mon Sep 17 00:00:00 2001 From: ouv Date: Thu, 1 Dec 2005 13:29:09 +0000 Subject: [PATCH] Automatic closing of the Build Progress dialog. --- src/VISUGUI/VISUM_msg_en.po | 3 +++ src/VISUGUI/VisuGUI.cxx | 2 ++ src/VISUGUI/VisuGUI_BuildProgressDlg.cxx | 11 +++++++++-- src/VISUGUI/VisuGUI_BuildProgressDlg.h | 2 ++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/VISUGUI/VISUM_msg_en.po b/src/VISUGUI/VISUM_msg_en.po index 654eaab5..f897f485 100644 --- a/src/VISUGUI/VISUM_msg_en.po +++ b/src/VISUGUI/VISUM_msg_en.po @@ -313,6 +313,9 @@ msgstr "All Files (*.*)" msgid "VisuGUI_BuildProgressDlg::FLT_MED_FILES" msgstr "MED Files (*.med)" +msgid "VisuGUI_BuildProgressDlg::CLOSE_AT_FINISH" +msgstr "Close dialog at finish" + msgid "VisuGUI_BuildProgressDlg::START" msgstr "Start" diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 16b33f07..0282d6ba 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -2899,7 +2899,9 @@ void VisuGUI::createPreferences() setPreferenceProperty( nbsteps, "max", 200 ); int importGr = addPreference( tr( "MED files import" ), srangeTab ); + setPreferenceProperty( importGr, "columns", 1 ); addPreference( tr( "Full MED loading" ), importGr, LightApp_Preferences::Bool, "VISU", "full_med_loading" ); + addPreference( tr( "Close progress dialog at finish" ), importGr, LightApp_Preferences::Bool, "VISU", "close_at_finish" ); } void VisuGUI::preferencesChanged( const QString&, const QString& ) diff --git a/src/VISUGUI/VisuGUI_BuildProgressDlg.cxx b/src/VISUGUI/VisuGUI_BuildProgressDlg.cxx index d62d1c4e..8a1bd71a 100644 --- a/src/VISUGUI/VisuGUI_BuildProgressDlg.cxx +++ b/src/VISUGUI/VisuGUI_BuildProgressDlg.cxx @@ -87,11 +87,15 @@ VisuGUI_BuildProgressDlg::VisuGUI_BuildProgressDlg( QWidget* theParent ): myBuildAtOnceCheckBox->setChecked( aResourceMgr->booleanValue( "VISU", "build_at_once", true ) ); connect( myBuildAtOnceCheckBox, SIGNAL( clicked() ), this, SLOT( onBuildCheckBoxClicked() ) ); + myCloseCheckBox = new QCheckBox( tr( "CLOSE_AT_FINISH" ), mySettingsBox ); + myCloseCheckBox->setChecked( aResourceMgr->booleanValue( "VISU", "close_at_finish", true ) ); + 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 ); + aSettingsLayout->addWidget( myBuildAtOnceCheckBox, 3, 0 ); + aSettingsLayout->addWidget( myCloseCheckBox, 4, 0 ); // Progress myProgressBox = new QGroupBox( tr( "IMPORT_PROGRESS" ), this ); @@ -306,7 +310,10 @@ void VisuGUI_BuildProgressDlg::onTimer() myTimeLCDNumber->display( aTime.toString( "m:ss.zzz" ) ); } - SUIT_MessageBox::warn1( this, tr( "INF_VISU" ), tr( "IMPORT_DONE" ), tr( "BUT_OK" ) ); + if( myCloseCheckBox->isChecked() ) + done( 0 ); + else + SUIT_MessageBox::warn1( this, tr( "INF_VISU" ), tr( "IMPORT_DONE" ), tr( "BUT_OK" ) ); } } catch( ... ) { diff --git a/src/VISUGUI/VisuGUI_BuildProgressDlg.h b/src/VISUGUI/VisuGUI_BuildProgressDlg.h index 5388b509..4d880596 100644 --- a/src/VISUGUI/VisuGUI_BuildProgressDlg.h +++ b/src/VISUGUI/VisuGUI_BuildProgressDlg.h @@ -100,6 +100,8 @@ private: QGroupBox* myTimeBox; QLCDNumber* myTimeLCDNumber; + QCheckBox* myCloseCheckBox; + QPushButton* myStartButton; double myCurrentTime; -- 2.39.2