Skip to content

Commit

Permalink
osm export: add buttons to select/unselect all tags
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Mar 23, 2015
1 parent 7b57caf commit 28a2bf9
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/app/openstreetmap/qgsosmexportdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ QgsOSMExportDialog::QgsOSMExportDialog( QWidget *parent ) :
connect( radPolylines, SIGNAL( clicked() ), this, SLOT( updateLayerName() ) );
connect( radPolygons, SIGNAL( clicked() ), this, SLOT( updateLayerName() ) );
connect( btnLoadTags, SIGNAL( clicked() ), this, SLOT( onLoadTags() ) );
connect( btnSelectAll, SIGNAL( clicked() ), this, SLOT( onSelectAll() ) );
connect( btnUnselectAll, SIGNAL( clicked() ), this, SLOT( onUnselectAll() ) );

mTagsModel = new QStandardItemModel( this );
mTagsModel->setHorizontalHeaderLabels( QStringList() << tr( "Tag" ) << tr( "Count" ) );
Expand Down Expand Up @@ -182,3 +184,19 @@ void QgsOSMExportDialog::onClose()
{
reject();
}

void QgsOSMExportDialog::onSelectAll()
{
for ( int i = 0; i < mTagsModel->rowCount(); ++i )
{
mTagsModel->item( i, 0 )->setCheckState( Qt::Checked );
}
}

void QgsOSMExportDialog::onUnselectAll()
{
for ( int i = 0; i < mTagsModel->rowCount(); ++i )
{
mTagsModel->item( i, 0 )->setCheckState( Qt::Unchecked );
}
}
2 changes: 2 additions & 0 deletions src/app/openstreetmap/qgsosmexportdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class QgsOSMExportDialog : public QDialog, private Ui::QgsOSMExportDialog
void onBrowse();
void updateLayerName();
void onLoadTags();
void onSelectAll();
void onUnselectAll();

void onOK();
void onClose();
Expand Down
14 changes: 14 additions & 0 deletions src/ui/qgsosmexportdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,20 @@
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btnSelectAll">
<property name="text">
<string>Select All</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnUnselectAll">
<property name="text">
<string>Unselect All</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
Expand Down

0 comments on commit 28a2bf9

Please sign in to comment.