Skip to content

Commit 28a2bf9

Browse files
committed
osm export: add buttons to select/unselect all tags
1 parent 7b57caf commit 28a2bf9

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

src/app/openstreetmap/qgsosmexportdialog.cpp

+18
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ QgsOSMExportDialog::QgsOSMExportDialog( QWidget *parent ) :
4040
connect( radPolylines, SIGNAL( clicked() ), this, SLOT( updateLayerName() ) );
4141
connect( radPolygons, SIGNAL( clicked() ), this, SLOT( updateLayerName() ) );
4242
connect( btnLoadTags, SIGNAL( clicked() ), this, SLOT( onLoadTags() ) );
43+
connect( btnSelectAll, SIGNAL( clicked() ), this, SLOT( onSelectAll() ) );
44+
connect( btnUnselectAll, SIGNAL( clicked() ), this, SLOT( onUnselectAll() ) );
4345

4446
mTagsModel = new QStandardItemModel( this );
4547
mTagsModel->setHorizontalHeaderLabels( QStringList() << tr( "Tag" ) << tr( "Count" ) );
@@ -182,3 +184,19 @@ void QgsOSMExportDialog::onClose()
182184
{
183185
reject();
184186
}
187+
188+
void QgsOSMExportDialog::onSelectAll()
189+
{
190+
for ( int i = 0; i < mTagsModel->rowCount(); ++i )
191+
{
192+
mTagsModel->item( i, 0 )->setCheckState( Qt::Checked );
193+
}
194+
}
195+
196+
void QgsOSMExportDialog::onUnselectAll()
197+
{
198+
for ( int i = 0; i < mTagsModel->rowCount(); ++i )
199+
{
200+
mTagsModel->item( i, 0 )->setCheckState( Qt::Unchecked );
201+
}
202+
}

src/app/openstreetmap/qgsosmexportdialog.h

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ class QgsOSMExportDialog : public QDialog, private Ui::QgsOSMExportDialog
3838
void onBrowse();
3939
void updateLayerName();
4040
void onLoadTags();
41+
void onSelectAll();
42+
void onUnselectAll();
4143

4244
void onOK();
4345
void onClose();

src/ui/qgsosmexportdialog.ui

+14
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,20 @@
106106
</property>
107107
</spacer>
108108
</item>
109+
<item>
110+
<widget class="QPushButton" name="btnSelectAll">
111+
<property name="text">
112+
<string>Select All</string>
113+
</property>
114+
</widget>
115+
</item>
116+
<item>
117+
<widget class="QPushButton" name="btnUnselectAll">
118+
<property name="text">
119+
<string>Unselect All</string>
120+
</property>
121+
</widget>
122+
</item>
109123
</layout>
110124
</item>
111125
<item>

0 commit comments

Comments
 (0)