Skip to content

Commit

Permalink
rephrase shown to visible
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Jul 13, 2020
1 parent d2e1d96 commit 256044c
Show file tree
Hide file tree
Showing 13 changed files with 80 additions and 80 deletions.
16 changes: 8 additions & 8 deletions python/core/auto_additions/qgsattributeeditorelement.py
@@ -1,13 +1,13 @@
# The following has been generated automatically from src/core/qgsattributeeditorelement.h
# monkey patching scoped based enum
QgsAttributeEditorRelation.Button.Link.__doc__ = "Show link button"
QgsAttributeEditorRelation.Button.Unlink.__doc__ = "Show unlink button"
QgsAttributeEditorRelation.Button.SaveChildEdits.__doc__ = "Show save child edits button"
QgsAttributeEditorRelation.Button.AddChildFeature.__doc__ = "Show add child feature (as in some projects we only want to allow to link/unlink existing features)"
QgsAttributeEditorRelation.Button.DuplicateChildFeature.__doc__ = "Show duplicate child feature"
QgsAttributeEditorRelation.Button.DeleteChildFeature.__doc__ = "Show delete child feature button"
QgsAttributeEditorRelation.Button.ZoomToChildFeature.__doc__ = "Show zoom to child feature"
QgsAttributeEditorRelation.Button.AllButtons.__doc__ = "Defaults set of buttons shown"
QgsAttributeEditorRelation.Button.Link.__doc__ = "Link button"
QgsAttributeEditorRelation.Button.Unlink.__doc__ = "Unlink button"
QgsAttributeEditorRelation.Button.SaveChildEdits.__doc__ = "Save child edits button"
QgsAttributeEditorRelation.Button.AddChildFeature.__doc__ = "Add child feature (as in some projects we only want to allow to link/unlink existing features)"
QgsAttributeEditorRelation.Button.DuplicateChildFeature.__doc__ = "Duplicate child feature"
QgsAttributeEditorRelation.Button.DeleteChildFeature.__doc__ = "Delete child feature button"
QgsAttributeEditorRelation.Button.ZoomToChildFeature.__doc__ = "Zoom to child feature"
QgsAttributeEditorRelation.Button.AllButtons.__doc__ = "All buttons"
QgsAttributeEditorRelation.Button.__doc__ = 'Possible buttons shown in the relation editor\n\n.. versionadded:: 3.16\n\n' + '* ``Link``: ' + QgsAttributeEditorRelation.Button.Link.__doc__ + '\n' + '* ``Unlink``: ' + QgsAttributeEditorRelation.Button.Unlink.__doc__ + '\n' + '* ``SaveChildEdits``: ' + QgsAttributeEditorRelation.Button.SaveChildEdits.__doc__ + '\n' + '* ``AddChildFeature``: ' + QgsAttributeEditorRelation.Button.AddChildFeature.__doc__ + '\n' + '* ``DuplicateChildFeature``: ' + QgsAttributeEditorRelation.Button.DuplicateChildFeature.__doc__ + '\n' + '* ``DeleteChildFeature``: ' + QgsAttributeEditorRelation.Button.DeleteChildFeature.__doc__ + '\n' + '* ``ZoomToChildFeature``: ' + QgsAttributeEditorRelation.Button.ZoomToChildFeature.__doc__ + '\n' + '* ``AllButtons``: ' + QgsAttributeEditorRelation.Button.AllButtons.__doc__
# --
QgsAttributeEditorRelation.Button.baseClass = QgsAttributeEditorRelation
Expand Down
16 changes: 8 additions & 8 deletions python/core/auto_generated/qgsattributeeditorelement.sip.in
Expand Up @@ -359,7 +359,7 @@ Determines if the "link feature" button should be shown
.. versionadded:: 2.18

.. deprecated:: QGIS 3.16
use shownButtons() instead
use visibleButtons() instead
%End

void setShowLinkButton( bool showLinkButton ) /Deprecated/;
Expand All @@ -369,7 +369,7 @@ Determines if the "link feature" button should be shown
.. versionadded:: 2.18

.. deprecated:: QGIS 3.16
use setShownButtons() instead
use setVisibleButtons() instead
%End

bool showUnlinkButton() const /Deprecated/;
Expand All @@ -379,7 +379,7 @@ Determines if the "unlink feature" button should be shown
.. versionadded:: 2.18

.. deprecated:: QGIS 3.16
use shownButtons() instead
use visibleButtons() instead
%End

void setShowUnlinkButton( bool showUnlinkButton ) /Deprecated/;
Expand All @@ -389,7 +389,7 @@ Determines if the "unlink feature" button should be shown
.. versionadded:: 2.18

.. deprecated:: QGIS 3.16
use setShownButtons() instead
use setVisibleButtons() instead
%End

