diff --git a/Code/Common/ApplicationsWrapper/mvdWrapperQtWidgetView.cxx b/Code/Common/ApplicationsWrapper/mvdWrapperQtWidgetView.cxx index 6af3aeac2ee2b2696237f7bc7f2bc6578bbf78c5..8f05e1a97e3d72a0a4a438eaac9da004cd2a8865 100644 --- a/Code/Common/ApplicationsWrapper/mvdWrapperQtWidgetView.cxx +++ b/Code/Common/ApplicationsWrapper/mvdWrapperQtWidgetView.cxx @@ -369,7 +369,7 @@ QtWidgetView::OnExecButtonClicked() StringVector paramKeys( otbApp->GetParametersKeys() ); - bool isSure = false; + bool isSure = true; for( StringVector::const_iterator it( paramKeys.begin() ); it!=paramKeys.end(); @@ -387,14 +387,15 @@ QtWidgetView::OnExecButtonClicked() ); isSure = - QMessageBox::question( - this, - tr( PROJECT_NAME ), - tr( "Are you sure you want to overwrite file '%1'?" ) - .arg( outImgParam->GetFileName() ), - QMessageBox::Yes | QMessageBox::No, - QMessageBox::No - )==QMessageBox::Yes || + ( !QFileInfo( outImgParam->GetFileName() ).exists() || + QMessageBox::question( + this, + tr( PROJECT_NAME ), + tr( "Are you sure you want to overwrite file '%1'?" ) + .arg( outImgParam->GetFileName() ), + QMessageBox::Yes | QMessageBox::No, + QMessageBox::No + )==QMessageBox::Yes ) && isSure; } } diff --git a/Code/Common/Core/mvdAbstractWorker.h b/Code/Common/Core/mvdAbstractWorker.h index f6bae651e96babcda2d1b3a4d8e72e8bb8c872fd..670360c953ef8e28cbe46b5018b8a8d880f44b3e 100644 --- a/Code/Common/Core/mvdAbstractWorker.h +++ b/Code/Common/Core/mvdAbstractWorker.h @@ -86,6 +86,10 @@ public: /** \brief Destructor. */ virtual ~AbstractWorker(); + /** + */ + inline QString GetFirstProgressText() const; + /*-[ PUBLIC SLOTS SECTION ]------------------------------------------------*/ // @@ -166,6 +170,10 @@ private: */ virtual QObject* virtual_Do() =0; + /** + */ + virtual QString virtual_GetFirstProgressText() const =0; + // // Private attributes. @@ -202,6 +210,14 @@ private slots: namespace mvd { +/*****************************************************************************/ +inline +QString +AbstractWorker::GetFirstProgressText() const +{ + return virtual_GetFirstProgressText(); +} + } // end namespace 'mvd' #endif // __mvdAbstractWorker_h diff --git a/Code/Common/Core/mvdImageImporter.cxx b/Code/Common/Core/mvdImageImporter.cxx index 0307804113349bbe51a0d38c20ed82b0db0a2f81..8a366f3710647448265f6b3c3a50958b1131ace4 100644 --- a/Code/Common/Core/mvdImageImporter.cxx +++ b/Code/Common/Core/mvdImageImporter.cxx @@ -92,10 +92,14 @@ QObject* ImageImporter ::virtual_Do() { + /* emit ProgressTextChanged( tr( "Importing image '%1' as dataset into cache directory..." ) .arg( QFileInfo( m_Filename ).fileName() ) ); + */ + + // emit ProgressTextChanged( GetFirstProgressText() ); emit ProgressValueChanged( -1 ); @@ -108,6 +112,16 @@ ImageImporter ); } +/*******************************************************************************/ +QString +ImageImporter +::virtual_GetFirstProgressText() const +{ + return + tr( "Importing image '%1' as dataset into cache directory..." ) + .arg( QFileInfo( m_Filename ).fileName() ); +} + /*******************************************************************************/ /* SLOTS */ /*******************************************************************************/ diff --git a/Code/Common/Core/mvdImageImporter.h b/Code/Common/Core/mvdImageImporter.h index 1e7626a0ae2f2265614414fb83a228f7e28881d2..4bb624a3e6ce75166e54fec92fa847ec0167bbb3 100644 --- a/Code/Common/Core/mvdImageImporter.h +++ b/Code/Common/Core/mvdImageImporter.h @@ -149,6 +149,8 @@ private: QObject* virtual_Do(); + QString virtual_GetFirstProgressText() const; + // // Private attributes. diff --git a/Code/Common/Gui/mvdTaskProgressDialog.cxx b/Code/Common/Gui/mvdTaskProgressDialog.cxx index e69be306fbae29927a269cc849f33ff2f0ab5048..4c3a3f352ce9baed64dc8be1173c5c5db3a9ae8e 100644 --- a/Code/Common/Gui/mvdTaskProgressDialog.cxx +++ b/Code/Common/Gui/mvdTaskProgressDialog.cxx @@ -126,6 +126,8 @@ TaskProgressDialog { m_BackgroundTask->start(); + setLabelText( m_BackgroundTask->GetWorker()->GetFirstProgressText() ); + return exec(); }