Skip to content

Commit

Permalink
confirmation/undo/redo for #1650
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12385 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Dec 9, 2009
1 parent 5cdfaf0 commit 46f93fc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/app/attributetable/qgsattributetabledialog.cpp
Expand Up @@ -235,7 +235,7 @@ void QgsAttributeTableDialog::on_mRemoveSelectionButton_clicked()

void QgsAttributeTableDialog::on_mDeleteSelectedButton_clicked()
{
mLayer->deleteSelectedFeatures();
QgisApp::instance()->deleteSelected( mLayer );
}

void QgsAttributeTableDialog::on_cbxShowSelectedOnly_toggled( bool theFlag )
Expand Down
12 changes: 8 additions & 4 deletions src/app/qgisapp.cpp
Expand Up @@ -3496,9 +3496,13 @@ void QgisApp::layerProperties()
mMapLegend->legendLayerShowProperties();
}

void QgisApp::deleteSelected()
void QgisApp::deleteSelected( QgsMapLayer *layer )
{
QgsMapLayer *layer = mMapLegend->currentLayer();
if ( !layer )
{
layer = mMapLegend->currentLayer();
}

if ( !layer )
{
QMessageBox::information( this, tr( "No Layer Selected" ),
Expand Down Expand Up @@ -3633,13 +3637,13 @@ QgsComposer* QgisApp::createNewComposer()
//and place action into print composers menu
mPrintComposersMenu->addAction( newComposerObject->windowAction() );
newComposerObject->open();
emit composerAdded(newComposerObject->view());
emit composerAdded( newComposerObject->view() );
return newComposerObject;
}

void QgisApp::deleteComposer( QgsComposer* c )
{
emit composerWillBeRemoved(c->view());
emit composerWillBeRemoved( c->view() );
mPrintComposers.remove( c );
mPrintComposersMenu->removeAction( c->windowAction() );
delete c;
Expand Down
9 changes: 5 additions & 4 deletions src/app/qgisapp.h
Expand Up @@ -379,6 +379,9 @@ class QgisApp : public QMainWindow

void loadOGRSublayers( QString layertype, QString uri, QStringList list );

/**Deletes the selected attributes for the currently selected vector layer*/
void deleteSelected( QgsMapLayer *layer = 0 );

protected:

//! Handle state changes (WindowTitleChange)
Expand Down Expand Up @@ -512,8 +515,6 @@ class QgisApp : public QMainWindow
void captureLine();
//! activates the capture polygon tool
void capturePolygon();
/**Deletes the selected attributes for the currently selected vector layer*/
void deleteSelected();
//! activates the move feature tool
void moveFeature();
//! activates the reshape features tool
Expand Down Expand Up @@ -674,8 +675,8 @@ class QgisApp : public QMainWindow
@note added in version 1.4*/
void composerAdded( QgsComposerView* v );

/**This signal is emitted before a new composer instance is going to be removed
@note added in version 1.4*/
/**This signal is emitted before a new composer instance is going to be removed
@note added in version 1.4*/
void composerWillBeRemoved( QgsComposerView* v );


Expand Down

0 comments on commit 46f93fc

Please sign in to comment.