mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-16 00:03:12 -04:00
geometry less features: update add feature tool in digitizing toolbar and icon in attribute table (fixes #8262)
This commit is contained in:
parent
588d5f425f
commit
dae8ea66a1
@ -147,6 +147,7 @@
|
|||||||
<file>themes/default/mActionCaptureLine.png</file>
|
<file>themes/default/mActionCaptureLine.png</file>
|
||||||
<file>themes/default/mActionCapturePoint.png</file>
|
<file>themes/default/mActionCapturePoint.png</file>
|
||||||
<file>themes/default/mActionCapturePolygon.png</file>
|
<file>themes/default/mActionCapturePolygon.png</file>
|
||||||
|
<file>themes/default/mActionNewTableRow.png</file>
|
||||||
<file>themes/default/mActionChangeLabelProperties.png</file>
|
<file>themes/default/mActionChangeLabelProperties.png</file>
|
||||||
<file>themes/default/mActionCheckQgisVersion.png</file>
|
<file>themes/default/mActionCheckQgisVersion.png</file>
|
||||||
<file>themes/default/mActionCollapseTree.png</file>
|
<file>themes/default/mActionCollapseTree.png</file>
|
||||||
|
BIN
images/themes/default/mActionNewTableRow.png
Normal file
BIN
images/themes/default/mActionNewTableRow.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 760 B |
@ -8701,6 +8701,10 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
|
|||||||
mActionDeleteRing->setEnabled( isEditable && canChangeGeometry );
|
mActionDeleteRing->setEnabled( isEditable && canChangeGeometry );
|
||||||
mActionOffsetCurve->setEnabled( false );
|
mActionOffsetCurve->setEnabled( false );
|
||||||
}
|
}
|
||||||
|
else if ( vlayer->geometryType() == QGis::NoGeometry )
|
||||||
|
{
|
||||||
|
mActionAddFeature->setIcon( QgsApplication::getThemeIcon( "/mActionNewTableRow.png" ) );
|
||||||
|
}
|
||||||
|
|
||||||
mActionOpenFieldCalc->setEnabled( isEditable && ( canChangeAttributes || canAddAttributes ) );
|
mActionOpenFieldCalc->setEnabled( isEditable && ( canChangeAttributes || canAddAttributes ) );
|
||||||
|
|
||||||
|
@ -154,6 +154,7 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
|
|||||||
mTableViewButton->setIcon( QgsApplication::getThemeIcon( "/mActionOpenTable.png" ) );
|
mTableViewButton->setIcon( QgsApplication::getThemeIcon( "/mActionOpenTable.png" ) );
|
||||||
mAttributeViewButton->setIcon( QgsApplication::getThemeIcon( "/mActionPropertyItem.png" ) );
|
mAttributeViewButton->setIcon( QgsApplication::getThemeIcon( "/mActionPropertyItem.png" ) );
|
||||||
mExpressionSelectButton->setIcon( QgsApplication::getThemeIcon( "/mIconExpressionSelect.svg" ) );
|
mExpressionSelectButton->setIcon( QgsApplication::getThemeIcon( "/mIconExpressionSelect.svg" ) );
|
||||||
|
mAddFeature->setIcon( QgsApplication::getThemeIcon( "/mActionNewTableRow.png" ) );
|
||||||
|
|
||||||
// toggle editing
|
// toggle editing
|
||||||
bool canChangeAttributes = mLayer->dataProvider()->capabilities() & QgsVectorDataProvider::ChangeAttributeValues;
|
bool canChangeAttributes = mLayer->dataProvider()->capabilities() & QgsVectorDataProvider::ChangeAttributeValues;
|
||||||
|
@ -45,6 +45,24 @@ bool QgsMapToolAddFeature::addFeature( QgsVectorLayer *vlayer, QgsFeature *f )
|
|||||||
return action.addFeature();
|
return action.addFeature();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QgsMapToolAddFeature::activate()
|
||||||
|
{
|
||||||
|
if ( !mCanvas || mCanvas->isDrawing() )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( mCanvas->currentLayer() );
|
||||||
|
if ( vlayer && vlayer->geometryType() == QGis::NoGeometry )
|
||||||
|
{
|
||||||
|
QgsFeature f;
|
||||||
|
addFeature( vlayer, &f );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QgsMapTool::activate();
|
||||||
|
}
|
||||||
|
|
||||||
void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
|
void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
|
||||||
{
|
{
|
||||||
QgsDebugMsg( "entered." );
|
QgsDebugMsg( "entered." );
|
||||||
|
@ -26,4 +26,5 @@ class APP_EXPORT QgsMapToolAddFeature : public QgsMapToolCapture
|
|||||||
void canvasReleaseEvent( QMouseEvent * e );
|
void canvasReleaseEvent( QMouseEvent * e );
|
||||||
|
|
||||||
bool addFeature( QgsVectorLayer *vlayer, QgsFeature *f );
|
bool addFeature( QgsVectorLayer *vlayer, QgsFeature *f );
|
||||||
|
void activate();
|
||||||
};
|
};
|
||||||
|
@ -105,7 +105,13 @@
|
|||||||
<string>Add feature</string>
|
<string>Add feature</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>+</string>
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>18</width>
|
||||||
|
<height>18</height>
|
||||||
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user