Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Abort classification upon high number of classes
  • Loading branch information
simon04 committed Nov 25, 2012
1 parent 349229f commit 755707d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/gui/symbology-ng/qgscategorizedsymbolrendererv2widget.cpp
Expand Up @@ -596,6 +596,19 @@ void QgsCategorizedSymbolRendererV2Widget::addCategories()
QList<QVariant> unique_vals;
mLayer->uniqueValues( idx, unique_vals );

// ask to abort if too many classes
if ( unique_vals.size() >= 1000 )
{
int res = QMessageBox::warning( 0, tr( "High number of classes!" ),
tr( "Classification would yield %1 entries which might not be expected. Continue?" ).arg( unique_vals.size() ),
QMessageBox::Ok | QMessageBox::Cancel,
QMessageBox::Cancel );
if ( res == QMessageBox::Cancel )
{
return;
}
}

//DlgAddCategories dlg(mStyle, createDefaultSymbol(), unique_vals, this);
//if (!dlg.exec())
// return;
Expand Down

0 comments on commit 755707d

Please sign in to comment.