Compare commits

..
148 Commits
Author SHA1 Message Date
trousseau 3d62ac8d5e Update plugins.xml 2026-05-12 13:52:45 +02:00
trousseau d89c17cf62 Update plugins.xml 2026-04-27 15:54:41 +02:00
trousseau 4019e483b7 Update plugins.xml 2026-04-27 15:50:09 +02:00
trousseau 5854252f02 Update plugins.xml 2026-04-27 15:49:22 +02:00
trousseau 6a955acd90 Update plugins.xml 2026-04-27 15:49:13 +02:00
trousseau 0fe0dd2dd3 Update plugins.xml 2026-04-27 15:45:46 +02:00
Colas 74ac0da75d fix install plugin 2026-04-22 15:24:18 +02:00
Colas 9066192072 fix downlowd url 2026-04-22 15:07:56 +02:00
Colas b299d3bdbf add gn_tools plugin 2026-04-22 14:56:10 +02:00
Colas 684b1fa869 Ajout logos RNGL 2025-03-06 17:26:39 +01:00
Colas 2a670b41e8 update version 2025-02-07 14:54:57 +01:00
Colas d1a3192129 update version 2025-02-07 14:51:01 +01:00
Colas 124938ff6b adjust polices 2025-02-07 14:48:43 +01:00
Colas 36403781ac adjust params position 2025-02-07 14:47:57 +01:00
Colas c8a7d6a209 add logos 2025-02-07 14:46:08 +01:00
Colas 0f94dbad98 Remove mdp from repot 2025-02-05 12:14:04 +01:00
Colas 6991e83ccc Remove mdp from repot 2025-02-05 12:13:13 +01:00
Colas fb7addbe75 add PythonSQL.py 2025-02-05 12:12:40 +01:00
Colas 488dae338f add PythonSQL.py 2025-02-05 12:11:04 +01:00
Colas a507309986 Remove mdp from repot 2025-02-05 12:09:55 +01:00
Colas a3d9d0730c init gitignore 2025-02-05 12:07:31 +01:00
Colas ace0310c2c Update logo CEN 2025-02-05 12:04:45 +01:00
Colas 27afebc093 add CEN38 icon 2025-02-04 18:41:56 +01:00
Colas 059ba80004 rename CEN-RA icon 2025-02-04 18:41:39 +01:00
Colas 2ecb90389a Update template title 2025-02-04 18:37:49 +01:00
Colas 3c5d8dc805 init file 2025-02-04 18:28:16 +01:00
Colas ab6d2abb67 Update metadata 2025-02-04 18:27:49 +01:00
Colas 923ceeb52f init file 2025-02-04 18:27:03 +01:00
Colas 344f02f3de update dimensional parameters 2025-02-04 18:25:21 +01:00
Colas ba39d889b3 transform to 2025-02-04 18:23:44 +01:00
Colas e6e888639f transform to 2025-02-04 18:22:37 +01:00
Colas bf4cb3de7f comment code writing in comments 2025-02-04 18:20:35 +01:00
Colas 7ad428ff5d init left_corner.py 2025-02-04 18:19:28 +01:00
Colas c1ceb1eeaf comment code writing in comments 2025-02-04 18:18:25 +01:00
Colas 01c3cfcca6 filter & sort modele 2025-02-04 18:13:55 +01:00
Colas 0f514e9f51 deactivate function login_base 2025-02-04 18:08:46 +01:00
Colas ca4999737e correction description 2025-02-04 18:07:28 +01:00
Colas ae1db1bba4 deactivate login_base & update plugins.xml URL 2025-02-04 18:06:39 +01:00
Colas 69050f3a6f clean password 2025-02-04 18:04:46 +01:00
Colas fd92bbefad Actualiser plugins.xml
Actualisation version plugin
2024-12-11 15:09:41 +01:00
Natacha 90555a5999 Actualiser plugins.xml 2024-12-06 11:40:14 +01:00
Natacha 8fc2dff981 Actualiser plugins.xml 2024-12-06 11:36:08 +01:00
Natacha a952c37b41 Actualisation xml 2024-11-29 10:05:41 +01:00
Natacha 0b7912a512 Actualisation xml 2024-11-29 10:05:10 +01:00
Natacha 6a66140db7 Custom CenIsere 2024-11-28 16:35:32 +01:00
Natacha 66df248ab8 Renommage des fichiers CenRa en CenIsere 2024-11-28 16:33:11 +01:00
Natacha 01015e6f46 Renommage en CenIsere_AUTOMAP 2024-11-28 16:28:45 +01:00
Natacha 1380827465 Remove gitignore 2024-11-28 16:27:11 +01:00
tlaveille 7fd53159e9 correctif et ajout de fonctionnaliter 2024-11-08 09:57:47 +01:00
tlaveille b685580d54 Revork des code et leur rangement 2024-10-22 17:23:45 +02:00
tlaveille 4c1a62f54d Revork du code
Merge branch 'main' of ssh://gitea.cenra-outils.org:2222/CEN-RA/Plugin_QGIS
2024-10-22 15:30:52 +02:00
tlaveille 70232ac4c7 Refont du code de CenRa_COPIE 2024-10-22 15:30:09 +02:00
tlaveille d360527d20 Actualiser CenRa_POSTGIS/README.md 2024-10-22 14:29:58 +02:00
tlaveille ee029c6b7f Actualiser README.md 2024-10-22 14:29:46 +02:00
tlaveille 98b0cfc604 Actualiser README.md 2024-10-22 14:29:36 +02:00
tlaveille 1d06bc30ad Actualiser README.md 2024-10-22 14:29:18 +02:00
tlaveille 0997a7d6d8 Update README 2024-10-22 14:27:32 +02:00
tlaveille 675f964145 Réorganisiont du code 2024-10-22 14:23:20 +02:00
tlaveille 801843fc0e mise à jour de pagerender, netoyage de metabase 2024-10-21 14:52:44 +02:00
tlaveille 8bfa4a557a Nouveau plugin de creation de code de mise en page 2024-10-21 12:46:11 +02:00
tlaveille c5fb0aae18 recodage de partie pour acceuillir pagerender ! 2024-10-21 12:41:49 +02:00
tlaveille b6081c5723 Merge branch 'main' of ssh://gitea.cenra-outils.org:2222/CEN-RA/Plugin_QGIS 2024-10-14 16:20:13 +02:00
tlaveille 52809a56a1 auto release remove 2024-10-14 16:19:06 +02:00
tlaveille 0c7c08da44 Supprimer .github/release.yml 2024-10-14 16:18:39 +02:00
tlaveille 0f90553c63 auto release file 2024-10-14 15:39:12 +02:00
tlaveille 8f2dec8869 auto release file 2024-10-14 15:32:00 +02:00
tlaveille e90ae04f93 auto release 2024-10-14 15:25:51 +02:00
tlaveille 7634407810 delete un gitignore dans flux 2024-10-14 14:34:51 +02:00
tlaveille de981982ea Git ignore fonctione 2024-10-14 14:31:30 +02:00
tlaveille bf0008be58 Git ignore fonctione 2024-10-14 14:26:59 +02:00
tlaveille 20053c7960 new test ignore 2024-10-14 14:12:01 +02:00
tlaveille dcbe7d73c3 new test ignore 2024-10-14 14:11:45 +02:00
tlaveille 06e259c338 premier commit/push 2024-10-14 13:56:22 +02:00
tlaveille c9954f295d test de commit avec gitignore 2024-10-14 11:50:44 +02:00
tlaveille 60d4051840 test de gitignore 2024-10-14 11:35:00 +02:00
tlaveille f831f2e5a3 Téléverser les fichiers vers "CenRa_Metabase" 2024-10-08 12:15:09 +02:00
tlaveille 839eb525e4 Téléverser les fichiers vers "CenRa_FLUX" 2024-10-07 17:17:27 +02:00
tlaveille 7b6e77d17e Téléverser les fichiers vers "CenRa_Metabase" 2024-10-07 17:16:57 +02:00
tlaveille 8ee1d6d888 Supprimer CenRa_AUTOMAP/tools/mise_en_pages/1. Modèle carto standard (consolidé).qpt 2024-10-07 17:16:16 +02:00
tlaveille 62b3052b04 Téléverser les fichiers vers "CenRa_AUTOMAP/tools/mise_en_pages" 2024-10-07 17:16:05 +02:00
tlaveille f2f1cb6ab1 Téléverser les fichiers vers "CenRa_AUTOMAP/tools/logo_library" 2024-10-07 17:15:47 +02:00
tlaveille 9683e7382c Téléverser les fichiers vers "CenRa_AUTOMAP/tools/font" 2024-10-07 17:14:51 +02:00
tlaveille 8f32acc561 Téléverser les fichiers vers "CenRa_AUTOMAP/tools/ui" 2024-10-07 17:14:25 +02:00
tlaveille 47fa68e1d2 Téléverser les fichiers vers "CenRa_AUTOMAP/tools" 2024-10-07 17:14:01 +02:00
tlaveille 6e159166cc Supprimer CenRa_AUTOMAP/editor.py 2024-10-07 17:13:38 +02:00
tlaveille d382770688 Téléverser les fichiers vers "CenRa_AUTOMAP" 2024-10-07 17:13:31 +02:00
tlaveille 82cce4a0f1 Téléverser les fichiers vers "CenRa_AUTOMAP/tools/ui" 2024-09-26 16:52:21 +02:00
tlaveille 3b44e6b59a Téléverser les fichiers vers "CenRa_AUTOMAP/tools/mise_en_pages" 2024-09-26 16:52:01 +02:00
tlaveille 450dc2fe68 Téléverser les fichiers vers "CenRa_AUTOMAP/tools/icons" 2024-09-26 16:51:39 +02:00
tlaveille 317f47cd11 Téléverser les fichiers vers "CenRa_AUTOMAP/tools/bg" 2024-09-26 16:51:23 +02:00
tlaveille d932dd0e74 Téléverser les fichiers vers "CenRa_AUTOMAP/tools" 2024-09-26 16:51:07 +02:00
tlaveille 5cf9380367 Téléverser les fichiers vers "CenRa_AUTOMAP" 2024-09-26 16:50:38 +02:00
tlaveille 055b9cc69d Téléverser les fichiers vers "CenRa_AUTOMAP" 2024-09-26 16:50:26 +02:00
tlaveille bace581f5c Supprimer issues.py 2024-09-26 16:49:57 +02:00
tlaveille f29df89ba0 Supprimer icon.png 2024-09-26 16:49:53 +02:00
tlaveille 8335b25ddd Supprimer editor.py 2024-09-26 16:49:49 +02:00
tlaveille 54585175ed Supprimer about_form.py 2024-09-26 16:49:44 +02:00
tlaveille 5a2ee3b1c0 Actualiser CenRa_AUTOMAP/CenRa_AutoMap.py 2024-09-26 16:49:35 +02:00
tlaveille 30a58ad9fd Téléverser les fichiers vers "/" 2024-09-26 16:49:07 +02:00
tlaveille 5f40aaea88 Actualiser plugins.xml 2024-08-26 15:51:43 +02:00
tlaveille 87f51f8084 Actualiser plugins.xml 2024-08-02 11:03:15 +02:00
tlaveille 76bcc9148d Actualiser CenRa_COPIE/README.md 2024-08-02 10:58:54 +02:00
tlaveille 5b6b96f134 Actualiser CenRa_COPIE/README.md 2024-08-02 10:46:50 +02:00
tlaveille 1a221bcbe2 Téléverser les fichiers vers "CenRa_SICEN" 2024-08-02 10:46:27 +02:00
tlaveille de1c84bf6d Téléverser les fichiers vers "CenRa_SICEN" 2024-08-02 10:46:19 +02:00
tlaveille babf387f37 Téléverser les fichiers vers "CenRa_SICEN/tools" 2024-08-02 10:45:53 +02:00
tlaveille 7775b9e0f7 Actualiser CenRa_SICEN/README.md 2024-08-02 10:45:34 +02:00
tlaveille 518a95d6fa Téléverser les fichiers vers "CenRa_SICEN" 2024-08-02 10:45:18 +02:00
tlaveille 299b2b01ea Actualiser CenRa_POSTGIS/README.md 2024-08-02 10:43:36 +02:00
tlaveille 94b5e1776f Téléverser les fichiers vers "CenRa_Metabase" 2024-08-02 10:43:02 +02:00
tlaveille 710304eb28 Téléverser les fichiers vers "CenRa_Metabase/resources" 2024-08-02 10:41:28 +02:00
tlaveille 6d39a11a39 Téléverser les fichiers vers "CenRa_POSTGIS" 2024-08-02 10:41:12 +02:00
tlaveille 29ef2053a1 Téléverser les fichiers vers "CenRa_FLUX/tools" 2024-08-02 10:40:49 +02:00
tlaveille 6f57119c09 Téléverser les fichiers vers "CenRa_COPIE/tools" 2024-08-02 10:40:12 +02:00
tlaveille 8f3512aaa2 Téléverser les fichiers vers "CenRa_Metabase/resources" 2024-08-02 10:39:55 +02:00
tlaveille 4c62cef083 Supprimer CenRa_COPIE/PythonSQL.py 2024-08-02 10:35:46 +02:00
tlaveille 8fdd6c2853 Téléverser les fichiers vers "CenRa_COPIE" 2024-08-02 10:35:37 +02:00
tlaveille 775e6b176e Téléverser les fichiers vers "CenRa_COPIE/tools" 2024-08-02 10:35:20 +02:00
tlaveille 7858e7f149 Téléverser les fichiers vers "CenRa_POSTGIS/tools" 2024-08-02 10:29:23 +02:00
tlaveille 5612948aa7 Téléverser les fichiers vers "CenRa_POSTGIS" 2024-08-02 10:28:54 +02:00
tlaveille bb454b0b4b Téléverser les fichiers vers "CenRa_POSTGIS" 2024-08-02 10:27:10 +02:00
tlaveille f4a21491f9 Téléverser les fichiers vers "CenRa_POSTGIS" 2024-08-02 10:26:27 +02:00
tlaveille d2cc6f16b5 Téléverser les fichiers vers "CenRa_POSTGIS" 2024-08-02 10:25:19 +02:00
tlaveille d666ae2a65 Téléverser les fichiers vers "CenRa_Metabase/i18n" 2024-08-02 10:24:14 +02:00
tlaveille 7c23016672 Téléverser les fichiers vers "CenRa_Metabase/resources/css" 2024-08-02 10:23:25 +02:00
tlaveille 496089bdd3 Téléverser les fichiers vers "CenRa_Metabase/resources/icons" 2024-08-02 10:22:55 +02:00
tlaveille f1f34160f1 Téléverser les fichiers vers "CenRa_Metabase/resources/ui" 2024-08-02 10:22:15 +02:00
tlaveille f4ab19ddcc Téléverser les fichiers vers "CenRa_Metabase/resources/xml" 2024-08-02 10:21:56 +02:00
tlaveille 653f14b3ff Téléverser les fichiers vers "CenRa_Metabase/resources" 2024-08-02 10:21:41 +02:00
tlaveille b1d2a2f9b5 Téléverser les fichiers vers "CenRa_Metabase" 2024-08-02 10:21:03 +02:00
tlaveille 812412c6f9 Téléverser les fichiers vers "CenRa_Metabase" 2024-08-02 10:20:26 +02:00
tlaveille 0d9fcd8de9 Téléverser les fichiers vers "CenRa_FLUX" 2024-08-02 10:19:08 +02:00
tlaveille cbccca397b Téléverser les fichiers vers "CenRa_FLUX" 2024-08-02 10:18:59 +02:00
tlaveille 543e94c861 Supprimer CenRa_FLUX/tools/resources.cpython-312.pyc 2024-08-02 10:17:56 +02:00
tlaveille 38a969d714 Supprimer CenRa_FLUX/tools/PythonSQL.cpython-312.pyc 2024-08-02 10:17:51 +02:00
tlaveille 3320ba1dd9 Téléverser les fichiers vers "CenRa_FLUX/tools" 2024-08-02 10:17:20 +02:00
tlaveille b7cfeb2484 Téléverser les fichiers vers "CenRa_FLUX" 2024-08-02 10:16:37 +02:00
tlaveille 7c0188b9a5 Téléverser les fichiers vers "CenRa_FLUX" 2024-08-02 10:15:52 +02:00
tlaveille 80bcd3de55 Téléverser les fichiers vers "/" 2024-08-01 15:40:30 +02:00
tlaveille 8c5691c77b Actualiser CenRa_COPIE/README.md 2024-08-01 15:18:17 +02:00
tlaveille b3f4f1ffa1 Téléverser les fichiers vers "CenRa_COPIE" 2024-08-01 15:17:53 +02:00
tlaveille c8966c7316 Téléverser les fichiers vers "CenRa_COPIE" 2024-08-01 15:17:32 +02:00
tlaveille 6aa35a2620 Supprimer copie_dialog.py 2024-08-01 14:43:37 +02:00
tlaveille 227aacb5d1 Supprimer copie.py.bak 2024-08-01 14:43:31 +02:00
tlaveille 5ec3a216b8 Supprimer copie.py 2024-08-01 14:43:27 +02:00
tlaveille de4d120f67 Supprimer copie_dialog.py.bak 2024-08-01 14:43:22 +02:00
tlaveille 1f91f96bac Supprimer cenra.png 2024-08-01 14:43:16 +02:00
tlaveille 997b1147af Merge pull request 'Téléverser les fichiers vers "/"' (#1) from dev into main
Reviewed-on: CEN-RA/Plugin_QGIS#1
2024-08-01 14:42:50 +02:00
193 changed files with 25636 additions and 595 deletions
+2
View File
@@ -0,0 +1,2 @@
*.zip
*/*/PythonSQL.py
+143
View File
@@ -0,0 +1,143 @@
__copyright__ = "Copyright 2021, 3Liz"
__license__ = "GPL version 3"
__email__ = "info@3liz.org"
from qgis.core import QgsApplication
from qgis.PyQt.QtCore import QCoreApplication, Qt, QTranslator, QUrl
from qgis.PyQt.QtGui import QDesktopServices, QIcon
from qgis.PyQt.QtWidgets import QAction, QMessageBox
from qgis.utils import iface
import qgis
#include <QSettings>
'''
from pg_metadata.connection_manager import (
store_connections,
validate_connections_names,
)
from pg_metadata.locator import LocatorFilter
from pg_metadata.processing.provider import PgMetadataProvider
from pg_metadata.qgis_plugin_tools.tools.custom_logging import setup_logger
'''
import os
from .tools.resources import (
plugin_path,
resources_path,
maj_verif,
)
from .canvas_editor import AutoMap_Editor
from .about_form import AutoMapAboutDialog
from PyQt5.QtCore import *
class PgAutoMap:
def __init__(self):
""" Constructor. """
self.canvas_editor = None
# self.issues = None
self.provider = None
self.locator_filter = None
self.dock_action = None
self.help_action = None
plugin_dir = os.path.dirname(__file__)
end_find = plugin_dir.rfind('\\')+1
global NAME
NAME = plugin_dir[end_find:]
maj_verif(NAME)
# Display About window on first use
version = qgis.utils.pluginMetadata('CenIsere_AUTOMAP','version')
s = QSettings()
versionUse = s.value("automap/version", 1, type=str)
if str(versionUse) != str(version) :
s.setValue("automap/version", str(version))
print(versionUse,version)
self.open_about_dialog()
def initGui(self):
""" Build the plugin GUI. """
self.toolBar = iface.addToolBar("CenIsere_AutoMap")
self.toolBar.setObjectName("CenIsere_AutoMap")
icon = QIcon(resources_path('icons', 'icon.png'))
# Open the online help
self.help_action = QAction(icon, 'CenIsere_AutoMap', iface.mainWindow())
iface.pluginHelpMenu().addAction(self.help_action)
self.help_action.triggered.connect(self.open_help)
if not self.canvas_editor:
self.canvas_editor = AutoMap_Editor()
self.automap_action = QAction(icon, 'CenIsere_AutoMap',None)
self.toolBar.addAction(self.automap_action)
self.automap_action.triggered.connect(self.open_editor)
# '''
# if not self.locator_filter:
# self.locator_filter = LocatorFilter(iface)
# iface.registerLocatorFilter(self.locator_filter)
# @staticmethod
# def check_invalid_connection_names():
# """ Check for invalid connection names in the QgsSettings. """
# valid, invalid = validate_connections_names()
# n_invalid = len(invalid)
# if n_invalid == 0:
# return
# invalid_text = ', '.join(invalid)
# msg = QMessageBox()
# msg.setIcon(QMessageBox.Warning)
# msg.setWindowTitle(tr('PgMetadata: Database connection(s) not available'))
# msg.setText(tr(
# f'{n_invalid} connection(s) listed in PgMetadata’s settings are invalid or '
# f'no longer available: {invalid_text}'))
# msg.setInformativeText(tr(
# 'Do you want to remove these connection(s) from the PgMetadata settings? '
# '(You can also do this later with the “Set Connections” tool.)'))
# msg.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
# clicked = msg.exec()
# if clicked == QMessageBox.Yes:
# iface.messageBar().pushSuccess('PgMetadata', tr(f'{n_invalid} invalid connection(s) removed.'))
# store_connections(valid)
# if clicked == QMessageBox.No:
# iface.messageBar().pushInfo('PgMetadata', tr(f'Keeping {n_invalid} invalid connections.'))
# '''
def open_about_dialog(self):
"""
About dialog
"""
dialog = AutoMapAboutDialog(iface)
dialog.exec_()
def open_help():
""" Open the online help. """
# QDesktopServices.openUrl(QUrl('https://plateformesig.CenIsere-outils.org/'))
def open_editor(self):
self.canvas_editor.show()
self.canvas_editor.raise_()
def unload(self):
""" Unload the plugin. """
if self.canvas_editor:
iface.removePluginMenu('CenIsere_AutoMap',self.automap_action)
if self.provider:
QgsApplication.processingRegistry().removeProvider(self.provider)
del self.provider
if self.locator_filter:
iface.deregisterLocatorFilter(self.locator_filter)
del self.locator_filter
if self.help_action:
iface.pluginHelpMenu().removeAction(self.help_action)
del self.help_action
+1
View File
@@ -0,0 +1 @@
# CenIsere_AutoMap
+10
View File
@@ -0,0 +1,10 @@
__copyright__ = "Copyright 2021, 3Liz"
__license__ = "GPL version 3"
__email__ = "info@3liz.org"
# noinspection PyPep8Naming
def classFactory(iface): # pylint: disable=invalid-name
_ = iface
from CenIsere_AUTOMAP.CenIsere_AutoMap import PgAutoMap
return PgAutoMap()
+46
View File
@@ -0,0 +1,46 @@
import os.path
from pathlib import Path
from qgis.PyQt import uic
from qgis.PyQt.QtGui import QPixmap
from qgis.PyQt.QtWidgets import QDialog
from .tools.resources import devlog
ABOUT_FORM_CLASS, _ = uic.loadUiType(
os.path.join(
str(Path(__file__).resolve().parent),
'tools/ui',
'CenIsere_AutoMap_about_form.ui'
)
)
class AutoMapAboutDialog(QDialog, ABOUT_FORM_CLASS):
""" About - Let the user display the about dialog. """
def __init__(self, iface, parent=None):
super().__init__(parent)
self.iface = iface
self.setupUi(self)
self.viewer.setHtml(devlog('CenIsere_AUTOMAP'))
self.rejected.connect(self.onReject)
self.buttonBox.rejected.connect(self.onReject)
self.buttonBox.accepted.connect(self.onAccept)
def onAccept(self):
"""
Save options when pressing OK button
"""
self.accept()
def onReject(self):
"""
Run some actions when
the user closes the dialog
"""
self.close()
+780
View File
@@ -0,0 +1,780 @@
import logging
import os
from PyQt5.QtCore import QSettings
from collections import namedtuple
from enum import Enum
from functools import partial
from pathlib import Path
from xml.dom.minidom import parseString
from qgis.gui import *
import qgis
from qgis.core import (
NULL,
QgsApplication,
QgsScaleBarSettings,
QgsDataSourceUri,
QgsProject,
QgsProviderConnectionException,
QgsProviderRegistry,
QgsRasterLayer,
QgsSettings,
QgsVectorLayer,
QgsGeometry,
QgsPrintLayout,
QgsReadWriteContext,
QgsLayoutItemMap,
QgsLayoutItemPage,
QgsLayoutSize,
QgsUnitTypes,
QgsLayoutPoint,
QgsLayoutItemLabel,
QgsLayoutItemPicture,
QgsLayoutItemLegend,
QgsLegendStyle,
QgsLayoutItemScaleBar,
QgsLayerTreeGroup,
QgsCoordinateReferenceSystem,
QgsCoordinateTransform,
QgsLayerTree,
QgsLayoutTableColumn,
QgsRectangle,
QgsLayoutItemMapOverviewStack,
)
from qgis.PyQt.QtCore import QLocale, QUrl, QDateTime, Qt
from qgis.PyQt.QtGui import QDesktopServices, QIcon, QColor, QFont, QMovie
from qgis.PyQt.QtPrintSupport import QPrinter
from qgis.PyQt.QtWebKitWidgets import QWebPage
from qgis.PyQt.QtWidgets import (
QDialog,
QAction,
QDockWidget,
QFileDialog,
QInputDialog,
QMenu,
QToolButton,
QTableWidget,
QTableWidgetItem,
QVBoxLayout,
)
from qgis.PyQt.QtXml import QDomDocument
from qgis.utils import iface
import glob
from .tools.resources import (
load_ui,
resources_path,
# login_base,
send_issues,
)
from .tools.mises_en_pages.canvas import (fletch_canvas)
from .issues import CenIsere_Issues
from datetime import date
EDITOR_CLASS = load_ui('CenIsere_AutoMap_base.ui')
LOGGER = logging.getLogger('CenIsere_AutoMap')
url_osm = 'https://osm.datagrandest.fr/mapcache/?crs=EPSG:2154&featureCount=10&format=image/png&layers=pure&maxHeight=256&maxWidth=256&styles=&url=https://osm.datagrandest.fr/mapcache'
url_ortho = 'http://tiles.craig.fr/ortho/service/?crs=EPSG:2154&featureCount=10&format=image/jpeg&layers=ortho&maxHeight=256&maxWidth=256&styles=&url=http://tiles.craig.fr/ortho/service'
url_mnt = 'http://tiles.craig.fr/mnt/crs=EPSG:2154&featureCount=10&format=image/png&layers=relief&maxHeight=256&maxWidth=256&styles=&url=http://tiles.craig.fr/mnt'
url_pente = 'http://tiles.craig.fr/mnt/crs=EPSG:2154&featureCount=10&format=image/png&layers=pente&maxHeight=256&maxWidth=256&styles=&url=http://tiles.craig.fr/mnt'
data_source = [
'CEN Isère',
'CEN-RA',
'IGN',
'CRAIG',
'OpenStreetMap',
'Sandre',
'BRGM',
'MUSÉUM NATIONAL D’HISTOIRE NATURELLE',
"Muséum national d'Histoire naturelle",
'ONF',
'20xx LPO',
'ofb.gouv.fr',
'Stamen Design',
'MTES',
'MTES',
'FEDER',
'DREAL Auvergne-Rhône-Alpes',
'INSEE',
'DGFiP',
'Fédération des Conservatoires d’espaces naturels',
'Plan cadastral informatisé - Etalab - juillet 202X',
'Parcellaire Express - IGN - 202X',
]
class AutoMap_Editor(QDialog, EDITOR_CLASS):
def __init__(self, parent=None):
_ = parent
super().__init__()
self.setupUi(self)
self.settings = QgsSettings()
self.s = QSettings()
path = ''
ix = 0
plugin_dir = str(os.path.dirname(os.path.abspath(__file__))).split(os.sep)
for i in plugin_dir[1:]:
ix = ix+1
path = path+'/'+i
self.tabWidget.setStyleSheet('background-image: url('+path+'/tools/bg/Capture.png);')
self.commandLinkButton.clicked.connect(self.chargement_qpt)
self.radioButton_9.clicked.connect(self.statu_atlas)
self.radioButton_10.clicked.connect(self.statu_source)
self.radioButton_11.clicked.connect(self.statu_map)
self.radioButton_13.clicked.connect(self.statu_titre)
self.comboBox_2.currentIndexChanged.connect(self.field_list)
self.comboBox_7.currentIndexChanged.connect(self.update_subtitle)
self.commandLinkButton_2.clicked.connect(self.load_ortho)
self.commandLinkButton_3.clicked.connect(self.load_osm)
self.CustomeLogo.clicked.connect(self.deflogoteck)
## On ajoute le nom des templates à la liste déroulante de l'onglet "mises en page" :
mises_en_page = []
for filename in glob.glob(resources_path("mises_en_pages","*.qpt")):
if filename.split("/")[-1] == "modele_carto.qpt":
continue
mises_en_page.append(filename)
mises_en_page.sort()
for i, filename in enumerate(mises_en_page):
nom_fichier = os.path.basename(filename)
self.comboBox.addItem(nom_fichier)
self.comboBox.setCurrentIndex(1)
self.template_parameters = {
'map_size': None,
'map_position' : None,
'position_map_size' : None,
'position_map_position' : None,
'title_position': None,
'title_size': None,
'subtitle_position': None,
'subtitle_size': None,
'logo_position': None,
'logo_size': None,
'legend_position': None,
'legend_size': None,
'scalebarnumeric_position':None,
'scalebarnumeric_size':None,
'scalebar_position': None,
'scalebar_size': None,
'north_position': None,
'north_size': None,
'credit_text_position': None,
'credit_text_size': None,
'credit_text2_position': None,
'credit_text2_size': None,
'image_size':None,
'image_position':None,
'image_size_2':None,
'image_position_2':None,
# Add more variables as needed
}
self.update_logo_library()
self.mComboBox_3.addItems(sorted(data_source))
self.hide_map()
self.hide_titre()
self.hide_source()
self.hide_atlas()
def update_logo_library(self):
self.mComboBox_4.clear()
logo_library = []
custome_bibliotech = glob.glob(self.s.value("automap/logoteck", 1, type=str)+'*.*')
for l,logo_x in enumerate(custome_bibliotech):
logo_library.append(' '+os.path.basename(logo_x))
bibliotech_png = glob.glob(resources_path("logo_library","*.png"))
bibliotech_jpeg = glob.glob(resources_path("logo_library","*.jpg"))
bibliotech = [*bibliotech_png, *bibliotech_jpeg]
for l,logo_x in enumerate(bibliotech):
logo_library.append(os.path.basename(logo_x))
self.mComboBox_4.addItems(sorted(logo_library))
def select_file(self):
options = QFileDialog.Options()
options |= QFileDialog.ShowDirsOnly
folder = QFileDialog.getExistingDirectory(self, "Sélection du dossier parent", options=options)
return folder+'/'
def deflogoteck(self):
folder = self.select_file()
logopath = folder
self.s.setValue("automap/logoteck", str(logopath))
self.update_logo_library()
def update_subtitle(self):
project_subtitle = QgsProject.instance()
if self.radioButton_13.isChecked() == 1:
if self.comboBox_7.currentText() != "":
try:
layout_subtitle = project_subtitle.layoutManager().layoutByName(self.comboBox_7.currentText())
self.lineEdit_3.setText(layout_subtitle.itemById("SubTitle").text())
except:
print("")
def load_ortho(self):
global myGroup,last_group
runing = False
try: myGroup
except NameError: runing = True
try: last_group
except NameError: last_group = ''
if runing or (last_group != '' and last_group != 'ortho'):
layername = False
layerAll = QgsProject.instance().layerTreeRoot().children()
xl = 0
for layeritem in layerAll:
if layeritem.name() == 'SuperFont':
myGroup = layerAll[xl]
layername = True
xl = xl+1
if layername:
(QgsProject.instance().layerTreeRoot()).removeChildNode(myGroup)
runing = True
if runing or last_group != 'ortho':
myGroup = (QgsProject.instance().layerTreeRoot()).addGroup("SuperFont")
last_group = 'ortho'
#OSM_RASTER = QgsRasterLayer(url_osm, 'OpenStreetMap Backgound', 'wms')
ORTHO_RASTER = QgsRasterLayer(url_ortho, 'Orthophoto AURA', 'wms')
MNT_RASTER = QgsRasterLayer(url_mnt, 'MNT RGE Alti (<= 1:100000)', 'wms')
PENTE_RASTER = QgsRasterLayer(url_pente, 'Pente RGE Alti 0 à 90°(<= 1:100000)', 'wms')
#OSM_RASTER.loadNamedStyle(resources_path("font","osm_background.qml"))
ORTHO_RASTER.loadNamedStyle(resources_path("font","ortho_aura.qml"))
MNT_RASTER.loadNamedStyle(resources_path("font","mnt_alti.qml"))
#QgsProject.instance().addMapLayer(OSM_RASTER,False)
QgsProject.instance().addMapLayer(ORTHO_RASTER,False)
QgsProject.instance().addMapLayer(MNT_RASTER,False)
QgsProject.instance().addMapLayer(PENTE_RASTER,False)
#myGroup.addLayer(OSM_RASTER)
myGroup.addLayer(ORTHO_RASTER)
myGroup.addLayer(MNT_RASTER)
myGroup.addLayer(PENTE_RASTER)
def load_osm(self):
global myGroup,last_group
runing = False
try: myGroup
except NameError: runing = True
try: last_group
except NameError: last_group = ''
if runing or (last_group != '' and last_group != 'osm'):
layername = False
layerAll = QgsProject.instance().layerTreeRoot().children()
xl = 0
for layeritem in layerAll:
if layeritem.name() == 'SuperFont':
myGroup = layerAll[xl]
layername = True
xl = xl+1
if layername:
(QgsProject.instance().layerTreeRoot()).removeChildNode(myGroup)
runing = True
if runing or last_group != 'osm':
myGroup = (QgsProject.instance().layerTreeRoot()).addGroup("SuperFont")
last_group = 'osm'
OSM_RASTER = QgsRasterLayer(url_osm, 'OpenStreetMap Backgound', 'wms')
#ORTHO_RASTER = QgsRasterLayer(url_ortho, 'Orthophoto AURA', 'wms')
MNT_RASTER = QgsRasterLayer(url_mnt, 'MNT RGE Alti (<= 1:100000)', 'wms')
PENTE_RASTER = QgsRasterLayer(url_pente, 'Pente RGE Alti 0 à 90°(<= 1:100000)', 'wms')
OSM_RASTER.loadNamedStyle(resources_path("font","osm_background.qml"))
#ORTHO_RASTER.loadNamedStyle(resources_path("font","ortho_aura.qml"))
MNT_RASTER.loadNamedStyle(resources_path("font","mnt_alti.qml"))
QgsProject.instance().addMapLayer(OSM_RASTER,False)
#QgsProject.instance().addMapLayer(ORTHO_RASTER,False)
QgsProject.instance().addMapLayer(MNT_RASTER,False)
QgsProject.instance().addMapLayer(PENTE_RASTER,False)
myGroup.addLayer(OSM_RASTER)
#myGroup.addLayer(ORTHO_RASTER)
myGroup.addLayer(MNT_RASTER)
myGroup.addLayer(PENTE_RASTER)
def raise_(self):
self.activateWindow()
self.mComboBox_2.clear()
self.comboBox_2.clear()
self.comboBox_3.clear()
self.comboBox_4.clear()
self.comboBox_5.clear()
self.comboBox_6.clear()
self.comboBox_7.clear()
couches = []
couche_vecteur = ['']
mapThemes = ['']
titrePage = ['']
for lyr in QgsProject.instance().mapLayers().values():
if isinstance(lyr, QgsVectorLayer):
couche_vecteur.append(lyr.name())
couches.append(lyr.name())
for mapThemesCollection in (QgsProject.instance().mapThemeCollection()).mapThemes():
mapThemes.append(mapThemesCollection)
for layoutTitre in (QgsProject.instance().layoutManager().layouts()):
titrePage.append(layoutTitre.name())
self.comboBox_2.addItems(sorted(couche_vecteur))
self.mComboBox_2.addItems(sorted(couches))
self.comboBox_5.addItems(sorted(mapThemes))
self.comboBox_6.addItems(sorted(mapThemes))
self.comboBox_7.addItems(sorted(titrePage))
def statu_map(self):
if self.radioButton_11.isChecked() == 1:
self.show_map()
else:
self.hide_map()
def show_map(self):
self.groupBox_3.setEnabled(True)
self.groupBox_3.show()
def hide_map(self):
self.groupBox_3.setEnabled(False)
self.groupBox_3.hide()
def statu_titre(self):
if self.radioButton_13.isChecked() == 1:
self.show_titre()
else:
self.hide_titre()
def show_titre(self):
self.lineEdit_2.setEnabled(False)
self.lineEdit_2.hide()
self.comboBox_7.setEnabled(True)
self.comboBox_7.show()
def hide_titre(self):
self.lineEdit_2.setEnabled(True)
self.lineEdit_2.show()
self.comboBox_7.setEnabled(False)
self.comboBox_7.hide()
def statu_source(self):
if self.radioButton_10.isChecked() == 1:
self.show_source()
else:
self.hide_source()
def show_source(self):
self.lineEdit_4.setEnabled(False)
self.lineEdit_4.hide()
self.mComboBox_3.setEnabled(True)
self.mComboBox_3.show()
def hide_source(self):
self.lineEdit_4.setEnabled(True)
self.lineEdit_4.show()
self.mComboBox_3.setEnabled(False)
self.mComboBox_3.hide()
def statu_atlas(self):
if self.radioButton_9.isChecked() == 1:
self.show_atlas()
else:
self.hide_atlas()
def show_atlas(self):
self.groupBox.setEnabled(True)
self.groupBox.show()
def hide_atlas(self):
self.groupBox.setEnabled(False)
self.groupBox.hide()
def field_list(self):
fields = []
self.comboBox_3.clear()
self.comboBox_4.clear()
if self.comboBox_2.currentText() != '':
layer = QgsProject.instance().mapLayersByName(self.comboBox_2.currentText())[0]
#BUG sur layer.fields() pas défini sur ce qui est pas vecteur
for vfields in layer.fields():
fields.append(vfields.name())
self.comboBox_3.addItems(sorted(fields))
self.comboBox_4.addItems(sorted(fields))
def chargement_qpt(self):
project = QgsProject.instance()
self.manager = project.layoutManager()
if self.radioButton_13.isChecked() == 1:
layout_name = self.comboBox_7.currentText()
else:
layout_name = self.lineEdit_2.text()
layouts_list = self.manager.printLayouts()
for filename in glob.glob(resources_path("mises_en_pages","*.qpt")):
with open(os.path.join(os.getcwd(), filename), 'r') as f:
self.layout = QgsPrintLayout(project)
self.layout.initializeDefaults()
myAtlas=self.layout.atlas()
template_content = f.read()
doc = QDomDocument()
doc.setContent(template_content)
self.layout.loadFromTemplate(doc, QgsReadWriteContext(), True)
self.layout.setName(layout_name)
if True:#os.path.basename(filename) == "1. Modèle carto standard (consolidé).qpt":
self.actualisation_mise_en_page()
## Add map to layout
self.map_modele_test = QgsLayoutItemMap(self.layout)
# Charger une carte vide
self.map_modele_test.setRect(20, 20, 20, 20)
# Mettre le canvas courant comme emprise
self.map_modele_test.setExtent(iface.mapCanvas().extent())
# Position de la carte dans le composeur
self.map_modele_test.attemptMove(self.template_parameters['map_position'])
# on dimensionne le rendu de la carte (pour référence la page totale est une page A4 donc 297*210)
self.map_modele_test.attemptResize(self.template_parameters['map_size'])
self.map_modele_test.setKeepLayerSet(True)
self.map_modele_test.setKeepLayerStyles(True)
if self.radioButton_11.isChecked() == 1:
self.map_modele_test.setKeepLayerSet(False)
self.map_modele_test.setKeepLayerStyles(False)
self.map_modele_test.setFollowVisibilityPreset(True)
self.map_modele_test.setFollowVisibilityPresetName(self.comboBox_5.currentText())
if self.radioButton_12.isChecked() == 1:
self.position_map = QgsLayoutItemMap(self.layout)
self.position_map.setRect(20, 20, 20, 20)
self.position_map.setExtent(QgsRectangle(641552,6647386, 995856,6331104))
self.position_map.setFollowVisibilityPreset(True)
self.position_map.setFollowVisibilityPresetName(self.comboBox_6.currentText())
self.position_map.attemptMove(self.template_parameters['position_map_position'])
self.position_map.attemptResize(self.template_parameters['position_map_size'])
overviewitem = QgsLayoutItemMapOverviewStack(self.position_map)
map_overview = self.position_map.overview()
map_overview.setLinkedMap(self.map_modele_test)
map_overview.setCentered(True)
overviewitem.addOverview(map_overview)
self.position_map.refresh()
self.map_modele_test.setFrameEnabled(False)
self.layout.addLayoutItem(self.position_map)
self.position_map.setId("carte_position")
self.map_modele_test.refresh()
self.map_modele_test.setBackgroundColor(QColor(255, 255, 255, 255))
self.map_modele_test.setFrameEnabled(False)
if self.radioButton_9.isChecked() == 1:
self.map_modele_test.setAtlasDriven(True)
self.layout.addLayoutItem(self.map_modele_test)
self.map_modele_test.setId("carte_principale")
if self.comboBox.currentText() == "3. Modèle carto standard Cen Isere.qpt":
# Ajout de la vague haute
image1 = QgsLayoutItemPicture(self.layout)
image1.setPicturePath(resources_path("mises_en_pages","vague.png"))
image1.attemptMove(self.template_parameters['image_position'])
image1.attemptResize(self.template_parameters['image_size'])
self.layout.addLayoutItem(image1)
image1.setMode(QgsLayoutItemPicture.FormatRaster)
# Ajout de la vague basse
image2 = QgsLayoutItemPicture(self.layout)
image2.setPicturePath(resources_path("mises_en_pages","vague2.png"))
image2.attemptMove(self.template_parameters['image_position_2'])
image2.attemptResize(self.template_parameters['image_size_2'])
self.layout.addLayoutItem(image2)
image2.setMode(QgsLayoutItemPicture.FormatRaster)
## Ajout d'un titre à la mise en page
title = QgsLayoutItemLabel(self.layout)
self.layout.addLayoutItem(title)
titre = layout_name
title.setText(titre)
title.setFont(QFont("Museo 700", 15, QFont.Bold))
title.setFontColor(QColor(62, 62, 62, 24))
title.attemptMove(self.template_parameters['title_position'])
title.attemptResize(self.template_parameters['title_size'])
title.setBackgroundEnabled(True)
title.setBackgroundColor(QColor(255, 255, 255, 130))
self.layout.addItem(title)
# title.adjustSizeToText() on n'utilise plutot setFixedSize pour pouvoir centrer le titre de manière plus optimale ici
title.setHAlign(Qt.AlignHCenter)
title.setVAlign(Qt.AlignVCenter)
## Ajout d'un sous titre à la mise en page
subtitle = QgsLayoutItemLabel(self.layout)
self.layout.addLayoutItem(subtitle)
titre = self.lineEdit_3.text()
if self.radioButton_9.isChecked() == 1:
titre = titre + ' [%' + self.comboBox_4.currentText() + '%]'
subtitle.setText(titre)
subtitle.setFont(QFont("Calibri", 10))
subtitle.setFontColor(QColor(0, 69, 148, 58))
subtitle.attemptMove(self.template_parameters['subtitle_position'])
subtitle.attemptResize(self.template_parameters['subtitle_size'])
subtitle.setId("SubTitle")
subtitle.setBackgroundEnabled(True)
subtitle.setBackgroundColor(QColor(255, 255, 255, 130))
self.layout.addItem(subtitle)
subtitle.setHAlign(Qt.AlignHCenter)
subtitle.setVAlign(Qt.AlignVCenter)
## Ajout du logo CEN NA en haut à gauche de la page
logo = QgsLayoutItemPicture(self.layout)
logo.setResizeMode(QgsLayoutItemPicture.Zoom)
logo.setMode(QgsLayoutItemPicture.FormatRaster)
logo.attemptMove(self.template_parameters['logo_position'])
logo.setFixedSize(self.template_parameters['logo_size'])
logo.setPicturePath(resources_path("icons","CEN38.jpg"))
logo.setId('logo')
self.layout.addLayoutItem(logo)
## Ajout de la legende :
legend = QgsLayoutItemLegend(self.layout)
legend.setId('legende_model1')
# legend.setTitle('Legende')
legend.adjustBoxSize()
legend.setFrameEnabled(False)
legend.setAutoUpdateModel(False)
legend.setLinkedMap(self.map_modele_test)
checked_items = self.mComboBox_2.checkedItems()
self.layout.addItem(legend)
# group_name = 'Périmètres écologiques' # Name of a group in your legend
layers_to_remove = []
for lyr in project.mapLayers().values():
if lyr.name() not in checked_items:
layers_to_remove.append(lyr.name())
# the layer tree
root = project.layerTreeRoot()
# get legend
legend = [i for i in self.layout.items() if isinstance(i, QgsLayoutItemLegend)][0]
# disable auto-update
legend.setAutoUpdateModel(False)
legend.setLegendFilterByMapEnabled(True)
# legend model
model = legend.model()
# the root legend group
root_group = model.rootGroup()
# loop through layer names
for layer_name in layers_to_remove:
# find layer in project
layer = project.mapLayersByName(layer_name)[0]
# get layer tree layer instance of layer
layertreelayer = root.findLayer(layer.id())
# get the parent of the layer tree layer (layer tree root, or group)
parent = layertreelayer.parent()
# if the parent is a group and has a name, find it and remove the layer
if isinstance(parent, QgsLayerTreeGroup) and parent.name():
group = root_group.findGroup(parent.name())
group.removeLayer(layer)
# remove layers that are not in a group
else:
root_group.removeLayer(layer)
legend.setEqualColumnWidth(True)
legend.setSplitLayer(True)
legend.setColumnSpace(5)
legend.setTitle('Légende')
legend.rstyle(QgsLegendStyle.Title).setMargin(1.5) # 1 mm
legend.rstyle(QgsLegendStyle.Title).setFont(QFont("Calibri", 12,QFont.Bold))
legend.rstyle(QgsLegendStyle.Group).setMargin(QgsLegendStyle.Top, 3)
legend.rstyle(QgsLegendStyle.Group).setFont(QFont("Calibri", 10))
legend.rstyle(QgsLegendStyle.Subgroup).setMargin(QgsLegendStyle.Top, 3)
legend.rstyle(QgsLegendStyle.Subgroup).setFont(QFont("Calibri", 10,QFont.Bold))
legend.rstyle(QgsLegendStyle.SymbolLabel).setFont(QFont("Calibri", 10))
legend.setColumnCount(self.spinBox.value())
legend.adjustBoxSize()
legend.setBackgroundEnabled(True)
legend.setBackgroundColor(QColor(255, 255, 255, 130))
self.layout.refresh()
legend.updateLegend()
legend.attemptMove(self.template_parameters['legend_position'])
## Ajout de l'échelle numeric à la mise en page
self.scalebarnumeric_qpt = QgsLayoutItemScaleBar(self.layout)
self.scalebarnumeric_qpt.setStyle('Numeric')
self.scalebarnumeric_qpt.setLinkedMap(self.map_modele_test)
self.scalebarnumeric_qpt.applyDefaultSize()
# self.scalebarnumeric_qpt.applyDefaultSettings()
self.scalebarnumeric_qpt.setNumberOfSegments(2)
self.scalebarnumeric_qpt.setNumberOfSegmentsLeft(0)
self.scalebarnumeric_qpt.attemptMove(self.template_parameters['scalebarnumeric_position'])
self.scalebarnumeric_qpt.attemptResize(self.template_parameters['scalebarnumeric_size'])
self.scalebarnumeric_qpt.setAlignment(QgsScaleBarSettings.Alignment(1))
self.scalebarnumeric_qpt.setFont(QFont("Calibri", 10))
self.scalebarnumeric_qpt.setBackgroundEnabled(True)
self.scalebarnumeric_qpt.setBackgroundColor(QColor(255, 255, 255, 130))
self.layout.addLayoutItem(self.scalebarnumeric_qpt)
## Ajout de l'échelle à la mise en page
self.scalebar_qpt = QgsLayoutItemScaleBar(self.layout)
self.scalebar_qpt.setStyle('Single Box')
self.scalebar_qpt.setLinkedMap(self.map_modele_test)
self.scalebar_qpt.applyDefaultSize()
self.scalebar_qpt.applyDefaultSettings()
self.scalebar_qpt.setNumberOfSegments(2)
self.scalebar_qpt.setNumberOfSegmentsLeft(0)
self.scalebar_qpt.attemptMove(self.template_parameters['scalebar_position'])
self.scalebar_qpt.attemptResize(self.template_parameters['scalebar_size'])
self.scalebar_qpt.setAlignment(QgsScaleBarSettings.Alignment(1))
self.scalebar_qpt.setFont(QFont("Calibri", 10))
self.scalebar_qpt.setBackgroundEnabled(True)
self.scalebar_qpt.setBackgroundColor(QColor(255, 255, 255, 130))
self.layout.addLayoutItem(self.scalebar_qpt)
# self.scalebar_qpt.setFixedSize(QgsLayoutSize(55, 15))
# ajout de la fleche du Nord
north = QgsLayoutItemPicture(self.layout)
north.setPicturePath(resources_path("mises_en_pages","NorthArrow_02.svg"))
self.layout.addLayoutItem(north)
north.attemptMove(self.template_parameters['north_position'])
north.attemptResize(self.template_parameters['north_size'])
if self.radioButton_10.isChecked() == 1:
info_text = ["Source : ©" + ', ©'.join(self.mComboBox_3.checkedItems())][0]
else:
info_text = ["Source : ©" + self.lineEdit_4.text()][0]
# ajout note info:
info = ["Réalisation : " + "CEN Isère (" + date.today().strftime(
"%d/%m/%Y") + ")"]
credit_text = QgsLayoutItemLabel(self.layout)
credit_text.setText(info[0])
credit_text.setFont(QFont("Calibri", 9))
credit_text.setHAlign(Qt.AlignRight)
credit_text.setVAlign(Qt.AlignVCenter)
credit_text.setItemRotation(-90)
credit_text.setBackgroundEnabled(True)
credit_text.setBackgroundColor(QColor(255, 255, 255, 30))
credit_text2 = QgsLayoutItemLabel(self.layout)
credit_text2.setText(info_text)
credit_text2.setFont(QFont("Calibri", 9))
credit_text2.setHAlign(Qt.AlignRight)
credit_text2.setVAlign(Qt.AlignVCenter)
credit_text.attemptMove(self.template_parameters['credit_text_position'])
credit_text.attemptResize(self.template_parameters['credit_text_size'])
credit_text2.attemptMove(self.template_parameters['credit_text2_position'])
credit_text2.attemptResize(self.template_parameters['credit_text2_size'])
self.layout.addLayoutItem(credit_text)
self.layout.addLayoutItem(credit_text2)
## Ajout du logo credit en bas à droit de la page
for logo_run in self.mComboBox_4.checkedItems():
logo_credit = QgsLayoutItemPicture(self.layout)
logo_credit.setResizeMode(QgsLayoutItemPicture.Zoom)
logo_credit.setMode(QgsLayoutItemPicture.FormatRaster)
cur_x = self.template_parameters['logo_credit_position'].x()
logo_credit.attemptMove(self.template_parameters['logo_credit_position'])
logo_credit.setPictureAnchor(4)
self.template_parameters['logo_credit_position'].setX(cur_x+51)
logo_credit.setFixedSize(self.template_parameters['logo_credit_size'])
if logo_run[0] == ' ':
logo_credit.setPicturePath(self.s.value("automap/logoteck", 1, type=str)+logo_run[1:])
else:
logo_credit.setPicturePath(resources_path("logo_library",logo_run))
logo_credit.setId('logo_'+logo_run)
logo_credit.setBackgroundEnabled(True)
logo_credit.setBackgroundColor(QColor(255, 255, 255, 130))
self.layout.addLayoutItem(logo_credit)
# credit_text.attemptResize(QgsLayoutSize(95, 5, QgsUnitTypes.LayoutMillimeters))
self.bar_echelle_auto(iface.mapCanvas(), self.scalebar_qpt)
existing_layout = project.layoutManager().layoutByName(self.layout.name())
if existing_layout:
if self.radioButton_12.isChecked() != 1:
project.layoutManager().removeLayout(existing_layout)
result = project.layoutManager().addLayout(self.layout)
self.manager.addLayout(self.layout)
if self.radioButton_9.isChecked() == 1:
self.layout.atlas().setEnabled(True)
cover_layer = QgsProject.instance().mapLayersByName(self.comboBox_2.currentText())[0]
self.layout.atlas().setCoverageLayer(cover_layer)
self.layout.atlas().setPageNameExpression(self.comboBox_4.currentText())
fichier_mise_en_page = layout_name
layout_modifie = QgsProject.instance().layoutManager().layoutByName(fichier_mise_en_page)
iface.openLayoutDesigner(layout_modifie)
self.close()
def actualisation_mise_en_page(self):
A4_size = {'Portrait':{'RIGHT':210,'LEFT':0,'TOP':0,'BOTTOM':297},'Landscape':{'RIGHT':297,'LEFT':0,'TOP':0,'BOTTOM':210}}
A3_size = {'Portrait':{'RIGHT':298,'LEFT':0,'TOP':0,'BOTTOM':420},'Landscape':{'RIGHT':420,'LEFT':0,'TOP':0,'BOTTOM':298}}
values_page = self.comboBox.currentText()
if self.radioButton_6.isChecked() and self.radioButton_7.isChecked():
pc = self.layout.pageCollection()
pc.pages()[0].setPageSize('A4', QgsLayoutItemPage.Portrait)
if self.radioButton_6.isChecked() and self.radioButton_8.isChecked():
pc = self.layout.pageCollection()
pc.pages()[0].setPageSize('A4', QgsLayoutItemPage.Landscape)
if self.radioButton_5.isChecked() and self.radioButton_7.isChecked():
pc = self.layout.pageCollection()
pc.pages()[0].setPageSize('A3', QgsLayoutItemPage.Portrait)
if self.radioButton_5.isChecked() and self.radioButton_8.isChecked():
pc = self.layout.pageCollection()
pc.pages()[0].setPageSize('A3', QgsLayoutItemPage.Landscape)
self.template_parameters = fletch_canvas(self,values_page)
def bar_echelle_auto(self, echelle, bar_echelle):
if True:
if echelle.scale() >= 20000:
bar_echelle.setUnits(QgsUnitTypes.DistanceKilometers)
bar_echelle.setUnitLabel("km")
bar_echelle.setUnitsPerSegment(round((echelle.scale()*0.02)/1000))
else:
bar_echelle.setUnits(QgsUnitTypes.DistanceMeters)
bar_echelle.setUnitLabel("m")
bar_echelle.setUnitsPerSegment(round(echelle.scale()*0.02))
bar_echelle.update()

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

+89
View File
@@ -0,0 +1,89 @@
import os
plugin_dir = os.path.dirname(__file__)
end_find = plugin_dir.rfind('\\')+1
NAME = plugin_dir[end_find:]
#print(NAME)
from qgis.gui import *
from qgis.core import (
NULL,
QgsApplication,
QgsDataSourceUri,
QgsProject,
QgsProviderConnectionException,
QgsProviderRegistry,
QgsRasterLayer,
QgsSettings,
QgsVectorLayer,
QgsGeometry,
)
from qgis.PyQt.QtWidgets import (
QDialog,
QAction,
QDockWidget,
QFileDialog,
QInputDialog,
QMenu,
QToolButton,
QTableWidget,
QTableWidgetItem,
)
from qgis.utils import iface
from .tools.resources import (
load_ui,
resources_path,
send_issues,
)
EDITOR_CLASS = load_ui('CenIsere_IssuesSend.ui')
class CenIsere_Issues(QDialog, EDITOR_CLASS):
def __init__(self, parent=None):
_ = parent
super().__init__()
self.setupUi(self)
self.settings = QgsSettings()
#place connect here
self.annuler_button.clicked.connect(self.close)
self.ok_button.clicked.connect(self.run_sendissues)
def run_sendissues(self):
text_titre = self.titre_line.text()
text_message = self.messages_plain.toPlainText()
statu_bug = self.check_bug.isChecked()
statu_aide = self.check_aide.isChecked()
statu_question = self.check_question.isChecked()
statu_amelioration = self.check_amelioration.isChecked()
statu_autre = self.check_autre.isChecked()
statu = []
if statu_bug == True : statu = statu + [1]
if statu_aide == True : statu = statu + [3]
if statu_question == True : statu = statu + [5]
if statu_amelioration == True : statu = statu + [2]
if statu_autre == True : statu = statu + [6]
if len(statu) >= 1:
import qgis
url = qgis.utils.pluginMetadata(NAME,'tracker')
print(text_message)
send_info = send_issues(url,text_titre,text_message,statu)
code = send_info.status_code
print(code)
else:
code = 423
if code == 201:
iface.messageBar().pushMessage("Envoyer :", "Votre messages à bien été envoyer.", level=Qgis.Success, duration=20)
self.close()
elif code == 422:
iface.messageBar().pushMessage("Erreur :", "Erreur dans le contenu du messages.", level=Qgis.Critical, duration=20)
elif code == 423:
iface.messageBar().pushMessage("Erreur :", "Pas de sujet sélectionné.", level=Qgis.Critical, duration=20)
elif code == 404:
iface.messageBar().pushMessage("Missing :", "Le serveur de messagerie est injoignable.", level=Qgis.Warning, duration=20)
+48
View File
@@ -0,0 +1,48 @@
# This file contains metadata for your plugin.
# This file should be included when you package your plugin.# Mandatory items:
[general]
name=CenIsere_AutoMap
qgisMinimumVersion=3.0
description=CenIsere_AutoMap
version=1.6
author=Conservatoire d'Espaces Naturels Isère
about=Outils de création de mise en page prédéfinis pour simplifier et organiser cette étape.
repository=https://gitea.cenra-outils.org/CEN38/Plugin_QGIS
#homepage=https://plateformesig.cenra-outils.org/
tracker=https://gitea.cenra-outils.org/api/v1/repos/CEN38/Plugin_QGIS/issues
# End of mandatory metadata
# Recommended items:
hasProcessingProvider=no
# Uncomment the following line and add your changelog:
changelog=<h2>CenIsere_AutoMap:</h2></br><p><h3>07/10/2024 - Version 1.6: </h3> - Option de bibliotheque de logo custome.</p></br><p><h3>03/10/2024 - Version 1.5: </h3> - Remonte la fênetre dans la pille.</br> - Gestion du nombre de colonne dans la légend.</br></p></br><p><h3>02/10/2024 - Version 1.4: </h3> - Mise en page plein écrant.</br></p></br><p><h3>01/10/2024 - Version 1.3: </h3> - Récupération du titre et sous-titre pour mise en page existente.</br> - Integration de bibliotheque de logo.</br> - Integration de gestionaire pour les source de donnée.</br> - Mise en place d'une bar d'echelle adaptative. </br></p></br><p><h3>30/09/2024 - Version 1.2: </h3> - Activation du thème. </br> - Ajouter une carte de suivie. </br><p></br><h3>27/09/2024 - Version 1.1: </h3> - Ajout d'une liste déroulante pour les sources de données. </br>- Bouton pour ajouter des fonts de carte customisés. </br>- Fonctionnalité de génération d'atlas. </p></br><p><h3>26/09/2024 - Version 1.0: </h3> - Lancement du plugin CenIsere_AutoMap avec une seul mise en page. </p></br>
# Tags are comma separated with spaces allowed
tags=python
category=Plugins
icon=icon.png
# experimental flag
experimental=False
# deprecated flag (applies to the whole plugin, not just a single version)
deprecated=False
# Since QGIS 3.8, a comma separated list of plugins to be installed
# (or upgraded) can be specified.
# Check the documentation for more information.
# plugin_dependencies=
Category of the plugin: Raster, Vector, Database or Web
# category=CenIsere,mise en page,atlas
# If the plugin can run on QGIS Server.
server=False
+34
View File
@@ -0,0 +1,34 @@
import sys
import socket
import os
IPAddr=socket.gethostbyname(socket.gethostname())
#print(IPAddr)
if IPAddr[0:11] == "100.100.100": #4269
host = "100.100.100.81"
port = "5432"
dbname = "sig4269"
sigdb="sig4269"
refdb="ref_geo4269"
password = "xxxxx"
if IPAddr[0:9] == "192.168.0": #01
host = "192.168.0.201"
port = "5432"
dbname = "sig01"
sigdb="sig01"
refdb="ref_geo01"
password = "xxxxx"
if IPAddr[0:9] == "192.168.1": #0726
host = "192.168.1.201"
port = "5432"
dbname = "sig0726"
sigdb="sig0726"
refdb="ref_geo0726"
password = "xxxxx"
if sys.platform == 'linux':
os_user = os.environ['USER']
else:
os_user = os.environ['USERNAME']
if os_user == 'STAGE':
os_user='stage'
if os_user == 'Administrateur':
os_user='stage'
Binary file not shown.

After

Width:  |  Height:  |  Size: 750 KiB

+143
View File
@@ -0,0 +1,143 @@
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
<qgis minScale="1e+08" hasScaleBasedVisibilityFlag="0" styleCategories="AllStyleCategories" version="3.36.2-Maidenhead" maxScale="0">
<flags>
<Identifiable>1</Identifiable>
<Removable>1</Removable>
<Searchable>1</Searchable>
<Private>0</Private>
</flags>
<temporal enabled="0" fetchMode="0" mode="0">
<fixedRange>
<start></start>
<end></end>
</fixedRange>
</temporal>
<elevation enabled="0" symbology="Line" zscale="1" band="1" zoffset="0">
<data-defined-properties>
<Option type="Map">
<Option type="QString" value="" name="name"/>
<Option name="properties"/>
<Option type="QString" value="collection" name="type"/>
</Option>
</data-defined-properties>
<profileLineSymbol>
<symbol force_rhr="0" frame_rate="10" type="line" alpha="1" is_animated="0" name="" clip_to_extent="1">
<data_defined_properties>
<Option type="Map">
<Option type="QString" value="" name="name"/>
<Option name="properties"/>
<Option type="QString" value="collection" name="type"/>
</Option>
</data_defined_properties>
<layer enabled="1" locked="0" class="SimpleLine" pass="0" id="{7e5fa3f7-eb9e-4791-ba1e-0e77899392ea}">
<Option type="Map">
<Option type="QString" value="0" name="align_dash_pattern"/>
<Option type="QString" value="square" name="capstyle"/>
<Option type="QString" value="5;2" name="customdash"/>
<Option type="QString" value="3x:0,0,0,0,0,0" name="customdash_map_unit_scale"/>
<Option type="QString" value="MM" name="customdash_unit"/>
<Option type="QString" value="0" name="dash_pattern_offset"/>
<Option type="QString" value="3x:0,0,0,0,0,0" name="dash_pattern_offset_map_unit_scale"/>
<Option type="QString" value="MM" name="dash_pattern_offset_unit"/>
<Option type="QString" value="0" name="draw_inside_polygon"/>
<Option type="QString" value="bevel" name="joinstyle"/>
<Option type="QString" value="145,82,45,255,rgb:0.56862745098039214,0.32156862745098042,0.17647058823529413,1" name="line_color"/>
<Option type="QString" value="solid" name="line_style"/>
<Option type="QString" value="0.6" name="line_width"/>
<Option type="QString" value="MM" name="line_width_unit"/>
<Option type="QString" value="0" name="offset"/>
<Option type="QString" value="3x:0,0,0,0,0,0" name="offset_map_unit_scale"/>
<Option type="QString" value="MM" name="offset_unit"/>
<Option type="QString" value="0" name="ring_filter"/>
<Option type="QString" value="0" name="trim_distance_end"/>
<Option type="QString" value="3x:0,0,0,0,0,0" name="trim_distance_end_map_unit_scale"/>
<Option type="QString" value="MM" name="trim_distance_end_unit"/>
<Option type="QString" value="0" name="trim_distance_start"/>
<Option type="QString" value="3x:0,0,0,0,0,0" name="trim_distance_start_map_unit_scale"/>
<Option type="QString" value="MM" name="trim_distance_start_unit"/>
<Option type="QString" value="0" name="tweak_dash_pattern_on_corners"/>
<Option type="QString" value="0" name="use_custom_dash"/>
<Option type="QString" value="3x:0,0,0,0,0,0" name="width_map_unit_scale"/>
</Option>
<data_defined_properties>
<Option type="Map">
<Option type="QString" value="" name="name"/>
<Option name="properties"/>
<Option type="QString" value="collection" name="type"/>
</Option>
</data_defined_properties>
</layer>
</symbol>
</profileLineSymbol>
<profileFillSymbol>
<symbol force_rhr="0" frame_rate="10" type="fill" alpha="1" is_animated="0" name="" clip_to_extent="1">
<data_defined_properties>
<Option type="Map">
<Option type="QString" value="" name="name"/>
<Option name="properties"/>
<Option type="QString" value="collection" name="type"/>
</Option>
</data_defined_properties>
<layer enabled="1" locked="0" class="SimpleFill" pass="0" id="{59353ec9-f57a-451f-93dc-24f9ec60d3e1}">
<Option type="Map">
<Option type="QString" value="3x:0,0,0,0,0,0" name="border_width_map_unit_scale"/>
<Option type="QString" value="145,82,45,255,rgb:0.56862745098039214,0.32156862745098042,0.17647058823529413,1" name="color"/>
<Option type="QString" value="bevel" name="joinstyle"/>
<Option type="QString" value="0,0" name="offset"/>
<Option type="QString" value="3x:0,0,0,0,0,0" name="offset_map_unit_scale"/>
<Option type="QString" value="MM" name="offset_unit"/>
<Option type="QString" value="35,35,35,255,rgb:0.13725490196078433,0.13725490196078433,0.13725490196078433,1" name="outline_color"/>
<Option type="QString" value="no" name="outline_style"/>
<Option type="QString" value="0.26" name="outline_width"/>
<Option type="QString" value="MM" name="outline_width_unit"/>
<Option type="QString" value="solid" name="style"/>
</Option>
<data_defined_properties>
<Option type="Map">
<Option type="QString" value="" name="name"/>
<Option name="properties"/>
<Option type="QString" value="collection" name="type"/>
</Option>
</data_defined_properties>
</layer>
</symbol>
</profileFillSymbol>
</elevation>
<customproperties>
<Option type="Map">
<Option type="bool" value="false" name="WMSBackgroundLayer"/>
<Option type="bool" value="false" name="WMSPublishDataSourceUrl"/>
<Option type="int" value="0" name="embeddedWidgets/count"/>
<Option type="QString" value="Html" name="identify/format"/>
</Option>
</customproperties>
<mapTip enabled="1"></mapTip>
<pipe-data-defined-properties>
<Option type="Map">
<Option type="QString" value="" name="name"/>
<Option name="properties"/>
<Option type="QString" value="collection" name="type"/>
</Option>
</pipe-data-defined-properties>
<pipe>
<provider>
<resampling enabled="false" zoomedOutResamplingMethod="nearestNeighbour" zoomedInResamplingMethod="nearestNeighbour" maxOversampling="2"/>
</provider>
<rasterrenderer opacity="1" nodataColor="" type="singlebandcolordata" band="1" alphaBand="-1">
<rasterTransparency/>
<minMaxOrigin>
<limits>None</limits>
<extent>WholeRaster</extent>
<statAccuracy>Estimated</statAccuracy>
<cumulativeCutLower>0.02</cumulativeCutLower>
<cumulativeCutUpper>0.98</cumulativeCutUpper>
<stdDevFactor>2</stdDevFactor>
</minMaxOrigin>
</rasterrenderer>
<brightnesscontrast contrast="0" gamma="1" brightness="0"/>
<huesaturation colorizeRed="255" saturation="0" colorizeBlue="128" grayscaleMode="2" colorizeOn="0" colorizeGreen="128" colorizeStrength="100" invertColors="0"/>
<rasterresampler maxOversampling="2"/>
<resamplingStage>resamplingFilter</resamplingStage>
</pipe>
<blendMode>6</blendMode>
</qgis>
+143
View File
@@ -0,0 +1,143 @@
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
<qgis minScale="1e+08" hasScaleBasedVisibilityFlag="0" styleCategories="AllStyleCategories" version="3.36.2-Maidenhead" maxScale="0">
<flags>
<Identifiable>1</Identifiable>
<Removable>1</Removable>
<Searchable>1</Searchable>
<Private>0</Private>
</flags>
<temporal enabled="0" fetchMode="0" mode="0">
<fixedRange>
<start></start>
<end></end>
</fixedRange>
</temporal>
<elevation enabled="0" symbology="Line" zscale="1" band="1" zoffset="0">
<data-defined-properties>
<Option type="Map">
<Option type="QString" value="" name="name"/>
<Option name="properties"/>
<Option type="QString" value="collection" name="type"/>
</Option>
</data-defined-properties>
<profileLineSymbol>
<symbol force_rhr="0" frame_rate="10" type="line" alpha="1" is_animated="0" name="" clip_to_extent="1">
<data_defined_properties>
<Option type="Map">
<Option type="QString" value="" name="name"/>
<Option name="properties"/>
<Option type="QString" value="collection" name="type"/>
</Option>
</data_defined_properties>
<layer enabled="1" locked="0" class="SimpleLine" pass="0" id="{ca7f0ebe-2f98-47c2-b569-3b44bade4d11}">
<Option type="Map">
<Option type="QString" value="0" name="align_dash_pattern"/>
<Option type="QString" value="square" name="capstyle"/>
<Option type="QString" value="5;2" name="customdash"/>
<Option type="QString" value="3x:0,0,0,0,0,0" name="customdash_map_unit_scale"/>
<Option type="QString" value="MM" name="customdash_unit"/>
<Option type="QString" value="0" name="dash_pattern_offset"/>
<Option type="QString" value="3x:0,0,0,0,0,0" name="dash_pattern_offset_map_unit_scale"/>
<Option type="QString" value="MM" name="dash_pattern_offset_unit"/>
<Option type="QString" value="0" name="draw_inside_polygon"/>
<Option type="QString" value="bevel" name="joinstyle"/>
<Option type="QString" value="152,125,183,255,rgb:0.59607843137254901,0.49019607843137253,0.71764705882352942,1" name="line_color"/>
<Option type="QString" value="solid" name="line_style"/>
<Option type="QString" value="0.6" name="line_width"/>
<Option type="QString" value="MM" name="line_width_unit"/>
<Option type="QString" value="0" name="offset"/>
<Option type="QString" value="3x:0,0,0,0,0,0" name="offset_map_unit_scale"/>
<Option type="QString" value="MM" name="offset_unit"/>
<Option type="QString" value="0" name="ring_filter"/>
<Option type="QString" value="0" name="trim_distance_end"/>
<Option type="QString" value="3x:0,0,0,0,0,0" name="trim_distance_end_map_unit_scale"/>
<Option type="QString" value="MM" name="trim_distance_end_unit"/>
<Option type="QString" value="0" name="trim_distance_start"/>
<Option type="QString" value="3x:0,0,0,0,0,0" name="trim_distance_start_map_unit_scale"/>
<Option type="QString" value="MM" name="trim_distance_start_unit"/>
<Option type="QString" value="0" name="tweak_dash_pattern_on_corners"/>
<Option type="QString" value="0" name="use_custom_dash"/>
<Option type="QString" value="3x:0,0,0,0,0,0" name="width_map_unit_scale"/>
</Option>
<data_defined_properties>
<Option type="Map">
<Option type="QString" value="" name="name"/>
<Option name="properties"/>
<Option type="QString" value="collection" name="type"/>
</Option>
</data_defined_properties>
</layer>
</symbol>
</profileLineSymbol>
<profileFillSymbol>
<symbol force_rhr="0" frame_rate="10" type="fill" alpha="1" is_animated="0" name="" clip_to_extent="1">
<data_defined_properties>
<Option type="Map">
<Option type="QString" value="" name="name"/>
<Option name="properties"/>
<Option type="QString" value="collection" name="type"/>
</Option>
</data_defined_properties>
<layer enabled="1" locked="0" class="SimpleFill" pass="0" id="{935ae4b1-d4c4-418b-88e0-dfa266fa0167}">
<Option type="Map">
<Option type="QString" value="3x:0,0,0,0,0,0" name="border_width_map_unit_scale"/>
<Option type="QString" value="152,125,183,255,rgb:0.59607843137254901,0.49019607843137253,0.71764705882352942,1" name="color"/>
<Option type="QString" value="bevel" name="joinstyle"/>
<Option type="QString" value="0,0" name="offset"/>
<Option type="QString" value="3x:0,0,0,0,0,0" name="offset_map_unit_scale"/>
<Option type="QString" value="MM" name="offset_unit"/>
<Option type="QString" value="35,35,35,255,rgb:0.13725490196078433,0.13725490196078433,0.13725490196078433,1" name="outline_color"/>
<Option type="QString" value="no" name="outline_style"/>
<Option type="QString" value="0.26" name="outline_width"/>
<Option type="QString" value="MM" name="outline_width_unit"/>
<Option type="QString" value="solid" name="style"/>
</Option>
<data_defined_properties>
<Option type="Map">
<Option type="QString" value="" name="name"/>
<Option name="properties"/>
<Option type="QString" value="collection" name="type"/>
</Option>
</data_defined_properties>
</layer>
</symbol>
</profileFillSymbol>
</elevation>
<customproperties>
<Option type="Map">
<Option type="bool" value="false" name="WMSBackgroundLayer"/>
<Option type="bool" value="false" name="WMSPublishDataSourceUrl"/>
<Option type="int" value="0" name="embeddedWidgets/count"/>
<Option type="QString" value="Undefined" name="identify/format"/>
</Option>
</customproperties>
<mapTip enabled="1"></mapTip>
<pipe-data-defined-properties>
<Option type="Map">
<Option type="QString" value="" name="name"/>
<Option name="properties"/>
<Option type="QString" value="collection" name="type"/>
</Option>
</pipe-data-defined-properties>
<pipe>
<provider>
<resampling enabled="false" zoomedOutResamplingMethod="nearestNeighbour" zoomedInResamplingMethod="nearestNeighbour" maxOversampling="2"/>
</provider>
<rasterrenderer opacity="0.8" nodataColor="" type="singlebandcolordata" band="1" alphaBand="-1">
<rasterTransparency/>
<minMaxOrigin>
<limits>None</limits>
<extent>WholeRaster</extent>
<statAccuracy>Estimated</statAccuracy>
<cumulativeCutLower>0.02</cumulativeCutLower>
<cumulativeCutUpper>0.98</cumulativeCutUpper>
<stdDevFactor>2</stdDevFactor>
</minMaxOrigin>
</rasterrenderer>
<brightnesscontrast contrast="20" gamma="0.9" brightness="30"/>
<huesaturation colorizeRed="255" saturation="30" colorizeBlue="255" grayscaleMode="0" colorizeOn="0" colorizeGreen="255" colorizeStrength="0" invertColors="0"/>
<rasterresampler maxOversampling="2"/>
<resamplingStage>resamplingFilter</resamplingStage>
</pipe>
<blendMode>6</blendMode>
</qgis>
@@ -0,0 +1,143 @@
<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
<qgis minScale="1e+08" hasScaleBasedVisibilityFlag="0" styleCategories="AllStyleCategories" version="3.36.2-Maidenhead" maxScale="0">
<flags>
<Identifiable>1</Identifiable>
<Removable>1</Removable>
<Searchable>1</Searchable>
<Private>0</Private>
</flags>
<temporal enabled="0" fetchMode="0" mode="0">
<fixedRange>
<start></start>
<end></end>
</fixedRange>
</temporal>
<elevation enabled="0" symbology="Line" zscale="1" band="1" zoffset="0">
<data-defined-properties>
<Option type="Map">
<Option type="QString" value="" name="name"/>
<Option name="properties"/>
<Option type="QString" value="collection" name="type"/>
</Option>
</data-defined-properties>
<profileLineSymbol>
<symbol force_rhr="0" frame_rate="10" type="line" alpha="1" is_animated="0" name="" clip_to_extent="1">
<data_defined_properties>
<Option type="Map">
<Option type="QString" value="" name="name"/>
<Option name="properties"/>
<Option type="QString" value="collection" name="type"/>
</Option>
</data_defined_properties>
<layer enabled="1" locked="0" class="SimpleLine" pass="0" id="{a04c2f3d-4206-4d46-98fa-41458cd1d25d}">
<Option type="Map">
<Option type="QString" value="0" name="align_dash_pattern"/>
<Option type="QString" value="square" name="capstyle"/>
<Option type="QString" value="5;2" name="customdash"/>
<Option type="QString" value="3x:0,0,0,0,0,0" name="customdash_map_unit_scale"/>
<Option type="QString" value="MM" name="customdash_unit"/>
<Option type="QString" value="0" name="dash_pattern_offset"/>
<Option type="QString" value="3x:0,0,0,0,0,0" name="dash_pattern_offset_map_unit_scale"/>
<Option type="QString" value="MM" name="dash_pattern_offset_unit"/>
<Option type="QString" value="0" name="draw_inside_polygon"/>
<Option type="QString" value="bevel" name="joinstyle"/>
<Option type="QString" value="213,180,60,255,rgb:0.83529411764705885,0.70588235294117652,0.23529411764705882,1" name="line_color"/>
<Option type="QString" value="solid" name="line_style"/>
<Option type="QString" value="0.6" name="line_width"/>
<Option type="QString" value="MM" name="line_width_unit"/>
<Option type="QString" value="0" name="offset"/>
<Option type="QString" value="3x:0,0,0,0,0,0" name="offset_map_unit_scale"/>
<Option type="QString" value="MM" name="offset_unit"/>
<Option type="QString" value="0" name="ring_filter"/>
<Option type="QString" value="0" name="trim_distance_end"/>
<Option type="QString" value="3x:0,0,0,0,0,0" name="trim_distance_end_map_unit_scale"/>
<Option type="QString" value="MM" name="trim_distance_end_unit"/>
<Option type="QString" value="0" name="trim_distance_start"/>
<Option type="QString" value="3x:0,0,0,0,0,0" name="trim_distance_start_map_unit_scale"/>
<Option type="QString" value="MM" name="trim_distance_start_unit"/>
<Option type="QString" value="0" name="tweak_dash_pattern_on_corners"/>
<Option type="QString" value="0" name="use_custom_dash"/>
<Option type="QString" value="3x:0,0,0,0,0,0" name="width_map_unit_scale"/>
</Option>
<data_defined_properties>
<Option type="Map">
<Option type="QString" value="" name="name"/>
<Option name="properties"/>
<Option type="QString" value="collection" name="type"/>
</Option>
</data_defined_properties>
</layer>
</symbol>
</profileLineSymbol>
<profileFillSymbol>
<symbol force_rhr="0" frame_rate="10" type="fill" alpha="1" is_animated="0" name="" clip_to_extent="1">
<data_defined_properties>
<Option type="Map">
<Option type="QString" value="" name="name"/>
<Option name="properties"/>
<Option type="QString" value="collection" name="type"/>
</Option>
</data_defined_properties>
<layer enabled="1" locked="0" class="SimpleFill" pass="0" id="{56980d1e-41f6-4d14-8389-d5daeb39d97f}">
<Option type="Map">
<Option type="QString" value="3x:0,0,0,0,0,0" name="border_width_map_unit_scale"/>
<Option type="QString" value="213,180,60,255,rgb:0.83529411764705885,0.70588235294117652,0.23529411764705882,1" name="color"/>
<Option type="QString" value="bevel" name="joinstyle"/>
<Option type="QString" value="0,0" name="offset"/>
<Option type="QString" value="3x:0,0,0,0,0,0" name="offset_map_unit_scale"/>
<Option type="QString" value="MM" name="offset_unit"/>
<Option type="QString" value="35,35,35,255,rgb:0.13725490196078433,0.13725490196078433,0.13725490196078433,1" name="outline_color"/>
<Option type="QString" value="no" name="outline_style"/>
<Option type="QString" value="0.26" name="outline_width"/>
<Option type="QString" value="MM" name="outline_width_unit"/>
<Option type="QString" value="solid" name="style"/>
</Option>
<data_defined_properties>
<Option type="Map">
<Option type="QString" value="" name="name"/>
<Option name="properties"/>
<Option type="QString" value="collection" name="type"/>
</Option>
</data_defined_properties>
</layer>
</symbol>
</profileFillSymbol>
</elevation>
<customproperties>
<Option type="Map">
<Option type="bool" value="false" name="WMSBackgroundLayer"/>
<Option type="bool" value="false" name="WMSPublishDataSourceUrl"/>
<Option type="int" value="0" name="embeddedWidgets/count"/>
<Option type="QString" value="Undefined" name="identify/format"/>
</Option>
</customproperties>
<mapTip enabled="1"></mapTip>
<pipe-data-defined-properties>
<Option type="Map">
<Option type="QString" value="" name="name"/>
<Option name="properties"/>
<Option type="QString" value="collection" name="type"/>
</Option>
</pipe-data-defined-properties>
<pipe>
<provider>
<resampling enabled="false" zoomedOutResamplingMethod="nearestNeighbour" zoomedInResamplingMethod="nearestNeighbour" maxOversampling="2"/>
</provider>
<rasterrenderer opacity="1" nodataColor="" type="singlebandcolordata" band="1" alphaBand="-1">
<rasterTransparency/>
<minMaxOrigin>
<limits>None</limits>
<extent>WholeRaster</extent>
<statAccuracy>Estimated</statAccuracy>
<cumulativeCutLower>0.02</cumulativeCutLower>
<cumulativeCutUpper>0.98</cumulativeCutUpper>
<stdDevFactor>2</stdDevFactor>
</minMaxOrigin>
</rasterrenderer>
<brightnesscontrast contrast="-10" gamma="1" brightness="40"/>
<huesaturation colorizeRed="255" saturation="10" colorizeBlue="255" grayscaleMode="0" colorizeOn="0" colorizeGreen="255" colorizeStrength="100" invertColors="0"/>
<rasterresampler maxOversampling="2"/>
<resamplingStage>resamplingFilter</resamplingStage>
</pipe>
<blendMode>6</blendMode>
</qgis>
Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 KiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

@@ -0,0 +1,120 @@
<Layout worldFileMap="" name="test.qpt" printResolution="300" units="mm">
<Snapper snapToGrid="0" snapToItems="1" tolerance="5" snapToGuides="1"/>
<Grid resolution="10" offsetUnits="mm" offsetX="0" resUnits="mm" offsetY="0"/>
<PageCollection>
<symbol name="" clip_to_extent="1" type="fill" force_rhr="0" alpha="1">
<data_defined_properties>
<Option type="Map">
<Option name="name" value="" type="QString"/>
<Option name="properties"/>
<Option name="type" value="collection" type="QString"/>
</Option>
</data_defined_properties>
<layer class="SimpleFill" locked="0" enabled="1" pass="0">
<Option type="Map">
<Option name="border_width_map_unit_scale" value="3x:0,0,0,0,0,0" type="QString"/>
<Option name="color" value="255,255,255,255" type="QString"/>
<Option name="joinstyle" value="miter" type="QString"/>
<Option name="offset" value="0,0" type="QString"/>
<Option name="offset_map_unit_scale" value="3x:0,0,0,0,0,0" type="QString"/>
<Option name="offset_unit" value="MM" type="QString"/>
<Option name="outline_color" value="35,35,35,255" type="QString"/>
<Option name="outline_style" value="no" type="QString"/>
<Option name="outline_width" value="0.26" type="QString"/>
<Option name="outline_width_unit" value="MM" type="QString"/>
<Option name="style" value="solid" type="QString"/>
</Option>
<prop k="border_width_map_unit_scale" v="3x:0,0,0,0,0,0"/>
<prop k="color" v="255,255,255,255"/>
<prop k="joinstyle" v="miter"/>
<prop k="offset" v="0,0"/>
<prop k="offset_map_unit_scale" v="3x:0,0,0,0,0,0"/>
<prop k="offset_unit" v="MM"/>
<prop k="outline_color" v="35,35,35,255"/>
<prop k="outline_style" v="no"/>
<prop k="outline_width" v="0.26"/>
<prop k="outline_width_unit" v="MM"/>
<prop k="style" v="solid"/>
<data_defined_properties>
<Option type="Map">
<Option name="name" value="" type="QString"/>
<Option name="properties"/>
<Option name="type" value="collection" type="QString"/>
</Option>
</data_defined_properties>
</layer>
</symbol>
<LayoutItem zValue="0" id="" itemRotation="0" position="0,0,mm" frame="false" templateUuid="{5c80221d-7561-455b-94fd-69a27d877679}" referencePoint="0" opacity="1" frameJoinStyle="miter" uuid="{5c80221d-7561-455b-94fd-69a27d877679}" blendMode="0" size="297,210,mm" groupUuid="" outlineWidthM="0.3,mm" positionOnPage="0,0,mm" type="65638" excludeFromExports="0" positionLock="false" background="true" visibility="1">
<FrameColor green="0" blue="0" red="0" alpha="255"/>
<BackgroundColor green="255" blue="255" red="255" alpha="255"/>
<LayoutObject>
<dataDefinedProperties>
<Option type="Map">
<Option name="name" value="" type="QString"/>
<Option name="properties"/>
<Option name="type" value="collection" type="QString"/>
</Option>
</dataDefinedProperties>
<customproperties>
<Option/>
</customproperties>
</LayoutObject>
<symbol name="" clip_to_extent="1" type="fill" force_rhr="0" alpha="1">
<data_defined_properties>
<Option type="Map">
<Option name="name" value="" type="QString"/>
<Option name="properties"/>
<Option name="type" value="collection" type="QString"/>
</Option>
</data_defined_properties>
<layer class="SimpleFill" locked="0" enabled="1" pass="0">
<Option type="Map">
<Option name="border_width_map_unit_scale" value="3x:0,0,0,0,0,0" type="QString"/>
<Option name="color" value="255,255,255,255" type="QString"/>
<Option name="joinstyle" value="miter" type="QString"/>
<Option name="offset" value="0,0" type="QString"/>
<Option name="offset_map_unit_scale" value="3x:0,0,0,0,0,0" type="QString"/>
<Option name="offset_unit" value="MM" type="QString"/>
<Option name="outline_color" value="35,35,35,255" type="QString"/>
<Option name="outline_style" value="no" type="QString"/>
<Option name="outline_width" value="0.26" type="QString"/>
<Option name="outline_width_unit" value="MM" type="QString"/>
<Option name="style" value="solid" type="QString"/>
</Option>
<prop k="border_width_map_unit_scale" v="3x:0,0,0,0,0,0"/>
<prop k="color" v="255,255,255,255"/>
<prop k="joinstyle" v="miter"/>
<prop k="offset" v="0,0"/>
<prop k="offset_map_unit_scale" v="3x:0,0,0,0,0,0"/>
<prop k="offset_unit" v="MM"/>
<prop k="outline_color" v="35,35,35,255"/>
<prop k="outline_style" v="no"/>
<prop k="outline_width" v="0.26"/>
<prop k="outline_width_unit" v="MM"/>
<prop k="style" v="solid"/>
<data_defined_properties>
<Option type="Map">
<Option name="name" value="" type="QString"/>
<Option name="properties"/>
<Option name="type" value="collection" type="QString"/>
</Option>
</data_defined_properties>
</layer>
</symbol>
</LayoutItem>
<GuideCollection visible="1"/>
</PageCollection>
<customproperties>
<Option type="Map">
<Option name="atlasRasterFormat" value="png" type="QString"/>
<Option name="imageAntialias" value="true" type="bool"/>
<Option name="imageCropMarginBottom" value="0" type="int"/>
<Option name="imageCropMarginLeft" value="0" type="int"/>
<Option name="imageCropMarginRight" value="0" type="int"/>
<Option name="imageCropMarginTop" value="0" type="int"/>
<Option name="imageCropToContents" value="false" type="bool"/>
<Option name="singleFile" value="true" type="bool"/>
</Option>
</customproperties>
<Atlas coverageLayer="" pageNameExpression="" filterFeatures="0" filenamePattern="'output_'||@atlas_featurenumber" enabled="0" hideCoverage="0" sortFeatures="0"/>
</Layout>
@@ -0,0 +1,120 @@
<Layout worldFileMap="" name="test.qpt" printResolution="300" units="mm">
<Snapper snapToGrid="0" snapToItems="1" tolerance="5" snapToGuides="1"/>
<Grid resolution="10" offsetUnits="mm" offsetX="0" resUnits="mm" offsetY="0"/>
<PageCollection>
<symbol name="" clip_to_extent="1" type="fill" force_rhr="0" alpha="1">
<data_defined_properties>
<Option type="Map">
<Option name="name" value="" type="QString"/>
<Option name="properties"/>
<Option name="type" value="collection" type="QString"/>
</Option>
</data_defined_properties>
<layer class="SimpleFill" locked="0" enabled="1" pass="0">
<Option type="Map">
<Option name="border_width_map_unit_scale" value="3x:0,0,0,0,0,0" type="QString"/>
<Option name="color" value="255,255,255,255" type="QString"/>
<Option name="joinstyle" value="miter" type="QString"/>
<Option name="offset" value="0,0" type="QString"/>
<Option name="offset_map_unit_scale" value="3x:0,0,0,0,0,0" type="QString"/>
<Option name="offset_unit" value="MM" type="QString"/>
<Option name="outline_color" value="35,35,35,255" type="QString"/>
<Option name="outline_style" value="no" type="QString"/>
<Option name="outline_width" value="0.26" type="QString"/>
<Option name="outline_width_unit" value="MM" type="QString"/>
<Option name="style" value="solid" type="QString"/>
</Option>
<prop k="border_width_map_unit_scale" v="3x:0,0,0,0,0,0"/>
<prop k="color" v="255,255,255,255"/>
<prop k="joinstyle" v="miter"/>
<prop k="offset" v="0,0"/>
<prop k="offset_map_unit_scale" v="3x:0,0,0,0,0,0"/>
<prop k="offset_unit" v="MM"/>
<prop k="outline_color" v="35,35,35,255"/>
<prop k="outline_style" v="no"/>
<prop k="outline_width" v="0.26"/>
<prop k="outline_width_unit" v="MM"/>
<prop k="style" v="solid"/>
<data_defined_properties>
<Option type="Map">
<Option name="name" value="" type="QString"/>
<Option name="properties"/>
<Option name="type" value="collection" type="QString"/>
</Option>
</data_defined_properties>
</layer>
</symbol>
<LayoutItem zValue="0" id="" itemRotation="0" position="0,0,mm" frame="false" templateUuid="{5c80221d-7561-455b-94fd-69a27d877679}" referencePoint="0" opacity="1" frameJoinStyle="miter" uuid="{5c80221d-7561-455b-94fd-69a27d877679}" blendMode="0" size="297,210,mm" groupUuid="" outlineWidthM="0.3,mm" positionOnPage="0,0,mm" type="65638" excludeFromExports="0" positionLock="false" background="true" visibility="1">
<FrameColor green="0" blue="0" red="0" alpha="255"/>
<BackgroundColor green="255" blue="255" red="255" alpha="255"/>
<LayoutObject>
<dataDefinedProperties>
<Option type="Map">
<Option name="name" value="" type="QString"/>
<Option name="properties"/>
<Option name="type" value="collection" type="QString"/>
</Option>
</dataDefinedProperties>
<customproperties>
<Option/>
</customproperties>
</LayoutObject>
<symbol name="" clip_to_extent="1" type="fill" force_rhr="0" alpha="1">
<data_defined_properties>
<Option type="Map">
<Option name="name" value="" type="QString"/>
<Option name="properties"/>
<Option name="type" value="collection" type="QString"/>
</Option>
</data_defined_properties>
<layer class="SimpleFill" locked="0" enabled="1" pass="0">
<Option type="Map">
<Option name="border_width_map_unit_scale" value="3x:0,0,0,0,0,0" type="QString"/>
<Option name="color" value="255,255,255,255" type="QString"/>
<Option name="joinstyle" value="miter" type="QString"/>
<Option name="offset" value="0,0" type="QString"/>
<Option name="offset_map_unit_scale" value="3x:0,0,0,0,0,0" type="QString"/>
<Option name="offset_unit" value="MM" type="QString"/>
<Option name="outline_color" value="35,35,35,255" type="QString"/>
<Option name="outline_style" value="no" type="QString"/>
<Option name="outline_width" value="0.26" type="QString"/>
<Option name="outline_width_unit" value="MM" type="QString"/>
<Option name="style" value="solid" type="QString"/>
</Option>
<prop k="border_width_map_unit_scale" v="3x:0,0,0,0,0,0"/>
<prop k="color" v="255,255,255,255"/>
<prop k="joinstyle" v="miter"/>
<prop k="offset" v="0,0"/>
<prop k="offset_map_unit_scale" v="3x:0,0,0,0,0,0"/>
<prop k="offset_unit" v="MM"/>
<prop k="outline_color" v="35,35,35,255"/>
<prop k="outline_style" v="no"/>
<prop k="outline_width" v="0.26"/>
<prop k="outline_width_unit" v="MM"/>
<prop k="style" v="solid"/>
<data_defined_properties>
<Option type="Map">
<Option name="name" value="" type="QString"/>
<Option name="properties"/>
<Option name="type" value="collection" type="QString"/>
</Option>
</data_defined_properties>
</layer>
</symbol>
</LayoutItem>
<GuideCollection visible="1"/>
</PageCollection>
<customproperties>
<Option type="Map">
<Option name="atlasRasterFormat" value="png" type="QString"/>
<Option name="imageAntialias" value="true" type="bool"/>
<Option name="imageCropMarginBottom" value="0" type="int"/>
<Option name="imageCropMarginLeft" value="0" type="int"/>
<Option name="imageCropMarginRight" value="0" type="int"/>
<Option name="imageCropMarginTop" value="0" type="int"/>
<Option name="imageCropToContents" value="false" type="bool"/>
<Option name="singleFile" value="true" type="bool"/>
</Option>
</customproperties>
<Atlas coverageLayer="" pageNameExpression="" filterFeatures="0" filenamePattern="'output_'||@atlas_featurenumber" enabled="0" hideCoverage="0" sortFeatures="0"/>
</Layout>
@@ -0,0 +1,114 @@
<Layout units="mm" worldFileMap="" printResolution="300" name="3. Modèle_carto_standard_cenIsere">
<Snapper snapToGuides="1" tolerance="5" snapToItems="1" snapToGrid="0"/>
<Grid offsetUnits="mm" resUnits="mm" resolution="10" offsetX="0" offsetY="0"/>
<PageCollection>
<symbol clip_to_extent="1" force_rhr="0" type="fill" name="" alpha="1">
<data_defined_properties>
<Option type="Map">
<Option value="" type="QString" name="name"/>
<Option name="properties"/>
<Option value="collection" type="QString" name="type"/>
</Option>
</data_defined_properties>
<layer locked="0" pass="0" enabled="1" class="SimpleFill">
<Option type="Map">
<Option value="3x:0,0,0,0,0,0" type="QString" name="border_width_map_unit_scale"/>
<Option value="255,255,255,255" type="QString" name="color"/>
<Option value="miter" type="QString" name="joinstyle"/>
<Option value="0,0" type="QString" name="offset"/>
<Option value="3x:0,0,0,0,0,0" type="QString" name="offset_map_unit_scale"/>
<Option value="MM" type="QString" name="offset_unit"/>
<Option value="35,35,35,255" type="QString" name="outline_color"/>
<Option value="no" type="QString" name="outline_style"/>
<Option value="0.26" type="QString" name="outline_width"/>
<Option value="MM" type="QString" name="outline_width_unit"/>
<Option value="solid" type="QString" name="style"/>
</Option>
<prop v="3x:0,0,0,0,0,0" k="border_width_map_unit_scale"/>
<prop v="255,255,255,255" k="color"/>
<prop v="miter" k="joinstyle"/>
<prop v="0,0" k="offset"/>
<prop v="3x:0,0,0,0,0,0" k="offset_map_unit_scale"/>
<prop v="MM" k="offset_unit"/>
<prop v="35,35,35,255" k="outline_color"/>
<prop v="no" k="outline_style"/>
<prop v="0.26" k="outline_width"/>
<prop v="MM" k="outline_width_unit"/>
<prop v="solid" k="style"/>
<data_defined_properties>
<Option type="Map">
<Option value="" type="QString" name="name"/>
<Option name="properties"/>
<Option value="collection" type="QString" name="type"/>
</Option>
</data_defined_properties>
</layer>
</symbol>
<LayoutItem type="65638" zValue="0" blendMode="0" referencePoint="0" frameJoinStyle="miter" outlineWidthM="0.3,mm" frame="false" groupUuid="" itemRotation="0" excludeFromExports="0" background="true" opacity="1" visibility="1" size="297,210,mm" positionOnPage="0,0,mm" id="" templateUuid="{2b090846-ab96-44d2-b168-90e1bcb35427}" uuid="{2b090846-ab96-44d2-b168-90e1bcb35427}" position="0,0,mm" positionLock="false">
<FrameColor red="0" blue="0" green="0" alpha="255"/>
<BackgroundColor red="255" blue="255" green="255" alpha="255"/>
<LayoutObject>
<dataDefinedProperties>
<Option type="Map">
<Option value="" type="QString" name="name"/>
<Option name="properties"/>
<Option value="collection" type="QString" name="type"/>
</Option>
</dataDefinedProperties>
<customproperties>
<Option/>
</customproperties>
</LayoutObject>
<symbol clip_to_extent="1" force_rhr="0" type="fill" name="" alpha="1">
<data_defined_properties>
<Option type="Map">
<Option value="" type="QString" name="name"/>
<Option name="properties"/>
<Option value="collection" type="QString" name="type"/>
</Option>
</data_defined_properties>
<layer locked="0" pass="0" enabled="1" class="SimpleFill">
<Option type="Map">
<Option value="3x:0,0,0,0,0,0" type="QString" name="border_width_map_unit_scale"/>
<Option value="255,255,255,255" type="QString" name="color"/>
<Option value="miter" type="QString" name="joinstyle"/>
<Option value="0,0" type="QString" name="offset"/>
<Option value="3x:0,0,0,0,0,0" type="QString" name="offset_map_unit_scale"/>
<Option value="MM" type="QString" name="offset_unit"/>
<Option value="35,35,35,255" type="QString" name="outline_color"/>
<Option value="no" type="QString" name="outline_style"/>
<Option value="0.26" type="QString" name="outline_width"/>
<Option value="MM" type="QString" name="outline_width_unit"/>
<Option value="solid" type="QString" name="style"/>
</Option>
<prop v="3x:0,0,0,0,0,0" k="border_width_map_unit_scale"/>
<prop v="255,255,255,255" k="color"/>
<prop v="miter" k="joinstyle"/>
<prop v="0,0" k="offset"/>
<prop v="3x:0,0,0,0,0,0" k="offset_map_unit_scale"/>
<prop v="MM" k="offset_unit"/>
<prop v="35,35,35,255" k="outline_color"/>
<prop v="no" k="outline_style"/>
<prop v="0.26" k="outline_width"/>
<prop v="MM" k="outline_width_unit"/>
<prop v="solid" k="style"/>
<data_defined_properties>
<Option type="Map">
<Option value="" type="QString" name="name"/>
<Option name="properties"/>
<Option value="collection" type="QString" name="type"/>
</Option>
</data_defined_properties>
</layer>
</symbol>
</LayoutItem>
<GuideCollection visible="1"/>
</PageCollection>
<customproperties>
<Option type="Map">
<Option value="png" type="QString" name="atlasRasterFormat"/>
<Option value="true" type="bool" name="singleFile"/>
</Option>
</customproperties>
<Atlas filterFeatures="0" pageNameExpression="" filenamePattern="'output_'||@atlas_featurenumber" hideCoverage="0" enabled="0" sortFeatures="0" coverageLayer=""/>
</Layout>
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Capa_1"
x="0px"
y="0px"
viewBox="0 0 470 470"
style="enable-background:new 0 0 470 470;"
xml:space="preserve"
inkscape:version="0.91 r13725"
sodipodi:docname="north-star-svgrepo-com.svg"><metadata
id="metadata41"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
id="defs39" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1017"
id="namedview37"
showgrid="false"
inkscape:zoom="0.50212766"
inkscape:cx="-58.75"
inkscape:cy="235"
inkscape:window-x="1912"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="Capa_1" /><g
id="g3"
transform="matrix(0.70762712,0,0,0.70762712,73.669492,121.42372)"><path
d="m 464.37,227.737 -137.711,-35.46 55.747,-94.413 c 1.74,-2.946 1.265,-6.697 -1.155,-9.117 -2.42,-2.42 -6.169,-2.894 -9.117,-1.154 L 277.721,143.34 242.263,5.63 C 241.41,2.316 238.422,0 235,0 c -3.422,0 -6.41,2.316 -7.263,5.63 L 192.277,143.341 97.865,87.593 c -2.947,-1.742 -6.697,-1.267 -9.117,1.154 -2.419,2.42 -2.895,6.171 -1.155,9.117 L 143.34,192.277 5.63,227.737 C 2.316,228.59 0,231.578 0,235 c 0,3.422 2.316,6.41 5.63,7.263 l 137.711,35.46 -55.747,94.413 c -1.74,2.946 -1.265,6.697 1.155,9.117 1.445,1.445 3.365,2.196 5.306,2.196 1.308,0 2.625,-0.342 3.811,-1.042 l 94.413,-55.747 35.46,137.71 c 0.854,3.313 3.841,5.63 7.263,5.63 3.422,0 6.41,-2.316 7.263,-5.63 l 35.46,-137.711 94.413,55.748 c 1.187,0.701 2.503,1.042 3.811,1.042 1.94,0 3.86,-0.751 5.306,-2.196 2.419,-2.42 2.895,-6.171 1.155,-9.117 l -55.747,-94.413 137.71,-35.46 c 3.314,-0.853 5.63,-3.841 5.63,-7.263 0,-3.422 -2.319,-6.41 -5.633,-7.263 z m -176.627,60.007 23.796,-6.128 43.142,73.065 -73.065,-43.143 6.127,-23.794 z m 25.697,-22.106 c -0.035,0.009 -0.07,0.019 -0.106,0.027 l -29.473,7.59 -22.344,-22.345 c -2.929,-2.928 -7.678,-2.928 -10.606,0 -2.929,2.93 -2.929,7.678 0,10.607 l 22.344,22.344 -7.59,29.478 c -0.008,0.033 -0.018,0.065 -0.025,0.099 L 235,432.423 204.356,313.413 c -0.004,-0.016 -7.61,-29.552 -7.61,-29.552 l 87.115,-87.116 29.302,7.546 C 313.21,204.303 432.423,235 432.423,235 L 313.44,265.638 Z m -25.697,-83.382 -6.127,-23.795 73.065,-43.143 -43.142,73.064 -23.796,-6.126 z m -22.099,-25.669 c 0.004,0.016 7.61,29.552 7.61,29.552 L 235,224.393 l -38.254,-38.254 7.59,-29.478 c 0.008,-0.033 0.018,-0.065 0.025,-0.099 L 235,37.577 l 30.644,119.01 z m -83.387,25.669 -23.796,6.128 -43.142,-73.065 73.065,43.143 -6.127,23.794 z m 3.882,14.489 L 224.393,235 186.139,273.255 37.577,235 186.139,196.745 Z m -3.882,90.999 6.127,23.795 -73.065,43.143 43.142,-73.064 23.796,6.126 z"
id="path5"
inkscape:connector-curvature="0" /></g><g
id="g7"
transform="matrix(0.70762712,0,0,0.70762712,77.669492,133.42372)" /><g
id="g9"
transform="matrix(0.70762712,0,0,0.70762712,77.669492,133.42372)" /><g
id="g11"
transform="matrix(0.70762712,0,0,0.70762712,77.669492,133.42372)" /><g
id="g13"
transform="matrix(0.70762712,0,0,0.70762712,77.669492,133.42372)" /><g
id="g15"
transform="matrix(0.70762712,0,0,0.70762712,77.669492,133.42372)" /><g
id="g17"
transform="matrix(0.70762712,0,0,0.70762712,77.669492,133.42372)" /><g
id="g19"
transform="matrix(0.70762712,0,0,0.70762712,77.669492,133.42372)" /><g
id="g21"
transform="matrix(0.70762712,0,0,0.70762712,77.669492,133.42372)" /><g
id="g23"
transform="matrix(0.70762712,0,0,0.70762712,77.669492,133.42372)" /><g
id="g25"
transform="matrix(0.70762712,0,0,0.70762712,77.669492,133.42372)" /><g
id="g27"
transform="matrix(0.70762712,0,0,0.70762712,77.669492,133.42372)" /><g
id="g29"
transform="matrix(0.70762712,0,0,0.70762712,77.669492,133.42372)" /><g
id="g31"
transform="matrix(0.70762712,0,0,0.70762712,77.669492,133.42372)" /><g
id="g33"
transform="matrix(0.70762712,0,0,0.70762712,77.669492,133.42372)" /><g
id="g35"
transform="matrix(0.70762712,0,0,0.70762712,77.669492,133.42372)" /><path
inkscape:connector-curvature="0"
class="st0"
d="m 230.3366,69.68989 20.38,33.826 c 0.404,0.673 0.717,1.188 0.953,1.59 0.487,0.002 1.12,0.004 1.805,0.004 l 20.004,0 c 0.557,0 1.027,-0.471 1.027,-1.028 l 0,-76.944 c 0,-0.557 -0.472,-1.027 -1.027,-1.027 l -20.004,0 c -0.555,0 -1.025,0.471 -1.025,1.027 l 0,33.553 c 0,2.979 -1.948,3.13 -2.338,3.13 -0.958,0 -1.803,-0.599 -2.518,-1.78 l -20.378,-33.826 c -0.498,-0.825 -0.852,-1.429 -1.104,-1.882 -0.4,-0.02 -0.956,-0.036 -1.655,-0.036 l -20.003,0 c -0.557,0 -1.027,0.47 -1.027,1.027 l 0,76.945 c 0,0.557 0.471,1.027 1.027,1.027 l 20.001,0 c 0.557,0 1.027,-0.47 1.027,-1.027 l 0,-33.229 c 0,-2.979 1.948,-3.129 2.338,-3.129 0.959,-10e-4 1.805,0.599 2.517,1.779 z"
id="path9" /></svg>

After

Width:  |  Height:  |  Size: 5.6 KiB

@@ -0,0 +1,47 @@
<svg viewBox="0 0 61.06 96.62" xmlns="http://www.w3.org/2000/svg">
<g transform="translate(-1.438 30.744)">
<g fill="none" stroke="param(outline)">
<path d="m61 35c0 16.02-12.984 29-29 29-16.02 0-29-12.984-29-29 0-16.02 12.984-29 29-29 16.02 0 29 12.984 29 29z" stroke-width="3"/>
<path d="m55 35c0 12.979-10.521 23.5-23.5 23.5-12.979 0-23.5-10.521-23.5-23.5 0-12.979 10.521-23.5 23.5-23.5 12.979 0 23.5 10.521 23.5 23.5z" stroke-width=".497" transform="matrix(1.01148 0 0 .99988 -.089 .004)"/>
<path d="m32 35v-32" stroke-width=".25"/>
</g>
<path d="m32-9.453l28.938 73.826-29-29-29 29z" fill="param(fill)" stroke="param(outline)" stroke-width="3"/>
<path d="m32-9.453l29 73.45-29-29-29 29z" fill="none" stroke="param(outline)" stroke-linecap="square"/>
<text fill="param(fill)" font-family="OPEN SANS" font-size="40" letter-spacing="0" line-height="125%" word-spacing="0" x="22.71" y="-10.854">
<tspan font-family="Adobe Heiti Std R" font-size="26" x="22.71" y="-10.854">N</tspan>
</text>
</g>
<g fill="none" stroke="param(outline)" stroke-width=".25" transform="translate(0 -3.829)">
<path d="m4 92.82l6.74-3.891"/>
<path d="m4.603 90.7l10.397-6"/>
<path d="m3 95.17l4-2.309"/>
<path d="m5.442 88.45l13.856-8"/>
<path d="m12 72.26l18.686-10.812"/>
<path d="m14.593 65.45l16.09-9.291"/>
<path d="m15.343 63.24l15.343-8.858"/>
<path d="m16.877 60.58l13.809-7.972"/>
<path d="m17.511 58.45l13.174-7.606"/>
<path d="m18.412 56.15l12.274-7.087"/>
<path d="m19 54.04l11.427-6.597"/>
<path d="m20 51.757l10.822-6.311"/>
<path d="m20.826 49.45l9.86-5.693"/>
<path d="m21.48 47.3l9.206-5.315"/>
<path d="m23 44.647l7.686-4.437"/>
<path d="m23.744 42.45l6.928-4"/>
<path d="m24.549 40.21l6.137-3.543"/>
<path d="m25 38.18l5.686-3.283"/>
<path d="m26.663 35.446l4.02-2.323"/>
<path d="m27.617 33.12l3.069-1.772"/>
<path d="m28 31.13l2.686-1.551"/>
<path d="m29.15 28.694l1.534-.886"/>
<path d="m13 69.909l17.686-10.211"/>
<path d="m9.206 79.19l21.48-12.402"/>
<path d="m8.36 81.45l22.326-12.89"/>
<path d="m7.671 83.62l19.946-11.516"/>
<path d="m6.137 86.27l17.02-9.827"/>
<path d="m10 76.956l20.686-11.943"/>
<path d="m11.279 74.45l19.407-11.205"/>
<path d="m14 67.56l16.686-9.634"/>
<path d="m30.562 65.744v-43.566" transform="translate(0 3.829)"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

@@ -0,0 +1,492 @@
from qgis.core import (
QgsLayoutSize,
QgsUnitTypes,
QgsLayoutPoint,
)
def fletch_canvas(self,values_page):
### Modèle carto standard ###
if values_page == '1. Modèle carto standard.qpt':
if self.radioButton_6.isChecked() and self.radioButton_7.isChecked():
self.template_parameters['position_map_size'] = QgsLayoutSize(50, 50, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['position_map_position'] = QgsLayoutPoint(2.5, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['map_size'] = QgsLayoutSize(199, 175+47, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['map_position'] = QgsLayoutPoint(5, 25, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['title_size'] = QgsLayoutSize(200, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['title_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['subtitle_size'] = QgsLayoutSize(200, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 12, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 275, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['legend_position'] = QgsLayoutPoint(5, 205+47, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(55, 5, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(145, 228+47, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebar_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebar_position'] = QgsLayoutPoint(145, 215+47, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['north_size'] = QgsLayoutSize(12, 12, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['north_position'] = QgsLayoutPoint(193, 214+47, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text_size'] = QgsLayoutSize(50, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text_position'] = QgsLayoutPoint(200, 75, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text2_position'] = QgsLayoutPoint(104, 201+47, QgsUnitTypes.LayoutMillimeters)
if self.radioButton_6.isChecked() and self.radioButton_8.isChecked():
self.template_parameters['position_map_size'] = QgsLayoutSize(100, 100, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['position_map_position'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['map_size'] = QgsLayoutSize(285, 145, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['map_position'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['title_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['title_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['subtitle_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 185, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['legend_position'] = QgsLayoutPoint(5, 168, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(207, 193, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebar_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebar_position'] = QgsLayoutPoint(207, 180, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['north_size'] = QgsLayoutSize(8.4, 12.5, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['north_position'] = QgsLayoutPoint(273, 182, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text_size'] = QgsLayoutSize(50, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text_position'] = QgsLayoutPoint(287, 123, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text2_position'] = QgsLayoutPoint(189, 168.5, QgsUnitTypes.LayoutMillimeters)
if self.radioButton_5.isChecked() and self.radioButton_7.isChecked():
self.template_parameters['map_size'] = QgsLayoutSize(285, 260, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['map_position'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['title_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['title_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['subtitle_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 395, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['legend_position'] = QgsLayoutPoint(5, 284, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(50, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(207, 310, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebar_size'] = QgsLayoutSize(50, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebar_position'] = QgsLayoutPoint(207, 298, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['north_size'] = QgsLayoutSize(8.4, 12.5, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['north_position'] = QgsLayoutPoint(273, 297, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text_size'] = QgsLayoutSize(50, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text_position'] = QgsLayoutPoint(287, 123, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text2_position'] = QgsLayoutPoint(189, 284, QgsUnitTypes.LayoutMillimeters)
if self.radioButton_5.isChecked() and self.radioButton_8.isChecked():
self.template_parameters['map_size'] = QgsLayoutSize(408.5, 222, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['map_position'] = QgsLayoutPoint(5, 23.5, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['title_size'] = QgsLayoutSize(409, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['title_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['subtitle_size'] = QgsLayoutSize(409, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 275, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['legend_position'] = QgsLayoutPoint(5, 249, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(323, 282, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebar_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebar_position'] = QgsLayoutPoint(323, 270, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['north_size'] = QgsLayoutSize(8.4, 12.5, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['north_position'] = QgsLayoutPoint(402, 270, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text_size'] = QgsLayoutSize(50, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text_position'] = QgsLayoutPoint(415, 123, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text2_position'] = QgsLayoutPoint(313, 247, QgsUnitTypes.LayoutMillimeters)
### Modèle carto plein page ###
if values_page == '2. Modèle carto plein page.qpt':
if self.radioButton_6.isChecked() and self.radioButton_7.isChecked():
self.template_parameters['position_map_size'] = QgsLayoutSize(50, 50, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['position_map_position'] = QgsLayoutPoint(2.5, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['map_size'] = QgsLayoutSize(210, 297, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['map_position'] = QgsLayoutPoint(0, 0, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['title_size'] = QgsLayoutSize(200, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['title_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['subtitle_size'] = QgsLayoutSize(200, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_size'] = QgsLayoutSize(48, 17, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 275, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['legend_position'] = QgsLayoutPoint(133, 215, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(64, 7, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(3, 288, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebar_size'] = QgsLayoutSize(65, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebar_position'] = QgsLayoutPoint(3, 273, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['north_size'] = QgsLayoutSize(12, 12, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['north_position'] = QgsLayoutPoint(196, 283, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text_size'] = QgsLayoutSize(50, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text_position'] = QgsLayoutPoint(200, 75, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text2_position'] = QgsLayoutPoint(55, 292, QgsUnitTypes.LayoutMillimeters)
if self.radioButton_6.isChecked() and self.radioButton_8.isChecked():
self.template_parameters['position_map_size'] = QgsLayoutSize(100, 100, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['position_map_position'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['map_size'] = QgsLayoutSize(297, 210, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['map_position'] = QgsLayoutPoint(0, 0, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['title_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['title_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['subtitle_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_size'] = QgsLayoutSize(48, 17, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 185, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['legend_position'] = QgsLayoutPoint(231, 135, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(64, 7, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(3, 201, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebar_size'] = QgsLayoutSize(65, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebar_position'] = QgsLayoutPoint(3, 186, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['north_size'] = QgsLayoutSize(12, 12, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['north_position'] = QgsLayoutPoint(283, 196, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text_size'] = QgsLayoutSize(50, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text_position'] = QgsLayoutPoint(287, 123, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text2_position'] = QgsLayoutPoint(98, 205, QgsUnitTypes.LayoutMillimeters)
if self.radioButton_5.isChecked() and self.radioButton_7.isChecked():
self.template_parameters['position_map_size'] = QgsLayoutSize(50, 50, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['position_map_position'] = QgsLayoutPoint(2.5, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['map_size'] = QgsLayoutSize(297, 420, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['map_position'] = QgsLayoutPoint(0, 0, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['title_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['title_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['subtitle_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_size'] = QgsLayoutSize(48, 17, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 370, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['legend_position'] = QgsLayoutPoint(219, 324, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(64, 7, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(3, 410, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebar_size'] = QgsLayoutSize(65, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebar_position'] = QgsLayoutPoint(3, 395, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['north_size'] = QgsLayoutSize(24, 24, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['north_position'] = QgsLayoutPoint(271, 394, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text_size'] = QgsLayoutSize(50, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text_position'] = QgsLayoutPoint(287125, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text2_position'] = QgsLayoutPoint(98, 414, QgsUnitTypes.LayoutMillimeters)
if self.radioButton_5.isChecked() and self.radioButton_8.isChecked():
self.template_parameters['position_map_size'] = QgsLayoutSize(100, 100, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['position_map_position'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['map_size'] = QgsLayoutSize(420, 297, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['map_position'] = QgsLayoutPoint(0, 0, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['title_size'] = QgsLayoutSize(411, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['title_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['subtitle_size'] = QgsLayoutSize(411, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_size'] = QgsLayoutSize(48, 17, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 247, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['legend_position'] = QgsLayoutPoint(341, 196, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(64, 7, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(3, 287, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebar_size'] = QgsLayoutSize(65, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebar_position'] = QgsLayoutPoint(3, 272, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['north_size'] = QgsLayoutSize(24, 24, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['north_position'] = QgsLayoutPoint(394, 271, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text_size'] = QgsLayoutSize(50, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text_position'] = QgsLayoutPoint(414, 123, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text2_position'] = QgsLayoutPoint(185, 292, QgsUnitTypes.LayoutMillimeters)
### Modèle carto standard CEN ISERE###
if values_page == '3. Modèle carto standard Cen Isere.qpt':
if self.radioButton_6.isChecked() and self.radioButton_7.isChecked():
self.template_parameters['position_map_size'] = QgsLayoutSize(50, 50, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['position_map_position'] = QgsLayoutPoint(2.5, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['map_size'] = QgsLayoutSize(199, 175+47, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['map_position'] = QgsLayoutPoint(5, 25, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['title_size'] = QgsLayoutSize(200, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['title_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['subtitle_size'] = QgsLayoutSize(200, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 12, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 275, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['legend_position'] = QgsLayoutPoint(5, 205+47, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(55, 5, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(145, 228+47, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebar_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebar_position'] = QgsLayoutPoint(145, 215+47, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['north_size'] = QgsLayoutSize(12, 12, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['north_position'] = QgsLayoutPoint(193, 214+47, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text_size'] = QgsLayoutSize(50, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text_position'] = QgsLayoutPoint(200, 79, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text2_position'] = QgsLayoutPoint(104, 201+47, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['image_size'] = QgsLayoutSize(199, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['image_position'] = QgsLayoutPoint(5, 18, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['image_size_2'] = QgsLayoutSize(200, 12, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['image_position_2'] = QgsLayoutPoint(4.5, 194.9+47, QgsUnitTypes.LayoutMillimeters)
if self.radioButton_6.isChecked() and self.radioButton_8.isChecked():
self.template_parameters['position_map_size'] = QgsLayoutSize(100, 100, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['position_map_position'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['map_size'] = QgsLayoutSize(285, 145, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['map_position'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['title_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['title_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['subtitle_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 185, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['legend_position'] = QgsLayoutPoint(5, 168, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(207, 193, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebar_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebar_position'] = QgsLayoutPoint(207, 180, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['north_size'] = QgsLayoutSize(8.4, 12.5, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['north_position'] = QgsLayoutPoint(273, 182, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text_size'] = QgsLayoutSize(50, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text_position'] = QgsLayoutPoint(287, 123, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text2_position'] = QgsLayoutPoint(189, 168.5, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['image_size'] = QgsLayoutSize(285, 23, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['image_position'] = QgsLayoutPoint(6, 13, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['image_size_2'] = QgsLayoutSize(286, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['image_position_2'] = QgsLayoutPoint(5.5, 162.2, QgsUnitTypes.LayoutMillimeters)
if self.radioButton_5.isChecked() and self.radioButton_7.isChecked():
self.template_parameters['map_size'] = QgsLayoutSize(285, 260, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['map_position'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['title_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['title_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['subtitle_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 395, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['legend_position'] = QgsLayoutPoint(5, 284, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(50, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(207, 310, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebar_size'] = QgsLayoutSize(50, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebar_position'] = QgsLayoutPoint(207, 298, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['north_size'] = QgsLayoutSize(8.4, 12.5, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['north_position'] = QgsLayoutPoint(273, 297, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text_size'] = QgsLayoutSize(50, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text_position'] = QgsLayoutPoint(287, 123, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text2_position'] = QgsLayoutPoint(189, 284, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['image_size'] = QgsLayoutSize(285, 30, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['image_position'] = QgsLayoutPoint(6, 13, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['image_size_2'] = QgsLayoutSize(286, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['image_position_2'] = QgsLayoutPoint(5.5, 278.2, QgsUnitTypes.LayoutMillimeters)
if self.radioButton_5.isChecked() and self.radioButton_8.isChecked():
self.template_parameters['map_size'] = QgsLayoutSize(408.5, 222, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['map_position'] = QgsLayoutPoint(5, 23.5, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['title_size'] = QgsLayoutSize(409, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['title_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['subtitle_size'] = QgsLayoutSize(409, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['subtitle_position'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_position'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_credit_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['logo_credit_position'] = QgsLayoutPoint(5, 275, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['legend_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['legend_position'] = QgsLayoutPoint(5, 249, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebarnumeric_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebarnumeric_position'] = QgsLayoutPoint(323, 282, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebar_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['scalebar_position'] = QgsLayoutPoint(323, 270, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['north_size'] = QgsLayoutSize(8.4, 12.5, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['north_position'] = QgsLayoutPoint(402, 270, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text_size'] = QgsLayoutSize(50, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text_position'] = QgsLayoutPoint(415, 123, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text2_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['credit_text2_position'] = QgsLayoutPoint(313, 247, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['image_size'] = QgsLayoutSize(408.5, 38, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['image_position'] = QgsLayoutPoint(5, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['image_size_2'] = QgsLayoutSize(409.3, 22, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['image_position_2'] = QgsLayoutPoint(4.6, 237.15, QgsUnitTypes.LayoutMillimeters)
# Retour des info #
return self.template_parameters
@@ -0,0 +1,168 @@
from qgis.core import (
QgsLayoutSize,
QgsUnitTypes,
QgsLayoutPoint,
)
def fletch_canvas(self):
if self.radioButton_6.isChecked():
values_page = 'A4'
else:
values_page = 'A3'
if self.radioButton_7.isChecked():
page_rotate = 'Portrait'
else:
page_rotate = 'Landscape'
if page_rotate == 'Portrait':
if values_page == 'A4':
self.template_parameters['Carte_2_size'] = QgsLayoutSize(50, 50, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(2.5, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_size'] = QgsLayoutSize(199, 175, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_locals'] = QgsLayoutPoint(5, 25, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_size'] = QgsLayoutSize(200, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_locals'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(200, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(5, 12, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_locals'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(5, 275, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_locals'] = QgsLayoutPoint(5, 205, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_size'] = QgsLayoutSize(55, 5, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(145, 228, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(145, 215, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_size'] = QgsLayoutSize(12, 12, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(193, 214, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_locals'] = QgsLayoutPoint(205, 125, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_locals'] = QgsLayoutPoint(104, 201, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_rotate'] = 0
self.template_parameters['Carte_2_rotate'] = 0
self.template_parameters['Legande_rotate'] = 0
self.template_parameters['Arrow_rotate'] = 0
self.template_parameters['Echelle_rotate'] = 0
self.template_parameters['Logo_rotate'] = 0
self.template_parameters['Titre_rotate'] = 0
self.template_parameters['Credit_rotate'] = 270
self.template_parameters['Source_rotate'] = 0
self.template_parameters['Sous_titre_rotate'] = 0
self.template_parameters['Echelle_2_rotate'] = 0
self.template_parameters['Logo_2_rotate'] = 0
if values_page == 'A3':
self.template_parameters['Carte_2_size'] = QgsLayoutSize(50, 50, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(2.5, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_size'] = QgsLayoutSize(285, 260, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_locals'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_locals'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_locals'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(5, 395, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_locals'] = QgsLayoutPoint(5, 284, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_size'] = QgsLayoutSize(50, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(207, 310, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(50, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(207, 298, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_size'] = QgsLayoutSize(8.4, 12.5, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(273, 297, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_locals'] = QgsLayoutPoint(291.5, 123, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_locals'] = QgsLayoutPoint(189, 284, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_rotate'] = 0
self.template_parameters['Carte_2_rotate'] = 0
self.template_parameters['Legande_rotate'] = 0
self.template_parameters['Arrow_rotate'] = 0
self.template_parameters['Echelle_rotate'] = 0
self.template_parameters['Logo_rotate'] = 0
self.template_parameters['Titre_rotate'] = 0
self.template_parameters['Credit_rotate'] = 270
self.template_parameters['Source_rotate'] = 0
self.template_parameters['Sous_titre_rotate'] = 0
self.template_parameters['Echelle_2_rotate'] = 0
self.template_parameters['Logo_2_rotate'] = 0
if page_rotate == 'Landscape':
if values_page == 'A4':
self.template_parameters['Carte_size'] = QgsLayoutSize(285, 145, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_locals'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_size'] = QgsLayoutSize(100, 100, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_locals'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_locals'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(5, 185, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_locals'] = QgsLayoutPoint(5, 168, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(207, 193, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(207, 180, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_size'] = QgsLayoutSize(8.4, 12.5, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(273, 182, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_locals'] = QgsLayoutPoint(291.5, 123, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_locals'] = QgsLayoutPoint(189, 168.5, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_rotate'] = 0
self.template_parameters['Carte_2_rotate'] = 0
self.template_parameters['Legande_rotate'] = 0
self.template_parameters['Arrow_rotate'] = 0
self.template_parameters['Echelle_rotate'] = 0
self.template_parameters['Logo_rotate'] = 0
self.template_parameters['Titre_rotate'] = 0
self.template_parameters['Credit_rotate'] = 270
self.template_parameters['Source_rotate'] = 0
self.template_parameters['Sous_titre_rotate'] = 0
self.template_parameters['Echelle_2_rotate'] = 0
self.template_parameters['Logo_2_rotate'] = 0
if values_page == 'A3':
self.template_parameters['Carte_size'] = QgsLayoutSize(408.5, 222, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_locals'] = QgsLayoutPoint(5, 23.5, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_size'] = QgsLayoutSize(100, 100, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_size'] = QgsLayoutSize(409, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_locals'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(409, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_size'] = QgsLayoutSize(46, 16, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_locals'] = QgsLayoutPoint(5, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(5, 275, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_locals'] = QgsLayoutPoint(5, 249, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(323, 282, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(55, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(323, 270, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_size'] = QgsLayoutSize(8.4, 12.5, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(402, 270, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_locals'] = QgsLayoutPoint(415, 123, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_locals'] = QgsLayoutPoint(313, 247, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_rotate'] = 0
self.template_parameters['Carte_2_rotate'] = 0
self.template_parameters['Legande_rotate'] = 0
self.template_parameters['Arrow_rotate'] = 0
self.template_parameters['Echelle_rotate'] = 0
self.template_parameters['Logo_rotate'] = 0
self.template_parameters['Titre_rotate'] = 0
self.template_parameters['Credit_rotate'] = 270
self.template_parameters['Source_rotate'] = 0
self.template_parameters['Sous_titre_rotate'] = 0
self.template_parameters['Echelle_2_rotate'] = 0
self.template_parameters['Logo_2_rotate'] = 0
return self.template_parameters
@@ -0,0 +1,167 @@
from qgis.core import (
QgsLayoutSize,
QgsUnitTypes,
QgsLayoutPoint,
)
def fletch_canvas(self):
if self.radioButton_6.isChecked():
values_page = 'A4'
else:
values_page = 'A3'
if self.radioButton_7.isChecked():
page_rotate = 'Portrait'
else:
page_rotate = 'Landscape'
if page_rotate == 'Portrait':
if values_page == 'A4':
self.template_parameters['Carte_size'] = QgsLayoutSize(200.0,200, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_locals'] = QgsLayoutPoint(6, 6, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_rotate'] = 0
self.template_parameters['Carte_2_size'] = QgsLayoutSize(80.0,80, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(126, 210, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_rotate'] = 0
self.template_parameters['Legande_size'] = QgsLayoutSize(86.0,86, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_locals'] = QgsLayoutPoint(6, 208, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_rotate'] = 0
self.template_parameters['Arrow_size'] = QgsLayoutSize(14.285714285714286,14, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(189, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_rotate'] = 0
self.template_parameters['Echelle_size'] = QgsLayoutSize(51.42857142857143,7, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(9, 197, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_rotate'] = 0
self.template_parameters['Logo_size'] = QgsLayoutSize(45.714285714285715,11, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_locals'] = QgsLayoutPoint(3, 3, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_rotate'] = 0
self.template_parameters['Titre_size'] = QgsLayoutSize(154.28571428571428,11, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_locals'] = QgsLayoutPoint(51, 3, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_rotate'] = 0
self.template_parameters['Credit_size'] = QgsLayoutSize(51.42857142857143,6, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_locals'] = QgsLayoutPoint(151, 210, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_rotate'] = 0
self.template_parameters['Source_size'] = QgsLayoutSize(51.42857142857143,6, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_locals'] = QgsLayoutPoint(229, 197, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_rotate'] = 0
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(125.71428571428571,14, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(60, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_rotate'] = 0
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(51.42857142857143,13, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(9, 184, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_rotate'] = 0
self.template_parameters['Logo_2_size'] = QgsLayoutSize(28.571428571428573,29, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(9, 151, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_rotate'] = 0
if values_page == 'A3':
self.template_parameters['Carte_size'] = QgsLayoutSize(282,282, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_locals'] = QgsLayoutPoint(8, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_rotate'] = 0
self.template_parameters['Carte_2_size'] = QgsLayoutSize(113,113, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(178, 296, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_rotate'] = 0
self.template_parameters['Legande_size'] = QgsLayoutSize(121,121, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_locals'] = QgsLayoutPoint(8, 293, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_rotate'] = 0
self.template_parameters['Arrow_size'] = QgsLayoutSize(20,20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(267, 28, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_rotate'] = 0
self.template_parameters['Echelle_size'] = QgsLayoutSize(73,10, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(13, 278, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_rotate'] = 0
self.template_parameters['Logo_size'] = QgsLayoutSize(64,16, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_locals'] = QgsLayoutPoint(4, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_rotate'] = 0
self.template_parameters['Titre_size'] = QgsLayoutSize(218,16, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_locals'] = QgsLayoutPoint(72, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_rotate'] = 0
self.template_parameters['Credit_size'] = QgsLayoutSize(73,8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_locals'] = QgsLayoutPoint(213, 296, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_rotate'] = 0
self.template_parameters['Source_size'] = QgsLayoutSize(73,8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_locals'] = QgsLayoutPoint(323, 278, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_rotate'] = 0
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(177,20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(85, 28, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_rotate'] = 0
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(73,18, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(13, 259, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_rotate'] = 0
self.template_parameters['Logo_2_size'] = QgsLayoutSize(40,40, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(13, 213, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_rotate'] = 0
if page_rotate == 'Landscape':
if values_page == 'A4':
self.template_parameters['Carte_size'] = QgsLayoutSize(200.0,200, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_locals'] = QgsLayoutPoint(6, 6, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_rotate'] = 0
self.template_parameters['Carte_2_size'] = QgsLayoutSize(85.71428571428571,69, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(209, 3, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_rotate'] = 0
self.template_parameters['Legande_size'] = QgsLayoutSize(85.71428571428571,131, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_locals'] = QgsLayoutPoint(209, 74, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_rotate'] = 0
self.template_parameters['Arrow_size'] = QgsLayoutSize(14.285714285714286,14, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(189, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_rotate'] = 0
self.template_parameters['Echelle_size'] = QgsLayoutSize(51.42857142857143,7, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(9, 197, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_rotate'] = 0
self.template_parameters['Logo_size'] = QgsLayoutSize(45.714285714285715,11, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_locals'] = QgsLayoutPoint(3, 3, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_rotate'] = 0
self.template_parameters['Titre_size'] = QgsLayoutSize(154.28571428571428,11, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_locals'] = QgsLayoutPoint(51, 3, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_rotate'] = 0
self.template_parameters['Credit_size'] = QgsLayoutSize(51.42857142857143,6, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_locals'] = QgsLayoutPoint(151, 197, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_rotate'] = 0
self.template_parameters['Source_size'] = QgsLayoutSize(51.42857142857143,6, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_locals'] = QgsLayoutPoint(229, 197, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_rotate'] = 0
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(125.71428571428571,14, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(60, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_rotate'] = 0
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(51.42857142857143,13, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(9, 184, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_rotate'] = 0
self.template_parameters['Logo_2_size'] = QgsLayoutSize(28.571428571428573,29, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(9, 151, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_rotate'] = 0
if values_page == 'A3':
self.template_parameters['Carte_size'] = QgsLayoutSize(282,282, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_locals'] = QgsLayoutPoint(8, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_rotate'] = 0
self.template_parameters['Carte_2_size'] = QgsLayoutSize(121,97, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(294, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_rotate'] = 0
self.template_parameters['Legande_size'] = QgsLayoutSize(121,185, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_locals'] = QgsLayoutPoint(294, 105, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_rotate'] = 0
self.template_parameters['Arrow_size'] = QgsLayoutSize(20,20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(266, 28, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_rotate'] = 0
self.template_parameters['Echelle_size'] = QgsLayoutSize(73,10, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(12, 278, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_rotate'] = 0
self.template_parameters['Logo_size'] = QgsLayoutSize(64,16, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_locals'] = QgsLayoutPoint(4, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_rotate'] = 0
self.template_parameters['Titre_size'] = QgsLayoutSize(218,16, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_locals'] = QgsLayoutPoint(73, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_rotate'] = 0
self.template_parameters['Credit_size'] = QgsLayoutSize(73,8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_locals'] = QgsLayoutPoint(214, 278, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_rotate'] = 0
self.template_parameters['Source_size'] = QgsLayoutSize(73,8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_locals'] = QgsLayoutPoint(322, 278, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_rotate'] = 0
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(177,20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(85, 28, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_rotate'] = 0
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(73,18, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(12, 260, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_rotate'] = 0
self.template_parameters['Logo_2_size'] = QgsLayoutSize(40,40, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(12, 214, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_rotate'] = 0
return self.template_parameters
@@ -0,0 +1,170 @@
from qgis.core import (
QgsLayoutSize,
QgsUnitTypes,
QgsLayoutPoint,
)
def fletch_canvas(self):
if self.radioButton_6.isChecked():
values_page = 'A4'
else:
values_page = 'A3'
if self.radioButton_7.isChecked():
page_rotate = 'Portrait'
else:
page_rotate = 'Landscape'
if page_rotate == 'Portrait':
if values_page == 'A4':
self.template_parameters['Carte_2_size'] = QgsLayoutSize(50, 50, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(2.5, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_size'] = QgsLayoutSize(210, 297, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_locals'] = QgsLayoutPoint(0, 0, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_size'] = QgsLayoutSize(200, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_locals'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(200, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_size'] = QgsLayoutSize(48, 17, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_position'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(5, 275, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_locals'] = QgsLayoutPoint(133, 215, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_size'] = QgsLayoutSize(64, 7, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(3, 288, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(65, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(3, 273, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_size'] = QgsLayoutSize(12, 12, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(196, 283, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_locals'] = QgsLayoutPoint(205, 125, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_size'] = QgsLayoutSize(100, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_locals'] = QgsLayoutPoint(55, 292, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_rotate'] = 0
self.template_parameters['Carte_2_rotate'] = 0
self.template_parameters['Legande_rotate'] = 0
self.template_parameters['Arrow_rotate'] = 0
self.template_parameters['Echelle_rotate'] = 0
self.template_parameters['Logo_rotate'] = 0
self.template_parameters['Titre_rotate'] = 0
self.template_parameters['Credit_rotate'] = 270
self.template_parameters['Source_rotate'] = 0
self.template_parameters['Sous_titre_rotate'] = 0
self.template_parameters['Echelle_2_rotate'] = 0
self.template_parameters['Logo_2_rotate'] = 0
if values_page == 'A3':
self.template_parameters['Carte_2_size'] = QgsLayoutSize(50, 50, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(2.5, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_size'] = QgsLayoutSize(297, 420, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_locals'] = QgsLayoutPoint(0, 0, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_locals'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_size'] = QgsLayoutSize(48, 17, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_locals'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(5, 370, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_locals'] = QgsLayoutPoint(219, 324, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_size'] = QgsLayoutSize(64, 7, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(3, 410, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(65, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(3, 395, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_size'] = QgsLayoutSize(24, 24, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(271, 394, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_locals'] = QgsLayoutPoint(291, 125, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_size'] = QgsLayoutSize(100, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_locals'] = QgsLayoutPoint(98, 414, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_rotate'] = 0
self.template_parameters['Carte_2_rotate'] = 0
self.template_parameters['Legande_rotate'] = 0
self.template_parameters['Arrow_rotate'] = 0
self.template_parameters['Echelle_rotate'] = 0
self.template_parameters['Logo_rotate'] = 0
self.template_parameters['Titre_rotate'] = 0
self.template_parameters['Credit_rotate'] = 270
self.template_parameters['Source_rotate'] = 0
self.template_parameters['Sous_titre_rotate'] = 0
self.template_parameters['Echelle_2_rotate'] = 0
self.template_parameters['Logo_2_rotate'] = 0
if page_rotate == 'Landscape':
if values_page == 'A4':
self.template_parameters['Carte_2_size'] = QgsLayoutSize(100, 100, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_size'] = QgsLayoutSize(420, 297, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_locals'] = QgsLayoutPoint(0, 0, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_size'] = QgsLayoutSize(411, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_locals'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(411, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_size'] = QgsLayoutSize(48, 17, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_locals'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(5, 247, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_locals'] = QgsLayoutPoint(341, 196, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_size'] = QgsLayoutSize(64, 7, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(3, 287, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(65, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(3, 272, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_size'] = QgsLayoutSize(24, 24, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(394, 271, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_size'] = QgsLayoutSize(100, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_locals'] = QgsLayoutPoint(414, 123, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_size'] = QgsLayoutSize(100, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_locals'] = QgsLayoutPoint(185, 292, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_rotate'] = 0
self.template_parameters['Carte_2_rotate'] = 0
self.template_parameters['Legande_rotate'] = 0
self.template_parameters['Arrow_rotate'] = 0
self.template_parameters['Echelle_rotate'] = 0
self.template_parameters['Logo_rotate'] = 0
self.template_parameters['Titre_rotate'] = 0
self.template_parameters['Credit_rotate'] = 270
self.template_parameters['Source_rotate'] = 0
self.template_parameters['Sous_titre_rotate'] = 0
self.template_parameters['Echelle_2_rotate'] = 0
self.template_parameters['Logo_2_rotate'] = 0
if values_page == 'A3':
self.template_parameters['Carte_2_size'] = QgsLayoutSize(100, 100, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_size'] = QgsLayoutSize(297, 210, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_locals'] = QgsLayoutPoint(0, 0, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_locals'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(286, 8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(5, 10, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_size'] = QgsLayoutSize(48, 17, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_locals'] = QgsLayoutPoint(5, 2, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_size'] = QgsLayoutSize(50, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(5, 185, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_size'] = QgsLayoutSize(405, 203, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_locals'] = QgsLayoutPoint(231, 135, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_size'] = QgsLayoutSize(64, 7, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(3, 201, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(65, 15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(3, 186, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_size'] = QgsLayoutSize(12, 12, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(283, 196, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_locals'] = QgsLayoutPoint(291.5, 123, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_size'] = QgsLayoutSize(100, 3.9, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_locals'] = QgsLayoutPoint(98, 205, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_rotate'] = 0
self.template_parameters['Carte_2_rotate'] = 0
self.template_parameters['Legande_rotate'] = 0
self.template_parameters['Arrow_rotate'] = 0
self.template_parameters['Echelle_rotate'] = 0
self.template_parameters['Logo_rotate'] = 0
self.template_parameters['Titre_rotate'] = 0
self.template_parameters['Credit_rotate'] = 270
self.template_parameters['Source_rotate'] = 0
self.template_parameters['Sous_titre_rotate'] = 0
self.template_parameters['Echelle_2_rotate'] = 0
self.template_parameters['Logo_2_rotate'] = 0
# Retour des info #
return self.template_parameters
@@ -0,0 +1,167 @@
from qgis.core import (
QgsLayoutSize,
QgsUnitTypes,
QgsLayoutPoint,
)
def fletch_canvas(self):
if self.radioButton_6.isChecked():
values_page = 'A4'
else:
values_page = 'A3'
if self.radioButton_7.isChecked():
page_rotate = 'Portrait'
else:
page_rotate = 'Landscape'
if page_rotate == 'Portrait':
if values_page == 'A4':
self.template_parameters['Carte_size'] = QgsLayoutSize(168.0,262, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_locals'] = QgsLayoutPoint(41, 1, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_rotate'] = 0
self.template_parameters['Carte_2_size'] = QgsLayoutSize(78.85714285714286,70, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(130, 1, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_rotate'] = 0
self.template_parameters['Legande_size'] = QgsLayoutSize(168.0,32, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_locals'] = QgsLayoutPoint(41, 264, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_rotate'] = 0
self.template_parameters['Arrow_size'] = QgsLayoutSize(14.285714285714286,14, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(13, 254, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_rotate'] = 0
self.template_parameters['Echelle_size'] = QgsLayoutSize(38.857142857142854,7, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(1, 289, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_rotate'] = 0
self.template_parameters['Logo_size'] = QgsLayoutSize(34.857142857142854,10, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_locals'] = QgsLayoutPoint(3, 139, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_rotate'] = 0
self.template_parameters['Titre_size'] = QgsLayoutSize(38.857142857142854,11, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_locals'] = QgsLayoutPoint(1, 3, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_rotate'] = 0
self.template_parameters['Credit_size'] = QgsLayoutSize(74.85714285714286,6, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_locals'] = QgsLayoutPoint(43, 3, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_rotate'] = 0
self.template_parameters['Source_size'] = QgsLayoutSize(104.0,6, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_locals'] = QgsLayoutPoint(104, 256, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_rotate'] = 0
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(38.857142857142854,14, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(1, 14, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_rotate'] = 0
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(38.857142857142854,13, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(1, 276, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_rotate'] = 0
self.template_parameters['Logo_2_size'] = QgsLayoutSize(30.0,30, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(41, 233, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_rotate'] = 0
if values_page == 'A3':
self.template_parameters['Carte_size'] = QgsLayoutSize(237,369, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_locals'] = QgsLayoutPoint(58, 2, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_rotate'] = 0
self.template_parameters['Carte_2_size'] = QgsLayoutSize(111,99, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(183, 2, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_rotate'] = 0
self.template_parameters['Legande_size'] = QgsLayoutSize(237,45, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_locals'] = QgsLayoutPoint(58, 372, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_rotate'] = 0
self.template_parameters['Arrow_size'] = QgsLayoutSize(20,20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(19, 358, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_rotate'] = 0
self.template_parameters['Echelle_size'] = QgsLayoutSize(55,10, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(2, 408, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_rotate'] = 0
self.template_parameters['Logo_size'] = QgsLayoutSize(49,14, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_locals'] = QgsLayoutPoint(4, 196, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_rotate'] = 0
self.template_parameters['Titre_size'] = QgsLayoutSize(55,15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_locals'] = QgsLayoutPoint(2, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_rotate'] = 0
self.template_parameters['Credit_size'] = QgsLayoutSize(106,8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_locals'] = QgsLayoutPoint(60, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_rotate'] = 0
self.template_parameters['Source_size'] = QgsLayoutSize(147,8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_locals'] = QgsLayoutPoint(147, 361, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_rotate'] = 0
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(55,20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(2, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_rotate'] = 0
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(55,19, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(2, 389, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_rotate'] = 0
self.template_parameters['Logo_2_size'] = QgsLayoutSize(42,42, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(58, 329, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_rotate'] = 0
if page_rotate == 'Landscape':
if values_page == 'A4':
self.template_parameters['Carte_size'] = QgsLayoutSize(254.85714285714286,175, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_locals'] = QgsLayoutPoint(41, 1, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_rotate'] = 0
self.template_parameters['Carte_2_size'] = QgsLayoutSize(78.85714285714286,70, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(217, 1, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_rotate'] = 0
self.template_parameters['Legande_size'] = QgsLayoutSize(254.85714285714286,32, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_locals'] = QgsLayoutPoint(41, 177, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_rotate'] = 0
self.template_parameters['Arrow_size'] = QgsLayoutSize(14.285714285714286,14, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(13, 168, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_rotate'] = 0
self.template_parameters['Echelle_size'] = QgsLayoutSize(38.857142857142854,7, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(1, 202, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_rotate'] = 0
self.template_parameters['Logo_size'] = QgsLayoutSize(34.857142857142854,10, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_locals'] = QgsLayoutPoint(3, 94, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_rotate'] = 0
self.template_parameters['Titre_size'] = QgsLayoutSize(38.857142857142854,11, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_locals'] = QgsLayoutPoint(1, 3, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_rotate'] = 0
self.template_parameters['Credit_size'] = QgsLayoutSize(74.85714285714286,6, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_locals'] = QgsLayoutPoint(43, 3, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_rotate'] = 0
self.template_parameters['Source_size'] = QgsLayoutSize(104.0,6, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_locals'] = QgsLayoutPoint(190, 169, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_rotate'] = 0
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(38.857142857142854,14, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(1, 14, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_rotate'] = 0
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(38.857142857142854,13, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(1, 189, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_rotate'] = 0
self.template_parameters['Logo_2_size'] = QgsLayoutSize(30.0,30, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(41, 146, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_rotate'] = 0
if values_page == 'A3':
self.template_parameters['Carte_size'] = QgsLayoutSize(359,247, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_locals'] = QgsLayoutPoint(58, 2, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_rotate'] = 0
self.template_parameters['Carte_2_size'] = QgsLayoutSize(111,99, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(306, 2, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Carte_2_rotate'] = 0
self.template_parameters['Legande_size'] = QgsLayoutSize(359,45, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_locals'] = QgsLayoutPoint(58, 250, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Legande_rotate'] = 0
self.template_parameters['Arrow_size'] = QgsLayoutSize(20,20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(19, 237, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Arrow_rotate'] = 0
self.template_parameters['Echelle_size'] = QgsLayoutSize(55,10, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(2, 285, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_rotate'] = 0
self.template_parameters['Logo_size'] = QgsLayoutSize(49,14, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_locals'] = QgsLayoutPoint(4, 133, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_rotate'] = 0
self.template_parameters['Titre_size'] = QgsLayoutSize(55,15, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_locals'] = QgsLayoutPoint(2, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Titre_rotate'] = 0
self.template_parameters['Credit_size'] = QgsLayoutSize(106,8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_locals'] = QgsLayoutPoint(60, 4, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Credit_rotate'] = 0
self.template_parameters['Source_size'] = QgsLayoutSize(147,8, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_locals'] = QgsLayoutPoint(268, 238, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Source_rotate'] = 0
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(55,20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(2, 20, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Sous_titre_rotate'] = 0
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(55,19, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(2, 267, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Echelle_2_rotate'] = 0
self.template_parameters['Logo_2_size'] = QgsLayoutSize(42,42, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(58, 206, QgsUnitTypes.LayoutMillimeters)
self.template_parameters['Logo_2_rotate'] = 0
return self.template_parameters
@@ -0,0 +1,120 @@
<Layout worldFileMap="" name="test.qpt" printResolution="300" units="mm">
<Snapper snapToGrid="0" snapToItems="1" tolerance="5" snapToGuides="1"/>
<Grid resolution="10" offsetUnits="mm" offsetX="0" resUnits="mm" offsetY="0"/>
<PageCollection>
<symbol name="" clip_to_extent="1" type="fill" force_rhr="0" alpha="1">
<data_defined_properties>
<Option type="Map">
<Option name="name" value="" type="QString"/>
<Option name="properties"/>
<Option name="type" value="collection" type="QString"/>
</Option>
</data_defined_properties>
<layer class="SimpleFill" locked="0" enabled="1" pass="0">
<Option type="Map">
<Option name="border_width_map_unit_scale" value="3x:0,0,0,0,0,0" type="QString"/>
<Option name="color" value="255,255,255,255" type="QString"/>
<Option name="joinstyle" value="miter" type="QString"/>
<Option name="offset" value="0,0" type="QString"/>
<Option name="offset_map_unit_scale" value="3x:0,0,0,0,0,0" type="QString"/>
<Option name="offset_unit" value="MM" type="QString"/>
<Option name="outline_color" value="35,35,35,255" type="QString"/>
<Option name="outline_style" value="no" type="QString"/>
<Option name="outline_width" value="0.26" type="QString"/>
<Option name="outline_width_unit" value="MM" type="QString"/>
<Option name="style" value="solid" type="QString"/>
</Option>
<prop k="border_width_map_unit_scale" v="3x:0,0,0,0,0,0"/>
<prop k="color" v="255,255,255,255"/>
<prop k="joinstyle" v="miter"/>
<prop k="offset" v="0,0"/>
<prop k="offset_map_unit_scale" v="3x:0,0,0,0,0,0"/>
<prop k="offset_unit" v="MM"/>
<prop k="outline_color" v="35,35,35,255"/>
<prop k="outline_style" v="no"/>
<prop k="outline_width" v="0.26"/>
<prop k="outline_width_unit" v="MM"/>
<prop k="style" v="solid"/>
<data_defined_properties>
<Option type="Map">
<Option name="name" value="" type="QString"/>
<Option name="properties"/>
<Option name="type" value="collection" type="QString"/>
</Option>
</data_defined_properties>
</layer>
</symbol>
<LayoutItem zValue="0" id="" itemRotation="0" position="0,0,mm" frame="false" templateUuid="{5c80221d-7561-455b-94fd-69a27d877679}" referencePoint="0" opacity="1" frameJoinStyle="miter" uuid="{5c80221d-7561-455b-94fd-69a27d877679}" blendMode="0" size="297,210,mm" groupUuid="" outlineWidthM="0.3,mm" positionOnPage="0,0,mm" type="65638" excludeFromExports="0" positionLock="false" background="true" visibility="1">
<FrameColor green="0" blue="0" red="0" alpha="255"/>
<BackgroundColor green="255" blue="255" red="255" alpha="255"/>
<LayoutObject>
<dataDefinedProperties>
<Option type="Map">
<Option name="name" value="" type="QString"/>
<Option name="properties"/>
<Option name="type" value="collection" type="QString"/>
</Option>
</dataDefinedProperties>
<customproperties>
<Option/>
</customproperties>
</LayoutObject>
<symbol name="" clip_to_extent="1" type="fill" force_rhr="0" alpha="1">
<data_defined_properties>
<Option type="Map">
<Option name="name" value="" type="QString"/>
<Option name="properties"/>
<Option name="type" value="collection" type="QString"/>
</Option>
</data_defined_properties>
<layer class="SimpleFill" locked="0" enabled="1" pass="0">
<Option type="Map">
<Option name="border_width_map_unit_scale" value="3x:0,0,0,0,0,0" type="QString"/>
<Option name="color" value="255,255,255,255" type="QString"/>
<Option name="joinstyle" value="miter" type="QString"/>
<Option name="offset" value="0,0" type="QString"/>
<Option name="offset_map_unit_scale" value="3x:0,0,0,0,0,0" type="QString"/>
<Option name="offset_unit" value="MM" type="QString"/>
<Option name="outline_color" value="35,35,35,255" type="QString"/>
<Option name="outline_style" value="no" type="QString"/>
<Option name="outline_width" value="0.26" type="QString"/>
<Option name="outline_width_unit" value="MM" type="QString"/>
<Option name="style" value="solid" type="QString"/>
</Option>
<prop k="border_width_map_unit_scale" v="3x:0,0,0,0,0,0"/>
<prop k="color" v="255,255,255,255"/>
<prop k="joinstyle" v="miter"/>
<prop k="offset" v="0,0"/>
<prop k="offset_map_unit_scale" v="3x:0,0,0,0,0,0"/>
<prop k="offset_unit" v="MM"/>
<prop k="outline_color" v="35,35,35,255"/>
<prop k="outline_style" v="no"/>
<prop k="outline_width" v="0.26"/>
<prop k="outline_width_unit" v="MM"/>
<prop k="style" v="solid"/>
<data_defined_properties>
<Option type="Map">
<Option name="name" value="" type="QString"/>
<Option name="properties"/>
<Option name="type" value="collection" type="QString"/>
</Option>
</data_defined_properties>
</layer>
</symbol>
</LayoutItem>
<GuideCollection visible="1"/>
</PageCollection>
<customproperties>
<Option type="Map">
<Option name="atlasRasterFormat" value="png" type="QString"/>
<Option name="imageAntialias" value="true" type="bool"/>
<Option name="imageCropMarginBottom" value="0" type="int"/>
<Option name="imageCropMarginLeft" value="0" type="int"/>
<Option name="imageCropMarginRight" value="0" type="int"/>
<Option name="imageCropMarginTop" value="0" type="int"/>
<Option name="imageCropToContents" value="false" type="bool"/>
<Option name="singleFile" value="true" type="bool"/>
</Option>
</customproperties>
<Atlas coverageLayer="" pageNameExpression="" filterFeatures="0" filenamePattern="'output_'||@atlas_featurenumber" enabled="0" hideCoverage="0" sortFeatures="0"/>
</Layout>
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

+187
View File
@@ -0,0 +1,187 @@
"""Tools to work with resource files."""
import configparser
import shutil
import tempfile
import base64
import psycopg2
import psycopg2.extras
from os.path import abspath, join, pardir, dirname
from qgis.PyQt.QtWidgets import QApplication
from qgis.PyQt import uic
__copyright__ = "Copyright 2019, 3Liz"
__license__ = "GPL version 3"
__email__ = "info@3liz.org"
__revision__ = "$Format:%H$"
def plugin_path(*args):
"""Get the path to plugin root folder.
:param args List of path elements e.g. ['img', 'logos', 'image.png']
:type args: str
:return: Absolute path to the plugin path.
:rtype: str
"""
path = dirname(dirname(__file__))
path = abspath(abspath(join(path, pardir)))
for item in args:
path = abspath(join(path, item))
return path
def plugin_name():
"""Return the plugin name according to metadata.txt.
:return: The plugin name.
:rtype: basestring
"""
metadata = metadata_config()
name = metadata["general"]["name"]
return name
def metadata_config() -> configparser:
"""Get the INI config parser for the metadata file.
:return: The config parser object.
:rtype: ConfigParser
"""
path = plugin_path("metadata.txt")
config = configparser.ConfigParser()
config.read(path, encoding='utf8')
return config
def plugin_test_data_path(*args, copy=False):
"""Get the path to the plugin test data path.
:param args List of path elements e.g. ['img', 'logos', 'image.png']
:type args: str
:param copy: If the file must be copied into a temporary directory first.
:type copy: bool
:return: Absolute path to the resources folder.
:rtype: str
"""
path = abspath(abspath(join(plugin_path(), "test", "data")))
for item in args:
path = abspath(join(path, item))
if copy:
temp = tempfile.mkdtemp()
shutil.copy(path, temp)
return join(temp, args[-1])
else:
return path
def resources_path(*args):
"""Get the path to our resources folder.
:param args List of path elements e.g. ['img', 'logos', 'image.png']
:type args: str
:return: Absolute path to the resources folder.
:rtype: str
"""
path = abspath(abspath(join(plugin_path(), "CenIsere_AUTOMAP/tools")))
for item in args:
path = abspath(join(path, item))
return path
def load_ui(*args):
"""Get compile UI file.
:param args List of path elements e.g. ['img', 'logos', 'image.png']
:type args: str
:return: Compiled UI file.
"""
ui_class, _ = uic.loadUiType(resources_path("ui", *args))
return ui_class
# def login_base(take=None):
# from CenRa_METABASE.tools.PythonSQL import host,port,dbname,password,os_user
# first_conn = psycopg2.connect("host=" + host + " port=" + port + " dbname="+dbname+" user=first_cnx password=" + password)
# first_cur = first_conn.cursor(cursor_factory = psycopg2.extras.DictCursor)
# first_cur.execute("SELECT mdp_w, login_w FROM pg_catalog.pg_user t1, admin_sig.vm_users_sig t2 WHERE t2.oid = t1.usesysid AND (login_w = '" + os_user + "' OR login_w = '" + os_user + "')")
# res_ident = first_cur.fetchone()
# mdp = base64.b64decode(str(res_ident[0])).decode('utf-8')
# user = res_ident[1]
# con = psycopg2.connect("host=" + host + " port=" + port + " dbname="+dbname+" user=" + user + " password=" + mdp)
# cur = con.cursor(cursor_factory = psycopg2.extras.DictCursor)
# first_conn.close()
# if take:
# return cur,con
# else:
# return cur
def send_issues(url,titre,body,labels):
import requests
import json
import os
import qgis
usr = os.environ['USERNAME']
token = '9d0a4e0bea561710e0728f161f7edf4e5201e112'
url=url+'?token='+token
headers = {'Authorization': 'token ' + token,'accept': 'application/json','Content-Type': 'application/json'}
payload = {'title': titre, 'body': body, 'labels': labels}
try:
urllib.request.urlopen('https://google.com')
binar = True
except:
binar = False
r = ''
if binar:
r = requests.post(url, data=json.dumps(payload), headers=headers)
return r
def maj_verif(NAME):
import qgis
import urllib.request
iface = qgis.utils.iface
from qgis.core import Qgis
url = qgis.utils.pluginMetadata(NAME,'repository')
#URL = url+'/raw/branch/main/plugins.xml'
URL = 'https://gitea.cenra-outils.org/CEN38/Plugin_QGIS/releases/download/latest/plugins.xml'
# print(URL)
version = qgis.utils.pluginMetadata(NAME,'version')
len_version = len(version)
try:
urllib.request.urlopen('https://google.com')
binar = True
except:
binar = False
if binar:
version_web = str(urllib.request.urlopen(URL).read())
plugin_num = version_web.find(NAME)
valeur_version_web = version_web.find('<version>',plugin_num)+9
version_plugin = version_web[valeur_version_web:valeur_version_web+len_version]
if version_plugin != version:
iface.messageBar().pushMessage("MAJ :", "Des mise à jour de plugin sont disponibles.", level=Qgis.Info, duration=30)
else:
iface.messageBar().pushMessage("WiFi :", "Pas de connection à internet.", level=Qgis.Warning, duration=30)
def tr(text, context="@default"):
return QApplication.translate(context, text)
def devlog(NAME):
import qgis
devmaj = '<head><style>* {margin:0; padding:0; }</style></head>'
devmaj = devmaj+qgis.utils.pluginMetadata(NAME,'changelog')
return devmaj
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CenRa_Metabase_editorwidget_base</class>
<widget class="QDialog" name="CenRa_Metabase_editorwidget_base">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>471</width>
<height>594</height>
</rect>
</property>
<property name="windowTitle">
<string>Metabase</string>
</property>
<property name="windowIcon">
<iconset>
<normaloff>../../CenRa_Metabase/tools/ui/icon.svg</normaloff>../../CenRa_Metabase/tools/ui/icon.svg</iconset>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>453</width>
<height>547</height>
</rect>
</property>
<widget class="QGroupBox" name="groupBox">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>451</width>
<height>541</height>
</rect>
</property>
<property name="title">
<string>DevLog</string>
</property>
<widget class="QWebView" name="viewer" native="true">
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>431</width>
<height>511</height>
</rect>
</property>
<property name="url" stdset="0">
<url>
<string>about:blank</string>
</url>
</property>
</widget>
</widget>
</widget>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header location="global">QtWebKitWidgets/QWebView</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,477 @@
# Form implementation generated from reading ui file '/home/colas/Git/Plugin_QGIS/CenIsere_AUTOMAP/tools/ui/CenIsere_AutoMap_base.ui'
#
# Created by: PyQt6 UI code generator 6.7.0
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_MapCENDialogBase(object):
def setupUi(self, MapCENDialogBase):
MapCENDialogBase.setObjectName("MapCENDialogBase")
MapCENDialogBase.resize(1150, 778)
self.tabWidget = QtWidgets.QTabWidget(parent=MapCENDialogBase)
self.tabWidget.setGeometry(QtCore.QRect(0, 0, 1150, 781))
self.tabWidget.setMinimumSize(QtCore.QSize(1150, 781))
self.tabWidget.setMaximumSize(QtCore.QSize(1150, 781))
self.tabWidget.setBaseSize(QtCore.QSize(1150, 781))
self.tabWidget.setStyleSheet("QWidget#tab{background-image: url(/Users/tlaveille/Pictures/Capturel.png);}\n"
" ")
self.tabWidget.setObjectName("tabWidget")
self.tab = QtWidgets.QWidget()
self.tab.setObjectName("tab")
self.groupBox_6 = QtWidgets.QGroupBox(parent=self.tab)
self.groupBox_6.setGeometry(QtCore.QRect(680, 350, 141, 41))
self.groupBox_6.setStyleSheet("QGroupBox#groupBox_6{background-color: rgb(255, 255, 255, 170);}")
self.groupBox_6.setTitle("")
self.groupBox_6.setObjectName("groupBox_6")
self.commandLinkButton = QtWidgets.QCommandLinkButton(parent=self.groupBox_6)
self.commandLinkButton.setGeometry(QtCore.QRect(0, 0, 141, 41))
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(10)
self.commandLinkButton.setFont(font)
self.commandLinkButton.setStyleSheet("background-color: qconicalgradient(cx:0, cy:0, angle:135, stop:0 rgba(255, 255, 0, 69), stop:0.375 rgba(255, 255, 0, 69), stop:0.423533 rgba(251, 255, 0, 145), stop:0.45 rgba(247, 255, 0, 208), stop:0.477581 rgba(255, 244, 71, 130), stop:0.518717 rgba(255, 218, 71, 130), stop:0.55 rgba(255, 255, 0, 255), stop:0.57754 rgba(255, 203, 0, 130), stop:0.625 rgba(255, 255, 0, 69), stop:1 rgba(255, 255, 0, 69));")
self.commandLinkButton.setObjectName("commandLinkButton")
self.groupBox_7 = QtWidgets.QGroupBox(parent=self.tab)
self.groupBox_7.setGeometry(QtCore.QRect(20, 70, 391, 611))
font = QtGui.QFont()
font.setBold(True)
font.setWeight(75)
self.groupBox_7.setFont(font)
self.groupBox_7.setStyleSheet("QGroupBox#groupBox_7{background-color: rgb(255, 255, 255, 170);}")
self.groupBox_7.setTitle("")
self.groupBox_7.setObjectName("groupBox_7")
self.label_4 = QtWidgets.QLabel(parent=self.groupBox_7)
self.label_4.setGeometry(QtCore.QRect(30, 10, 311, 41))
font = QtGui.QFont()
font.setBold(True)
font.setUnderline(True)
font.setWeight(75)
self.label_4.setFont(font)
self.label_4.setStyleSheet("color: rgb(11, 11, 11);")
self.label_4.setObjectName("label_4")
self.comboBox = QtWidgets.QComboBox(parent=self.groupBox_7)
self.comboBox.setGeometry(QtCore.QRect(30, 40, 331, 22))
self.comboBox.setEditable(False)
self.comboBox.setCurrentText("")
self.comboBox.setInsertPolicy(QtWidgets.QComboBox.InsertPolicy.InsertAlphabetically)
self.comboBox.setObjectName("comboBox")
self.comboBox.addItem("")
self.comboBox.setItemText(0, "")
self.lineEdit_2 = QtWidgets.QLineEdit(parent=self.groupBox_7)
self.lineEdit_2.setEnabled(True)
self.lineEdit_2.setGeometry(QtCore.QRect(40, 200, 311, 21))
self.lineEdit_2.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.lineEdit_2.setReadOnly(False)
self.lineEdit_2.setClearButtonEnabled(True)
self.lineEdit_2.setObjectName("lineEdit_2")
self.label_6 = QtWidgets.QLabel(parent=self.groupBox_7)
self.label_6.setGeometry(QtCore.QRect(30, 170, 311, 41))
font = QtGui.QFont()
font.setBold(False)
font.setUnderline(True)
font.setWeight(50)
self.label_6.setFont(font)
self.label_6.setStyleSheet("color: rgb(11, 11, 11);")
self.label_6.setObjectName("label_6")
self.lineEdit_3 = QtWidgets.QLineEdit(parent=self.groupBox_7)
self.lineEdit_3.setEnabled(True)
self.lineEdit_3.setGeometry(QtCore.QRect(40, 290, 311, 21))
self.lineEdit_3.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.lineEdit_3.setReadOnly(False)
self.lineEdit_3.setClearButtonEnabled(True)
self.lineEdit_3.setObjectName("lineEdit_3")
self.label_7 = QtWidgets.QLabel(parent=self.groupBox_7)
self.label_7.setGeometry(QtCore.QRect(30, 260, 311, 41))
font = QtGui.QFont()
font.setBold(False)
font.setUnderline(True)
font.setWeight(50)
self.label_7.setFont(font)
self.label_7.setStyleSheet("color: rgb(11, 11, 11);")
self.label_7.setObjectName("label_7")
self.label_8 = QtWidgets.QLabel(parent=self.groupBox_7)
self.label_8.setGeometry(QtCore.QRect(30, 330, 311, 41))
font = QtGui.QFont()
font.setBold(False)
font.setUnderline(True)
font.setWeight(50)
self.label_8.setFont(font)
self.label_8.setStyleSheet("color: rgb(11, 11, 11);")
self.label_8.setObjectName("label_8")
self.lineEdit_4 = QtWidgets.QLineEdit(parent=self.groupBox_7)
self.lineEdit_4.setEnabled(True)
self.lineEdit_4.setGeometry(QtCore.QRect(40, 360, 311, 21))
self.lineEdit_4.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.lineEdit_4.setReadOnly(False)
self.lineEdit_4.setClearButtonEnabled(True)
self.lineEdit_4.setObjectName("lineEdit_4")
self.mComboBox_2 = QgsCheckableComboBox(parent=self.groupBox_7)
self.mComboBox_2.setGeometry(QtCore.QRect(40, 450, 250, 20))
self.mComboBox_2.setMinimumSize(QtCore.QSize(260, 20))
self.mComboBox_2.setMaximumSize(QtCore.QSize(310, 20))
self.mComboBox_2.setStyleSheet("")
self.mComboBox_2.setCurrentText("")
self.mComboBox_2.setMaxVisibleItems(15)
self.mComboBox_2.setSizeAdjustPolicy(QtWidgets.QComboBox.SizeAdjustPolicy.AdjustToContents)
self.mComboBox_2.setDefaultText("")
self.mComboBox_2.setObjectName("mComboBox_2")
self.label_14 = QtWidgets.QLabel(parent=self.groupBox_7)
self.label_14.setGeometry(QtCore.QRect(30, 420, 290, 41))
font = QtGui.QFont()
font.setBold(False)
font.setUnderline(True)
font.setWeight(50)
self.label_14.setFont(font)
self.label_14.setStyleSheet("color: rgb(11, 11, 11);")
self.label_14.setObjectName("label_14")
self.horizontalLayoutWidget = QtWidgets.QWidget(parent=self.groupBox_7)
self.horizontalLayoutWidget.setGeometry(QtCore.QRect(40, 80, 261, 31))
self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget")
self.horizontalLayout = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget)
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout.setObjectName("horizontalLayout")
self.label_3 = QtWidgets.QLabel(parent=self.horizontalLayoutWidget)
font = QtGui.QFont()
font.setPointSize(10)
font.setBold(True)
font.setUnderline(False)
font.setWeight(75)
self.label_3.setFont(font)
self.label_3.setObjectName("label_3")
self.horizontalLayout.addWidget(self.label_3)
self.radioButton_6 = QtWidgets.QRadioButton(parent=self.horizontalLayoutWidget)
font = QtGui.QFont()
font.setPointSize(10)
self.radioButton_6.setFont(font)
self.radioButton_6.setIconSize(QtCore.QSize(16, 16))
self.radioButton_6.setChecked(True)
self.radioButton_6.setObjectName("radioButton_6")
self.horizontalLayout.addWidget(self.radioButton_6)
self.radioButton_5 = QtWidgets.QRadioButton(parent=self.horizontalLayoutWidget)
font = QtGui.QFont()
font.setPointSize(10)
self.radioButton_5.setFont(font)
self.radioButton_5.setObjectName("radioButton_5")
self.horizontalLayout.addWidget(self.radioButton_5)
self.horizontalLayoutWidget_2 = QtWidgets.QWidget(parent=self.groupBox_7)
self.horizontalLayoutWidget_2.setGeometry(QtCore.QRect(40, 110, 261, 31))
self.horizontalLayoutWidget_2.setObjectName("horizontalLayoutWidget_2")
self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_2)
self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.label_16 = QtWidgets.QLabel(parent=self.horizontalLayoutWidget_2)
font = QtGui.QFont()
font.setPointSize(10)
font.setBold(True)
font.setUnderline(False)
font.setWeight(75)
self.label_16.setFont(font)
self.label_16.setObjectName("label_16")
self.horizontalLayout_2.addWidget(self.label_16)
self.radioButton_7 = QtWidgets.QRadioButton(parent=self.horizontalLayoutWidget_2)
font = QtGui.QFont()
font.setPointSize(10)
self.radioButton_7.setFont(font)
self.radioButton_7.setIconSize(QtCore.QSize(16, 16))
self.radioButton_7.setChecked(True)
self.radioButton_7.setObjectName("radioButton_7")
self.horizontalLayout_2.addWidget(self.radioButton_7)
self.radioButton_8 = QtWidgets.QRadioButton(parent=self.horizontalLayoutWidget_2)
font = QtGui.QFont()
font.setPointSize(10)
self.radioButton_8.setFont(font)
self.radioButton_8.setObjectName("radioButton_8")
self.horizontalLayout_2.addWidget(self.radioButton_8)
self.radioButton_9 = QtWidgets.QRadioButton(parent=self.groupBox_7)
self.radioButton_9.setGeometry(QtCore.QRect(270, 570, 82, 15))
font = QtGui.QFont()
font.setPointSize(10)
self.radioButton_9.setFont(font)
self.radioButton_9.setObjectName("radioButton_9")
self.radioButton_10 = QtWidgets.QRadioButton(parent=self.groupBox_7)
self.radioButton_10.setGeometry(QtCore.QRect(75, 390, 200, 16))
font = QtGui.QFont()
font.setPointSize(10)
self.radioButton_10.setFont(font)
self.radioButton_10.setObjectName("radioButton_10")
self.mComboBox_3 = QgsCheckableComboBox(parent=self.groupBox_7)
self.mComboBox_3.setGeometry(QtCore.QRect(40, 360, 310, 20))
self.mComboBox_3.setMinimumSize(QtCore.QSize(310, 20))
self.mComboBox_3.setMaximumSize(QtCore.QSize(310, 20))
self.mComboBox_3.setStyleSheet("")
self.mComboBox_3.setInputMethodHints(QtCore.Qt.InputMethodHint.ImhNone)
self.mComboBox_3.setCurrentText("")
self.mComboBox_3.setMaxVisibleItems(15)
self.mComboBox_3.setSizeAdjustPolicy(QtWidgets.QComboBox.SizeAdjustPolicy.AdjustToContents)
self.mComboBox_3.setDefaultText("")
self.mComboBox_3.setObjectName("mComboBox_3")
self.radioButton_11 = QtWidgets.QRadioButton(parent=self.groupBox_7)
self.radioButton_11.setGeometry(QtCore.QRect(75, 150, 200, 16))
font = QtGui.QFont()
font.setPointSize(10)
self.radioButton_11.setFont(font)
self.radioButton_11.setObjectName("radioButton_11")
self.radioButton_13 = QtWidgets.QRadioButton(parent=self.groupBox_7)
self.radioButton_13.setGeometry(QtCore.QRect(75, 230, 200, 16))
font = QtGui.QFont()
font.setPointSize(10)
self.radioButton_13.setFont(font)
self.radioButton_13.setObjectName("radioButton_13")
self.comboBox_7 = QtWidgets.QComboBox(parent=self.groupBox_7)
self.comboBox_7.setGeometry(QtCore.QRect(40, 200, 311, 22))
self.comboBox_7.setEditable(False)
self.comboBox_7.setCurrentText("")
self.comboBox_7.setInsertPolicy(QtWidgets.QComboBox.InsertPolicy.InsertAlphabetically)
self.comboBox_7.setObjectName("comboBox_7")
self.comboBox_7.addItem("")
self.comboBox_7.setItemText(0, "")
self.mComboBox_4 = QgsCheckableComboBox(parent=self.groupBox_7)
self.mComboBox_4.setGeometry(QtCore.QRect(40, 530, 310, 20))
self.mComboBox_4.setMinimumSize(QtCore.QSize(310, 20))
self.mComboBox_4.setMaximumSize(QtCore.QSize(310, 20))
self.mComboBox_4.setStyleSheet("")
self.mComboBox_4.setCurrentText("")
self.mComboBox_4.setMaxVisibleItems(15)
self.mComboBox_4.setSizeAdjustPolicy(QtWidgets.QComboBox.SizeAdjustPolicy.AdjustToContents)
self.mComboBox_4.setDefaultText("")
self.mComboBox_4.setObjectName("mComboBox_4")
self.label_15 = QtWidgets.QLabel(parent=self.groupBox_7)
self.label_15.setGeometry(QtCore.QRect(30, 500, 311, 41))
font = QtGui.QFont()
font.setBold(False)
font.setUnderline(True)
font.setWeight(50)
self.label_15.setFont(font)
self.label_15.setStyleSheet("color: rgb(11, 11, 11);")
self.label_15.setObjectName("label_15")
self.label_17 = QtWidgets.QLabel(parent=self.groupBox_7)
self.label_17.setGeometry(QtCore.QRect(75, 465, 311, 41))
font = QtGui.QFont()
font.setBold(False)
font.setUnderline(False)
font.setWeight(50)
self.label_17.setFont(font)
self.label_17.setStyleSheet("color: rgb(11, 11, 11);")
self.label_17.setObjectName("label_17")
self.label_18 = QtWidgets.QLabel(parent=self.groupBox_7)
self.label_18.setGeometry(QtCore.QRect(155, 465, 311, 41))
font = QtGui.QFont()
font.setBold(False)
font.setUnderline(False)
font.setWeight(50)
self.label_18.setFont(font)
self.label_18.setStyleSheet("color: rgb(11, 11, 11);")
self.label_18.setObjectName("label_18")
self.spinBox = QtWidgets.QSpinBox(parent=self.groupBox_7)
self.spinBox.setGeometry(QtCore.QRect(110, 475, 42, 22))
self.spinBox.setMinimum(1)
self.spinBox.setMaximum(10)
self.spinBox.setObjectName("spinBox")
self.CustomeLogo = QtWidgets.QPushButton(parent=self.groupBox_7)
self.CustomeLogo.setGeometry(QtCore.QRect(30, 560, 180, 23))
self.CustomeLogo.setObjectName("CustomeLogo")
self.comboBox_7.raise_()
self.mComboBox_3.raise_()
self.label_4.raise_()
self.comboBox.raise_()
self.lineEdit_2.raise_()
self.label_6.raise_()
self.lineEdit_3.raise_()
self.label_7.raise_()
self.label_8.raise_()
self.lineEdit_4.raise_()
self.mComboBox_2.raise_()
self.label_14.raise_()
self.horizontalLayoutWidget.raise_()
self.horizontalLayoutWidget_2.raise_()
self.radioButton_9.raise_()
self.radioButton_10.raise_()
self.radioButton_11.raise_()
self.radioButton_13.raise_()
self.mComboBox_4.raise_()
self.label_15.raise_()
self.label_17.raise_()
self.label_18.raise_()
self.spinBox.raise_()
self.CustomeLogo.raise_()
self.label_5 = QtWidgets.QLabel(parent=self.tab)
self.label_5.setGeometry(QtCore.QRect(920, 10, 211, 71))
self.label_5.setText("")
self.label_5.setScaledContents(True)
self.label_5.setObjectName("label_5")
self.groupBox = QtWidgets.QGroupBox(parent=self.tab)
self.groupBox.setGeometry(QtCore.QRect(430, 500, 411, 201))
self.groupBox.setStyleSheet("QGroupBox#groupBox{background-color: rgb(255, 255, 255, 170);}")
self.groupBox.setTitle("")
self.groupBox.setObjectName("groupBox")
self.comboBox_4 = QtWidgets.QComboBox(parent=self.groupBox)
self.comboBox_4.setGeometry(QtCore.QRect(40, 160, 331, 22))
self.comboBox_4.setEditable(False)
self.comboBox_4.setCurrentText("")
self.comboBox_4.setInsertPolicy(QtWidgets.QComboBox.InsertPolicy.InsertAlphabetically)
self.comboBox_4.setObjectName("comboBox_4")
self.comboBox_4.addItem("")
self.comboBox_4.setItemText(0, "")
self.label_9 = QtWidgets.QLabel(parent=self.groupBox)
self.label_9.setGeometry(QtCore.QRect(30, 130, 311, 41))
font = QtGui.QFont()
font.setBold(False)
font.setUnderline(True)
font.setWeight(50)
self.label_9.setFont(font)
self.label_9.setStyleSheet("color: rgb(11, 11, 11);")
self.label_9.setObjectName("label_9")
self.label_10 = QtWidgets.QLabel(parent=self.groupBox)
self.label_10.setGeometry(QtCore.QRect(30, 70, 311, 41))
font = QtGui.QFont()
font.setBold(False)
font.setUnderline(True)
font.setWeight(50)
self.label_10.setFont(font)
self.label_10.setStyleSheet("color: rgb(11, 11, 11);")
self.label_10.setObjectName("label_10")
self.comboBox_3 = QtWidgets.QComboBox(parent=self.groupBox)
self.comboBox_3.setGeometry(QtCore.QRect(40, 100, 331, 22))
self.comboBox_3.setEditable(False)
self.comboBox_3.setCurrentText("")
self.comboBox_3.setInsertPolicy(QtWidgets.QComboBox.InsertPolicy.InsertAlphabetically)
self.comboBox_3.setObjectName("comboBox_3")
self.comboBox_3.addItem("")
self.comboBox_3.setItemText(0, "")
self.comboBox_2 = QtWidgets.QComboBox(parent=self.groupBox)
self.comboBox_2.setGeometry(QtCore.QRect(40, 40, 331, 22))
self.comboBox_2.setEditable(False)
self.comboBox_2.setCurrentText("")
self.comboBox_2.setInsertPolicy(QtWidgets.QComboBox.InsertPolicy.InsertAlphabetically)
self.comboBox_2.setObjectName("comboBox_2")
self.comboBox_2.addItem("")
self.comboBox_2.setItemText(0, "")
self.label_11 = QtWidgets.QLabel(parent=self.groupBox)
self.label_11.setGeometry(QtCore.QRect(30, 10, 311, 41))
font = QtGui.QFont()
font.setBold(False)
font.setUnderline(True)
font.setWeight(50)
self.label_11.setFont(font)
self.label_11.setStyleSheet("color: rgb(11, 11, 11);")
self.label_11.setObjectName("label_11")
self.groupBox_2 = QtWidgets.QGroupBox(parent=self.tab)
self.groupBox_2.setGeometry(QtCore.QRect(960, 10, 171, 111))
self.groupBox_2.setStyleSheet("QGroupBox#groupBox_2{background-color: rgb(255, 255, 255, 170);}")
self.groupBox_2.setTitle("")
self.groupBox_2.setObjectName("groupBox_2")
self.commandLinkButton_3 = QtWidgets.QCommandLinkButton(parent=self.groupBox_2)
self.commandLinkButton_3.setGeometry(QtCore.QRect(10, 60, 161, 41))
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(10)
self.commandLinkButton_3.setFont(font)
self.commandLinkButton_3.setStyleSheet("background-color: qconicalgradient(cx:0, cy:0, angle:135, stop:0 rgba(255, 255, 0, 69), stop:0.375 rgba(255, 255, 0, 69), stop:0.423533 rgba(251, 255, 0, 145), stop:0.45 rgba(247, 255, 0, 208), stop:0.477581 rgba(255, 244, 71, 130), stop:0.518717 rgba(255, 218, 71, 130), stop:0.55 rgba(255, 255, 0, 255), stop:0.57754 rgba(255, 203, 0, 130), stop:0.625 rgba(255, 255, 0, 69), stop:1 rgba(255, 255, 0, 69));")
self.commandLinkButton_3.setObjectName("commandLinkButton_3")
self.commandLinkButton_2 = QtWidgets.QCommandLinkButton(parent=self.groupBox_2)
self.commandLinkButton_2.setGeometry(QtCore.QRect(10, 10, 141, 41))
font = QtGui.QFont()
font.setFamily("Segoe UI")
font.setPointSize(10)
self.commandLinkButton_2.setFont(font)
self.commandLinkButton_2.setAutoFillBackground(False)
self.commandLinkButton_2.setStyleSheet("background-color: qconicalgradient(cx:0, cy:0, angle:135, stop:0 rgba(255, 255, 0, 69), stop:0.375 rgba(255, 255, 0, 69), stop:0.423533 rgba(251, 255, 0, 145), stop:0.45 rgba(247, 255, 0, 208), stop:0.477581 rgba(255, 244, 71, 130), stop:0.518717 rgba(255, 218, 71, 130), stop:0.55 rgba(255, 255, 0, 255), stop:0.57754 rgba(255, 203, 0, 130), stop:0.625 rgba(255, 255, 0, 69), stop:1 rgba(255, 255, 0, 69));")
self.commandLinkButton_2.setObjectName("commandLinkButton_2")
self.groupBox_3 = QtWidgets.QGroupBox(parent=self.tab)
self.groupBox_3.setGeometry(QtCore.QRect(430, 110, 251, 161))
self.groupBox_3.setStyleSheet("QGroupBox#groupBox_3{background-color: rgb(255, 255, 255, 170);}")
self.groupBox_3.setTitle("")
self.groupBox_3.setObjectName("groupBox_3")
self.comboBox_5 = QtWidgets.QComboBox(parent=self.groupBox_3)
self.comboBox_5.setGeometry(QtCore.QRect(20, 40, 211, 22))
self.comboBox_5.setEditable(False)
self.comboBox_5.setCurrentText("")
self.comboBox_5.setInsertPolicy(QtWidgets.QComboBox.InsertPolicy.InsertAlphabetically)
self.comboBox_5.setObjectName("comboBox_5")
self.comboBox_5.addItem("")
self.comboBox_5.setItemText(0, "")
self.label_12 = QtWidgets.QLabel(parent=self.groupBox_3)
self.label_12.setGeometry(QtCore.QRect(10, 10, 311, 41))
font = QtGui.QFont()
font.setBold(False)
font.setUnderline(True)
font.setWeight(50)
self.label_12.setFont(font)
self.label_12.setStyleSheet("color: rgb(11, 11, 11);")
self.label_12.setObjectName("label_12")
self.label_13 = QtWidgets.QLabel(parent=self.groupBox_3)
self.label_13.setGeometry(QtCore.QRect(10, 70, 311, 41))
font = QtGui.QFont()
font.setBold(False)
font.setUnderline(True)
font.setWeight(50)
self.label_13.setFont(font)
self.label_13.setStyleSheet("color: rgb(11, 11, 11);")
self.label_13.setObjectName("label_13")
self.radioButton_12 = QtWidgets.QRadioButton(parent=self.groupBox_3)
self.radioButton_12.setGeometry(QtCore.QRect(80, 130, 181, 16))
font = QtGui.QFont()
font.setPointSize(10)
self.radioButton_12.setFont(font)
self.radioButton_12.setObjectName("radioButton_12")
self.comboBox_6 = QtWidgets.QComboBox(parent=self.groupBox_3)
self.comboBox_6.setGeometry(QtCore.QRect(20, 100, 211, 22))
self.comboBox_6.setEditable(False)
self.comboBox_6.setCurrentText("")
self.comboBox_6.setInsertPolicy(QtWidgets.QComboBox.InsertPolicy.InsertAlphabetically)
self.comboBox_6.setObjectName("comboBox_6")
self.comboBox_6.addItem("")
self.comboBox_6.setItemText(0, "")
self.groupBox.raise_()
self.groupBox_6.raise_()
self.groupBox_7.raise_()
self.label_5.raise_()
self.groupBox_2.raise_()
self.groupBox_3.raise_()
self.tabWidget.addTab(self.tab, "")
self.retranslateUi(MapCENDialogBase)
self.tabWidget.setCurrentIndex(0)
QtCore.QMetaObject.connectSlotsByName(MapCENDialogBase)
def retranslateUi(self, MapCENDialogBase):
_translate = QtCore.QCoreApplication.translate
MapCENDialogBase.setWindowTitle(_translate("MapCENDialogBase", "AutoMap"))
self.commandLinkButton.setText(_translate("MapCENDialogBase", " Mise en page"))
self.label_4.setText(_translate("MapCENDialogBase", "Modèles de mise en page :"))
self.lineEdit_2.setText(_translate("MapCENDialogBase", "Titre à renseigner ici"))
self.label_6.setText(_translate("MapCENDialogBase", "Titre de la carte :"))
self.lineEdit_3.setText(_translate("MapCENDialogBase", "Sous-titre à renseigner ici"))
self.label_7.setText(_translate("MapCENDialogBase", "Sous-titre de la carte :"))
self.label_8.setText(_translate("MapCENDialogBase", "Source des données :"))
self.lineEdit_4.setText(_translate("MapCENDialogBase", "à renseigner ici"))
self.label_14.setText(_translate("MapCENDialogBase", "Éléments à intégrer à la légende :"))
self.label_3.setText(_translate("MapCENDialogBase", "Format :"))
self.radioButton_6.setText(_translate("MapCENDialogBase", "A4"))
self.radioButton_5.setText(_translate("MapCENDialogBase", "A3"))
self.label_16.setText(_translate("MapCENDialogBase", "Orientation :"))
self.radioButton_7.setText(_translate("MapCENDialogBase", "Portrait"))
self.radioButton_8.setText(_translate("MapCENDialogBase", "Paysage"))
self.radioButton_9.setText(_translate("MapCENDialogBase", "Atlas"))
self.radioButton_10.setText(_translate("MapCENDialogBase", "Utilisez le gestionnaire"))
self.radioButton_11.setText(_translate("MapCENDialogBase", "Theme et suivie de positionnement"))
self.radioButton_13.setText(_translate("MapCENDialogBase", "Mise en page existante"))
self.label_15.setText(_translate("MapCENDialogBase", "Bibliotheque de logo :"))
self.label_17.setText(_translate("MapCENDialogBase", "Sur"))
self.label_18.setText(_translate("MapCENDialogBase", "colonne(s)"))
self.CustomeLogo.setText(_translate("MapCENDialogBase", "Custom Bibliotheque"))
self.label_9.setText(_translate("MapCENDialogBase", "Colonne de sous-titre :"))
self.label_10.setText(_translate("MapCENDialogBase", "Colonne d\'identification :"))
self.label_11.setText(_translate("MapCENDialogBase", "Couche de suivie :"))
self.commandLinkButton_3.setText(_translate("MapCENDialogBase", "OpenStreetMap"))
self.commandLinkButton_2.setText(_translate("MapCENDialogBase", " Ortho"))
self.label_12.setText(_translate("MapCENDialogBase", "Théme principal :"))
self.label_13.setText(_translate("MapCENDialogBase", "Théme de suivie :"))
self.radioButton_12.setText(_translate("MapCENDialogBase", "Activé le suivie"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("MapCENDialogBase", "Liste de templates existants"))
from qgscheckablecombobox import QgsCheckableComboBox
@@ -0,0 +1,332 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CenRa_IssuesSend</class>
<widget class="QDialog" name="CenRa_IssuesSend">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>810</width>
<height>587</height>
</rect>
</property>
<property name="windowTitle">
<string>CEN38 Metabase</string>
</property>
<property name="windowIcon">
<iconset>
<normaloff>icon.svg</normaloff>icon.svg</iconset>
</property>
<widget class="QWidget" name="gridLayoutWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>550</y>
<width>811</width>
<height>31</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="2">
<widget class="QPushButton" name="annuler_button">
<property name="text">
<string>Annuler</string>
</property>
</widget>
</item>
<item row="0" column="3">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="ok_button">
<property name="text">
<string>Envoyer</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QGroupBox" name="groupBox">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>791</width>
<height>531</height>
</rect>
</property>
<property name="title">
<string>Issues</string>
</property>
<widget class="QLineEdit" name="titre_line">
<property name="geometry">
<rect>
<x>240</x>
<y>40</y>
<width>321</width>
<height>41</height>
</rect>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QPlainTextEdit" name="messages_plain">
<property name="geometry">
<rect>
<x>10</x>
<y>101</y>
<width>571</width>
<height>421</height>
</rect>
</property>
</widget>
<widget class="QFrame" name="frame">
<property name="geometry">
<rect>
<x>589</x>
<y>100</y>
<width>191</width>
<height>431</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<widget class="QWidget" name="formLayoutWidget">
<property name="geometry">
<rect>
<x>9</x>
<y>9</y>
<width>341</width>
<height>411</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="labelAlignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="formAlignment">
<set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
</property>
<item row="0" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="check_bug">
<property name="text">
<string>Bug</string>
</property>
</widget>
</item>
<item row="2" column="0">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="check_aide">
<property name="text">
<string>Aide</string>
</property>
</widget>
</item>
<item row="3" column="0">
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="check_question">
<property name="text">
<string>Question</string>
</property>
</widget>
</item>
<item row="4" column="0">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="check_amelioration">
<property name="text">
<string>Amélioration</string>
</property>
</widget>
</item>
<item row="5" column="0">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="1">
<widget class="QCheckBox" name="check_autre">
<property name="text">
<string>Autre</string>
</property>
</widget>
</item>
<item row="6" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>250</x>
<y>20</y>
<width>51</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>14</pointsize>
</font>
</property>
<property name="text">
<string>Titre:</string>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>20</x>
<y>70</y>
<width>91</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>Messages:</string>
</property>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>600</x>
<y>70</y>
<width>91</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>Sujet:</string>
</property>
</widget>
</widget>
</widget>
<tabstops>
<tabstop>ok_button</tabstop>
<tabstop>annuler_button</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
@@ -0,0 +1,126 @@
# Form implementation generated from reading ui file '/home/colas/Git/Plugin_QGIS/CenIsere_AUTOMAP/tools/ui/CenIsere_IssuesSend.ui'
#
# Created by: PyQt6 UI code generator 6.7.0
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_CenRa_IssuesSend(object):
def setupUi(self, CenRa_IssuesSend):
CenRa_IssuesSend.setObjectName("CenRa_IssuesSend")
CenRa_IssuesSend.resize(810, 587)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap("/home/colas/Git/Plugin_QGIS/CenIsere_AUTOMAP/tools/ui/icon.svg"), QtGui.QIcon.Mode.Normal, QtGui.QIcon.State.Off)
CenRa_IssuesSend.setWindowIcon(icon)
self.gridLayoutWidget = QtWidgets.QWidget(parent=CenRa_IssuesSend)
self.gridLayoutWidget.setGeometry(QtCore.QRect(0, 550, 811, 31))
self.gridLayoutWidget.setObjectName("gridLayoutWidget")
self.gridLayout_2 = QtWidgets.QGridLayout(self.gridLayoutWidget)
self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
self.gridLayout_2.setObjectName("gridLayout_2")
self.annuler_button = QtWidgets.QPushButton(parent=self.gridLayoutWidget)
self.annuler_button.setObjectName("annuler_button")
self.gridLayout_2.addWidget(self.annuler_button, 0, 2, 1, 1)
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
self.gridLayout_2.addItem(spacerItem, 0, 3, 1, 1)
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
self.gridLayout_2.addItem(spacerItem1, 0, 0, 1, 1)
self.ok_button = QtWidgets.QPushButton(parent=self.gridLayoutWidget)
self.ok_button.setObjectName("ok_button")
self.gridLayout_2.addWidget(self.ok_button, 0, 1, 1, 1)
self.groupBox = QtWidgets.QGroupBox(parent=CenRa_IssuesSend)
self.groupBox.setGeometry(QtCore.QRect(10, 10, 791, 531))
self.groupBox.setObjectName("groupBox")
self.titre_line = QtWidgets.QLineEdit(parent=self.groupBox)
self.titre_line.setGeometry(QtCore.QRect(240, 40, 321, 41))
self.titre_line.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter)
self.titre_line.setObjectName("titre_line")
self.messages_plain = QtWidgets.QPlainTextEdit(parent=self.groupBox)
self.messages_plain.setGeometry(QtCore.QRect(10, 101, 571, 421))
self.messages_plain.setObjectName("messages_plain")
self.frame = QtWidgets.QFrame(parent=self.groupBox)
self.frame.setGeometry(QtCore.QRect(589, 100, 191, 431))
self.frame.setFrameShape(QtWidgets.QFrame.Shape.StyledPanel)
self.frame.setFrameShadow(QtWidgets.QFrame.Shadow.Raised)
self.frame.setObjectName("frame")
self.formLayoutWidget = QtWidgets.QWidget(parent=self.frame)
self.formLayoutWidget.setGeometry(QtCore.QRect(9, 9, 341, 411))
self.formLayoutWidget.setObjectName("formLayoutWidget")
self.formLayout = QtWidgets.QFormLayout(self.formLayoutWidget)
self.formLayout.setLabelAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter)
self.formLayout.setFormAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTop|QtCore.Qt.AlignmentFlag.AlignTrailing)
self.formLayout.setContentsMargins(0, 0, 0, 0)
self.formLayout.setObjectName("formLayout")
spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
self.formLayout.setItem(0, QtWidgets.QFormLayout.ItemRole.LabelRole, spacerItem2)
spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
self.formLayout.setItem(1, QtWidgets.QFormLayout.ItemRole.LabelRole, spacerItem3)
self.check_bug = QtWidgets.QCheckBox(parent=self.formLayoutWidget)
self.check_bug.setObjectName("check_bug")
self.formLayout.setWidget(1, QtWidgets.QFormLayout.ItemRole.FieldRole, self.check_bug)
spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
self.formLayout.setItem(2, QtWidgets.QFormLayout.ItemRole.LabelRole, spacerItem4)
self.check_aide = QtWidgets.QCheckBox(parent=self.formLayoutWidget)
self.check_aide.setObjectName("check_aide")
self.formLayout.setWidget(2, QtWidgets.QFormLayout.ItemRole.FieldRole, self.check_aide)
spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
self.formLayout.setItem(3, QtWidgets.QFormLayout.ItemRole.LabelRole, spacerItem5)
self.check_question = QtWidgets.QCheckBox(parent=self.formLayoutWidget)
self.check_question.setObjectName("check_question")
self.formLayout.setWidget(3, QtWidgets.QFormLayout.ItemRole.FieldRole, self.check_question)
spacerItem6 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
self.formLayout.setItem(4, QtWidgets.QFormLayout.ItemRole.LabelRole, spacerItem6)
self.check_amelioration = QtWidgets.QCheckBox(parent=self.formLayoutWidget)
self.check_amelioration.setObjectName("check_amelioration")
self.formLayout.setWidget(4, QtWidgets.QFormLayout.ItemRole.FieldRole, self.check_amelioration)
spacerItem7 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
self.formLayout.setItem(5, QtWidgets.QFormLayout.ItemRole.LabelRole, spacerItem7)
self.check_autre = QtWidgets.QCheckBox(parent=self.formLayoutWidget)
self.check_autre.setObjectName("check_autre")
self.formLayout.setWidget(5, QtWidgets.QFormLayout.ItemRole.FieldRole, self.check_autre)
spacerItem8 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Expanding)
self.formLayout.setItem(6, QtWidgets.QFormLayout.ItemRole.LabelRole, spacerItem8)
self.label = QtWidgets.QLabel(parent=self.groupBox)
self.label.setGeometry(QtCore.QRect(250, 20, 51, 21))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(14)
self.label.setFont(font)
self.label.setObjectName("label")
self.label_2 = QtWidgets.QLabel(parent=self.groupBox)
self.label_2.setGeometry(QtCore.QRect(20, 70, 91, 31))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(12)
self.label_2.setFont(font)
self.label_2.setObjectName("label_2")
self.label_3 = QtWidgets.QLabel(parent=self.groupBox)
self.label_3.setGeometry(QtCore.QRect(600, 70, 91, 31))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(12)
self.label_3.setFont(font)
self.label_3.setObjectName("label_3")
self.retranslateUi(CenRa_IssuesSend)
QtCore.QMetaObject.connectSlotsByName(CenRa_IssuesSend)
CenRa_IssuesSend.setTabOrder(self.ok_button, self.annuler_button)
def retranslateUi(self, CenRa_IssuesSend):
_translate = QtCore.QCoreApplication.translate
CenRa_IssuesSend.setWindowTitle(_translate("CenRa_IssuesSend", "CEN38 Metabase"))
self.annuler_button.setText(_translate("CenRa_IssuesSend", "Annuler"))
self.ok_button.setText(_translate("CenRa_IssuesSend", "Envoyer"))
self.groupBox.setTitle(_translate("CenRa_IssuesSend", "Issues"))
self.check_bug.setText(_translate("CenRa_IssuesSend", "Bug"))
self.check_aide.setText(_translate("CenRa_IssuesSend", "Aide"))
self.check_question.setText(_translate("CenRa_IssuesSend", "Question"))
self.check_amelioration.setText(_translate("CenRa_IssuesSend", "Amélioration"))
self.check_autre.setText(_translate("CenRa_IssuesSend", "Autre"))
self.label.setText(_translate("CenRa_IssuesSend", "Titre:"))
self.label_2.setText(_translate("CenRa_IssuesSend", "Messages:"))
self.label_3.setText(_translate("CenRa_IssuesSend", "Sujet:"))
+100
View File
@@ -0,0 +1,100 @@
__copyright__ = "Copyright 2021, 3Liz"
__license__ = "GPL version 3"
__email__ = "info@3liz.org"
from qgis.core import QgsApplication
from qgis.PyQt.QtCore import QCoreApplication, Qt, QTranslator, QUrl
from qgis.PyQt.QtGui import QDesktopServices, QIcon
from qgis.PyQt.QtWidgets import QAction, QMessageBox
from qgis.utils import iface
import qgis
#include <QSettings>
import os
from .tools.resources import (
plugin_path,
resources_path,
maj_verif,
)
from .copie_editor import Copie_Editor
from .about_form import CopieAboutDialog
from PyQt5.QtCore import *
class PgCopie:
def __init__(self):
""" Constructor. """
self.action_editor = None
self.issues = None
self.provider = None
self.locator_filter = None
self.dock_action = None
self.help_action = None
plugin_dir = os.path.dirname(__file__)
end_find = plugin_dir.rfind('\\')+1
global NAME
NAME = plugin_dir[end_find:]
maj_verif(NAME)
# Display About window on first use
version = qgis.utils.pluginMetadata('CenRa_Copie','version')
s = QSettings()
versionUse = s.value("copie/version", 1, type=str)
if str(versionUse) != str(version) :
s.setValue("copie/version", str(version))
print(versionUse,version)
self.open_about_dialog()
def initGui(self):
""" Build the plugin GUI. """
self.toolBar = iface.addToolBar("CenRa_Copie")
self.toolBar.setObjectName("CenRa_Copie")
icon = QIcon(resources_path('icons', 'icon.png'))
# Open the online help
self.help_action = QAction(icon, "CenRa_Copie", iface.mainWindow())
iface.pluginHelpMenu().addAction(self.help_action)
self.help_action.triggered.connect(self.open_help)
if not self.action_editor:
self.action_editor = Copie_Editor()
self.copie_editor = QAction(icon, 'Copie',None)
self.toolBar.addAction(self.copie_editor)
self.copie_editor.triggered.connect(self.open_editor)
def open_about_dialog(self):
"""
About dialog
"""
dialog = CopieAboutDialog(iface)
dialog.exec_()
def open_help():
""" Open the online help. """
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
def open_editor(self):
self.action_editor.show()
self.action_editor.raise_()
def unload(self):
""" Unload the plugin. """
if self.action_editor:
iface.removePluginMenu('CenRa_Copie',self.copie_editor)
if self.provider:
QgsApplication.processingRegistry().removeProvider(self.provider)
del self.provider
if self.locator_filter:
iface.deregisterLocatorFilter(self.locator_filter)
del self.locator_filter
if self.help_action:
iface.pluginHelpMenu().removeAction(self.help_action)
del self.help_action
+5
View File
@@ -0,0 +1,5 @@
# Plugin_COPIE
---
## Objectif !
Vise à faciliter la création table dans PostgreSQL en utilisant des table déja existant,
tout en utilisant des modèles homogènes pour la saisie.
+6
View File
@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
def classFactory(iface):
_ = iface
from CenRa_COPIE.CenRa_Copie import PgCopie
return PgCopie()
+46
View File
@@ -0,0 +1,46 @@
import os.path
from pathlib import Path
from qgis.PyQt import uic
from qgis.PyQt.QtGui import QPixmap
from qgis.PyQt.QtWidgets import QDialog
from .tools.resources import devlog
ABOUT_FORM_CLASS, _ = uic.loadUiType(
os.path.join(
str(Path(__file__).resolve().parent),
'tools/ui',
'CenRa_about_form.ui'
)
)
class CopieAboutDialog(QDialog, ABOUT_FORM_CLASS):
""" About - Let the user display the about dialog. """
def __init__(self, iface, parent=None):
super().__init__(parent)
self.iface = iface
self.setupUi(self)
self.viewer.setHtml(devlog('CenRa_COPIE'))
self.rejected.connect(self.onReject)
self.buttonBox.rejected.connect(self.onReject)
self.buttonBox.accepted.connect(self.onAccept)
def onAccept(self):
"""
Save options when pressing OK button
"""
self.accept()
def onReject(self):
"""
Run some actions when
the user closes the dialog
"""
self.close()
+43 -195
View File
@@ -1,202 +1,50 @@
# -*- coding: utf-8 -*-
"""
/***************************************************************************
Copie
A QGIS plugin
Permet la copie d'une table dans une base PostGis
-------------------
begin : 2015-04-13
git sha : $Format:%H$
copyright : (C) 2015 by Guillaume COSTES - CEN Rhône-Alpes
email : guillaume.costes@espaces-naturels.fr
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
"""
from __future__ import absolute_import
#from PyQt4.QtCore import *
#from PyQt4.QtGui import *
# Import the PyQt and QGIS libraries
from builtins import next
from builtins import str
from builtins import object
import qgis
from qgis.PyQt.QtCore import QSettings
from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog, QMessageBox
from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog
from qgis.PyQt.QtGui import QIcon
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from qgis.core import QgsDataSourceUri
from builtins import str
from builtins import object
from PyQt5 import QtGui
from qgis.core import *
from qgis.gui import *
# Initialize Qt resources from file resources.py
from . import resources_rc
# Import the code for the dialog
from .copie_dialog import CopieDialog
from qgis.core import QgsDataSourceUri
from .tools.PythonSQL import *
from .tools.resources import (
load_ui,
resources_path,
login_base,
send_issues,
)
from .issues import CenRa_Issues
from qgis.utils import iface
import os.path
from .PythonSQL import *
import webbrowser, os
import psycopg2
import psycopg2.extras
import base64
#import socket
import os
#import sys
class Copie(object):
"""QGIS Plugin Implementation."""
EDITOR_CLASS = load_ui('CenRa_Copie_base.ui')
def __init__(self, iface):
"""Constructor.
class Copie_Editor(QDialog, EDITOR_CLASS):
:param iface: An interface instance that will be passed to this class
which provides the hook by which you can manipulate the QGIS
application at run time.
:type iface: QgsInterface
"""
# Save reference to the QGIS interface
def __init__(self, parent=None):
_ = parent
super().__init__()
self.setupUi(self)
self.settings = QgsSettings()
self.s = QSettings()
self.setWindowIcon(QtGui.QIcon(resources_path('icons','icon.png')))
self.iface = iface
# initialize plugin directory
self.plugin_dir = os.path.dirname(__file__)
# initialize locale
locale = QSettings().value('locale/userLocale')[0:2]
locale_path = os.path.join(
self.plugin_dir,
'i18n',
'Copie_{}.qm'.format(locale))
if os.path.exists(locale_path):
self.translator = QTranslator()
self.translator.load(locale_path)
if qVersion() > '4.3.3':
QCoreApplication.installTranslator(self.translator)
# Create the dialog (after translation) and keep reference
self.dlg = CopieDialog()
# Declare instance attributes
self.actions = []
self.menu = self.tr(u'&Copie')
# TODO: We are going to let the user set this up in a future iteration
self.toolbar = self.iface.addToolBar(u'Copie')
self.toolbar.setObjectName(u'Copie')
# noinspection PyMethodMayBeStatic
def tr(self, message):
"""Get the translation for a string using Qt translation API.
We implement this ourselves since we do not inherit QObject.
:param message: String for translation.
:type message: str, QString
:returns: Translated version of message.
:rtype: QString
"""
# noinspection PyTypeChecker,PyArgumentList,PyCallByClass
return QCoreApplication.translate('Copie', message)
def add_action(
self,
icon_path,
text,
callback,
enabled_flag=True,
add_to_menu=True,
add_to_toolbar=True,
status_tip=None,
whats_this=None,
parent=None):
"""Add a toolbar icon to the toolbar.
:param icon_path: Path to the icon for this action. Can be a resource
path (e.g. ':/plugins/foo/bar.png') or a normal file system path.
:type icon_path: str
:param text: Text that should be shown in menu items for this action.
:type text: str
:param callback: Function to be called when the action is triggered.
:type callback: function
:param enabled_flag: A flag indicating if the action should be enabled
by default. Defaults to True.
:type enabled_flag: bool
:param add_to_menu: Flag indicating whether the action should also
be added to the menu. Defaults to True.
:type add_to_menu: bool
:param add_to_toolbar: Flag indicating whether the action should also
be added to the toolbar. Defaults to True.
:type add_to_toolbar: bool
:param status_tip: Optional text to show in a popup when mouse pointer
hovers over the action.
:type status_tip: str
:param parent: Parent widget for the new action. Defaults None.
:type parent: QWidget
:param whats_this: Optional text to show in the status bar when the
mouse pointer hovers over the action.
:returns: The action that was created. Note that the action is also
added to self.actions list.
:rtype: QAction
"""
icon = QIcon(icon_path)
action = QAction(icon, text, parent)
action.triggered.connect(callback)
action.setEnabled(enabled_flag)
if status_tip is not None:
action.setStatusTip(status_tip)
if whats_this is not None:
action.setWhatsThis(whats_this)
if add_to_toolbar:
self.toolbar.addAction(action)
if add_to_menu:
self.iface.addPluginToMenu(
self.menu,
action)
self.actions.append(action)
return action
def initGui(self):
"""Create the menu entries and toolbar icons inside the QGIS GUI."""
icon_path = ':/plugins/Copie/table_copie.png'
self.add_action(
icon_path,
text=self.tr(u'Copie'),
callback=self.run,
parent=self.iface.mainWindow())
def unload(self):
"""Removes the plugin menu item and icon from QGIS GUI."""
for action in self.actions:
self.iface.removePluginMenu(
self.tr(u'&Copie'),
action)
self.iface.removeToolBarIcon(action)
# remove the toolbar
del self.toolbar
def run(self):
def raise_(self):
"""Run method that performs all the real work"""
layer = self.iface.activeLayer()
@@ -252,16 +100,16 @@ class Copie(object):
con.close()
self.dlg.schema.clear()
self.dlg.schema.addItems(listItems)
self.dlg.schema.setCurrentIndex(-1) # Pour ne pas commencer la liste au premier schema
self.schema.clear()
self.schema.addItems(listItems)
self.schema.setCurrentIndex(-1) # Pour ne pas commencer la liste au premier schema
self.dlg.table_source.setText(source_schema + "." + source_tablename) # Affiche le nom de la table source
self.table_source.setText(source_schema + "." + source_tablename) # Affiche le nom de la table source
# show the dialog
self.dlg.show()
self.show()
# Run the dialog event loop
result = self.dlg.exec_()
result = self.exec_()
# See if OK was pressed
if result:
#******************************debut script*********************************
@@ -288,24 +136,24 @@ class Copie(object):
# tablename
source_tablename = [s for s in list_sources if "table" in s][0].split('"')[3]
if self.dlg.schema.currentIndex() == -1 :
if self.schema.currentIndex() == -1 :
QMessageBox.warning(None, "Oups :", "Veuillez choisir un dossier de destination.")
return
schema = self.dlg.schema.currentText()
schema = self.schema.currentText()
if self.dlg.table_destination.text() == '' :
if self.table_destination.text() == '' :
QMessageBox.warning(None, "Oups :", "Veuillez choisir un nom de destination.")
return
if self.dlg.annee.text() == 'aaaa' or self.dlg.annee.text() == '':
tablename = schema + "_" + self.dlg.table_destination.text().lower()
if self.annee.text() == 'aaaa' or self.annee.text() == '':
tablename = schema + "_" + self.table_destination.text().lower()
else :
tablename = schema + "_" + self.dlg.table_destination.text().lower() + "_" + self.dlg.annee.text()
tablename = schema + "_" + self.table_destination.text().lower() + "_" + self.annee.text()
tablename_qgis = tablename[1:] # Permet d'enlever le "_", ajouter a la premiere etape, dans qgis
if self.dlg.table_vide.isChecked() == 1 :
if self.table_vide.isChecked() == 1 :
SQL_table = "CREATE TABLE " + schema + "." + tablename + " AS SELECT * FROM " + source_schema + "." + source_tablename + " LIMIT 0;"
else :
SQL_table = "CREATE TABLE " + schema + "." + tablename + " AS SELECT * FROM " + source_schema + "." + source_tablename
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

+88
View File
@@ -0,0 +1,88 @@
import os
plugin_dir = os.path.dirname(__file__)
end_find = plugin_dir.rfind('\\')+1
NAME = plugin_dir[end_find:]
from qgis.gui import *
from qgis.core import (
NULL,
QgsApplication,
QgsDataSourceUri,
QgsProject,
QgsProviderConnectionException,
QgsProviderRegistry,
QgsRasterLayer,
QgsSettings,
QgsVectorLayer,
QgsGeometry,
)
from qgis.PyQt.QtWidgets import (
QDialog,
QAction,
QDockWidget,
QFileDialog,
QInputDialog,
QMenu,
QToolButton,
QTableWidget,
QTableWidgetItem,
)
from qgis.utils import iface
from .tools.resources import (
load_ui,
resources_path,
send_issues,
)
EDITOR_CLASS = load_ui('CenRa_IssuesSend.ui')
class CenRa_Issues(QDialog, EDITOR_CLASS):
def __init__(self, parent=None):
_ = parent
super().__init__()
self.setupUi(self)
self.settings = QgsSettings()
#place connect here
self.annuler_button.clicked.connect(self.close)
self.ok_button.clicked.connect(self.run_sendissues)
def run_sendissues(self):
text_titre = self.titre_line.text()
text_message = self.messages_plain.toPlainText()
statu_bug = self.check_bug.isChecked()
statu_aide = self.check_aide.isChecked()
statu_question = self.check_question.isChecked()
statu_amelioration = self.check_amelioration.isChecked()
statu_autre = self.check_autre.isChecked()
statu = []
if statu_bug == True : statu = statu + [1]
if statu_aide == True : statu = statu + [3]
if statu_question == True : statu = statu + [5]
if statu_amelioration == True : statu = statu + [2]
if statu_autre == True : statu = statu + [6]
if len(statu) >= 1:
import qgis
url = qgis.utils.pluginMetadata(NAME,'tracker')
print(text_message)
send_info = send_issues(url,text_titre,text_message,statu)
code = send_info.status_code
print(code)
else:
code = 423
if code == 201:
iface.messageBar().pushMessage("Envoyer :", "Votre messages à bien été envoyer.", level=Qgis.Success, duration=20)
self.close()
elif code == 422:
iface.messageBar().pushMessage("Erreur :", "Erreur dans le contenu du messages.", level=Qgis.Critical, duration=20)
elif code == 423:
iface.messageBar().pushMessage("Erreur :", "Pas de sujet sélectionné.", level=Qgis.Critical, duration=20)
elif code == 404:
iface.messageBar().pushMessage("Missing :", "Le serveur de messagerie est injoignable.", level=Qgis.Warning, duration=20)
+37
View File
@@ -0,0 +1,37 @@
# This file contains metadata for your plugin. Since
# version 2.0 of QGIS this is the proper way to supply
# information about a plugin. The old method of
# embedding metadata in __init__.py will
# is no longer supported since version 2.0.
# This file should be included when you package your plugin.# Mandatory items:
[general]
name=CenRA_COPIE
qgisMinimumVersion=3.0
description=Permet la copie d'une table dans une base PostGis
version=2.0
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
email=si_besoin@cen-rhonealpes.fr
# End of mandatory metadata
# Recommended items:
# Uncomment the following line and add your changelog:
changelog=<h2>CenRa_COPIE:</h2></br><p><h3>22/10/2024 - Version 2:</h3>- Refonte du code.</p></br><p><h3>13/09/2024 - Version 1.5:</h3>- Ajoute d'un changelog et vérification de mise à jour.</p>
# Tags are comma separated with spaces allowed
tags=cenra, database, table
repository=https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS
homepage=https://plateformesig.cenra-outils.org/
category=Plugins
icon=icon.png
# experimental flag
experimental=True
# deprecated flag (applies to the whole plugin, not just a single version)
deprecated=False
+21
View File
@@ -0,0 +1,21 @@
from qgis.core import QgsApplication
def gitea():
file_url = QgsApplication.qgisSettingsDirPath()+'QGIS/QGIS3.ini'
recherche_1 = 'plugin_repositories\\github\\url=https://github.com/CEN-Rhone-Alpes/Plugin_QGIS/releases/latest/download/plugins.xml'
replace_1 = 'plugin_repositories\\gitea\\url=https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/plugins.xml'
recherche_2 = 'github'
replace_2 = 'gitea'
# Read in the file
with open(file_url, 'r') as file:
filedata = file.read()
# Replace the target string
filedata = filedata.replace(recherche_1, replace_1)
filedata = filedata.replace(recherche_2, replace_2)
# Write the file out again
with open(file_url, 'w') as file:
file.write(filedata)
+172
View File
@@ -0,0 +1,172 @@
import sys
import socket
import os
IPAddr=socket.gethostbyname(socket.gethostname())
if IPAddr[0:11] == "100.100.100": #4269
host = "100.100.100.11"
port = "5432"
dbname = "sig4269"
sigdb="sig4269"
refdb="ref_geo4269"
password = "XXXXXX"
if IPAddr[0:9] == "192.168.0": #01
host = "192.168.0.201"
port = "5432"
dbname = "sig01"
sigdb="sig01"
refdb="ref_geo01"
password = "XXXXXX"
if IPAddr[0:9] == "192.168.1": #0726
host = "192.168.1.201"
port = "5432"
dbname = "sig0726"
sigdb="sig0726"
refdb="ref_geo0726"
password = "XXXXXX"
if sys.platform == 'linux':
os_user = os.environ['USER']
else:
os_user = os.environ['USERNAME']
if os_user == 'STAGE':
os_user='stage'
geom = "geom"
champ_travaux_prevus_multipolygon="""(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, surface_m2 double precision, surface_ha double precision, date_creation date, date_maj date, geom geometry(MultiPolygon,2154))"""
champ_travaux_prevus_multilinestring="""(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, longueur_m double precision, longueur_km double precision, date_creation date, date_maj date, geom geometry(MultiLineString,2154))"""
champ_travaux_prevus_point = """(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, x_wgs84 double precision, y_wgs84 double precision, date_creation date, date_maj date, geom geometry(Point,2154))"""
champ_viergePolygone = """(gid serial NOT NULL, commentaire text, surface_m2 double precision, surface_ha double precision, geom geometry(MultiPolygon,2154))"""
champ_viergeLigne = """(gid serial NOT NULL, commentaire text, longueur_m double precision, longueur_km double precision, geom geometry(MultiLineString,2154))"""
champ_viergePoint = """(gid serial NOT NULL, commentaire text, x_wgs84 double precision, y_wgs84 double precision, geom geometry(Point,2154))"""
champ_habitat = """(gid serial NOT NULL, cd_cb_01 text, lb_cb97_fr_01 text, occupation_01 integer, cd_cb_02 text, lb_cb97_fr_02 text, occupation_02 integer, cd_cb_03 text, lb_cb97_fr_03 text, occupation_03 integer, milieu_code text, milieu_libelle text, surface_m2 double precision, surface_ha double precision, commentaire text, date_creation date, date_maj date, geom geometry(MultiPolygon,2154))"""
champ_contour="""(gid serial NOT NULL, date_creation date, date_maj date, utilisateur character varying, dept character(2), nom character varying, surface_m2 double precision, surface_ha double precision, type_site character varying, type_milieu character varying, date_premier_pg integer, date_debut_pg integer, date_fin_pg integer, referent character varying, gestion_deleguee character varying, terrain_militaire character(3), ens character(3), zh character(3), adapt_pmr character(3), inform character(3), guide character(3), ouverture_public character(3), obs character(3), anim character(3), n2000_anim character(3), contrat_n2000_conseil character(3), n2000_op character(3), contrat_n2000_benef character(3), contrat_agri character(3), bc_habitat integer, bc_amphibien integer, bc_coleoptere integer, bc_crustace integer, bc_mammifere integer, bc_chiroptere integer, bc_mollusque integer, bc_odonate integer, bc_oiseau integer, bc_orthoptere integer, bc_poisson integer, bc_reptile integer, bc_rhopalocere integer, bc_heterocere integer, bc_autre_invertebre integer, bc_flore integer, bc_bryophyte integer, bc_champignon integer, suiv_analyse_sol character(3), suiv_piezo character(3), suiv_climat character(3), suiv_topo character(3), suiv_habitat character(3), suiv_amphibien character(3), suiv_coleoptere character(3), suiv_crustace character(3), suiv_mammifere character(3), suiv_chiroptere character(3), suiv_mollusque character(3), suiv_odonate character(3), suiv_oiseau character(3), suiv_orthoptere character(3), suiv_poisson character(3), suiv_reptile character(3), suiv_rhopalocere character(3), suiv_heterocere character(3), suiv_autre_invertebre character(3), suiv_flore character(3), suiv_bryophyte character(3), suiv_champignon character(3), suiv_analyse_eau character(3), suiv_phenologie character(3), suiv_frequentation character(3), suiv_paysager character(3), suiv_autre character(3), commentaire text, geom geometry(MultiPolygon,2154))
"""
champ_vegethab_point = """(
gid serial NOT NULL ,
cd_eu_01 character varying(254) COLLATE pg_catalog."default",
lb_eu_01 character varying(254) COLLATE pg_catalog."default",
occupati_1 bigint,
cd_eu_02 character varying(254) COLLATE pg_catalog."default",
lb_eu_02 character varying(254) COLLATE pg_catalog."default",
occupati_2 bigint,
cd_eu_03 character varying(254) COLLATE pg_catalog."default",
lb_eu_03 character varying(254) COLLATE pg_catalog."default",
occupati_3 bigint,
milieu_cod character varying(254) COLLATE pg_catalog."default",
milieu_lib character varying(254) COLLATE pg_catalog."default",
surface_m2 numeric,
surface_ha numeric,
commentair character varying(254) COLLATE pg_catalog."default",
date_creat date,
date_maj date,
num_phyto character varying(254) COLLATE pg_catalog."default",
type_unite character varying(254) COLLATE pg_catalog."default",
dynamique character varying(254) COLLATE pg_catalog."default",
gestio_obs character varying(254) COLLATE pg_catalog."default",
degrad_obs character varying(254) COLLATE pg_catalog."default",
eta_conser character varying(254) COLLATE pg_catalog."default",
clas_phyto character varying(254) COLLATE pg_catalog."default",
alli_phyto character varying(254) COLLATE pg_catalog."default",
syntaxon character varying(254) COLLATE pg_catalog."default",
n2000 character varying(254) COLLATE pg_catalog."default",
lrr_aura character varying(254) COLLATE pg_catalog."default",
lrr_cbna character varying(254) COLLATE pg_catalog."default",
lrr_cbnmc character varying(254) COLLATE pg_catalog."default",
vege_enjeu character varying(254) COLLATE pg_catalog."default",
num_photo character varying(254) COLLATE pg_catalog."default",
nature_obs character varying(254) COLLATE pg_catalog."default",
date_sais date,
s_al_phyto character varying(254) COLLATE pg_catalog."default",
alli_name character varying(254) COLLATE pg_catalog."default",
salli_name character varying(254) COLLATE pg_catalog."default",
class_name character varying(254) COLLATE pg_catalog."default",
geom geometry(Point,2154)
)
"""
champ_vegethab_multilinestring = """(
gid serial NOT NULL ,
cd_eu_01 character varying(254) COLLATE pg_catalog."default",
lb_eu_01 character varying(254) COLLATE pg_catalog."default",
occupati_1 bigint,
cd_eu_02 character varying(254) COLLATE pg_catalog."default",
lb_eu_02 character varying(254) COLLATE pg_catalog."default",
occupati_2 bigint,
cd_eu_03 character varying(254) COLLATE pg_catalog."default",
lb_eu_03 character varying(254) COLLATE pg_catalog."default",
occupati_3 bigint,
milieu_cod character varying(254) COLLATE pg_catalog."default",
milieu_lib character varying(254) COLLATE pg_catalog."default",
surface_m2 numeric,
surface_ha numeric,
commentair character varying(254) COLLATE pg_catalog."default",
date_creat date,
date_maj date,
num_phyto character varying(254) COLLATE pg_catalog."default",
type_unite character varying(254) COLLATE pg_catalog."default",
dynamique character varying(254) COLLATE pg_catalog."default",
gestio_obs character varying(254) COLLATE pg_catalog."default",
degrad_obs character varying(254) COLLATE pg_catalog."default",
eta_conser character varying(254) COLLATE pg_catalog."default",
clas_phyto character varying(254) COLLATE pg_catalog."default",
alli_phyto character varying(254) COLLATE pg_catalog."default",
syntaxon character varying(254) COLLATE pg_catalog."default",
n2000 character varying(254) COLLATE pg_catalog."default",
lrr_aura character varying(254) COLLATE pg_catalog."default",
lrr_cbna character varying(254) COLLATE pg_catalog."default",
lrr_cbnmc character varying(254) COLLATE pg_catalog."default",
vege_enjeu character varying(254) COLLATE pg_catalog."default",
num_photo character varying(254) COLLATE pg_catalog."default",
nature_obs character varying(254) COLLATE pg_catalog."default",
date_sais date,
s_al_phyto character varying(254) COLLATE pg_catalog."default",
alli_name character varying(254) COLLATE pg_catalog."default",
salli_name character varying(254) COLLATE pg_catalog."default",
class_name character varying(254) COLLATE pg_catalog."default",
geom geometry(MultiLineString,2154)
)
"""
champ_vegethab_multipolygon = """(
gid serial NOT NULL ,
cd_eu_01 character varying(254) COLLATE pg_catalog."default",
lb_eu_01 character varying(254) COLLATE pg_catalog."default",
occupati_1 bigint,
cd_eu_02 character varying(254) COLLATE pg_catalog."default",
lb_eu_02 character varying(254) COLLATE pg_catalog."default",
occupati_2 bigint,
cd_eu_03 character varying(254) COLLATE pg_catalog."default",
lb_eu_03 character varying(254) COLLATE pg_catalog."default",
occupati_3 bigint,
milieu_cod character varying(254) COLLATE pg_catalog."default",
milieu_lib character varying(254) COLLATE pg_catalog."default",
surface_m2 numeric,
surface_ha numeric,
commentair character varying(254) COLLATE pg_catalog."default",
date_creat date,
date_maj date,
num_phyto character varying(254) COLLATE pg_catalog."default",
type_unite character varying(254) COLLATE pg_catalog."default",
dynamique character varying(254) COLLATE pg_catalog."default",
gestio_obs character varying(254) COLLATE pg_catalog."default",
degrad_obs character varying(254) COLLATE pg_catalog."default",
eta_conser character varying(254) COLLATE pg_catalog."default",
clas_phyto character varying(254) COLLATE pg_catalog."default",
alli_phyto character varying(254) COLLATE pg_catalog."default",
syntaxon character varying(254) COLLATE pg_catalog."default",
n2000 character varying(254) COLLATE pg_catalog."default",
lrr_aura character varying(254) COLLATE pg_catalog."default",
lrr_cbna character varying(254) COLLATE pg_catalog."default",
lrr_cbnmc character varying(254) COLLATE pg_catalog."default",
vege_enjeu character varying(254) COLLATE pg_catalog."default",
num_photo character varying(254) COLLATE pg_catalog."default",
nature_obs character varying(254) COLLATE pg_catalog."default",
date_sais date,
s_al_phyto character varying(254) COLLATE pg_catalog."default",
alli_name character varying(254) COLLATE pg_catalog."default",
salli_name character varying(254) COLLATE pg_catalog."default",
class_name character varying(254) COLLATE pg_catalog."default",
geom geometry(MultiPolygon,2154)
)
"""
Binary file not shown.

After

Width:  |  Height:  |  Size: 910 B

+183
View File
@@ -0,0 +1,183 @@
"""Tools to work with resource files."""
import configparser
import shutil
import tempfile
import base64
import psycopg2
import psycopg2.extras
from os.path import abspath, join, pardir, dirname
from qgis.PyQt import uic
__copyright__ = "Copyright 2019, 3Liz"
__license__ = "GPL version 3"
__email__ = "info@3liz.org"
__revision__ = "$Format:%H$"
def plugin_path(*args):
"""Get the path to plugin root folder.
:param args List of path elements e.g. ['img', 'logos', 'image.png']
:type args: str
:return: Absolute path to the plugin path.
:rtype: str
"""
path = dirname(dirname(__file__))
path = abspath(abspath(join(path, pardir)))
for item in args:
path = abspath(join(path, item))
return path
def plugin_name():
"""Return the plugin name according to metadata.txt.
:return: The plugin name.
:rtype: basestring
"""
metadata = metadata_config()
name = metadata["general"]["name"]
return name
def metadata_config() -> configparser:
"""Get the INI config parser for the metadata file.
:return: The config parser object.
:rtype: ConfigParser
"""
path = plugin_path("metadata.txt")
config = configparser.ConfigParser()
config.read(path, encoding='utf8')
return config
def plugin_test_data_path(*args, copy=False):
"""Get the path to the plugin test data path.
:param args List of path elements e.g. ['img', 'logos', 'image.png']
:type args: str
:param copy: If the file must be copied into a temporary directory first.
:type copy: bool
:return: Absolute path to the resources folder.
:rtype: str
"""
path = abspath(abspath(join(plugin_path(), "test", "data")))
for item in args:
path = abspath(join(path, item))
if copy:
temp = tempfile.mkdtemp()
shutil.copy(path, temp)
return join(temp, args[-1])
else:
return path
def resources_path(*args):
"""Get the path to our resources folder.
:param args List of path elements e.g. ['img', 'logos', 'image.png']
:type args: str
:return: Absolute path to the resources folder.
:rtype: str
"""
path = abspath(abspath(join(plugin_path(), "CenRa_Copie\\tools")))
for item in args:
path = abspath(join(path, item))
return path
def load_ui(*args):
"""Get compile UI file.
:param args List of path elements e.g. ['img', 'logos', 'image.png']
:type args: str
:return: Compiled UI file.
"""
ui_class, _ = uic.loadUiType(resources_path("ui", *args))
return ui_class
def login_base(take=None):
from CenRa_Metabase.resources.PythonSQL import host,port,dbname,password,os_user
first_conn = psycopg2.connect("host=" + host + " port=" + port + " dbname="+dbname+" user=first_cnx password=" + password)
first_cur = first_conn.cursor(cursor_factory = psycopg2.extras.DictCursor)
first_cur.execute("SELECT mdp_w, login_w FROM pg_catalog.pg_user t1, admin_sig.vm_users_sig t2 WHERE t2.oid = t1.usesysid AND (login_w = '" + os_user + "' OR login_w = '" + os_user + "')")
res_ident = first_cur.fetchone()
mdp = base64.b64decode(str(res_ident[0])).decode('utf-8')
user = res_ident[1]
con = psycopg2.connect("host=" + host + " port=" + port + " dbname="+dbname+" user=" + user + " password=" + mdp)
cur = con.cursor(cursor_factory = psycopg2.extras.DictCursor)
first_conn.close()
if take:
return cur,con
else:
return cur
def send_issues(url,titre,body,labels):
import requests
import json
import os
import qgis
usr = os.environ['USERNAME']
token = '9d0a4e0bea561710e0728f161f7edf4e5201e112'
url=url+'?token='+token
headers = {'Authorization': 'token ' + token,'accept': 'application/json','Content-Type': 'application/json'}
payload = {'title': titre, 'body': body, 'labels': labels}
try:
urllib.request.urlopen('https://google.com')
binar = True
except:
binar = False
r = ''
if binar:
r = requests.post(url, data=json.dumps(payload), headers=headers)
return r
def maj_verif(NAME):
import qgis
import urllib.request
iface = qgis.utils.iface
from qgis.core import Qgis
url = qgis.utils.pluginMetadata(NAME,'repository')
#URL = url+'/raw/branch/main/plugins.xml'
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/releases/plugins.xml'
# print(URL)
version = qgis.utils.pluginMetadata(NAME,'version')
len_version = len(version)
try:
urllib.request.urlopen('https://google.com')
binar = True
except:
binar = False
if binar:
version_web = str(urllib.request.urlopen(URL).read())
plugin_num = version_web.find(NAME)
valeur_version_web = version_web.find('<version>',plugin_num)+9
version_plugin = version_web[valeur_version_web:valeur_version_web+len_version]
if version_plugin != version:
iface.messageBar().pushMessage("MAJ :", "Des mise à jour de plugin sont disponibles.", level=Qgis.Info, duration=30)
else:
iface.messageBar().pushMessage("WiFi :", "Pas de connection à internet.", level=Qgis.Warning, duration=30)
def devlog(NAME):
import qgis
devmaj = '<head><style>* {margin:0; padding:0; }</style></head>'
devmaj = devmaj+qgis.utils.pluginMetadata(NAME,'changelog')
return devmaj
+234
View File
@@ -0,0 +1,234 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CopieDialogBase</class>
<widget class="QDialog" name="CopieDialogBase">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>386</width>
<height>290</height>
</rect>
</property>
<property name="windowTitle">
<string>Copie</string>
</property>
<widget class="QDialogButtonBox" name="button_box">
<property name="geometry">
<rect>
<x>100</x>
<y>250</y>
<width>161</width>
<height>32</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
<widget class="QLabel" name="schema_label">
<property name="geometry">
<rect>
<x>20</x>
<y>100</y>
<width>121</width>
<height>29</height>
</rect>
</property>
<property name="maximumSize">
<size>
<width>10000</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Dossier de destination </string>
</property>
</widget>
<widget class="QLabel" name="label_nom_table">
<property name="geometry">
<rect>
<x>20</x>
<y>150</y>
<width>131</width>
<height>29</height>
</rect>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Nom de la nouvelle table</string>
</property>
</widget>
<widget class="QComboBox" name="schema">
<property name="geometry">
<rect>
<x>20</x>
<y>130</y>
<width>351</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QLineEdit" name="table_destination">
<property name="geometry">
<rect>
<x>20</x>
<y>180</y>
<width>291</width>
<height>20</height>
</rect>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
</widget>
<widget class="QLineEdit" name="annee">
<property name="geometry">
<rect>
<x>320</x>
<y>180</y>
<width>50</width>
<height>20</height>
</rect>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>aaaa</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QCheckBox" name="table_vide">
<property name="geometry">
<rect>
<x>60</x>
<y>220</y>
<width>271</width>
<height>20</height>
</rect>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Cocher cette case pour vider la table de destination</string>
</property>
</widget>
<widget class="QLineEdit" name="table_source">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>60</y>
<width>351</width>
<height>20</height>
</rect>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
</widget>
<widget class="QLabel" name="Titre">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>381</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>14</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Copie d'une table</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QLabel" name="table_source_label">
<property name="geometry">
<rect>
<x>20</x>
<y>30</y>
<width>75</width>
<height>29</height>
</rect>
</property>
<property name="maximumSize">
<size>
<width>75</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Table source </string>
</property>
</widget>
</widget>
<resources/>
<connections>
<connection>
<sender>button_box</sender>
<signal>accepted()</signal>
<receiver>CopieDialogBase</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel">
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
<connection>
<sender>button_box</sender>
<signal>rejected()</signal>
<receiver>CopieDialogBase</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel">
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
</connections>
</ui>
+332
View File
@@ -0,0 +1,332 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CenRa_IssuesSend</class>
<widget class="QDialog" name="CenRa_IssuesSend">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>810</width>
<height>587</height>
</rect>
</property>
<property name="windowTitle">
<string>CEN-RA Metabase</string>
</property>
<property name="windowIcon">
<iconset>
<normaloff>icon.svg</normaloff>icon.svg</iconset>
</property>
<widget class="QWidget" name="gridLayoutWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>550</y>
<width>811</width>
<height>31</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="2">
<widget class="QPushButton" name="annuler_button">
<property name="text">
<string>Annuler</string>
</property>
</widget>
</item>
<item row="0" column="3">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="ok_button">
<property name="text">
<string>Envoyer</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QGroupBox" name="groupBox">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>791</width>
<height>531</height>
</rect>
</property>
<property name="title">
<string>Issues</string>
</property>
<widget class="QLineEdit" name="titre_line">
<property name="geometry">
<rect>
<x>240</x>
<y>40</y>
<width>321</width>
<height>41</height>
</rect>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QPlainTextEdit" name="messages_plain">
<property name="geometry">
<rect>
<x>10</x>
<y>101</y>
<width>571</width>
<height>421</height>
</rect>
</property>
</widget>
<widget class="QFrame" name="frame">
<property name="geometry">
<rect>
<x>589</x>
<y>100</y>
<width>191</width>
<height>431</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<widget class="QWidget" name="formLayoutWidget">
<property name="geometry">
<rect>
<x>9</x>
<y>9</y>
<width>341</width>
<height>411</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="labelAlignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="formAlignment">
<set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
</property>
<item row="0" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="check_bug">
<property name="text">
<string>Bug</string>
</property>
</widget>
</item>
<item row="2" column="0">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="check_aide">
<property name="text">
<string>Aide</string>
</property>
</widget>
</item>
<item row="3" column="0">
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="check_question">
<property name="text">
<string>Question</string>
</property>
</widget>
</item>
<item row="4" column="0">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="check_amelioration">
<property name="text">
<string>Amélioration</string>
</property>
</widget>
</item>
<item row="5" column="0">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="1">
<widget class="QCheckBox" name="check_autre">
<property name="text">
<string>Autre</string>
</property>
</widget>
</item>
<item row="6" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>250</x>
<y>20</y>
<width>51</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>14</pointsize>
</font>
</property>
<property name="text">
<string>Titre:</string>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>20</x>
<y>70</y>
<width>91</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>Messages:</string>
</property>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>600</x>
<y>70</y>
<width>91</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>Sujet:</string>
</property>
</widget>
</widget>
</widget>
<tabstops>
<tabstop>ok_button</tabstop>
<tabstop>annuler_button</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
+96
View File
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CenRa_Metabase_editorwidget_base</class>
<widget class="QDialog" name="CenRa_Metabase_editorwidget_base">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>471</width>
<height>594</height>
</rect>
</property>
<property name="windowTitle">
<string>Metabase</string>
</property>
<property name="windowIcon">
<iconset>
<normaloff>../../CenRa_Metabase/tools/ui/icon.svg</normaloff>../../CenRa_Metabase/tools/ui/icon.svg</iconset>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>453</width>
<height>547</height>
</rect>
</property>
<widget class="QGroupBox" name="groupBox">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>451</width>
<height>541</height>
</rect>
</property>
<property name="title">
<string>DevLog</string>
</property>
<widget class="QWebView" name="viewer" native="true">
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>431</width>
<height>511</height>
</rect>
</property>
<property name="url" stdset="0">
<url>
<string>about:blank</string>
</url>
</property>
</widget>
</widget>
</widget>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header location="global">QtWebKitWidgets/QWebView</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
+100
View File
@@ -0,0 +1,100 @@
__copyright__ = "Copyright 2021, 3Liz"
__license__ = "GPL version 3"
__email__ = "info@3liz.org"
from qgis.core import QgsApplication
from qgis.PyQt.QtCore import QCoreApplication, Qt, QTranslator, QUrl
from qgis.PyQt.QtGui import QDesktopServices, QIcon
from qgis.PyQt.QtWidgets import QAction, QMessageBox
from qgis.utils import iface
import qgis
#include <QSettings>
import os
from .tools.resources import (
plugin_path,
resources_path,
maj_verif,
)
from .flux_editor import Flux_Editor
from .about_form import FluxAboutDialog
from PyQt5.QtCore import *
class PgFlux:
def __init__(self):
""" Constructor. """
self.action_editor = None
self.issues = None
self.provider = None
self.locator_filter = None
self.dock_action = None
self.help_action = None
plugin_dir = os.path.dirname(__file__)
end_find = plugin_dir.rfind('\\')+1
global NAME
NAME = plugin_dir[end_find:]
maj_verif(NAME)
# Display About window on first use
version = qgis.utils.pluginMetadata('CenRa_Flux','version')
s = QSettings()
versionUse = s.value("flux/version", 1, type=str)
if str(versionUse) != str(version) :
s.setValue("flux/version", str(version))
print(versionUse,version)
self.open_about_dialog()
def initGui(self):
""" Build the plugin GUI. """
self.toolBar = iface.addToolBar("CenRa_Flux")
self.toolBar.setObjectName("CenRa_Flux")
icon = QIcon(resources_path('icons', 'icon.png'))
# Open the online help
self.help_action = QAction(icon, "CenRa_Flux", iface.mainWindow())
iface.pluginHelpMenu().addAction(self.help_action)
self.help_action.triggered.connect(self.open_help)
if not self.action_editor:
self.action_editor = Flux_Editor()
self.flux_editor = QAction(icon, 'SigCEN',None)
self.toolBar.addAction(self.flux_editor)
self.flux_editor.triggered.connect(self.open_editor)
def open_about_dialog(self):
"""
About dialog
"""
dialog = CopieAboutDialog(iface)
dialog.exec_()
def open_help():
""" Open the online help. """
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
def open_editor(self):
self.action_editor.show()
self.action_editor.raise_()
def unload(self):
""" Unload the plugin. """
if self.action_editor:
iface.removePluginMenu('CenRa_Flux',self.flux_editor)
if self.provider:
QgsApplication.processingRegistry().removeProvider(self.provider)
del self.provider
if self.locator_filter:
iface.deregisterLocatorFilter(self.locator_filter)
del self.locator_filter
if self.help_action:
iface.pluginHelpMenu().removeAction(self.help_action)
del self.help_action
+60
View File
@@ -0,0 +1,60 @@
# <p align="center">FluxCEN</p>
<img align="left" src=https://raw.githubusercontent.com/CEN-Nouvelle-Aquitaine/fluxcen/main/icon.png width="220"/>
<br>
<br>
<br>
Le plugin QGIS FluxCEN permet d'accéder rapidement à un large éventail de flux WFS/WMS organisés par catégories et interrogeables sous forme de mots-clés.
<br>
<br>
Il évite ainsi d'avoir à gérer dans QGIS une multitude de connexions.
<br>
<br>
<br>
## 🧐 Features
- Sélection rapide des ressources par autocomplétion
- Regroupement des flux au sein de catégories
- Gestion des styles par défaut à l'ouverture dans QGIS pour les données WFS
- Centralisation et gestion des flux simplifiée dans un fichier .csv
- Code et ressources attachées gérées directement via le git
- Prise en charge des flux Geoserver et Mapserver
- Lien direct vers la fiche de métadonnées de la ressource
## Composition du fichier .csv
* service : type de service utilisé (WFS ou WMS)
* categorie : categorie de la couche pour affichage et recherche dans le plugin
* Nom_couche_plugin : nom de la couche qui s'affichera dans le plugin
* nom_technique : nom technique de la couche utilisé sur le serveur source (caché dans le plugin)
* url : URL du serveur pour accéder à la couche
* source : Source de la donnée
* style : nom du fichier de style pour affichage à l'ouverture dans QGIS
* metadonnees : URL d'accès à la fiche de métadonnées liée à la resource
Exemple pour accéder à la BD ORTHO® :
| service | categorie | Nom_couche_plugin | nom_technique | url | source | style |
| -------- | -------- | -------- | -------- | -------- |-------- | -------- |
| WMS Raster| Fonds cartos | BD ORTHO® | HR.ORTHOIMAGERY.ORTHOPHOTOS |https://wxs.ign.fr/ortho/geoportail/r/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities| IGN | |
## Style des couches
Le dossier *styles_couches* stocke les styles QGIS au format .qml afin d'appliquer par défaut ce style à l'ouverture de la couche dans QGIS. L'ajout d'un style dans ce dossier nécessite de reporter le nom du fichier .qml dans le champ "style" du csv.
## Accès aux données protégées
Si l'accès à la majorité des ressources reste public, certaines peuvent être protégées par un mot de passe (données métier confidentielles par exemple).
Cette authentification est gérée via le serveur cartographique qui génère les flux.
Pour y accéder, il faut créer en amont une authentification dans QGIS. L'ouverture des données protégées se fera alors à partir de la première authentification enregistrée dans QGIS (pas de gestion multi-authentification pour le moment)
## Interface du plugin:
<img align="center" src=https://raw.githubusercontent.com/CEN-Nouvelle-Aquitaine/fluxcen/main/fluxcen_interface.PNG width="600"/>
+6
View File
@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
def classFactory(iface):
_ = iface
from CenRa_FLUX.CenRa_Flux import PgFlux
return PgFlux()
+46
View File
@@ -0,0 +1,46 @@
import os.path
from pathlib import Path
from qgis.PyQt import uic
from qgis.PyQt.QtGui import QPixmap
from qgis.PyQt.QtWidgets import QDialog
from .tools.resources import devlog
ABOUT_FORM_CLASS, _ = uic.loadUiType(
os.path.join(
str(Path(__file__).resolve().parent),
'tools/ui',
'CenRa_about_form.ui'
)
)
class FluxAboutDialog(QDialog, ABOUT_FORM_CLASS):
""" About - Let the user display the about dialog. """
def __init__(self, iface, parent=None):
super().__init__(parent)
self.iface = iface
self.setupUi(self)
self.viewer.setHtml(devlog('CenRa_FLUX'))
self.rejected.connect(self.onReject)
self.buttonBox.rejected.connect(self.onReject)
self.buttonBox.accepted.connect(self.onAccept)
def onAccept(self):
"""
Save options when pressing OK button
"""
self.accept()
def onReject(self):
"""
Run some actions when
the user closes the dialog
"""
self.close()
+362
View File
@@ -0,0 +1,362 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
# Import the PyQt and QGIS libraries
from builtins import next
from builtins import str
from builtins import object
import qgis
from qgis.PyQt import QtCore
from qgis.PyQt.QtCore import QSettings
from qgis.PyQt import QtWidgets
from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog
from qgis.PyQt.QtGui import QIcon
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5 import QtGui
from qgis.core import *
from qgis.core import QgsDataSourceUri
from qgis.PyQt.QtWidgets import (
QDialog,
QAction,
QDockWidget,
QFileDialog,
QInputDialog,
QMenu,
QToolButton,
QTableWidget,
QTableWidgetItem,
QMessageBox,
QVBoxLayout,
)
from .tools.PythonSQL import *
from .tools.resources import (
load_ui,
resources_path,
login_base,
send_issues,
)
from .issues import CenRa_Issues
from qgis.utils import iface
import os.path
import webbrowser, os
import psycopg2
import psycopg2.extras
import base64
first_conn = psycopg2.connect("host=" + host + " port=" + port + " dbname="+dbname+" user=first_cnx password=" + password)
first_cur = first_conn.cursor(cursor_factory = psycopg2.extras.DictCursor)
first_cur.execute("SELECT mdp_w, login_w FROM pg_catalog.pg_user t1, admin_sig.vm_users_sig t2 WHERE t2.oid = t1.usesysid AND (login_w = '" + os_user + "' OR login_w = '" + os_user + "')")
res_ident = first_cur.fetchone()
mdp = base64.b64decode(str(res_ident[0])).decode('utf-8')
user = res_ident[1]
first_conn.close()
EDITOR_CLASS = load_ui('CenRa_Flux_base.ui')
class Flux_Editor(QDialog, EDITOR_CLASS):
def __init__(self, parent=None):
_ = parent
super().__init__()
self.setupUi(self)
self.settings = QgsSettings()
self.s = QSettings()
self.setWindowIcon(QtGui.QIcon(resources_path('icons','icon.png')))
self.first_start = None
self.iface = iface
self.label_3.setPixmap(QtGui.QPixmap(resources_path('ui','logo.png')))
self.commandLinkButton.setIcon(QtGui.QIcon(resources_path('ui','arrow-bottom.png')))
self.commandLinkButton_2.setIcon(QtGui.QIcon(resources_path('ui','arrow-up.png')))
self.tableWidget.setSelectionBehavior(QTableWidget.SelectRows)
self.tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
self.comboBox_2.addItem("SIG")
self.comboBox_2.addItem('REF')
self.comboBox.currentIndexChanged.connect(self.initialisation_flux)
self.commandLinkButton.clicked.connect(self.selection_flux)
self.tableWidget.itemDoubleClicked.connect(self.selection_flux)
self.pushButton_2.clicked.connect(self.limite_flux)
self.commandLinkButton_2.clicked.connect(self.suppression_flux)
self.tableWidget_2.itemDoubleClicked.connect(self.suppression_flux)
self.comboBox_2.currentIndexChanged.connect(self.bd_source)
layout = QVBoxLayout()
self.lineEdit.textChanged.connect(self.filtre_dynamique)
layout.addWidget(self.lineEdit)
#self.lineEdit.mousePressEvent = self._mousePressEvent
#metadonnees_plugin = open(self.plugin_path + '/metadata.txt')
#infos_metadonnees = metadonnees_plugin.readlines()
def raise_(self):
"""Run method that performs all the real work"""
self.bd_source()
def bd_source(self):
self.activateWindow()
bd_origine=self.comboBox_2.currentText()
if bd_origine == 'REF':
self.run_ref()
if bd_origine == 'SIG':
self.run_sig()
def run_ref(self):
"""Run method that performs all the real work"""
while self.tableWidget_2.rowCount() > 0:
self.tableWidget_2.removeRow(self.tableWidget_2.rowCount()-1)
# print(self.tableWidget_2.rowCount())
global cur,con,dbtype
dbtype=refdb
con = psycopg2.connect("host=" + host + " port=" + port + " dbname="+dbtype+" user=" + user + " password=" + mdp)
cur = con.cursor(cursor_factory = psycopg2.extras.DictCursor)
self.initialisation_flux()
self.combobox_custom()
# Create the dialog with elements (after translation) and keep reference
# Only create GUI ONCE in callback, so that it will only load when the plugin is started
if self.first_start == True:
self.first_start = False
# show the dialog
self.show()
# Run the dialog event loop
result = self.exec_()
# See if OK was pressed
if result:
# Do something useful here - delete the line containing pass and
# substitute with your code.
pass
def run_sig(self):
"""Run method that performs all the real work"""
while self.tableWidget_2.rowCount() > 0:
self.tableWidget_2.removeRow(self.tableWidget_2.rowCount()-1)
global cur,con,dbtype
dbtype=sigdb
con = psycopg2.connect("host=" + host + " port=" + port + " dbname="+dbtype+" user=" + user + " password=" + mdp)
cur = con.cursor(cursor_factory = psycopg2.extras.DictCursor)
self.initialisation_flux()
self.combobox_custom()
# Create the dialog with elements (after translation) and keep reference
# Only create GUI ONCE in callback, so that it will only load when the plugin is started
if self.first_start == True:
self.first_start = False
# show the dialog
self.show()
# Run the dialog event loop
result = self.exec_()
# See if OK was pressed
if result:
# Do something useful here - delete the line containing pass and
# substitute with your code.
pass
def suppression_flux(self):
self.tableWidget_2.removeRow(self.tableWidget_2.currentRow())
def open_url(self, item):
url = item.data(Qt.UserRole)
def initialisation_flux(self):
if dbtype == sigdb:
if self.comboBox.currentText() == 'toutes les catégories':
custom_list=schemaname_list
elif self.comboBox.currentText() == 'travaux':
custom_list="""(SELECT schemaname,tablename from pg_catalog.pg_tables
where schemaname like '"""+ str(self.comboBox.currentText()) +"""%' order by schemaname,tablename) UNION (SELECT schemaname,matviewname AS tablename FROM pg_catalog.pg_matviews where schemaname like '"""+ str(self.comboBox.currentText()) +"""%' order by schemaname,tablename) order by schemaname,tablename;"""
else:
custom_list="""(SELECT schemaname,tablename from pg_catalog.pg_tables
where schemaname like '\_"""+ str(self.comboBox.currentText()) +"""%' order by schemaname,tablename) UNION (SELECT schemaname,matviewname AS tablename FROM pg_catalog.pg_matviews where schemaname like '\_"""+ str(self.comboBox.currentText()) +"""%' order by schemaname,tablename) order by schemaname,tablename;"""
else:
if self.comboBox.currentText() == 'toutes les catégories':
custom_list=schemaname_list_ref
else:
custom_list="""SELECT schemaname,tablename from pg_catalog.pg_tables
where schemaname like '"""+ str(self.comboBox.currentText()) +"""' order by schemaname,tablename;"""
cur.execute(custom_list)
list_schema = cur.fetchall()
self.tableWidget.setRowCount(len(list_schema))
self.tableWidget.setColumnCount(3)
i=0
for value in list_schema:
if dbtype == sigdb:
type_val = str(value[0])[1:3]
schema_name=str(value[0])[4:]
table_name=str(value[1])
else:
type_val = ''
schema_name=str(value[0])
table_name=str(value[1])
if type_val == 'fo':
type_val=str(value[0])[1:5]
schema_name=str(value[0])[6:]
table_name=str(value[1])
elif type_val == 'ra':
type_val='travaux'
schema_name=str(value[0])
table_name=str(value[1])
elif type_val != '00' and type_val != '01' and type_val != '07' and type_val != '26' and type_val != '42' and type_val != '69' and type_val != 'ra':
type_val='agregation'
schema_name=str(value[0])
table_name=str(value[1])
item = QTableWidgetItem(type_val)
self.tableWidget.setItem(i,0,item)
item = QTableWidgetItem(schema_name)
self.tableWidget.setItem(i,1,item)
item = QTableWidgetItem(table_name)
self.tableWidget.setItem(i,2,item)
i=i+1
self.tableWidget.setColumnWidth(0, 20)
self.tableWidget.setColumnWidth(1, 300)
self.tableWidget.setColumnWidth(2, 300)
self.tableWidget.setHorizontalHeaderLabels(["Code","Schema","Table"])
def selection_flux(self):
selected_row = 0
selected_items = self.tableWidget.selectedItems()
# Assuming you want to compare items in the first column for uniqueness
new_item_text = selected_items[2].text()
if not self.item_already_exists(new_item_text):
self.tableWidget_2.insertRow(selected_row)
for column in range(self.tableWidget.columnCount()):
cloned_item = selected_items[column].clone()
self.tableWidget_2.setHorizontalHeaderLabels(["Code","Schema", "Table"])
self.tableWidget_2.setColumnCount(3)
self.tableWidget_2.setItem(selected_row, column, cloned_item)
self.tableWidget_2.setColumnWidth(0, 50)
self.tableWidget_2.setColumnWidth(1, 300)
self.tableWidget_2.setColumnWidth(2, 300)
def item_already_exists(self, new_item_text):
# Assuming you want to compare items in the first column for uniqueness
existing_items = self.tableWidget_2.findItems(new_item_text, QtCore.Qt.MatchExactly)
# Check if there are any existing items with the same text in the first column
return len(existing_items) > 0
def limite_flux(self):
if self.tableWidget_2.rowCount() > 5:
self.QMBquestion = QMessageBox.question(iface.mainWindow(), u"Attention !",
"Le nombre de flux à charger en une seule fois est limité à 5 pour des questions de performances. Souhaitez vous tout de même charger les " + str(
self.tableWidget_2.rowCount()) + " flux sélectionnés ? (risque de plantage de QGIS)",
QMessageBox.Yes | QMessageBox.No)
if self.QMBquestion == QMessageBox.Yes:
self.chargement_flux()
if self.QMBquestion == QMessageBox.No:
print("Annulation du chargement des couches")
if self.tableWidget_2.rowCount() <= 5:
self.chargement_flux()
def chargement_flux(self):
managerAU = QgsApplication.authManager()
k = managerAU.availableAuthMethodConfigs().keys()
def REQUEST(type):
switcher = {
'WFS': "GetFeature",
'WMS': "GetMap",
'WMS+Vecteur': "GetMap",
'WMS+Raster': "GetMap",
'WMTS': "GetMap"
}
return switcher.get(type, "nothing")
def displayOnWindows(type, uri, name):
p = []
for row in range(0, self.tableWidget_2.rowCount()):
## supression de la partie de l'url après le point d'interrogation
if dbtype == sigdb:
code = self.tableWidget_2.item(row,0).text()
schema = '_'+code+'_'+self.tableWidget_2.item(row,1).text()
if code == 'travaux' or code == 'agregation':
schema = self.tableWidget_2.item(row,1).text()
table = self.tableWidget_2.item(row,2).text()#.split("?", 1)[0]
if dbtype == refdb:
# code = self.tableWidget_2.item(row,0).text()
schema = self.tableWidget_2.item(row,1).text()
table = self.tableWidget_2.item(row,2).text()#.split("?", 1)[0]
uri = QgsDataSourceUri()
uri.setConnection(host ,port ,dbtype ,user ,mdp)
# nom du schéma à remplacer: "hydrographie" à supprimer et mettre "couches_collaboratives" lorsqu'on aura regroupé les couches à modifier dans un même schéma
uri.setDataSource(schema, table, "geom")
uri.setKeyColumn('gid')
# Chargement de la couche PostGIS
geom_type ='SELECT right(st_geometrytype(geom),-3) as a FROM '+schema+'.'+table+' GROUP BY a'
cur.execute(geom_type)
list_typegeom = cur.fetchall()
print(len(list_typegeom))
if len(list_typegeom) > 1:
for typegeom in list_typegeom:
if typegeom[0] == 'MultiPolygon':
uri.setWkbType(QgsWkbTypes.MultiPolygon)
elif typegeom[0] == 'MultiLineString':
uri.setWkbType(QgsWkbTypes.MultiLineString)
elif typegeom[0] == 'Point':
uri.setWkbType(QgsWkbTypes.Point)
if typegeom[0] == 'Polygon':
uri.setWkbType(QgsWkbTypes.Polygon)
elif typegeom[0] == 'LineString':
uri.setWkbType(QgsWkbTypes.LineString)
elif typegeom[0] == 'MultiPoint':
uri.setWkbType(QgsWkbTypes.MultiPoint)
if (typegeom[0] != None and typegeom[0] != 'Polygon'):
uri.setSrid('2154')
layer = QgsVectorLayer(uri.uri(), table, "postgres")
# Ajout de la couche au canevas QGIS
QgsProject.instance().addMapLayer(layer)
else:
layer = QgsVectorLayer(uri.uri(), table, "postgres")
# Ajout de la couche au canevas QGIS
QgsProject.instance().addMapLayer(layer)
def combobox_custom(self):
if dbtype == sigdb:
self.comboBox.clear()
self.comboBox.addItem("toutes les catégories")
self.comboBox.addItem('00')
self.comboBox.addItem('01')
self.comboBox.addItem('07')
self.comboBox.addItem('26')
self.comboBox.addItem('42')
self.comboBox.addItem('69')
self.comboBox.addItem('agregation')
self.comboBox.addItem('travaux')
self.comboBox.addItem('form')
if dbtype == refdb:
custom_list=schemaname_distinct
cur.execute(custom_list)
list_schema = cur.fetchall()
self.comboBox.clear()
self.comboBox.addItem("toutes les catégories")
for baxval in list_schema:
self.comboBox.addItem(baxval[0])
def filtre_dynamique(self, filter_text):
for i in range(self.tableWidget.rowCount()):
for j in range(self.tableWidget.columnCount()):
item = self.tableWidget.item(i, j)
match = filter_text.lower() not in item.text().lower()
self.tableWidget.setRowHidden(i, match)
if not match:
break
def popup(self):
self.dialog = Popup() # +++ - self
self.dialog.text_edit.show()
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

+88
View File
@@ -0,0 +1,88 @@
import os
plugin_dir = os.path.dirname(__file__)
end_find = plugin_dir.rfind('\\')+1
NAME = plugin_dir[end_find:]
from qgis.gui import *
from qgis.core import (
NULL,
QgsApplication,
QgsDataSourceUri,
QgsProject,
QgsProviderConnectionException,
QgsProviderRegistry,
QgsRasterLayer,
QgsSettings,
QgsVectorLayer,
QgsGeometry,
)
from qgis.PyQt.QtWidgets import (
QDialog,
QAction,
QDockWidget,
QFileDialog,
QInputDialog,
QMenu,
QToolButton,
QTableWidget,
QTableWidgetItem,
)
from qgis.utils import iface
from .tools.resources import (
load_ui,
resources_path,
send_issues,
)
EDITOR_CLASS = load_ui('CenRa_IssuesSend.ui')
class CenRa_Issues(QDialog, EDITOR_CLASS):
def __init__(self, parent=None):
_ = parent
super().__init__()
self.setupUi(self)
self.settings = QgsSettings()
#place connect here
self.annuler_button.clicked.connect(self.close)
self.ok_button.clicked.connect(self.run_sendissues)
def run_sendissues(self):
text_titre = self.titre_line.text()
text_message = self.messages_plain.toPlainText()
statu_bug = self.check_bug.isChecked()
statu_aide = self.check_aide.isChecked()
statu_question = self.check_question.isChecked()
statu_amelioration = self.check_amelioration.isChecked()
statu_autre = self.check_autre.isChecked()
statu = []
if statu_bug == True : statu = statu + [1]
if statu_aide == True : statu = statu + [3]
if statu_question == True : statu = statu + [5]
if statu_amelioration == True : statu = statu + [2]
if statu_autre == True : statu = statu + [6]
if len(statu) >= 1:
import qgis
url = qgis.utils.pluginMetadata(NAME,'tracker')
print(text_message)
send_info = send_issues(url,text_titre,text_message,statu)
code = send_info.status_code
print(code)
else:
code = 423
if code == 201:
iface.messageBar().pushMessage("Envoyer :", "Votre messages à bien été envoyer.", level=Qgis.Success, duration=20)
self.close()
elif code == 422:
iface.messageBar().pushMessage("Erreur :", "Erreur dans le contenu du messages.", level=Qgis.Critical, duration=20)
elif code == 423:
iface.messageBar().pushMessage("Erreur :", "Pas de sujet sélectionné.", level=Qgis.Critical, duration=20)
elif code == 404:
iface.messageBar().pushMessage("Missing :", "Le serveur de messagerie est injoignable.", level=Qgis.Warning, duration=20)
+48
View File
@@ -0,0 +1,48 @@
# This file contains metadata for your plugin.
# This file should be included when you package your plugin.# Mandatory items:
[general]
name=CenRa_FLUX
qgisMinimumVersion=3.0
description=Permet d'ouvrire une table dans la base PostGis
version=2.1
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
email=si_besoin@cen-rhonealpes.fr
#about=
# End of mandatory metadata
# Recommended items:
hasProcessingProvider=no
# Uncomment the following line and add your changelog:
# changelog= correctif de sécurité: envoi du certificat d'authentification seulement pour les couches fonciercen et drone / intégration des styles RPG geoportail / modification des noms de couches pour plus de clarté
# Tags are comma separated with spaces allowed
tags=cenra, postgis, database
repository=https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS
homepage=https://plateformesig.cenra-outils.org/
tracker=https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS
category=Plugins
icon=icon.png
# experimental flag
experimental=False
changelog=<h1>CenRA_FLUX:</h1></br><p><h3>22/10/2024 - Version 2.1:</h3> - Correctif de bug.</br> - Evolution de la limit de 3 à 5. </br></p></br><p><h3>22/10/2024 - Version 2.0:</h3> - Reformatage du code.</br></p></br><p><h3>03/10/2024 - Version 1.14:</h3> - Remonte la fênetre dans la pille.</br></p><p><h3>13/09/2024 - Version 1.13:</h3>- MAJ sur le lien du changelog</br>- Bug-fix: Ouvre MultiPolygone et Polygon séparément.</p></br><p><h3>10/09/2024 - Version 1.11:</h3>- Ouverture de table contenant plusieurs géométries.</p></br><p><h3>26/08/2024 - Version 1.10:</h3>- Ajoute d'un changelog et vérification de mise à jour.</p>
# deprecated flag (applies to the whole plugin, not just a single version)
deprecated=False
# Since QGIS 3.8, a comma separated list of plugins to be installed
# (or upgraded) can be specified.
# Check the documentation for more information.
# plugin_dependencies=
# If the plugin can run on QGIS Server.
server=False
+21
View File
@@ -0,0 +1,21 @@
from qgis.core import QgsApplication
def gitea():
file_url = QgsApplication.qgisSettingsDirPath()+'QGIS/QGIS3.ini'
recherche_1 = 'plugin_repositories\\github\\url=https://github.com/CEN-Rhone-Alpes/Plugin_QGIS/releases/latest/download/plugins.xml'
replace_1 = 'plugin_repositories\\gitea\\url=https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/plugins.xml'
recherche_2 = 'github'
replace_2 = 'gitea'
# Read in the file
with open(file_url, 'r') as file:
filedata = file.read()
# Replace the target string
filedata = filedata.replace(recherche_1, replace_1)
filedata = filedata.replace(recherche_2, replace_2)
# Write the file out again
with open(file_url, 'w') as file:
file.write(filedata)
+185
View File
@@ -0,0 +1,185 @@
import sys
import socket
import os
IPAddr=socket.gethostbyname(socket.gethostname())
print(IPAddr)
if IPAddr[0:11] == "100.100.100": #4269
host = "100.100.100.11"
port = "5432"
dbname = "sig4269"
sigdb="sig4269"
refdb="ref_geo4269"
password = "XXXXXX"
if IPAddr[0:9] == "192.168.0": #01
host = "192.168.0.201"
port = "5432"
dbname = "sig01"
sigdb="sig01"
refdb="ref_geo01"
password = "XXXXXX"
if IPAddr[0:9] == "192.168.1": #0726
host = "192.168.1.201"
port = "5432"
dbname = "sig0726"
sigdb="sig0726"
refdb="ref_geo0726"
password = "XXXXXX"
if sys.platform == 'linux':
os_user = os.environ['USER']
else:
os_user = os.environ['USERNAME']
if os_user == 'STAGE':
os_user='stage'
if os_user == 'Administrateur':
os_user = 'stage'
schemaname_distinct="""SELECT DISTINCT schemaname from pg_catalog.pg_tables
WHERE schemaname NOT LIKE '_archives' AND schemaname NOT LIKE 'topology' AND schemaname NOT LIKE 'information_schema' AND schemaname NOT LIKE 'pg_catalog' and schemaname NOT LIKE 'public' AND schemaname NOT LIKE '_trier'
order by schemaname;"""
schemaname_list_ref="""SELECT schemaname,tablename from pg_catalog.pg_tables
WHERE schemaname NOT LIKE '_archives' AND schemaname NOT LIKE 'topology' AND schemaname NOT LIKE 'information_schema' AND schemaname NOT LIKE 'pg_catalog' and schemaname NOT LIKE 'public' AND schemaname NOT LIKE '_trier'
order by schemaname,tablename;"""
schemaname_list="""(SELECT schemaname,tablename from pg_catalog.pg_tables
where schemaname like 'trav%' or schemaname like '\_ag%' or schemaname like '\_00%' or schemaname like '\_01%' or schemaname like '\_07%' or schemaname like '\_26%' or schemaname like '\_form%' or schemaname like '\_42%' or schemaname like '\_69%' order by schemaname,tablename)
UNION
(SELECT schemaname,matviewname AS tablename FROM pg_catalog.pg_matviews order by schemaname,tablename) order by schemaname,tablename;"""
geom = "geom"
champ_travaux_prevus_multipolygon="""(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, surface_m2 double precision, surface_ha double precision, date_creation date, date_maj date, geom geometry(MultiPolygon,2154))"""
champ_travaux_prevus_multilinestring="""(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, longueur_m double precision, longueur_km double precision, date_creation date, date_maj date, geom geometry(MultiLineString,2154))"""
champ_travaux_prevus_point = """(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, x_wgs84 double precision, y_wgs84 double precision, date_creation date, date_maj date, geom geometry(Point,2154))"""
champ_viergePolygone = """(gid serial NOT NULL, commentaire text, surface_m2 double precision, surface_ha double precision, geom geometry(MultiPolygon,2154))"""
champ_viergeLigne = """(gid serial NOT NULL, commentaire text, longueur_m double precision, longueur_km double precision, geom geometry(MultiLineString,2154))"""
champ_viergePoint = """(gid serial NOT NULL, commentaire text, x_wgs84 double precision, y_wgs84 double precision, geom geometry(Point,2154))"""
champ_habitat = """(gid serial NOT NULL, cd_cb_01 text, lb_cb97_fr_01 text, occupation_01 integer, cd_cb_02 text, lb_cb97_fr_02 text, occupation_02 integer, cd_cb_03 text, lb_cb97_fr_03 text, occupation_03 integer, milieu_code text, milieu_libelle text, surface_m2 double precision, surface_ha double precision, commentaire text, date_creation date, date_maj date, geom geometry(MultiPolygon,2154))"""
champ_contour="""(gid serial NOT NULL, date_creation date, date_maj date, utilisateur character varying, dept character(2), nom character varying, surface_m2 double precision, surface_ha double precision, type_site character varying, type_milieu character varying, date_premier_pg integer, date_debut_pg integer, date_fin_pg integer, referent character varying, gestion_deleguee character varying, terrain_militaire character(3), ens character(3), zh character(3), adapt_pmr character(3), inform character(3), guide character(3), ouverture_public character(3), obs character(3), anim character(3), n2000_anim character(3), contrat_n2000_conseil character(3), n2000_op character(3), contrat_n2000_benef character(3), contrat_agri character(3), bc_habitat integer, bc_amphibien integer, bc_coleoptere integer, bc_crustace integer, bc_mammifere integer, bc_chiroptere integer, bc_mollusque integer, bc_odonate integer, bc_oiseau integer, bc_orthoptere integer, bc_poisson integer, bc_reptile integer, bc_rhopalocere integer, bc_heterocere integer, bc_autre_invertebre integer, bc_flore integer, bc_bryophyte integer, bc_champignon integer, suiv_analyse_sol character(3), suiv_piezo character(3), suiv_climat character(3), suiv_topo character(3), suiv_habitat character(3), suiv_amphibien character(3), suiv_coleoptere character(3), suiv_crustace character(3), suiv_mammifere character(3), suiv_chiroptere character(3), suiv_mollusque character(3), suiv_odonate character(3), suiv_oiseau character(3), suiv_orthoptere character(3), suiv_poisson character(3), suiv_reptile character(3), suiv_rhopalocere character(3), suiv_heterocere character(3), suiv_autre_invertebre character(3), suiv_flore character(3), suiv_bryophyte character(3), suiv_champignon character(3), suiv_analyse_eau character(3), suiv_phenologie character(3), suiv_frequentation character(3), suiv_paysager character(3), suiv_autre character(3), commentaire text, geom geometry(MultiPolygon,2154))
"""
champ_vegethab_point = """(
gid serial NOT NULL ,
cd_eu_01 character varying(254) COLLATE pg_catalog."default",
lb_eu_01 character varying(254) COLLATE pg_catalog."default",
occupati_1 bigint,
cd_eu_02 character varying(254) COLLATE pg_catalog."default",
lb_eu_02 character varying(254) COLLATE pg_catalog."default",
occupati_2 bigint,
cd_eu_03 character varying(254) COLLATE pg_catalog."default",
lb_eu_03 character varying(254) COLLATE pg_catalog."default",
occupati_3 bigint,
milieu_cod character varying(254) COLLATE pg_catalog."default",
milieu_lib character varying(254) COLLATE pg_catalog."default",
surface_m2 numeric,
surface_ha numeric,
commentair character varying(254) COLLATE pg_catalog."default",
date_creat date,
date_maj date,
num_phyto character varying(254) COLLATE pg_catalog."default",
type_unite character varying(254) COLLATE pg_catalog."default",
dynamique character varying(254) COLLATE pg_catalog."default",
gestio_obs character varying(254) COLLATE pg_catalog."default",
degrad_obs character varying(254) COLLATE pg_catalog."default",
eta_conser character varying(254) COLLATE pg_catalog."default",
clas_phyto character varying(254) COLLATE pg_catalog."default",
alli_phyto character varying(254) COLLATE pg_catalog."default",
syntaxon character varying(254) COLLATE pg_catalog."default",
n2000 character varying(254) COLLATE pg_catalog."default",
lrr_aura character varying(254) COLLATE pg_catalog."default",
lrr_cbna character varying(254) COLLATE pg_catalog."default",
lrr_cbnmc character varying(254) COLLATE pg_catalog."default",
vege_enjeu character varying(254) COLLATE pg_catalog."default",
num_photo character varying(254) COLLATE pg_catalog."default",
nature_obs character varying(254) COLLATE pg_catalog."default",
date_sais date,
s_al_phyto character varying(254) COLLATE pg_catalog."default",
alli_name character varying(254) COLLATE pg_catalog."default",
salli_name character varying(254) COLLATE pg_catalog."default",
class_name character varying(254) COLLATE pg_catalog."default",
geom geometry(Point,2154)
)
"""
champ_vegethab_multilinestring = """(
gid serial NOT NULL ,
cd_eu_01 character varying(254) COLLATE pg_catalog."default",
lb_eu_01 character varying(254) COLLATE pg_catalog."default",
occupati_1 bigint,
cd_eu_02 character varying(254) COLLATE pg_catalog."default",
lb_eu_02 character varying(254) COLLATE pg_catalog."default",
occupati_2 bigint,
cd_eu_03 character varying(254) COLLATE pg_catalog."default",
lb_eu_03 character varying(254) COLLATE pg_catalog."default",
occupati_3 bigint,
milieu_cod character varying(254) COLLATE pg_catalog."default",
milieu_lib character varying(254) COLLATE pg_catalog."default",
surface_m2 numeric,
surface_ha numeric,
commentair character varying(254) COLLATE pg_catalog."default",
date_creat date,
date_maj date,
num_phyto character varying(254) COLLATE pg_catalog."default",
type_unite character varying(254) COLLATE pg_catalog."default",
dynamique character varying(254) COLLATE pg_catalog."default",
gestio_obs character varying(254) COLLATE pg_catalog."default",
degrad_obs character varying(254) COLLATE pg_catalog."default",
eta_conser character varying(254) COLLATE pg_catalog."default",
clas_phyto character varying(254) COLLATE pg_catalog."default",
alli_phyto character varying(254) COLLATE pg_catalog."default",
syntaxon character varying(254) COLLATE pg_catalog."default",
n2000 character varying(254) COLLATE pg_catalog."default",
lrr_aura character varying(254) COLLATE pg_catalog."default",
lrr_cbna character varying(254) COLLATE pg_catalog."default",
lrr_cbnmc character varying(254) COLLATE pg_catalog."default",
vege_enjeu character varying(254) COLLATE pg_catalog."default",
num_photo character varying(254) COLLATE pg_catalog."default",
nature_obs character varying(254) COLLATE pg_catalog."default",
date_sais date,
s_al_phyto character varying(254) COLLATE pg_catalog."default",
alli_name character varying(254) COLLATE pg_catalog."default",
salli_name character varying(254) COLLATE pg_catalog."default",
class_name character varying(254) COLLATE pg_catalog."default",
geom geometry(MultiLineString,2154)
)
"""
champ_vegethab_multipolygon = """(
gid serial NOT NULL ,
cd_eu_01 character varying(254) COLLATE pg_catalog."default",
lb_eu_01 character varying(254) COLLATE pg_catalog."default",
occupati_1 bigint,
cd_eu_02 character varying(254) COLLATE pg_catalog."default",
lb_eu_02 character varying(254) COLLATE pg_catalog."default",
occupati_2 bigint,
cd_eu_03 character varying(254) COLLATE pg_catalog."default",
lb_eu_03 character varying(254) COLLATE pg_catalog."default",
occupati_3 bigint,
milieu_cod character varying(254) COLLATE pg_catalog."default",
milieu_lib character varying(254) COLLATE pg_catalog."default",
surface_m2 numeric,
surface_ha numeric,
commentair character varying(254) COLLATE pg_catalog."default",
date_creat date,
date_maj date,
num_phyto character varying(254) COLLATE pg_catalog."default",
type_unite character varying(254) COLLATE pg_catalog."default",
dynamique character varying(254) COLLATE pg_catalog."default",
gestio_obs character varying(254) COLLATE pg_catalog."default",
degrad_obs character varying(254) COLLATE pg_catalog."default",
eta_conser character varying(254) COLLATE pg_catalog."default",
clas_phyto character varying(254) COLLATE pg_catalog."default",
alli_phyto character varying(254) COLLATE pg_catalog."default",
syntaxon character varying(254) COLLATE pg_catalog."default",
n2000 character varying(254) COLLATE pg_catalog."default",
lrr_aura character varying(254) COLLATE pg_catalog."default",
lrr_cbna character varying(254) COLLATE pg_catalog."default",
lrr_cbnmc character varying(254) COLLATE pg_catalog."default",
vege_enjeu character varying(254) COLLATE pg_catalog."default",
num_photo character varying(254) COLLATE pg_catalog."default",
nature_obs character varying(254) COLLATE pg_catalog."default",
date_sais date,
s_al_phyto character varying(254) COLLATE pg_catalog."default",
alli_name character varying(254) COLLATE pg_catalog."default",
salli_name character varying(254) COLLATE pg_catalog."default",
class_name character varying(254) COLLATE pg_catalog."default",
geom geometry(MultiPolygon,2154)
)
"""
Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

+183
View File
@@ -0,0 +1,183 @@
"""Tools to work with resource files."""
import configparser
import shutil
import tempfile
import base64
import psycopg2
import psycopg2.extras
from os.path import abspath, join, pardir, dirname
from qgis.PyQt import uic
__copyright__ = "Copyright 2019, 3Liz"
__license__ = "GPL version 3"
__email__ = "info@3liz.org"
__revision__ = "$Format:%H$"
def plugin_path(*args):
"""Get the path to plugin root folder.
:param args List of path elements e.g. ['img', 'logos', 'image.png']
:type args: str
:return: Absolute path to the plugin path.
:rtype: str
"""
path = dirname(dirname(__file__))
path = abspath(abspath(join(path, pardir)))
for item in args:
path = abspath(join(path, item))
return path
def plugin_name():
"""Return the plugin name according to metadata.txt.
:return: The plugin name.
:rtype: basestring
"""
metadata = metadata_config()
name = metadata["general"]["name"]
return name
def metadata_config() -> configparser:
"""Get the INI config parser for the metadata file.
:return: The config parser object.
:rtype: ConfigParser
"""
path = plugin_path("metadata.txt")
config = configparser.ConfigParser()
config.read(path, encoding='utf8')
return config
def plugin_test_data_path(*args, copy=False):
"""Get the path to the plugin test data path.
:param args List of path elements e.g. ['img', 'logos', 'image.png']
:type args: str
:param copy: If the file must be copied into a temporary directory first.
:type copy: bool
:return: Absolute path to the resources folder.
:rtype: str
"""
path = abspath(abspath(join(plugin_path(), "test", "data")))
for item in args:
path = abspath(join(path, item))
if copy:
temp = tempfile.mkdtemp()
shutil.copy(path, temp)
return join(temp, args[-1])
else:
return path
def resources_path(*args):
"""Get the path to our resources folder.
:param args List of path elements e.g. ['img', 'logos', 'image.png']
:type args: str
:return: Absolute path to the resources folder.
:rtype: str
"""
path = abspath(abspath(join(plugin_path(), "CenRa_FLUX\\tools")))
for item in args:
path = abspath(join(path, item))
return path
def load_ui(*args):
"""Get compile UI file.
:param args List of path elements e.g. ['img', 'logos', 'image.png']
:type args: str
:return: Compiled UI file.
"""
ui_class, _ = uic.loadUiType(resources_path("ui", *args))
return ui_class
def login_base(take=None):
from .tools.PythonSQL import host,port,dbname,password,os_user
first_conn = psycopg2.connect("host=" + host + " port=" + port + " dbname="+dbname+" user=first_cnx password=" + password)
first_cur = first_conn.cursor(cursor_factory = psycopg2.extras.DictCursor)
first_cur.execute("SELECT mdp_w, login_w FROM pg_catalog.pg_user t1, admin_sig.vm_users_sig t2 WHERE t2.oid = t1.usesysid AND (login_w = '" + os_user + "' OR login_w = '" + os_user + "')")
res_ident = first_cur.fetchone()
mdp = base64.b64decode(str(res_ident[0])).decode('utf-8')
user = res_ident[1]
con = psycopg2.connect("host=" + host + " port=" + port + " dbname="+dbname+" user=" + user + " password=" + mdp)
cur = con.cursor(cursor_factory = psycopg2.extras.DictCursor)
first_conn.close()
if take:
return cur,con
else:
return cur
def send_issues(url,titre,body,labels):
import requests
import json
import os
import qgis
usr = os.environ['USERNAME']
token = '9d0a4e0bea561710e0728f161f7edf4e5201e112'
url=url+'?token='+token
headers = {'Authorization': 'token ' + token,'accept': 'application/json','Content-Type': 'application/json'}
payload = {'title': titre, 'body': body, 'labels': labels}
try:
urllib.request.urlopen('https://google.com')
binar = True
except:
binar = False
r = ''
if binar:
r = requests.post(url, data=json.dumps(payload), headers=headers)
return r
def maj_verif(NAME):
import qgis
import urllib.request
iface = qgis.utils.iface
from qgis.core import Qgis
url = qgis.utils.pluginMetadata(NAME,'repository')
#URL = url+'/raw/branch/main/plugins.xml'
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/releases/plugins.xml'
# print(URL)
version = qgis.utils.pluginMetadata(NAME,'version')
len_version = len(version)
try:
urllib.request.urlopen('https://google.com')
binar = True
except:
binar = False
if binar:
version_web = str(urllib.request.urlopen(URL).read())
plugin_num = version_web.find(NAME)
valeur_version_web = version_web.find('<version>',plugin_num)+9
version_plugin = version_web[valeur_version_web:valeur_version_web+len_version]
if version_plugin != version:
iface.messageBar().pushMessage("MAJ :", "Des mise à jour de plugin sont disponibles.", level=Qgis.Info, duration=30)
else:
iface.messageBar().pushMessage("WiFi :", "Pas de connection à internet.", level=Qgis.Warning, duration=30)
def devlog(NAME):
import qgis
devmaj = '<head><style>* {margin:0; padding:0; }</style></head>'
devmaj = devmaj+qgis.utils.pluginMetadata(NAME,'changelog')
return devmaj
@@ -0,0 +1,242 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog</class>
<resources>
</resources>
<widget class="QDialog" name="Dialog">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>910</width>
<height>800</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>910</width>
<height>800</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>910</width>
<height>800</height>
</size>
</property>
<property name="windowTitle">
<string>SIG CEN-RA</string>
</property>
<widget class="QComboBox" name="comboBox">
<property name="geometry">
<rect>
<x>260</x>
<y>130</y>
<width>171</width>
<height>22</height>
</rect>
</property>
<property name="editable">
<bool>false</bool>
</property>
<property name="currentText">
<string notr="true"/>
</property>
</widget>
<widget class="QComboBox" name="comboBox_2">
<property name="geometry">
<rect>
<x>370</x>
<y>80</y>
<width>171</width>
<height>22</height>
</rect>
</property>
<property name="editable">
<bool>false</bool>
</property>
<property name="currentText">
<string notr="true"/>
</property>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>350</x>
<y>20</y>
<width>221</width>
<height>71</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="resources.qrc">:/plugins/CenRa_FLUX/logo.jpg</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton" name="pushButton_2">
<property name="geometry">
<rect>
<x>370</x>
<y>750</y>
<width>171</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Charger les couches</string>
</property>
</widget>
<widget class="QTableWidget" name="tableWidget">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>30</x>
<y>170</y>
<width>850</width>
<height>281</height>
</rect>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
</widget>
<widget class="QTableWidget" name="tableWidget_2">
<property name="geometry">
<rect>
<x>30</x>
<y>550</y>
<width>850</width>
<height>181</height>
</rect>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
</widget>
<widget class="QCommandLinkButton" name="commandLinkButton">
<property name="geometry">
<rect>
<x>400</x>
<y>470</y>
<width>61</width>
<height>61</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/plugins/CenRa_FLUX/arrow-bottom.png</normaloff>:/plugins/CenRa_FLUX/arrow-bottom.png</iconset>
</property>
<property name="iconSize">
<size>
<width>50</width>
<height>40</height>
</size>
</property>
</widget>
<widget class="QCommandLinkButton" name="commandLinkButton_2">
<property name="geometry">
<rect>
<x>460</x>
<y>470</y>
<width>61</width>
<height>61</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/plugins/CenRa_FLUX/arrow-up.png</normaloff>:/plugins/CenRa_FLUX/arrow-up.png</iconset>
</property>
<property name="iconSize">
<size>
<width>50</width>
<height>40</height>
</size>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>480</x>
<y>130</y>
<width>171</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Recherche par mots-clés</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>40</x>
<y>150</y>
<width>161</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<family>Calibri</family>
<pointsize>10</pointsize>
<italic>false</italic>
</font>
</property>
<property name="text">
<string>Liste des flux disponibles :</string>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>30</x>
<y>530</y>
<width>171</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<family>Calibri</family>
<pointsize>10</pointsize>
<italic>false</italic>
</font>
</property>
<property name="text">
<string>Flux sélectionné(s) à charger :</string>
</property>
</widget>
</widget>
<connections/>
</ui>
+252
View File
@@ -0,0 +1,252 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Dialog</class>
<widget class="QDialog" name="Dialog">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>910</width>
<height>800</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>910</width>
<height>800</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>910</width>
<height>800</height>
</size>
</property>
<property name="windowTitle">
<string>SIG CEN-RA</string>
</property>
<widget class="QComboBox" name="comboBox">
<property name="geometry">
<rect>
<x>260</x>
<y>130</y>
<width>171</width>
<height>22</height>
</rect>
</property>
<property name="editable">
<bool>false</bool>
</property>
<property name="currentText">
<string notr="true"/>
</property>
</widget>
<widget class="QComboBox" name="comboBox_2">
<property name="geometry">
<rect>
<x>370</x>
<y>80</y>
<width>171</width>
<height>22</height>
</rect>
</property>
<property name="editable">
<bool>false</bool>
</property>
<property name="currentText">
<string notr="true"/>
</property>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>345</x>
<y>10</y>
<width>221</width>
<height>71</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap>:/plugins/CenRa_FLUX/logo.jpg</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton" name="pushButton_2">
<property name="geometry">
<rect>
<x>370</x>
<y>750</y>
<width>171</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Charger les couches</string>
</property>
</widget>
<widget class="QTableWidget" name="tableWidget">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>30</x>
<y>170</y>
<width>850</width>
<height>281</height>
</rect>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
</widget>
<widget class="QTableWidget" name="tableWidget_2">
<property name="geometry">
<rect>
<x>30</x>
<y>550</y>
<width>850</width>
<height>181</height>
</rect>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
</widget>
<widget class="QCommandLinkButton" name="commandLinkButton">
<property name="geometry">
<rect>
<x>400</x>
<y>470</y>
<width>61</width>
<height>61</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normaloff>:/plugins/CenRa_FLUX/arrow-bottom.png</normaloff>:/plugins/CenRa_FLUX/arrow-bottom.png</iconset>
</property>
<property name="iconSize">
<size>
<width>50</width>
<height>40</height>
</size>
</property>
</widget>
<widget class="QCommandLinkButton" name="commandLinkButton_2">
<property name="geometry">
<rect>
<x>460</x>
<y>470</y>
<width>61</width>
<height>61</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normaloff>:/plugins/CenRa_FLUX/arrow-up.png</normaloff>:/plugins/CenRa_FLUX/arrow-up.png</iconset>
</property>
<property name="iconSize">
<size>
<width>50</width>
<height>40</height>
</size>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>480</x>
<y>130</y>
<width>171</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Recherche par mots-clés</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>40</x>
<y>150</y>
<width>161</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<family>Calibri</family>
<pointsize>10</pointsize>
<italic>false</italic>
</font>
</property>
<property name="text">
<string>Liste des flux disponibles :</string>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>30</x>
<y>530</y>
<width>171</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<family>Calibri</family>
<pointsize>10</pointsize>
<italic>false</italic>
</font>
</property>
<property name="text">
<string>Flux sélectionné(s) à charger :</string>
</property>
</widget>
<zorder>label_3</zorder>
<zorder>comboBox</zorder>
<zorder>comboBox_2</zorder>
<zorder>pushButton_2</zorder>
<zorder>tableWidget</zorder>
<zorder>tableWidget_2</zorder>
<zorder>commandLinkButton</zorder>
<zorder>commandLinkButton_2</zorder>
<zorder>lineEdit</zorder>
<zorder>label</zorder>
<zorder>label_2</zorder>
</widget>
<resources/>
<connections/>
</ui>
+332
View File
@@ -0,0 +1,332 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CenRa_IssuesSend</class>
<widget class="QDialog" name="CenRa_IssuesSend">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>810</width>
<height>587</height>
</rect>
</property>
<property name="windowTitle">
<string>CEN-RA Metabase</string>
</property>
<property name="windowIcon">
<iconset>
<normaloff>icon.svg</normaloff>icon.svg</iconset>
</property>
<widget class="QWidget" name="gridLayoutWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>550</y>
<width>811</width>
<height>31</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="2">
<widget class="QPushButton" name="annuler_button">
<property name="text">
<string>Annuler</string>
</property>
</widget>
</item>
<item row="0" column="3">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="ok_button">
<property name="text">
<string>Envoyer</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QGroupBox" name="groupBox">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>791</width>
<height>531</height>
</rect>
</property>
<property name="title">
<string>Issues</string>
</property>
<widget class="QLineEdit" name="titre_line">
<property name="geometry">
<rect>
<x>240</x>
<y>40</y>
<width>321</width>
<height>41</height>
</rect>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QPlainTextEdit" name="messages_plain">
<property name="geometry">
<rect>
<x>10</x>
<y>101</y>
<width>571</width>
<height>421</height>
</rect>
</property>
</widget>
<widget class="QFrame" name="frame">
<property name="geometry">
<rect>
<x>589</x>
<y>100</y>
<width>191</width>
<height>431</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<widget class="QWidget" name="formLayoutWidget">
<property name="geometry">
<rect>
<x>9</x>
<y>9</y>
<width>341</width>
<height>411</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="labelAlignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="formAlignment">
<set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
</property>
<item row="0" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="check_bug">
<property name="text">
<string>Bug</string>
</property>
</widget>
</item>
<item row="2" column="0">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="check_aide">
<property name="text">
<string>Aide</string>
</property>
</widget>
</item>
<item row="3" column="0">
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="check_question">
<property name="text">
<string>Question</string>
</property>
</widget>
</item>
<item row="4" column="0">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="check_amelioration">
<property name="text">
<string>Amélioration</string>
</property>
</widget>
</item>
<item row="5" column="0">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="1">
<widget class="QCheckBox" name="check_autre">
<property name="text">
<string>Autre</string>
</property>
</widget>
</item>
<item row="6" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>250</x>
<y>20</y>
<width>51</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>14</pointsize>
</font>
</property>
<property name="text">
<string>Titre:</string>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>20</x>
<y>70</y>
<width>91</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>Messages:</string>
</property>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>600</x>
<y>70</y>
<width>91</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>12</pointsize>
</font>
</property>
<property name="text">
<string>Sujet:</string>
</property>
</widget>
</widget>
</widget>
<tabstops>
<tabstop>ok_button</tabstop>
<tabstop>annuler_button</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
+96
View File
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CenRa_Metabase_editorwidget_base</class>
<widget class="QDialog" name="CenRa_Metabase_editorwidget_base">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>471</width>
<height>594</height>
</rect>
</property>
<property name="windowTitle">
<string>Metabase</string>
</property>
<property name="windowIcon">
<iconset>
<normaloff>../../CenRa_Metabase/tools/ui/icon.svg</normaloff>../../CenRa_Metabase/tools/ui/icon.svg</iconset>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="mouseTracking">
<bool>true</bool>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>453</width>
<height>547</height>
</rect>
</property>
<widget class="QGroupBox" name="groupBox">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>451</width>
<height>541</height>
</rect>
</property>
<property name="title">
<string>DevLog</string>
</property>
<widget class="QWebView" name="viewer" native="true">
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>431</width>
<height>511</height>
</rect>
</property>
<property name="url" stdset="0">
<url>
<string>about:blank</string>
</url>
</property>
</widget>
</widget>
</widget>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header location="global">QtWebKitWidgets/QWebView</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

+220
View File
@@ -0,0 +1,220 @@
__copyright__ = "Copyright 2021, 3Liz"
__license__ = "GPL version 3"
__email__ = "info@3liz.org"
from qgis.core import QgsApplication
from qgis.PyQt.QtCore import QCoreApplication, Qt, QTranslator, QUrl
from qgis.PyQt.QtGui import QDesktopServices, QIcon
from qgis.PyQt.QtWidgets import QAction, QMessageBox
from qgis.utils import iface
import qgis
#include <QSettings>
'''
from pg_metadata.connection_manager import (
store_connections,
validate_connections_names,
)
from pg_metadata.locator import LocatorFilter
from pg_metadata.processing.provider import PgMetadataProvider
from pg_metadata.qgis_plugin_tools.tools.custom_logging import setup_logger
'''
import os
from .tools.resources import (
plugin_path,
resources_path,
maj_verif,
)
from .dock import CenRa_Metabase
from .editor import Metabase_Editor
from .about_form import MetabaseAboutDialog
#from CenRa_Metabase.issues import CenRa_Issues
from PyQt5.QtCore import *
class PgMetadata:
def __init__(self):
""" Constructor. """
self.dock = None
self.editor = None
# self.issues = None
self.provider = None
self.locator_filter = None
self.dock_action = None
self.help_action = None
plugin_dir = os.path.dirname(__file__)
end_find = plugin_dir.rfind('\\')+1
global NAME
NAME = plugin_dir[end_find:]
maj_verif(NAME)
# Display About window on first use
version = qgis.utils.pluginMetadata('CenRa_METABASE','version')
s = QSettings()
versionUse = s.value("metadata/version", 1, type=str)
if str(versionUse) != str(version) :
s.setValue("metadata/version", str(version))
print(versionUse,version)
self.open_about_dialog()
# setup_logger('pg_metadata')
#locale, file_path = setup_translation(
# folder=plugin_path("i18n"), file_pattern="CenRa_Metabase_{}.qm")
#if file_path:
# self.translator = QTranslator()
# self.translator.load(file_path)
# noinspection PyCallByClass,PyArgumentList
# QCoreApplication.installTranslator(self.translator)
# noinspection PyPep8Naming
#def initProcessing(self):
#""" Add the QGIS Processing provider. """
#if not self.provider:
#self.provider = PgMetadataProvider()
#QgsApplication.processingRegistry().addProvider(self.provider)
# noinspection PyPep8Naming
def initGui(self):
""" Build the plugin GUI. """
#self.initProcessing()
#self.check_invalid_connection_names()
self.toolBar = iface.addToolBar("CenRa_Metabase")
self.toolBar.setObjectName("CenRa_Metabase")
icon = QIcon(resources_path('icons', 'icon.png'))
icon2 = QIcon(resources_path('icons', 'icon_2.png'))
# Open the online help
self.help_action = QAction(icon, 'CenRa_Metabase', iface.mainWindow())
iface.pluginHelpMenu().addAction(self.help_action)
self.help_action.triggered.connect(self.open_help)
if not self.editor:
self.editor = Metabase_Editor()
self.editor_action = QAction(icon2, 'CenRa_Metabase',None)
self.toolBar.addAction(self.editor_action)
self.editor_action.triggered.connect(self.open_editor)
if not self.dock:
self.dock = CenRa_Metabase()
iface.addDockWidget(Qt.RightDockWidgetArea, self.dock)
# Open/close the dock from plugin menu
self.dock_action = QAction(icon, 'CenRa_Metabase', iface.mainWindow())
iface.pluginMenu().addAction(self.dock_action)
self.dock_action.triggered.connect(self.open_dock)
# if not self.issues:
# self.issues = CenRa_Issues()
# self.issues_action = QAction(icon, 'CenRa_Metabase',None)
# self.toolBar.addAction(self.issues_action)
# self.issues_action.triggered.connect(self.open_issues)
# '''
# if not self.locator_filter:
# self.locator_filter = LocatorFilter(iface)
# iface.registerLocatorFilter(self.locator_filter)
# @staticmethod
# def check_invalid_connection_names():
# """ Check for invalid connection names in the QgsSettings. """
# valid, invalid = validate_connections_names()
# n_invalid = len(invalid)
# if n_invalid == 0:
# return
# invalid_text = ', '.join(invalid)
# msg = QMessageBox()
# msg.setIcon(QMessageBox.Warning)
# msg.setWindowTitle(tr('PgMetadata: Database connection(s) not available'))
# msg.setText(tr(
# f'{n_invalid} connection(s) listed in PgMetadata’s settings are invalid or '
# f'no longer available: {invalid_text}'))
# msg.setInformativeText(tr(
# 'Do you want to remove these connection(s) from the PgMetadata settings? '
# '(You can also do this later with the “Set Connections” tool.)'))
# msg.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
# clicked = msg.exec()
# if clicked == QMessageBox.Yes:
# iface.messageBar().pushSuccess('PgMetadata', tr(f'{n_invalid} invalid connection(s) removed.'))
# store_connections(valid)
# if clicked == QMessageBox.No:
# iface.messageBar().pushInfo('PgMetadata', tr(f'Keeping {n_invalid} invalid connections.'))
# '''
def open_about_dialog(self):
"""
About dialog
"""
dialog = MetabaseAboutDialog(iface)
dialog.exec_()
def open_help():
""" Open the online help. """
# QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
def open_dock(self):
""" Open the dock. """
self.dock.show()
self.dock.raise_()
def open_editor(self):
self.editor.show()
self.editor.raise_()
# def open_issues(self):
# self.issues.show()
# self.issues.raise_()
def unload(self):
""" Unload the plugin. """
if self.editor:
iface.removePluginMenu('CenRa_Metabase',self.editor_action)
#self.editor.removeToolBarIcon(self.editor_action)
if self.dock:
iface.removeDockWidget(self.dock)
self.dock.deleteLater()
if self.provider:
QgsApplication.processingRegistry().removeProvider(self.provider)
del self.provider
if self.locator_filter:
iface.deregisterLocatorFilter(self.locator_filter)
del self.locator_filter
if self.dock_action:
iface.pluginMenu().removeAction(self.dock_action)
del self.dock_action
if self.help_action:
iface.pluginHelpMenu().removeAction(self.help_action)
del self.help_action
@staticmethod
def run_tests(pattern='test_*.py', package=None):
"""Run the test inside QGIS."""
try:
from pathlib import Path
from pg_metadata.qgis_plugin_tools.infrastructure.test_runner import (
test_package,
)
if package is None:
package = '{}.__init__'.format(Path(__file__).parent.name)
test_package(package, pattern)
except (AttributeError, ModuleNotFoundError):
message = 'Could not load tests. Are you using a production package?'
print(message) # NOQA
+1
View File
@@ -0,0 +1 @@
# CenRa_Metabase
+10
View File
@@ -0,0 +1,10 @@
__copyright__ = "Copyright 2021, 3Liz"
__license__ = "GPL version 3"
__email__ = "info@3liz.org"
# noinspection PyPep8Naming
def classFactory(iface): # pylint: disable=invalid-name
_ = iface
from CenRa_METABASE.CenRa_Metabase import PgMetadata
return PgMetadata()
+46
View File
@@ -0,0 +1,46 @@
import os.path
from pathlib import Path
from qgis.PyQt import uic
from qgis.PyQt.QtGui import QPixmap
from qgis.PyQt.QtWidgets import QDialog
from .tools.resources import devlog
ABOUT_FORM_CLASS, _ = uic.loadUiType(
os.path.join(
str(Path(__file__).resolve().parent),
'tools/ui',
'CenRa_Metabase_about_form.ui'
)
)
class MetabaseAboutDialog(QDialog, ABOUT_FORM_CLASS):
""" About - Let the user display the about dialog. """
def __init__(self, iface, parent=None):
super().__init__(parent)
self.iface = iface
self.setupUi(self)
self.viewer.setHtml(devlog('CenRa_METABASE'))
self.rejected.connect(self.onReject)
self.buttonBox.rejected.connect(self.onReject)
self.buttonBox.accepted.connect(self.onAccept)
def onAccept(self):
"""
Save options when pressing OK button
"""
self.accept()
def onReject(self):
"""
Run some actions when
the user closes the dialog
"""
self.close()

Some files were not shown because too many files have changed in this diff Show More