Skip to content
Permalink
Browse files

[DXF] add (un)select all buttons

  • Loading branch information
3nids committed Dec 9, 2013
1 parent c610f37 commit 3f37d249797fc84c9d5331c78f4562b9577b3a5b
Showing with 62 additions and 12 deletions.
  1. +14 −0 src/app/qgsdxfexportdialog.cpp
  2. +5 −0 src/app/qgsdxfexportdialog.h
  3. +43 −12 src/ui/qgsdxfexportdialogbase.ui
@@ -11,6 +11,8 @@ QgsDxfExportDialog::QgsDxfExportDialog( const QList<QgsMapLayer*>& layerKeys, QW
setupUi( this );
connect( mFileLineEdit, SIGNAL( textChanged( const QString& ) ), this, SLOT( setOkEnabled() ) );
connect( this, SIGNAL( accepted() ), this, SLOT( saveSettings() ) );
connect( mSelectAllButton, SIGNAL( clicked() ), this, SLOT( selectAll() ) );
connect( mUnSelectAllButton, SIGNAL( clicked() ), this, SLOT( unSelectAll() ) );

QList<QgsMapLayer*>::const_iterator layerIt = layerKeys.constBegin();
for ( ; layerIt != layerKeys.constEnd(); ++layerIt )
@@ -43,6 +45,18 @@ QgsDxfExportDialog::~QgsDxfExportDialog()

}

void QgsDxfExportDialog::selectAll()
{
for ( int r = 0; r < mLayersListWidget->count(); r++ )
mLayersListWidget->item( r )->setCheckState( Qt::Checked );
}

void QgsDxfExportDialog::unSelectAll()
{
for ( int r = 0; r < mLayersListWidget->count(); r++ )
mLayersListWidget->item( r )->setCheckState( Qt::Unchecked );
}

QList<QString> QgsDxfExportDialog::layers() const
{
QList<QString> layerKeyList;
@@ -16,6 +16,11 @@ class QgsDxfExportDialog: public QDialog, private Ui::QgsDxfExportDialogBase
QgsDxfExport::SymbologyExport symbologyMode() const;
QString saveFile() const;

public slots:
/** change the selection of layers in the list */
void selectAll();
void unSelectAll();

private slots:
void on_mFileSelectionButton_clicked();
void setOkEnabled();
@@ -14,7 +14,17 @@
<string>DXF export</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<item row="4" column="1">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="0" column="0" colspan="3">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1">
<widget class="QLineEdit" name="mFileLineEdit"/>
@@ -74,15 +84,36 @@
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
<item row="2" column="0" colspan="2">
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QPushButton" name="mSelectAllButton">
<property name="text">
<string>Select all</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="mUnSelectAllButton">
<property name="text">
<string>Unselet all</string>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
@@ -95,8 +126,8 @@
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
<x>263</x>
<y>282</y>
</hint>
<hint type="destinationlabel">
<x>157</x>

0 comments on commit 3f37d24

Please sign in to comment.
You can’t perform that action at this time.