Skip to content

Commit

Permalink
Add composer templates path variable
Browse files Browse the repository at this point in the history
  • Loading branch information
BishopGIS committed May 6, 2018
1 parent 9ecb769 commit 59b9513
Show file tree
Hide file tree
Showing 11 changed files with 6,323 additions and 7 deletions.
5,343 changes: 5,343 additions & 0 deletions opt/overwrite/src/core/qgsexpression.cpp

Large diffs are not rendered by default.

971 changes: 971 additions & 0 deletions opt/overwrite/src/core/qgsexpressioncontext.cpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion resources/composer_templates/A1-Horizontal.qpt
Expand Up @@ -19,7 +19,7 @@
<ComposerItem pagey="0" page="1" id="Рамка" lastValidViewScaleFactor="-1" positionMode="0" positionLock="true" x="0" y="0" visibility="1" zValue="3" background="false" transparency="0" frameJoinStyle="miter" blendMode="0" width="841" outlineWidth="0.3" excludeFromExports="0" uuid="{fc9d42ee-fe91-4a75-9787-efddf3b559a6}" height="594" itemRotation="0" frame="false" pagex="0">
<FrameColor alpha="255" red="0" blue="0" green="0"/>
<BackgroundColor alpha="255" red="255" blue="255" green="255"/>
<dataDefinedSource expr="" field="" active="false" useExpr="true"/>
<dataDefinedSource expr="@qgis_composer_templates_path + '/A1-g.svg'" field="" active="true" useExpr="true"/>
</ComposerItem>
</ComposerPicture>
<ComposerMap mapRotation="0" keepLayerSet="false" id="0" previewMode="Cache" drawCanvasItems="false">
Expand Down
2 changes: 1 addition & 1 deletion resources/composer_templates/A1-Vertical.qpt
Expand Up @@ -19,7 +19,7 @@
<ComposerItem pagey="0" page="1" id="Рамка" lastValidViewScaleFactor="-1" positionMode="0" positionLock="true" x="0" y="0" visibility="1" zValue="3" background="false" transparency="0" frameJoinStyle="miter" blendMode="0" width="594" outlineWidth="0.3" excludeFromExports="0" uuid="{4bacb874-d1be-4ea5-9f67-91dcc481f6f7}" height="841" itemRotation="0" frame="false" pagex="0">
<FrameColor alpha="255" red="0" blue="0" green="0"/>
<BackgroundColor alpha="255" red="255" blue="255" green="255"/>
<dataDefinedSource expr="" field="" active="false" useExpr="true"/>
<dataDefinedSource expr="@qgis_composer_templates_path + '/A1-v.svg'" field="" active="true" useExpr="true"/>
</ComposerItem>
</ComposerPicture>
<ComposerMap mapRotation="0" keepLayerSet="false" id="0" previewMode="Cache" drawCanvasItems="false">
Expand Down
2 changes: 1 addition & 1 deletion resources/composer_templates/A2-Horizontal.qpt
Expand Up @@ -19,7 +19,7 @@
<ComposerItem pagey="0" page="1" id="Рамка" lastValidViewScaleFactor="-1" positionMode="0" positionLock="true" x="0" y="0" visibility="1" zValue="3" background="false" transparency="0" frameJoinStyle="miter" blendMode="0" width="594" outlineWidth="0.3" excludeFromExports="0" uuid="{4bacb874-d1be-4ea5-9f67-91dcc481f6f7}" height="420" itemRotation="0" frame="false" pagex="0">
<FrameColor alpha="255" red="0" blue="0" green="0"/>
<BackgroundColor alpha="255" red="255" blue="255" green="255"/>
<dataDefinedSource expr="" field="" active="false" useExpr="true"/>
<dataDefinedSource expr="@qgis_composer_templates_path + '/A2-g.svg'" field="" active="true" useExpr="true"/>
</ComposerItem>
</ComposerPicture>
<ComposerMap mapRotation="0" keepLayerSet="false" id="0" previewMode="Cache" drawCanvasItems="false">
Expand Down
2 changes: 1 addition & 1 deletion resources/composer_templates/A2-Vertical.qpt
Expand Up @@ -19,7 +19,7 @@
<ComposerItem pagey="0" page="1" id="Рамка" lastValidViewScaleFactor="-1" positionMode="0" positionLock="true" x="0" y="0" visibility="1" zValue="3" background="false" transparency="0" frameJoinStyle="miter" blendMode="0" width="420" outlineWidth="0.3" excludeFromExports="0" uuid="{4bacb874-d1be-4ea5-9f67-91dcc481f6f7}" height="594" itemRotation="0" frame="false" pagex="0">
<FrameColor alpha="255" red="0" blue="0" green="0"/>
<BackgroundColor alpha="255" red="255" blue="255" green="255"/>
<dataDefinedSource expr="" field="" active="false" useExpr="true"/>
<dataDefinedSource expr="@qgis_composer_templates_path + '/A2-v.svg'" field="" active="true" useExpr="true"/>
</ComposerItem>
</ComposerPicture>
<ComposerMap mapRotation="0" keepLayerSet="false" id="0" previewMode="Cache" drawCanvasItems="false">
Expand Down
2 changes: 1 addition & 1 deletion resources/composer_templates/A3-Horizontal.qpt
Expand Up @@ -19,7 +19,7 @@
<ComposerItem pagey="0" page="1" id="Рамка" lastValidViewScaleFactor="-1" positionMode="0" positionLock="true" x="0" y="0" visibility="1" zValue="3" background="false" transparency="0" frameJoinStyle="miter" blendMode="0" width="420" outlineWidth="0.3" excludeFromExports="0" uuid="{4bacb874-d1be-4ea5-9f67-91dcc481f6f7}" height="297" itemRotation="0" frame="false" pagex="0">
<FrameColor alpha="255" red="0" blue="0" green="0"/>
<BackgroundColor alpha="255" red="255" blue="255" green="255"/>
<dataDefinedSource expr="" field="" active="false" useExpr="true"/>
<dataDefinedSource expr="@qgis_composer_templates_path + '/A3-g.svg'" field="" active="true" useExpr="true"/>
</ComposerItem>
</ComposerPicture>
<ComposerMap mapRotation="0" keepLayerSet="false" id="0" previewMode="Cache" drawCanvasItems="false">
Expand Down
2 changes: 1 addition & 1 deletion resources/composer_templates/A3-Vertical.qpt
Expand Up @@ -19,7 +19,7 @@
<ComposerItem pagey="0" page="1" id="Рамка" lastValidViewScaleFactor="-1" positionMode="0" positionLock="true" x="0" y="0" visibility="1" zValue="3" background="false" transparency="0" frameJoinStyle="miter" blendMode="0" width="297" outlineWidth="0.3" excludeFromExports="0" uuid="{4bacb874-d1be-4ea5-9f67-91dcc481f6f7}" height="420" itemRotation="0" frame="false" pagex="0">
<FrameColor alpha="255" red="0" blue="0" green="0"/>
<BackgroundColor alpha="255" red="255" blue="255" green="255"/>
<dataDefinedSource expr="" field="" active="false" useExpr="true"/>
<dataDefinedSource expr="@qgis_composer_templates_path + '/A3-v.svg'" field="" active="true" useExpr="true"/>
</ComposerItem>
</ComposerPicture>
<ComposerMap mapRotation="0" keepLayerSet="false" id="0" previewMode="Cache" drawCanvasItems="false">
Expand Down
2 changes: 1 addition & 1 deletion resources/composer_templates/A4-Vertical.qpt
Expand Up @@ -28,7 +28,7 @@
<ComposerItem pagey="0" page="1" id="Рамка" lastValidViewScaleFactor="-1" positionMode="0" positionLock="true" x="0" y="0" visibility="1" zValue="3" background="false" transparency="0" frameJoinStyle="miter" blendMode="0" width="210" outlineWidth="0.3" excludeFromExports="0" uuid="{4bacb874-d1be-4ea5-9f67-91dcc481f6f7}" height="297" itemRotation="0" frame="false" pagex="0">
<FrameColor alpha="255" red="0" blue="0" green="0"/>
<BackgroundColor alpha="255" red="255" blue="255" green="255"/>
<dataDefinedSource expr="" field="" active="false" useExpr="true"/>
<dataDefinedSource expr="@qgis_composer_templates_path + '/A4-v.svg'" field="" active="true" useExpr="true"/>
</ComposerItem>
</ComposerPicture>
<ComposerLegend symbolWidth="7" title="Условные обозначения:" boxSpace="2" splitLayer="0" equalColumnWidth="0" map="0" titleAlignment="1" symbolHeight="4" wmsLegendHeight="25" wrapChar="" fontColor="#000000" columnSpace="2" wmsLegendWidth="50" columnCount="1">
Expand Down
1 change: 1 addition & 0 deletions src/core/qgsexpression.cpp
Expand Up @@ -5097,6 +5097,7 @@ void QgsExpression::initVariableHelp()
gVariableHelpTexts.insert( "qgis_platform", QCoreApplication::translate( "variable_help", "QGIS platform, eg 'desktop' or 'server'." ) );
gVariableHelpTexts.insert( "user_account_name", QCoreApplication::translate( "variable_help", "Current user's operating system account name." ) );
gVariableHelpTexts.insert( "user_full_name", QCoreApplication::translate( "variable_help", "Current user's operating system user name (if available)." ) );
gVariableHelpTexts.insert( "qgis_composer_templates_path", QCoreApplication::translate( "variable_help", "Composer templates path." ) );

//project variables
gVariableHelpTexts.insert( "project_title", QCoreApplication::translate( "variable_help", "Title of current project." ) );
Expand Down
1 change: 1 addition & 0 deletions src/core/qgsexpressioncontext.cpp
Expand Up @@ -516,6 +516,7 @@ QgsExpressionContextScope* QgsExpressionContextUtils::globalScope()
scope->addVariable( QgsExpressionContextScope::StaticVariable( "qgis_os_name", QgsApplication::osName(), true ) );
scope->addVariable( QgsExpressionContextScope::StaticVariable( "user_account_name", QgsApplication::userLoginName(), true ) );
scope->addVariable( QgsExpressionContextScope::StaticVariable( "user_full_name", QgsApplication::userFullName(), true ) );
scope->addVariable( QgsExpressionContextScope::StaticVariable( "qgis_composer_templates_path", QgsApplication::pkgDataPath() + QDir::separator() + "composer_templates", true ) );

return scope;
}
Expand Down

0 comments on commit 59b9513

Please sign in to comment.