@@ -300,11 +300,11 @@ void QgsAttributeActionDialog::addDefaultActions()
300
300
{
301
301
int pos = 0 ;
302
302
insertRow ( pos++, QgsAction::Generic, tr ( " Echo attribute's value" ), QStringLiteral ( " echo \" [% \" MY_FIELD\" %]\" " ), QLatin1String ( " " ), true , tr ( " Attribute Value" ), QSet<QString>() << QStringLiteral ( " Field" ) );
303
- insertRow ( pos++, QgsAction::Generic, tr ( " Run an application" ), QStringLiteral ( " ogr2ogr -f \" ESRI Shapefile\" \" [% \" OUTPUT_PATH\" %]\" \" [% \" INPUT_FILE\" %]\" " ), QLatin1String ( " " ), true , tr ( " Run application" ), QSet<QString>() << QStringLiteral ( " AttributeTable " ) << QStringLiteral ( " Canvas" ) );
303
+ insertRow ( pos++, QgsAction::Generic, tr ( " Run an application" ), QStringLiteral ( " ogr2ogr -f \" ESRI Shapefile\" \" [% \" OUTPUT_PATH\" %]\" \" [% \" INPUT_FILE\" %]\" " ), QLatin1String ( " " ), true , tr ( " Run application" ), QSet<QString>() << QStringLiteral ( " Feature " ) << QStringLiteral ( " Canvas" ) );
304
304
insertRow ( pos++, QgsAction::GenericPython, tr ( " Get feature id" ), QStringLiteral ( " from qgis.PyQt import QtWidgets\n\n QtWidgets.QMessageBox.information(None, \" Feature id\" , \" feature id is [% $id %]\" )" ), QLatin1String ( " " ), false , tr ( " Feature ID" ), QSet<QString>() << QStringLiteral ( " Feature" ) << QStringLiteral ( " Canvas" ) );
305
305
insertRow ( pos++, QgsAction::GenericPython, tr ( " Selected field's value (Identify features tool)" ), QStringLiteral ( " from qgis.PyQt import QtWidgets\n\n QtWidgets.QMessageBox.information(None, \" Current field's value\" , \" [% @current_field %]\" )" ), QLatin1String ( " " ), false , tr ( " Field Value" ), QSet<QString>() << QStringLiteral ( " Field" ) );
306
306
insertRow ( pos++, QgsAction::GenericPython, tr ( " Clicked coordinates (Run feature actions tool)" ), QStringLiteral ( " from qgis.PyQt import QtWidgets\n\n QtWidgets.QMessageBox.information(None, \" Clicked coords\" , \" layer: [% @layer_id %]\\ ncoords: ([% @click_x %],[% @click_y %])\" )" ), QLatin1String ( " " ), false , tr ( " Clicked Coordinate" ), QSet<QString>() << QStringLiteral ( " Canvas" ) );
307
- insertRow ( pos++, QgsAction::OpenUrl, tr ( " Open file" ), QStringLiteral ( " [% \" PATH\" %]" ), QLatin1String ( " " ), false , tr ( " Open file" ), QSet<QString>() << QStringLiteral ( " AttributeTable " ) << QStringLiteral ( " Canvas" ) );
307
+ insertRow ( pos++, QgsAction::OpenUrl, tr ( " Open file" ), QStringLiteral ( " [% \" PATH\" %]" ), QLatin1String ( " " ), false , tr ( " Open file" ), QSet<QString>() << QStringLiteral ( " Feature " ) << QStringLiteral ( " Canvas" ) );
308
308
insertRow ( pos++, QgsAction::OpenUrl, tr ( " Search on web based on attribute's value" ), QStringLiteral ( " http://www.google.com/search?q=[% \" ATTRIBUTE\" %]" ), QLatin1String ( " " ), false , tr ( " Search Web" ), QSet<QString>() << QStringLiteral ( " Field" ) );
309
309
insertRow ( pos++, QgsAction::GenericPython, tr ( " List feature ids" ), QStringLiteral ( " from qgis.PyQt import QtWidgets\n\n layer = QgsMapLayerRegistry.instance().mapLayer('[% @layer_id %]')\n if layer.selectedFeatureCount():\n ids = layer.selectedFeaturesIds()\n else:\n ids = [f.id() for f in layer.getFeatures()]\n\n QtWidgets.QMessageBox.information(None, \" Feature ids\" , ', '.join([str(id) for id in ids]))" ), QLatin1String ( " " ), false , tr ( " List feature ids" ), QSet<QString>() << QStringLiteral ( " Layer" ) );
310
310
}
0 commit comments