void setShowSaveChildEditsButton( bool showChildEdits ) /Deprecated/;
Expand All @@ -399,7 +399,7 @@ Determines if the "Save child layer edits" button should be shown
.. versionadded:: 3.14

.. deprecated:: QGIS 3.16
use setShownButtons() instead
use setVisibleButtons() instead
%End

bool showSaveChildEditsButton() const /Deprecated/;
Expand All @@ -409,17 +409,17 @@ Determines if the "Save child layer edits" button should be shown
.. versionadded:: 3.14

.. deprecated:: QGIS 3.16
use shownButtons() instead
use visibleButtons() instead
%End

void setShownButtons( const QgsAttributeEditorRelation::Buttons &buttons );
void setVisibleButtons( const QgsAttributeEditorRelation::Buttons &buttons );
%Docstring
Defines the buttons which are shown

.. versionadded:: 3.16
%End

QgsAttributeEditorRelation::Buttons shownButtons() const;
QgsAttributeEditorRelation::Buttons visibleButtons() const;
%Docstring
Returns the buttons which are shown

Expand Down
Expand Up @@ -46,7 +46,7 @@ Determines if the "link feature" button should be shown
.. versionadded:: 2.18

.. deprecated:: QGIS 3.16
use shownButtons() instead
use visibleButtons() instead
%End

void setShowLinkButton( bool showLinkButton ) /Deprecated/;
Expand All @@ -56,7 +56,7 @@ Determines if the "link feature" button should be shown
.. versionadded:: 2.18

.. deprecated:: QGIS 3.16
use setShownButtons() instead
use setVisibleButtons() instead
%End

bool showUnlinkButton() const /Deprecated/;
Expand All @@ -66,7 +66,7 @@ Determines if the "unlink feature" button should be shown
.. versionadded:: 2.18

.. deprecated:: QGIS 3.16
use shownButtons() instead
use visibleButtons() instead
%End

void setShowUnlinkButton( bool showUnlinkButton ) /Deprecated/;
Expand All @@ -76,7 +76,7 @@ Determines if the "unlink feature" button should be shown
.. versionadded:: 2.18

.. deprecated:: QGIS 3.16
use setShownButtons() instead
use setVisibleButtons() instead
%End

void setShowSaveChildEditsButton( bool showChildEdits ) /Deprecated/;
Expand All @@ -86,7 +86,7 @@ Determines if the "Save child layer edits" button should be shown
.. versionadded:: 3.14

.. deprecated:: QGIS 3.16
use setShownButtons() instead
use setVisibleButtons() instead
%End

bool showSaveChildEditsButton() const /Deprecated/;
Expand All @@ -96,17 +96,17 @@ Determines if the "Save child layer edits" button should be shown
.. versionadded:: 3.14

.. deprecated:: QGIS 3.16
use shownButtons() instead
use visibleButtons() instead
%End

void setShownButtons( const QgsAttributeEditorRelation::Buttons &buttons );
void setVisibleButtons( const QgsAttributeEditorRelation::Buttons &buttons );
%Docstring
Defines the buttons which are shown

.. versionadded:: 3.16
%End

QgsAttributeEditorRelation::Buttons shownButtons() const;
QgsAttributeEditorRelation::Buttons visibleButtons() const;
%Docstring
Returns the buttons which are shown

Expand Down
16 changes: 8 additions & 8 deletions python/gui/auto_generated/qgsrelationeditorwidget.sip.in
Expand Up @@ -116,7 +116,7 @@ Determines if the "link feature" button should be shown
.. versionadded:: 2.18

.. deprecated:: QGIS 3.16
use shownButtons() instead
use visibleButtons() instead
%End

void setShowLinkButton( bool showLinkButton ) /Deprecated/;
Expand All @@ -126,7 +126,7 @@ Determines if the "link feature" button should be shown
.. versionadded:: 2.18

.. deprecated:: QGIS 3.16
use setShownButtons() instead
use setVisibleButtons() instead
%End

bool showUnlinkButton() const /Deprecated/;
Expand All @@ -136,7 +136,7 @@ Determines if the "unlink feature" button should be shown
.. versionadded:: 2.18

.. deprecated:: QGIS 3.16
use shownButtons() instead
use visibleButtons() instead
%End

void setShowUnlinkButton( bool showUnlinkButton ) /Deprecated/;
Expand All @@ -146,7 +146,7 @@ Determines if the "unlink feature" button should be shown
.. versionadded:: 2.18

.. deprecated:: QGIS 3.16
use setShownButtons() instead
use setVisibleButtons() instead
%End

void setShowSaveChildEditsButton( bool showChildEdits ) /Deprecated/;
Expand All @@ -156,7 +156,7 @@ Determines if the "Save child layer edits" button should be shown
.. versionadded:: 3.14

