Skip to content

Commit

Permalink
#9094: Other shortcut changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuarte47 committed Dec 17, 2013
1 parent 6ae5942 commit b069aaf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/app/nodetool/qgsmaptoolnodetool.cpp
Expand Up @@ -711,7 +711,7 @@ void QgsMapToolNodeTool::keyReleaseEvent( QKeyEvent* e )
return;
}

if ( mSelectedFeature && e->key() == Qt::Key_Delete )
if ( mSelectedFeature && e->key() == Qt::Key_Backspace )
{
mSelectedFeature->deleteSelectedVertexes();
mCanvas->refresh();
Expand Down
17 changes: 10 additions & 7 deletions src/app/qgisapp.cpp
Expand Up @@ -4845,13 +4845,6 @@ void QgisApp::deleteSelected( QgsMapLayer *layer, QWidget* parent )
return;
}

//display a warning
int numberOfDeletedFeatures = vlayer->selectedFeaturesIds().size();
if ( QMessageBox::warning( parent, tr( "Delete features" ), tr( "Delete %n feature(s)?", "number of features to delete", numberOfDeletedFeatures ), QMessageBox::Ok, QMessageBox::Cancel ) == QMessageBox::Cancel )
{
return;
}

vlayer->beginEditCommand( tr( "Features deleted" ) );
if ( !vlayer->deleteSelectedFeatures() )
{
Expand Down Expand Up @@ -6479,6 +6472,8 @@ void QgisApp::removeAllLayers()

void QgisApp::removeLayer()
{
int numberOfRemovedLayers = 0;

if ( mMapCanvas && mMapCanvas->isDrawing() )
{
return;
Expand All @@ -6494,6 +6489,14 @@ void QgisApp::removeLayer()
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer*>( layer );
if ( vlayer && vlayer->isEditable() && !toggleEditing( vlayer, true ) )
return;

numberOfRemovedLayers++;
}

//display a warning
if ( QMessageBox::warning( this, tr( "Remove layers" ), tr( "Remove %n layer(s)?", "number of layers to remove", numberOfRemovedLayers ), QMessageBox::Ok, QMessageBox::Cancel ) == QMessageBox::Cancel )
{
return;
}

mMapLegend->removeSelectedLayers();
Expand Down
4 changes: 2 additions & 2 deletions src/ui/qgsattributetabledialog.ui
Expand Up @@ -112,7 +112,7 @@
<item>
<widget class="QToolButton" name="mDeleteSelectedButton">
<property name="toolTip">
<string>Delete selected features (Ctrl+D)</string>
<string>Delete selected features (DEL)</string>
</property>
<property name="text">
<string>...</string>
Expand All @@ -128,7 +128,7 @@
</size>
</property>
<property name="shortcut">
<string>Ctrl+D</string>
<string>Delete</string>
</property>
</widget>
</item>
Expand Down

0 comments on commit b069aaf

Please sign in to comment.