Commit 3d08c8f7 authored by Stéphane Albert's avatar Stéphane Albert
Browse files

ENH: Updated estimated file size when file is selected/unselected.

parent 7f35ec11
......@@ -218,7 +218,7 @@ ImportImagesDialog
{
flags |= Qt::ItemIsEnabled;
builder->SetBypassEnabled( false );
builder->SetBypassEnabled( count<=1 );
++ m_EffectiveCount;
}
......@@ -288,10 +288,11 @@ ImportImagesDialog
if( flags.testFlag( Qt::ItemIsEnabled ) )
{
items.back()->setFlags( flags | Qt::ItemIsUserCheckable );
items.back()->setCheckState(
builder->GetNbResolutions() > 1
? Qt::Checked
: Qt::Unchecked
builder->IsBypassEnabled()
? Qt::Unchecked
: Qt::Checked
);
}
else
......@@ -387,12 +388,19 @@ ImportImagesDialog
// Create index.
QModelIndex index( model->index( row, COLUMN_OVERVIEW_SIZE ) );
//
// Get GDAL overview builder.
otb::GDALOverviewsBuilder::Pointer builder(
m_GDALOverviewsBuilders[ index.row() ]
);
assert( !builder.IsNull() );
//
// Update file size.
model->setData(
index,
ToHumanReadableSize(
m_GDALOverviewsBuilders[ index.row() ]->GetEstimatedSize()
builder->GetEstimatedSize()
)
);
}
......@@ -517,8 +525,11 @@ ImportImagesDialog
GetBuilder( item->index() );
if( !builder.IsNull() )
{
builder->SetBypassEnabled( item->checkState()!=Qt::Checked );
UpdateFileSize( index.row() );
}
assert( m_UI!=NULL );
assert( m_UI->filenamesTreeView->selectionModel()!=NULL );
......
Supports Markdown
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