Commit b2d5a6b0 authored by Stéphane Albert's avatar Stéphane Albert

BUG: Fixed problem in overwrite confirm dialog for OTB app; Fixed issue...

BUG: Fixed problem in overwrite confirm dialog for OTB app; Fixed issue #744(Set import progress dialog before poping it up to center diaog).
parent 7026905e
......@@ -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;
}
}
......
......@@ -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
......@@ -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 */
/*******************************************************************************/
......
......@@ -149,6 +149,8 @@ private:
QObject* virtual_Do();
QString virtual_GetFirstProgressText() const;
//
// Private attributes.
......
......@@ -126,6 +126,8 @@ TaskProgressDialog
{
m_BackgroundTask->start();
setLabelText( m_BackgroundTask->GetWorker()->GetFirstProgressText() );
return exec();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment