File tree Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -235,7 +235,7 @@ void QgsAttributeTableDialog::on_mRemoveSelectionButton_clicked()
235
235
236
236
void QgsAttributeTableDialog::on_mDeleteSelectedButton_clicked ()
237
237
{
238
- mLayer -> deleteSelectedFeatures ( );
238
+ QgisApp::instance ()-> deleteSelected ( mLayer );
239
239
}
240
240
241
241
void QgsAttributeTableDialog::on_cbxShowSelectedOnly_toggled ( bool theFlag )
Original file line number Diff line number Diff line change @@ -3496,9 +3496,13 @@ void QgisApp::layerProperties()
3496
3496
mMapLegend ->legendLayerShowProperties ();
3497
3497
}
3498
3498
3499
- void QgisApp::deleteSelected ()
3499
+ void QgisApp::deleteSelected ( QgsMapLayer *layer )
3500
3500
{
3501
- QgsMapLayer *layer = mMapLegend ->currentLayer ();
3501
+ if ( !layer )
3502
+ {
3503
+ layer = mMapLegend ->currentLayer ();
3504
+ }
3505
+
3502
3506
if ( !layer )
3503
3507
{
3504
3508
QMessageBox::information ( this , tr ( " No Layer Selected" ),
@@ -3633,13 +3637,13 @@ QgsComposer* QgisApp::createNewComposer()
3633
3637
// and place action into print composers menu
3634
3638
mPrintComposersMenu ->addAction ( newComposerObject->windowAction () );
3635
3639
newComposerObject->open ();
3636
- emit composerAdded (newComposerObject->view ());
3640
+ emit composerAdded ( newComposerObject->view () );
3637
3641
return newComposerObject;
3638
3642
}
3639
3643
3640
3644
void QgisApp::deleteComposer ( QgsComposer* c )
3641
3645
{
3642
- emit composerWillBeRemoved (c->view ());
3646
+ emit composerWillBeRemoved ( c->view () );
3643
3647
mPrintComposers .remove ( c );
3644
3648
mPrintComposersMenu ->removeAction ( c->windowAction () );
3645
3649
delete c;
Original file line number Diff line number Diff line change @@ -379,6 +379,9 @@ class QgisApp : public QMainWindow
379
379
380
380
void loadOGRSublayers ( QString layertype, QString uri, QStringList list );
381
381
382
+ /* *Deletes the selected attributes for the currently selected vector layer*/
383
+ void deleteSelected ( QgsMapLayer *layer = 0 );
384
+
382
385
protected:
383
386
384
387
// ! Handle state changes (WindowTitleChange)
@@ -512,8 +515,6 @@ class QgisApp : public QMainWindow
512
515
void captureLine ();
513
516
// ! activates the capture polygon tool
514
517
void capturePolygon ();
515
- /* *Deletes the selected attributes for the currently selected vector layer*/
516
- void deleteSelected ();
517
518
// ! activates the move feature tool
518
519
void moveFeature ();
519
520
// ! activates the reshape features tool
@@ -674,8 +675,8 @@ class QgisApp : public QMainWindow
674
675
@note added in version 1.4*/
675
676
void composerAdded ( QgsComposerView* v );
676
677
677
- /* *This signal is emitted before a new composer instance is going to be removed
678
- @note added in version 1.4*/
678
+ /* *This signal is emitted before a new composer instance is going to be removed
679
+ @note added in version 1.4*/
679
680
void composerWillBeRemoved ( QgsComposerView* v );
680
681
681
682
You can’t perform that action at this time.
0 commit comments