.. deprecated:: QGIS 3.16
use setShownButtons() instead
use setVisibleButtons() instead
%End

bool showSaveChildEditsButton() const /Deprecated/;
Expand All @@ -166,17 +166,17 @@ Determines if the "Save child layer edits" button should be shown
.. versionadded:: 3.14

.. deprecated:: QGIS 3.16
use shownButtons() instead
use visibleButtons() instead
%End

void setShownButtons( const QgsAttributeEditorRelation::Buttons &buttons );
void setVisibleButtons( const QgsAttributeEditorRelation::Buttons &buttons );
%Docstring
Defines the buttons which are shown

.. versionadded:: 3.16
%End

QgsAttributeEditorRelation::Buttons shownButtons() const;
QgsAttributeEditorRelation::Buttons visibleButtons() const;
%Docstring
Returns the buttons which are shown

Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsattributeeditorelement.cpp
Expand Up @@ -170,7 +170,7 @@ bool QgsAttributeEditorRelation::showSaveChildEditsButton() const
return mButtons.testFlag( Button::SaveChildEdits );
}

void QgsAttributeEditorRelation::setShownButtons( const QgsAttributeEditorRelation::Buttons &buttons )
void QgsAttributeEditorRelation::setVisibleButtons( const QgsAttributeEditorRelation::Buttons &buttons )
{
mButtons = buttons;
}
Expand Down
34 changes: 17 additions & 17 deletions src/core/qgsattributeeditorelement.h
Expand Up @@ -342,14 +342,14 @@ class CORE_EXPORT QgsAttributeEditorRelation : public QgsAttributeEditorElement
*/
enum class Button : int
{
Link = 1 << 1, //!< Show link button
Unlink = 1 << 2, //!< Show unlink button
SaveChildEdits = 1 << 3, //!< Show save child edits button
AddChildFeature = 1 << 4, //!< Show add child feature (as in some projects we only want to allow to link/unlink existing features)
DuplicateChildFeature = 1 << 5, //!< Show duplicate child feature
DeleteChildFeature = 1 << 6, //!< Show delete child feature button
ZoomToChildFeature = 1 << 7, //!< Show zoom to child feature
AllButtons = Link | Unlink | SaveChildEdits | AddChildFeature | DuplicateChildFeature | DeleteChildFeature | ZoomToChildFeature //!< Defaults set of buttons shown
Link = 1 << 1, //!< Link button
Unlink = 1 << 2, //!< Unlink button
SaveChildEdits = 1 << 3, //!< Save child edits button
AddChildFeature = 1 << 4, //!< Add child feature (as in some projects we only want to allow to link/unlink existing features)
DuplicateChildFeature = 1 << 5, //!< Duplicate child feature
DeleteChildFeature = 1 << 6, //!< Delete child feature button
ZoomToChildFeature = 1 << 7, //!< Zoom to child feature
AllButtons = Link | Unlink | SaveChildEdits | AddChildFeature | DuplicateChildFeature | DeleteChildFeature | ZoomToChildFeature //!< All buttons
};
Q_ENUM( Button )
Q_DECLARE_FLAGS( Buttons, Button )
Expand Down Expand Up @@ -417,64 +417,64 @@ class CORE_EXPORT QgsAttributeEditorRelation : public QgsAttributeEditorElement
/**
* Determines if the "link feature" button should be shown
* \since QGIS 2.18
* \deprecated since QGIS 3.16 use shownButtons() instead
* \deprecated since QGIS 3.16 use visibleButtons() instead
*/
Q_DECL_DEPRECATED bool showLinkButton() const SIP_DEPRECATED;

/**
* Determines if the "link feature" button should be shown
* \since QGIS 2.18
* \deprecated since QGIS 3.16 use setShownButtons() instead
* \deprecated since QGIS 3.16 use setVisibleButtons() instead
*/
Q_DECL_DEPRECATED void setShowLinkButton( bool showLinkButton ) SIP_DEPRECATED;

/**
* Determines if the "unlink feature" button should be shown
* \since QGIS 2.18
* \deprecated since QGIS 3.16 use shownButtons() instead
* \deprecated since QGIS 3.16 use visibleButtons() instead
*/
Q_DECL_DEPRECATED bool showUnlinkButton() const SIP_DEPRECATED;

/**
* Determines if the "unlink feature" button should be shown
* \since QGIS 2.18
* \deprecated since QGIS 3.16 use setShownButtons() instead
* \deprecated since QGIS 3.16 use setVisibleButtons() instead
*/
Q_DECL_DEPRECATED void setShowUnlinkButton( bool showUnlinkButton ) SIP_DEPRECATED;

