Skip to content

Commit

Permalink
Merge pull request #41009 from suricactus/dms_gui
Browse files Browse the repository at this point in the history
Document management system a.k.a. polymorphic relations GUI
  • Loading branch information
m-kuhn committed Jan 22, 2021
2 parents c90b8c8 + 25f3220 commit a84f2a2
Show file tree
Hide file tree
Showing 28 changed files with 1,367 additions and 350 deletions.
1 change: 1 addition & 0 deletions python/core/auto_additions/qgsrelation.py
@@ -1,2 +1,3 @@
# The following has been generated automatically from src/core/qgsrelation.h
QgsRelation.RelationType.baseClass = QgsRelation
QgsRelation.RelationStrength.baseClass = QgsRelation
10 changes: 10 additions & 0 deletions python/core/auto_generated/qgspolymorphicrelation.sip.in
Expand Up @@ -227,6 +227,16 @@ Returns a list of generated relations, based on the currently set :py:func:`~Qgs
QString layerRepresentation( const QgsVectorLayer *layer ) const;
%Docstring
Returns layer representation as evaluated string
%End

QgsRelation::RelationStrength strength() const;
%Docstring
Returns the relation strength for all the generated normal relations
%End

void setRelationStrength( QgsRelation::RelationStrength relationStrength );
%Docstring
Sets the relation strength for all the generated normal relations
%End

};
Expand Down
13 changes: 13 additions & 0 deletions python/core/auto_generated/qgsrelation.sip.in
Expand Up @@ -22,6 +22,12 @@ class QgsRelation

public:

enum RelationType
{
Normal,
Generated,
};

enum RelationStrength
{
Association,
Expand Down Expand Up @@ -333,6 +339,13 @@ Returns the parent polymorphic relation id. If the relation is a normal relation
%Docstring
Returns the parent polymorphic relation. If the relation is a normal relation, an invalid polymorphic relation is returned.

.. versionadded:: 3.18
%End

RelationType type() const;
%Docstring
Returns the type of the relation

.. versionadded:: 3.18
%End

Expand Down
3 changes: 3 additions & 0 deletions python/gui/auto_generated/qgsmaptool.sip.in
Expand Up @@ -20,6 +20,7 @@
#include <qgsmaptoolpan.h>
#include <qgsmaptoolemitpoint.h>
#include <qgsmaptoolidentify.h>
#include <qgsmaptooldigitizefeature.h>
%End

class QgsMapTool : QObject
Expand All @@ -43,6 +44,8 @@ implemented as map tools.
sipType = sipType_QgsMapToolEmitPoint;
else if ( dynamic_cast<QgsMapToolIdentify *>( sipCpp ) != NULL )
sipType = sipType_QgsMapToolIdentify;
else if ( dynamic_cast<QgsMapToolDigitizeFeature *>( sipCpp ) != NULL )
sipType = sipType_QgsMapToolDigitizeFeature;
else
sipType = NULL;
%End
Expand Down
1 change: 1 addition & 0 deletions src/app/CMakeLists.txt
Expand Up @@ -140,6 +140,7 @@ set(QGIS_APP_SRCS
qgsrastercalcdialog.cpp
qgsrelationmanagerdialog.cpp
qgsrelationadddlg.cpp
qgsrelationaddpolymorphicdlg.cpp
qgsselectbyformdialog.cpp
qgsstatisticalsummarydockwidget.cpp
qgstextannotationdialog.cpp
Expand Down
1 change: 1 addition & 0 deletions src/app/qgsprojectproperties.cpp
Expand Up @@ -1586,6 +1586,7 @@ void QgsProjectProperties::apply()
QgsProject::instance()->writeEntry( QStringLiteral( "Macros" ), QStringLiteral( "/pythonCode" ), pythonMacros );

QgsProject::instance()->relationManager()->setRelations( mRelationManagerDlg->relations() );
QgsProject::instance()->relationManager()->setPolymorphicRelations( mRelationManagerDlg->polymorphicRelations() );

//save variables
QgsProject::instance()->setCustomVariables( mVariableEditor->variablesInActiveScope() );
Expand Down

0 comments on commit a84f2a2

Please sign in to comment.