Skip to content
Permalink
Browse files

skip enabledOnlyWhenEditable from pyhton bindings

in the construtors of QgsAction and QgsMapLayerAction
  • Loading branch information
signedav committed Feb 23, 2018
1 parent 55a8d41 commit 555cdf0a20d926fde8708a2f70600cfcf5fccc35
Showing with 38 additions and 3 deletions.
  1. +26 −0 src/core/qgsaction.h
  2. +12 −3 src/gui/qgsmaplayeractionregistry.h
@@ -59,6 +59,7 @@ class CORE_EXPORT QgsAction
* \param capture If this is set to true, the output will be captured when an action is run
* \param enabledOnlyWhenEditable if true then action is only enable in editmode
*/
#ifndef SIP_RUN
QgsAction( ActionType type, const QString &description, const QString &command, bool capture = false, bool enabledOnlyWhenEditable = false )
: mType( type )
, mDescription( description )
@@ -67,6 +68,16 @@ class CORE_EXPORT QgsAction
, mId( QUuid::createUuid() )
, mIsEnabledOnlyWhenEditable( enabledOnlyWhenEditable )
{}
#else
QgsAction( ActionType type, const QString &description, const QString &command, bool capture = false )
: mType( type )
, mDescription( description )
, mCommand( command )
, mCaptureOutput( capture )
, mId( QUuid::createUuid() )
, mIsEnabledOnlyWhenEditable( enabledOnlyWhenEditable )
{}
#endif

/**
* Create a new QgsAction
@@ -81,6 +92,7 @@ class CORE_EXPORT QgsAction
* \param notificationMessage A particular message which reception will trigger the action
* \param enabledOnlyWhenEditable if true then action is only enable in editmode
*/
#ifndef SIP_RUN
QgsAction( ActionType type, const QString &description, const QString &action, const QString &icon, bool capture, const QString &shortTitle = QString(), const QSet<QString> &actionScopes = QSet<QString>(), const QString &notificationMessage = QString(), bool enabledOnlyWhenEditable = false )
: mType( type )
, mDescription( description )
@@ -93,6 +105,20 @@ class CORE_EXPORT QgsAction
, mId( QUuid::createUuid() )
, mIsEnabledOnlyWhenEditable( enabledOnlyWhenEditable )
{}
#else
QgsAction( ActionType type, const QString &description, const QString &action, const QString &icon, bool capture, const QString &shortTitle = QString(), const QSet<QString> &actionScopes = QSet<QString>(), const QString &notificationMessage = QString() )
: mType( type )
, mDescription( description )
, mShortTitle( shortTitle )
, mIcon( icon )
, mCommand( action )
, mCaptureOutput( capture )
, mActionScopes( actionScopes )
, mNotificationMessage( notificationMessage )
, mId( QUuid::createUuid() )
, mIsEnabledOnlyWhenEditable( enabledOnlyWhenEditable )
{}
#endif

//! The name of the action. This may be a longer description.
QString name() const { return mDescription; }
@@ -50,14 +50,23 @@ class GUI_EXPORT QgsMapLayerAction : public QAction
* Creates a map layer action which can run on any layer
* \note using AllActions as a target probably does not make a lot of sense. This default action was settled for API compatibility reasons.
*/
#ifndef SIP_RUN
QgsMapLayerAction( const QString &name, QObject *parent SIP_TRANSFERTHIS, Targets targets = AllActions, const QIcon &icon = QIcon(), const bool enabledOnlyWhenEditable = false );

#else
QgsMapLayerAction( const QString &name, QObject *parent SIP_TRANSFERTHIS, Targets targets = AllActions, const QIcon &icon = QIcon() );
#endif
//! Creates a map layer action which can run only on a specific layer
#ifndef SIP_RUN
QgsMapLayerAction( const QString &name, QObject *parent SIP_TRANSFERTHIS, QgsMapLayer *layer, Targets targets = AllActions, const QIcon &icon = QIcon(), const bool enabledOnlyWhenEditable = false );

#else
QgsMapLayerAction( const QString &name, QObject *parent SIP_TRANSFERTHIS, QgsMapLayer *layer, Targets targets = AllActions, const QIcon &icon = QIcon() );
#endif
//! Creates a map layer action which can run on a specific type of layer
#ifndef SIP_RUN
QgsMapLayerAction( const QString &name, QObject *parent SIP_TRANSFERTHIS, QgsMapLayer::LayerType layerType, Targets targets = AllActions, const QIcon &icon = QIcon(), const bool enabledOnlyWhenEditable = false );

#else
QgsMapLayerAction( const QString &name, QObject *parent SIP_TRANSFERTHIS, QgsMapLayer::LayerType layerType, Targets targets = AllActions, const QIcon &icon = QIcon() );
#endif
~QgsMapLayerAction() override;

//! True if action can run using the specified layer

0 comments on commit 555cdf0

Please sign in to comment.
You can’t perform that action at this time.