@@ -49,27 +49,10 @@ QgsAtlasCompositionWidget::QgsAtlasCompositionWidget( QWidget* parent, QgsCompos
49
49
connect ( layerRegistry, SIGNAL ( layerWasAdded ( QgsMapLayer* ) ), this , SLOT ( onLayerAdded ( QgsMapLayer* ) ) );
50
50
}
51
51
52
- // update the composer map combo box
53
- // populate the map list
54
- mComposerMapComboBox ->clear ();
55
- QList<const QgsComposerMap*> availableMaps = mComposition ->composerMapItems ();
56
- QList<const QgsComposerMap*>::const_iterator mapItemIt = availableMaps.constBegin ();
57
- for ( ; mapItemIt != availableMaps.constEnd (); ++mapItemIt )
58
- {
59
- mComposerMapComboBox ->addItem ( tr ( " Map %1" ).arg (( *mapItemIt )->id () ), qVariantFromValue (( void * )*mapItemIt ) );
60
- }
61
-
62
52
// Sort direction
63
53
mAtlasSortFeatureDirectionButton ->setEnabled ( false );
64
-
65
54
mAtlasSortFeatureKeyComboBox ->setEnabled ( false );
66
55
67
- // Connect to addition / removal of maps
68
- connect ( mComposition , SIGNAL ( composerMapAdded ( QgsComposerMap* ) ), this , SLOT ( onComposerMapAdded ( QgsComposerMap* ) ) );
69
- connect ( mComposition , SIGNAL ( itemRemoved ( QgsComposerItem* ) ), this , SLOT ( onItemRemoved ( QgsComposerItem* ) ) );
70
-
71
- connect ( mAtlasMarginRadio , SIGNAL ( toggled ( bool ) ), mAtlasMarginSpinBox , SLOT ( setEnabled ( bool ) ) );
72
-
73
56
// connect to updates
74
57
connect ( &mComposition ->atlasComposition (), SIGNAL ( parameterChanged () ), this , SLOT ( updateGuiElements () ) );
75
58
@@ -90,7 +73,6 @@ void QgsAtlasCompositionWidget::on_mUseAtlasCheckBox_stateChanged( int state )
90
73
mVisibilityGroup ->setEnabled ( true );
91
74
mSortingGroup ->setEnabled ( true );
92
75
mFilteringGroup ->setEnabled ( true );
93
- mScalingGroup ->setEnabled ( true );
94
76
mOutputGroup ->setEnabled ( true );
95
77
}
96
78
else
@@ -100,7 +82,6 @@ void QgsAtlasCompositionWidget::on_mUseAtlasCheckBox_stateChanged( int state )
100
82
mVisibilityGroup ->setEnabled ( false );
101
83
mSortingGroup ->setEnabled ( false );
102
84
mFilteringGroup ->setEnabled ( false );
103
- mScalingGroup ->setEnabled ( false );
104
85
mOutputGroup ->setEnabled ( false );
105
86
}
106
87
}
@@ -137,39 +118,10 @@ void QgsAtlasCompositionWidget::onLayerAdded( QgsMapLayer* map )
137
118
{
138
119
atlasMap->setCoverageLayer ( vectorLayer );
139
120
updateAtlasFeatures ();
140
- checkLayerType ( vectorLayer );
141
121
}
142
122
}
143
123
}
144
124
145
- void QgsAtlasCompositionWidget::onComposerMapAdded ( QgsComposerMap* map )
146
- {
147
- QgsAtlasComposition* atlasMap = &mComposition ->atlasComposition ();
148
- mComposerMapComboBox ->addItem ( tr ( " Map %1" ).arg ( map->id () ), qVariantFromValue (( void * )map ) );
149
- if ( mComposerMapComboBox ->count () == 1 )
150
- {
151
- atlasMap->setComposerMap ( map );
152
- }
153
- }
154
-
155
- void QgsAtlasCompositionWidget::onItemRemoved ( QgsComposerItem* item )
156
- {
157
- QgsAtlasComposition* atlasMap = &mComposition ->atlasComposition ();
158
- QgsComposerMap* map = dynamic_cast <QgsComposerMap*>( item );
159
- if ( map )
160
- {
161
- int idx = mComposerMapComboBox ->findData ( qVariantFromValue (( void * )map ) );
162
- if ( idx != -1 )
163
- {
164
- mComposerMapComboBox ->removeItem ( idx );
165
- }
166
- }
167
- if ( mComposerMapComboBox ->count () == 0 )
168
- {
169
- atlasMap->setComposerMap ( 0 );
170
- }
171
- }
172
-
173
125
void QgsAtlasCompositionWidget::on_mAtlasCoverageLayerComboBox_currentIndexChanged ( int index )
174
126
{
175
127
QgsAtlasComposition* atlasMap = &mComposition ->atlasComposition ();
@@ -190,7 +142,6 @@ void QgsAtlasCompositionWidget::on_mAtlasCoverageLayerComboBox_currentIndexChang
190
142
191
143
if ( layer )
192
144
{
193
- checkLayerType ( layer );
194
145
atlasMap->setCoverageLayer ( layer );
195
146
updateAtlasFeatures ();
196
147
}
@@ -200,44 +151,6 @@ void QgsAtlasCompositionWidget::on_mAtlasCoverageLayerComboBox_currentIndexChang
200
151
}
201
152
}
202
153
203
- void QgsAtlasCompositionWidget::checkLayerType ( QgsVectorLayer *layer )
204
- {
205
- // enable or disable fixed scale control based on layer type
206
- if ( !layer ) return ;
207
- switch ( layer->wkbType () )
208
- {
209
- case QGis::WKBPoint:
210
- case QGis::WKBPoint25D:
211
- case QGis::WKBMultiPoint:
212
- case QGis::WKBMultiPoint25D:
213
- // For point layers buffer setting makes no sense, so set "fixed scale" on and disable margin control
214
- mAtlasFixedScaleRadio ->setChecked ( true );
215
- mAtlasMarginRadio ->setEnabled ( false );
216
- break ;
217
- default :
218
- // Not a point layer, so enable changes to fixed scale control
219
- mAtlasMarginRadio ->setEnabled ( true );
220
- }
221
- }
222
-
223
- void QgsAtlasCompositionWidget::on_mComposerMapComboBox_currentIndexChanged ( int index )
224
- {
225
- QgsAtlasComposition* atlasMap = &mComposition ->atlasComposition ();
226
- if ( !atlasMap )
227
- {
228
- return ;
229
- }
230
- if ( index == -1 )
231
- {
232
- atlasMap->setComposerMap ( 0 );
233
- }
234
- else
235
- {
236
- QgsComposerMap* map = reinterpret_cast <QgsComposerMap*>( mComposerMapComboBox ->itemData ( index ).value <void *>() );
237
- atlasMap->setComposerMap ( map );
238
- }
239
- }
240
-
241
154
void QgsAtlasCompositionWidget::on_mAtlasFilenamePatternEdit_textChanged ( const QString& text )
242
155
{
243
156
QgsAtlasComposition* atlasMap = &mComposition ->atlasComposition ();
@@ -280,22 +193,6 @@ void QgsAtlasCompositionWidget::on_mAtlasHideCoverageCheckBox_stateChanged( int
280
193
atlasMap->setHideCoverage ( state == Qt::Checked );
281
194
}
282
195
283
- void QgsAtlasCompositionWidget::on_mAtlasFixedScaleRadio_toggled ( bool checked )
284
- {
285
- QgsAtlasComposition* atlasMap = &mComposition ->atlasComposition ();
286
- if ( !atlasMap )
287
- {
288
- return ;
289
- }
290
- atlasMap->setFixedScale ( checked );
291
- }
292
-
293
- void QgsAtlasCompositionWidget::on_mAtlasMarginSpinBox_valueChanged ( int value )
294
- {
295
- QgsAtlasComposition* atlasMap = &mComposition ->atlasComposition ();
296
- atlasMap->setMargin ( value / 100 . );
297
- }
298
-
299
196
void QgsAtlasCompositionWidget::on_mAtlasSingleFileCheckBox_stateChanged ( int state )
300
197
{
301
198
QgsAtlasComposition* atlasMap = &mComposition ->atlasComposition ();
@@ -487,26 +384,9 @@ void QgsAtlasCompositionWidget::updateGuiElements()
487
384
if ( idx != -1 )
488
385
{
489
386
mAtlasCoverageLayerComboBox ->setCurrentIndex ( idx );
490
- checkLayerType ( atlasMap->coverageLayer () );
491
- }
492
- idx = mComposerMapComboBox ->findData ( qVariantFromValue (( void * )atlasMap->composerMap () ) );
493
- if ( idx != -1 )
494
- {
495
- mComposerMapComboBox ->setCurrentIndex ( idx );
496
387
}
497
388
498
- mAtlasMarginSpinBox ->setValue ( static_cast <int >( atlasMap->margin () * 100 ) );
499
389
mAtlasFilenamePatternEdit ->setText ( atlasMap->filenamePattern () );
500
- if ( atlasMap->fixedScale () )
501
- {
502
- mAtlasFixedScaleRadio ->setChecked ( true );
503
- mAtlasMarginSpinBox ->setEnabled ( false );
504
- }
505
- else
506
- {
507
- mAtlasMarginRadio ->setChecked ( true );
508
- mAtlasMarginSpinBox ->setEnabled ( true );
509
- }
510
390
mAtlasHideCoverageCheckBox ->setCheckState ( atlasMap->hideCoverage () ? Qt::Checked : Qt::Unchecked );
511
391
mAtlasSingleFileCheckBox ->setCheckState ( atlasMap->singleFile () ? Qt::Checked : Qt::Unchecked );
512
392
mAtlasSortFeatureCheckBox ->setCheckState ( atlasMap->sortFeatures () ? Qt::Checked : Qt::Unchecked );
@@ -523,6 +403,5 @@ void QgsAtlasCompositionWidget::blockAllSignals( bool b )
523
403
mVisibilityGroup ->blockSignals ( b );
524
404
mSortingGroup ->blockSignals ( b );
525
405
mFilteringGroup ->blockSignals ( b );
526
- mScalingGroup ->blockSignals ( b );
527
406
mOutputGroup ->blockSignals ( b );
528
407
}
0 commit comments