/**
* Determines if the "Save child layer edits" button should be shown
* \since QGIS 3.14
* \deprecated since QGIS 3.16 use setShownButtons() instead
* \deprecated since QGIS 3.16 use setVisibleButtons() instead
*/
Q_DECL_DEPRECATED void setShowSaveChildEditsButton( bool showChildEdits ) SIP_DEPRECATED;

/**
* Determines if the "Save child layer edits" button should be shown
* \since QGIS 3.14
* \deprecated since QGIS 3.16 use shownButtons() instead
* \deprecated since QGIS 3.16 use visibleButtons() instead
*/
Q_DECL_DEPRECATED bool showSaveChildEditsButton() const SIP_DEPRECATED;

/**
* Defines the buttons which are shown
* \since QGIS 3.16
*/
void setShownButtons( const QgsAttributeEditorRelation::Buttons &buttons );
void setVisibleButtons( const QgsAttributeEditorRelation::Buttons &buttons );

/**
* Returns the buttons which are shown
* \since QGIS 3.16
*/
QgsAttributeEditorRelation::Buttons shownButtons() const {return mButtons;}
QgsAttributeEditorRelation::Buttons visibleButtons() const {return mButtons;}


private:
void saveConfiguration( QDomElement &elem ) const override;
QString typeIdentifier() const override;
QString mRelationId;
QgsRelation mRelation;
Buttons mButtons = Button::AllButtons;
Buttons mButtons = Buttons( Button::AllButtons );
};

Q_DECLARE_OPERATORS_FOR_FLAGS( QgsAttributeEditorRelation::Buttons )
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgseditformconfig.cpp
Expand Up @@ -618,7 +618,7 @@ QgsAttributeEditorElement *QgsEditFormConfig::attributeEditorElementFromDomEleme
if ( elem.hasAttribute( "buttons" ) )
{
QString buttonString = elem.attribute( QStringLiteral( "buttons" ), qgsFlagValueToKeys( QgsAttributeEditorRelation::Button::AllButtons ) );
relElement->setShownButtons( qgsFlagKeysToValue( buttonString, QgsAttributeEditorRelation::Button::AllButtons ) );
relElement->setVisibleButtons( qgsFlagKeysToValue( buttonString, QgsAttributeEditorRelation::Button::AllButtons ) );
}
else
{
Expand All @@ -627,7 +627,7 @@ QgsAttributeEditorElement *QgsEditFormConfig::attributeEditorElementFromDomEleme
buttons.setFlag( QgsAttributeEditorRelation::Button::Link, elem.attribute( QStringLiteral( "showLinkButton" ), QStringLiteral( "1" ) ).toInt() );
buttons.setFlag( QgsAttributeEditorRelation::Button::Unlink, elem.attribute( QStringLiteral( "showUnlinkButton" ), QStringLiteral( "1" ) ).toInt() );
buttons.setFlag( QgsAttributeEditorRelation::Button::SaveChildEdits, elem.attribute( QStringLiteral( "showSaveChildEditsButton" ), QStringLiteral( "1" ) ).toInt() );
relElement->setShownButtons( buttons );
relElement->setVisibleButtons( buttons );
}
newElement = relElement;
}
Expand Down
12 changes: 6 additions & 6 deletions src/gui/editorwidgets/qgsrelationwidgetwrapper.cpp
Expand Up @@ -191,7 +191,7 @@ bool QgsRelationWidgetWrapper::valid() const

bool QgsRelationWidgetWrapper::showLinkButton() const
{
return shownButtons().testFlag( QgsAttributeEditorRelation::Button::Link );
return visibleButtons().testFlag( QgsAttributeEditorRelation::Button::Link );
}

void QgsRelationWidgetWrapper::setShowLinkButton( bool showLinkButton )
Expand All @@ -204,16 +204,16 @@ void QgsRelationWidgetWrapper::setShowLinkButton( bool showLinkButton )

bool QgsRelationWidgetWrapper::showSaveChildEditsButton() const
{
return shownButtons().testFlag( QgsAttributeEditorRelation::Button::SaveChildEdits );
return visibleButtons().testFlag( QgsAttributeEditorRelation::Button::SaveChildEdits );
}

void QgsRelationWidgetWrapper::setShownButtons( const QgsAttributeEditorRelation::Buttons &buttons )
void QgsRelationWidgetWrapper::setVisibleButtons( const QgsAttributeEditorRelation::Buttons &buttons )
{
if ( mWidget )
mWidget->setShownButtons( buttons );
mWidget->setVisibleButtons( buttons );
}

QgsAttributeEditorRelation::Buttons QgsRelationWidgetWrapper::shownButtons() const
QgsAttributeEditorRelation::Buttons QgsRelationWidgetWrapper::visibleButtons() const
{
return mWidget->shownButtons();
return mWidget->visibleButtons();
}

0 comments on commit 256044c

Please sign in to comment.