Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61ed7b286a | ||
|
|
4a3d0a38c3 | ||
|
|
1185a7313d | ||
|
|
d844b9d416 | ||
|
|
5200a3b3c2 | ||
|
|
8c8068b330 | ||
|
|
8a1e7e6d70 | ||
|
|
2765093f1d | ||
|
|
614195fbaf | ||
|
|
ebeefb78b9 | ||
|
|
256a0ac6d4 | ||
|
|
af10bce94c | ||
|
|
8c55d902c0 | ||
|
|
5a03084daa | ||
|
|
a3b634d514 | ||
|
|
728f72cffd | ||
|
|
272b47a174 | ||
|
|
21a652fdb2 | ||
|
|
799a635edc | ||
|
|
ff2e0f22be | ||
|
|
8c1ee42080 | ||
|
|
a3479085b6 | ||
|
|
1b54026a13 | ||
|
|
670c698b77 | ||
|
|
9b438f5bf1 | ||
|
|
02681490f6 | ||
|
|
4b8bc74386 | ||
|
|
9a85e9aaae | ||
|
|
910ba14dc9 | ||
|
|
d9f27eaa0f | ||
|
|
2842526605 | ||
|
|
ec677ffc5a | ||
|
|
3c9a6a8b88 | ||
|
|
06321e4e26 | ||
|
|
83e22782f7 |
@@ -34,8 +34,11 @@ from .tools.resources import (
|
||||
)
|
||||
pyperclip()
|
||||
|
||||
from .canvas_editor import AutoMap_Editor
|
||||
from .style_invoke import AutoMap_Style
|
||||
try:
|
||||
from .canvas_editor import AutoMap_Editor
|
||||
from .style_invoke import AutoMap_Style
|
||||
except NameError:
|
||||
print('404')
|
||||
|
||||
|
||||
class PgAutoMap:
|
||||
|
||||
@@ -14,6 +14,7 @@ from qgis.core import (
|
||||
QgsLayoutItemLabel,
|
||||
QgsLayoutItemPicture,
|
||||
QgsLayoutItemLegend,
|
||||
QgsLayoutItem,
|
||||
QgsLegendStyle,
|
||||
QgsLayoutItemScaleBar,
|
||||
QgsLayerTreeGroup,
|
||||
@@ -547,6 +548,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
||||
# Ajout du logo CEN NA en haut à gauche de la page
|
||||
logo = QgsLayoutItemPicture(self.layout)
|
||||
logo.setResizeMode(QgsLayoutItemPicture.Zoom)
|
||||
logo.setPictureAnchor(QgsLayoutItem.ReferencePoint(4))
|
||||
logo.setMode(QgsLayoutItemPicture.FormatRaster)
|
||||
logo.setItemRotation(self.template_parameters['Logo_rotate'])
|
||||
logo.setFixedSize(self.template_parameters['Logo_size'])
|
||||
@@ -675,6 +677,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
||||
north.setPicturePath(resources_path("mises_en_pages", self.template_parameters['Arrow_path']))
|
||||
north.setLinkedMap(self.map_modele_test)
|
||||
self.layout.addLayoutItem(north)
|
||||
north.setPictureAnchor(QgsLayoutItem.ReferencePoint(4))
|
||||
north.setItemRotation(self.template_parameters['Arrow_rotate'])
|
||||
north.attemptMove(self.template_parameters['Arrow_locals'])
|
||||
north.attemptResize(self.template_parameters['Arrow_size'])
|
||||
@@ -728,6 +731,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
||||
for logo_run in self.mComboBox_4.checkedItems():
|
||||
logo_credit = QgsLayoutItemPicture(self.layout)
|
||||
logo_credit.setResizeMode(QgsLayoutItemPicture.Zoom)
|
||||
logo_credit.setPictureAnchor(QgsLayoutItem.ReferencePoint(4))
|
||||
logo_credit.setMode(QgsLayoutItemPicture.FormatRaster)
|
||||
cur_x = self.template_parameters['Logo_2_locals'].x()
|
||||
logo_credit.setItemRotation(self.template_parameters['Logo_2_rotate'])
|
||||
|
||||
@@ -5,9 +5,10 @@
|
||||
[general]
|
||||
name=CenRa_AutoMap
|
||||
qgisMinimumVersion=3.0
|
||||
qgisMaximumVersion=4.99
|
||||
supportsQt6=True
|
||||
description=CenRa_AutoMap
|
||||
version=2.3
|
||||
version=2.9
|
||||
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
|
||||
email=si_besoin@cen-rhonealpes.fr
|
||||
|
||||
@@ -22,7 +23,7 @@ tracker=https://gitea.cenra-outils.org/api/v1/repos/CEN-RA/Plugin_QGIS/issues
|
||||
|
||||
hasProcessingProvider=no
|
||||
# Uncomment the following line and add your changelog:
|
||||
changelog=<h2>CenRa_AUTOMAP:</h2></br><p><h3>15/12/2025 - Version 2.3: </h3> - nouvelle mise en page n2000.</p></br><p><h3>12/12/2025 - Version 2.2: </h3> - nouvelle mise en page pour n2000.</p></br><p><h3>30/07/2025 - Version 2.1: </h3> - Correctife de bug.</p></br><p><h3>19/05/2025 - Version 2.0: </h3> - Compatible PyQt5 et PyQt6</p></br><p><h3>11/04/2025 - Version 1.7: </h3> - Correctif d'orthographe.</p></br><p><h3>09/04/2025 - Version 1.6: </h3> - Correctif bug en TT.</p></br><p><h3>09/04/2025 - Version 1.5: </h3> - Optimisation pour le TT.</p></br><p><h3>03/04/2025 - Version 1.4: </h3> - Mise a jour de securite.</p></br><p><h3>20/03/2025 - Version 1.3: </h3> - Fenêtre redimensionnable avec déplaçable avec la mollette sourit.</p></br><p><h3>25/02/2025 - Version 1.2: </h3> - DockWidget pour ouverture de couche avec theme.</p></br><p><h3>28/01/2025 - Version 1.1: </h3> - Multi-Composeur pris en charge.</p></br><p><h3>27/01/2025 - Version 1.0: </h3> - Version releases.</br> - Ajoute un message d'avertissement au moment d'écraser la mise en page.</br> - Ajoute prénom et nom dans la réalisation.</br> - Utilisation de Calibri.</p></br><p><h3>13/01/2025 - Version 0.1.10: </h3> - Correctif.</p></br><p><h3>07/01/2025 - Version 0.1.9: </h3> - ByPass du certif ssl ci erreur.</p></br><p><h3>19/12/2024 - Version 0.1.8: </h3> - Nouvelle mise en page.</br> - Incrémentation automatique de nouveau modele de mise en page. </br> - Correctif de bug.</p></br><p><h3>21/10/2024 - Version 0.1.7: </h3> - Epurations du code.</p></br><p><h3>07/10/2024 - Version 0.1.6: </h3> - Option de bibliotheque de logo custome.</p></br><p><h3>03/10/2024 - Version 0.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 0.1.4: </h3> - Mise en page plein écrant.</br></p></br><p><h3>01/10/2024 - Version 0.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 0.1.2: </h3> - Activation du thème. </br> - Ajouter une carte de suivie. </br><p></br><h3>27/09/2024 - Version 0.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 0.1.0: </h3> - Lancement du plugin CenRa_AutoMap avec une seul mise en page. </p></br>
|
||||
changelog=<h2>CenRa_AUTOMAP:</h2></br><p><h3>12/03/2026 - Version 2.9: </h3> - qgisMaximumVersion est 4.0.</p></br><p><h3>09/01/2026 - Version 2.8: </h3> - deplacement de l'echelle.</p></br><p><h3>18/12/2025 - Version 2.7: </h3> - fix de bug gitea.</p></br><p><h3>18/12/2025 - Version 2.6: </h3> - ajoue du logo n2000 et region.</p></br><p><h3>17/12/2025 - Version 2.5: </h3> - Carte n2000 mise a jour landscape et portrait.</p></br><p><h3>15/12/2025 - Version 2.4: </h3> - Landescape pour n2000.</p></br><p><h3>15/12/2025 - Version 2.3: </h3> - nouvelle mise en page n2000.</p></br><p><h3>12/12/2025 - Version 2.2: </h3> - nouvelle mise en page pour n2000.</p></br><p><h3>30/07/2025 - Version 2.1: </h3> - Correctife de bug.</p></br><p><h3>19/05/2025 - Version 2.0: </h3> - Compatible PyQt5 et PyQt6</p></br><p><h3>11/04/2025 - Version 1.7: </h3> - Correctif d'orthographe.</p></br><p><h3>09/04/2025 - Version 1.6: </h3> - Correctif bug en TT.</p></br><p><h3>09/04/2025 - Version 1.5: </h3> - Optimisation pour le TT.</p></br><p><h3>03/04/2025 - Version 1.4: </h3> - Mise a jour de securite.</p></br><p><h3>20/03/2025 - Version 1.3: </h3> - Fenêtre redimensionnable avec déplaçable avec la mollette sourit.</p></br><p><h3>25/02/2025 - Version 1.2: </h3> - DockWidget pour ouverture de couche avec theme.</p></br><p><h3>28/01/2025 - Version 1.1: </h3> - Multi-Composeur pris en charge.</p></br><p><h3>27/01/2025 - Version 1.0: </h3> - Version releases.</br> - Ajoute un message d'avertissement au moment d'écraser la mise en page.</br> - Ajoute prénom et nom dans la réalisation.</br> - Utilisation de Calibri.</p></br><p><h3>13/01/2025 - Version 0.1.10: </h3> - Correctif.</p></br><p><h3>07/01/2025 - Version 0.1.9: </h3> - ByPass du certif ssl ci erreur.</p></br><p><h3>19/12/2024 - Version 0.1.8: </h3> - Nouvelle mise en page.</br> - Incrémentation automatique de nouveau modele de mise en page. </br> - Correctif de bug.</p></br><p><h3>21/10/2024 - Version 0.1.7: </h3> - Epurations du code.</p></br><p><h3>07/10/2024 - Version 0.1.6: </h3> - Option de bibliotheque de logo custome.</p></br><p><h3>03/10/2024 - Version 0.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 0.1.4: </h3> - Mise en page plein écrant.</br></p></br><p><h3>01/10/2024 - Version 0.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 0.1.2: </h3> - Activation du thème. </br> - Ajouter une carte de suivie. </br><p></br><h3>27/09/2024 - Version 0.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 0.1.0: </h3> - Lancement du plugin CenRa_AutoMap avec une seul mise en page. </p></br>
|
||||
|
||||
# Tags are comma separated with spaces allowed
|
||||
tags=python
|
||||
|
||||
|
After Width: | Height: | Size: 113 KiB |
|
Before Width: | Height: | Size: 46 KiB |
@@ -36,7 +36,7 @@ def fletch_canvas(self):
|
||||
self.template_parameters['Arrow_background'] = False
|
||||
self.template_parameters['Arrow_path'] = "NorthArrow_03.svg"
|
||||
self.template_parameters['Echelle_size'] = QgsLayoutSize(50.0, 10, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(85, 244, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(90, 244, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_rotate'] = 0
|
||||
self.template_parameters['Logo_size'] = QgsLayoutSize(40.0, 20, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Logo_locals'] = QgsLayoutPoint(6, 234, QgsUnitTypes.LayoutMillimeters)
|
||||
@@ -56,7 +56,7 @@ def fletch_canvas(self):
|
||||
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(4, 13, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Sous_titre_rotate'] = 0
|
||||
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(50.0, 13, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(85, 233, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(90, 233, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_2_rotate'] = 0
|
||||
self.template_parameters['Logo_2_size'] = QgsLayoutSize(40.0, 20, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(48, 234, QgsUnitTypes.LayoutMillimeters)
|
||||
@@ -107,91 +107,91 @@ def fletch_canvas(self):
|
||||
self.template_parameters['Logo_2_rotate'] = 0
|
||||
if page_rotate == 'Landscape':
|
||||
if values_page == 'A4':
|
||||
self.template_parameters['Carte_size'] = QgsLayoutSize(206.0, 200, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Carte_locals'] = QgsLayoutPoint(29, 8.0, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Carte_size'] = QgsLayoutSize(189.0, 189, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Carte_locals'] = QgsLayoutPoint(9, 18.0, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Carte_rotate'] = 0
|
||||
self.template_parameters['Carte_frame'] = True
|
||||
self.template_parameters['Carte_2_size'] = QgsLayoutSize(50.0, 40, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(210, 54.0, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Carte_2_rotate'] = 270
|
||||
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(194, 20.0, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Carte_2_rotate'] = 0
|
||||
self.template_parameters['Carte_2_frame'] = True
|
||||
self.template_parameters['Legande_size'] = QgsLayoutSize(206.0, 36, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Legande_locals'] = QgsLayoutPoint(258, 208.0, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Legande_rotate'] = 270
|
||||
self.template_parameters['Legande_size'] = QgsLayoutSize(203.0, 62, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Legande_locals'] = QgsLayoutPoint(199, 63.0, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Legande_rotate'] = 0
|
||||
self.template_parameters['Legande_frame'] = True
|
||||
self.template_parameters['Arrow_size'] = QgsLayoutSize(14.0, 14, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(30, 23.0, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Arrow_rotate'] = 270
|
||||
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(177, 20.0, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Arrow_rotate'] = 0
|
||||
self.template_parameters['Arrow_background'] = False
|
||||
self.template_parameters['Arrow_path'] = "NorthArrow_03.svg"
|
||||
self.template_parameters['Echelle_size'] = QgsLayoutSize(50, 8, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(241, 112, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_rotate'] = 270
|
||||
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(247, 43, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_rotate'] = 0
|
||||
self.template_parameters['Logo_size'] = QgsLayoutSize(40.0, 30, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Logo_locals'] = QgsLayoutPoint(237, 206.0, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Logo_rotate'] = 270
|
||||
self.template_parameters['Titre_size'] = QgsLayoutSize(206.0, 11, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Titre_locals'] = QgsLayoutPoint(2, 208.0, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Titre_rotate'] = 270
|
||||
self.template_parameters['Credit_size'] = QgsLayoutSize(207, 6, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Credit_locals'] = QgsLayoutPoint(28, 202, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Logo_locals'] = QgsLayoutPoint(209, 174.0, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Logo_rotate'] = 0
|
||||
self.template_parameters['Titre_size'] = QgsLayoutSize(289.0, 11, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Titre_locals'] = QgsLayoutPoint(3, 1.0, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Titre_rotate'] = 0
|
||||
self.template_parameters['Credit_size'] = QgsLayoutSize(191, 6, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Credit_locals'] = QgsLayoutPoint(8, 201, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Credit_rotate'] = 0
|
||||
self.template_parameters['Credit_alignment'] = 0x0001
|
||||
self.template_parameters['Source_size'] = QgsLayoutSize(207, 6, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Source_locals'] = QgsLayoutPoint(28, 196, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Source_size'] = QgsLayoutSize(191, 6, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Source_locals'] = QgsLayoutPoint(8, 195, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Source_rotate'] = 0
|
||||
self.template_parameters['Source_alignment'] = 0x0001
|
||||
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(202.0, 14, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(13, 206.0, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Sous_titre_rotate'] = 270
|
||||
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(289.0, 6, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(3, 12.0, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Sous_titre_rotate'] = 0
|
||||
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(50, 13, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(233, 112, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_2_rotate'] = 270
|
||||
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(249, 30, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_2_rotate'] = 0
|
||||
self.template_parameters['Logo_2_size'] = QgsLayoutSize(40.0, 30, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(237, 162, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Logo_2_rotate'] = 270
|
||||
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(252, 174, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Logo_2_rotate'] = 0
|
||||
if values_page == 'A3':
|
||||
self.template_parameters['Carte_size'] = QgsLayoutSize(290, 282, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Carte_locals'] = QgsLayoutPoint(39, 8, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Carte_size'] = QgsLayoutSize(305.0, 273, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Carte_locals'] = QgsLayoutPoint(9, 18.0, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Carte_rotate'] = 0
|
||||
self.template_parameters['Carte_frame'] = True
|
||||
self.template_parameters['Carte_2_size'] = QgsLayoutSize(70, 55, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(320, 80, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Carte_2_rotate'] = 270
|
||||
self.template_parameters['Carte_2_size'] = QgsLayoutSize(50.0, 40, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(311, 20.0, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Carte_2_rotate'] = 0
|
||||
self.template_parameters['Carte_2_frame'] = True
|
||||
self.template_parameters['Legande_size'] = QgsLayoutSize(290, 5., QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Legande_locals'] = QgsLayoutPoint(365, 295, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Legande_rotate'] = 270
|
||||
self.template_parameters['Legande_size'] = QgsLayoutSize(203.0, 62, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Legande_locals'] = QgsLayoutPoint(317, 63.0, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Legande_rotate'] = 0
|
||||
self.template_parameters['Legande_frame'] = True
|
||||
self.template_parameters['Arrow_size'] = QgsLayoutSize(20, 20, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(41, 31, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Arrow_rotate'] = 270
|
||||
self.template_parameters['Arrow_size'] = QgsLayoutSize(14.0, 14, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(296, 20.0, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Arrow_rotate'] = 0
|
||||
self.template_parameters['Arrow_background'] = False
|
||||
self.template_parameters['Arrow_path'] = "NorthArrow_03.svg"
|
||||
self.template_parameters['Echelle_size'] = QgsLayoutSize(72, 11, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(360, 160, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_rotate'] = 270
|
||||
self.template_parameters['Logo_size'] = QgsLayoutSize(40, 30, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Logo_locals'] = QgsLayoutPoint(340, 290, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Logo_rotate'] = 270
|
||||
self.template_parameters['Titre_size'] = QgsLayoutSize(290, 15, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Titre_locals'] = QgsLayoutPoint(3, 293, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Titre_rotate'] = 270
|
||||
self.template_parameters['Credit_size'] = QgsLayoutSize(290, 8, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Credit_locals'] = QgsLayoutPoint(39, 282, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_size'] = QgsLayoutSize(50, 8, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(364, 43, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_rotate'] = 0
|
||||
self.template_parameters['Logo_size'] = QgsLayoutSize(40.0, 30, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Logo_locals'] = QgsLayoutPoint(320, 264.0, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Logo_rotate'] = 0
|
||||
self.template_parameters['Titre_size'] = QgsLayoutSize(413.0, 11, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Titre_locals'] = QgsLayoutPoint(3, 1.0, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Titre_rotate'] = 0
|
||||
self.template_parameters['Credit_size'] = QgsLayoutSize(306, 6, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Credit_locals'] = QgsLayoutPoint(8, 285, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Credit_rotate'] = 0
|
||||
self.template_parameters['Credit_alignment'] = 0x0001
|
||||
self.template_parameters['Source_size'] = QgsLayoutSize(290, 8, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Source_locals'] = QgsLayoutPoint(39, 274, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Source_size'] = QgsLayoutSize(306, 6, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Source_locals'] = QgsLayoutPoint(8, 279, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Source_rotate'] = 0
|
||||
self.template_parameters['Source_alignment'] = 0x0001
|
||||
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(285, 20, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(19, 291, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Sous_titre_rotate'] = 270
|
||||
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(70, 20, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(330, 159, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_2_rotate'] = 270
|
||||
self.template_parameters['Logo_2_size'] = QgsLayoutSize(40, 30, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(340, 230, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Logo_2_rotate'] = 270
|
||||
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(413.0, 6, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(3, 12.0, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Sous_titre_rotate'] = 0
|
||||
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(50, 13, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(366, 30, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_2_rotate'] = 0
|
||||
self.template_parameters['Logo_2_size'] = QgsLayoutSize(40.0, 30, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(369, 264, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Logo_2_rotate'] = 0
|
||||
return self.template_parameters
|
||||
|
||||
@@ -18,93 +18,93 @@ def fletch_canvas(self):
|
||||
|
||||
if page_rotate == 'Portrait':
|
||||
if values_page == 'A4':
|
||||
self.template_parameters['Carte_size'] = QgsLayoutSize(145.0, 140, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Carte_locals'] = QgsLayoutPoint(28, 3, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Carte_rotate'] = 270
|
||||
self.template_parameters['Carte_size'] = QgsLayoutSize(145.0, 135, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Carte_locals'] = QgsLayoutPoint(4, 18, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Carte_rotate'] = 0
|
||||
self.template_parameters['Carte_frame'] = True
|
||||
self.template_parameters['Carte_2_size'] = QgsLayoutSize(50, 40, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(165, 55, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Carte_2_rotate'] = 270
|
||||
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(146, 21, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Carte_2_rotate'] = 0
|
||||
self.template_parameters['Carte_2_frame'] = True
|
||||
self.template_parameters['Legande_size'] = QgsLayoutSize(198.85714285714286, 36, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Legande_locals'] = QgsLayoutPoint(185, 145, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Legande_rotate'] = 270
|
||||
self.template_parameters['Legande_locals'] = QgsLayoutPoint(153, 64, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Legande_rotate'] = 0
|
||||
self.template_parameters['Legande_frame'] = True
|
||||
self.template_parameters['Arrow_size'] = QgsLayoutSize(14.0, 14, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(29, 4, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(6, 20, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Arrow_rotate'] = 0
|
||||
self.template_parameters['Arrow_background'] = False
|
||||
self.template_parameters['Arrow_path'] = "NorthArrow_03.svg"
|
||||
self.template_parameters['Echelle_size'] = QgsLayoutSize(50.0, 10, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(196, 210, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_rotate'] = 270
|
||||
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(154, 220, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_rotate'] = 0
|
||||
self.template_parameters['Logo_size'] = QgsLayoutSize(40.0, 20, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Logo_locals'] = QgsLayoutPoint(185, 290, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Logo_rotate'] = 270
|
||||
self.template_parameters['Titre_size'] = QgsLayoutSize(290.0, 10, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Titre_locals'] = QgsLayoutPoint(2, 295, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Titre_rotate'] = 270
|
||||
self.template_parameters['Logo_locals'] = QgsLayoutPoint(160, 264, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Logo_rotate'] = 0
|
||||
self.template_parameters['Titre_size'] = QgsLayoutSize(205.0, 10, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Titre_locals'] = QgsLayoutPoint(2, 1, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Titre_rotate'] = 0
|
||||
self.template_parameters['Credit_size'] = QgsLayoutSize(145.0, 6, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Credit_locals'] = QgsLayoutPoint(173, 143.0, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Credit_rotate'] = 180
|
||||
self.template_parameters['Credit_locals'] = QgsLayoutPoint(4, 147.0, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Credit_rotate'] = 0
|
||||
self.template_parameters['Credit_alignment'] = 0x0001
|
||||
self.template_parameters['Source_size'] = QgsLayoutSize(145.0, 6, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Source_locals'] = QgsLayoutPoint(173, 137.0, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Source_rotate'] = 180
|
||||
self.template_parameters['Source_locals'] = QgsLayoutPoint(4, 141.0, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Source_rotate'] = 0
|
||||
self.template_parameters['Source_alignment'] = 0x0001
|
||||
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(290, 10, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(12, 295, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Sous_titre_rotate'] = 270
|
||||
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(205, 6, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(2, 11, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Sous_titre_rotate'] = 0
|
||||
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(50.0, 13, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(185, 210, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_2_rotate'] = 270
|
||||
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(162, 208, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_2_rotate'] = 0
|
||||
self.template_parameters['Logo_2_size'] = QgsLayoutSize(40.0, 20, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(185, 248, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Logo_2_rotate'] = 270
|
||||
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(160, 234, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Logo_2_rotate'] = 0
|
||||
if values_page == 'A3':
|
||||
self.template_parameters['Carte_size'] = QgsLayoutSize(225.0, 200, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Carte_locals'] = QgsLayoutPoint(28, 3, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Carte_rotate'] = 270
|
||||
self.template_parameters['Carte_size'] = QgsLayoutSize(233.0, 192, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Carte_locals'] = QgsLayoutPoint(4, 18, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Carte_rotate'] = 0
|
||||
self.template_parameters['Carte_frame'] = True
|
||||
self.template_parameters['Carte_2_size'] = QgsLayoutSize(50, 40, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(250, 55, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Carte_2_rotate'] = 270
|
||||
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(234, 21, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Carte_2_rotate'] = 0
|
||||
self.template_parameters['Carte_2_frame'] = True
|
||||
self.template_parameters['Legande_size'] = QgsLayoutSize(200, 36, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Legande_locals'] = QgsLayoutPoint(260, 235, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Legande_rotate'] = 270
|
||||
self.template_parameters['Legande_size'] = QgsLayoutSize(190, 36, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Legande_locals'] = QgsLayoutPoint(242, 64, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Legande_rotate'] = 0
|
||||
self.template_parameters['Legande_frame'] = True
|
||||
self.template_parameters['Arrow_size'] = QgsLayoutSize(14.0, 14, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(29, 4, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(6, 20, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Arrow_rotate'] = 0
|
||||
self.template_parameters['Arrow_background'] = False
|
||||
self.template_parameters['Arrow_path'] = "NorthArrow_03.svg"
|
||||
self.template_parameters['Echelle_size'] = QgsLayoutSize(50.0, 10, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(276, 325, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_rotate'] = 270
|
||||
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(154, 220, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_rotate'] = 0
|
||||
self.template_parameters['Logo_size'] = QgsLayoutSize(40.0, 20, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Logo_locals'] = QgsLayoutPoint(265, 410, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Logo_rotate'] = 270
|
||||
self.template_parameters['Titre_size'] = QgsLayoutSize(405.0, 10, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Titre_locals'] = QgsLayoutPoint(2, 410, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Titre_rotate'] = 270
|
||||
self.template_parameters['Credit_size'] = QgsLayoutSize(225.0, 6, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Credit_locals'] = QgsLayoutPoint(253, 203.0, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Credit_rotate'] = 180
|
||||
self.template_parameters['Logo_locals'] = QgsLayoutPoint(248, 386, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Logo_rotate'] = 0
|
||||
self.template_parameters['Titre_size'] = QgsLayoutSize(293.0, 10, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Titre_locals'] = QgsLayoutPoint(2, 1, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Titre_rotate'] = 0
|
||||
self.template_parameters['Credit_size'] = QgsLayoutSize(233.0, 6, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Credit_locals'] = QgsLayoutPoint(4, 204.0, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Credit_rotate'] = 0
|
||||
self.template_parameters['Credit_alignment'] = 0x0001
|
||||
self.template_parameters['Source_size'] = QgsLayoutSize(225.0, 6, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Source_locals'] = QgsLayoutPoint(253, 197.0, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Source_rotate'] = 180
|
||||
self.template_parameters['Source_size'] = QgsLayoutSize(233.0, 6, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Source_locals'] = QgsLayoutPoint(4, 198.0, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Source_rotate'] = 0
|
||||
self.template_parameters['Source_alignment'] = 0x0001
|
||||
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(405, 10, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(12, 410, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Sous_titre_rotate'] = 270
|
||||
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(293, 6, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(2, 11, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Sous_titre_rotate'] = 0
|
||||
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(50.0, 13, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(265, 325, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_2_rotate'] = 270
|
||||
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(252, 330, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Echelle_2_rotate'] = 0
|
||||
self.template_parameters['Logo_2_size'] = QgsLayoutSize(40.0, 20, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(265, 365, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Logo_2_rotate'] = 270
|
||||
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(160, 234, QgsUnitTypes.LayoutMillimeters)
|
||||
self.template_parameters['Logo_2_rotate'] = 0
|
||||
if page_rotate == 'Landscape':
|
||||
if values_page == 'A4':
|
||||
self.template_parameters['Carte_size'] = QgsLayoutSize(145.0, 140, QgsUnitTypes.LayoutMillimeters)
|
||||
|
||||
@@ -21,7 +21,11 @@ from .tools.resources import (
|
||||
maj_verif,
|
||||
)
|
||||
pyperclip()
|
||||
from .copie_editor import Copie_Editor
|
||||
|
||||
try:
|
||||
from .copie_editor import Copie_Editor
|
||||
except NameError:
|
||||
print('404')
|
||||
|
||||
|
||||
class PgCopie:
|
||||
|
||||
@@ -9,9 +9,10 @@
|
||||
[general]
|
||||
name=CenRA_COPIE
|
||||
qgisMinimumVersion=3.0
|
||||
qgisMaximumVersion=4.99
|
||||
supportsQt6=True
|
||||
description=Permet la copie d'une table dans une base PostGis
|
||||
version=3.1
|
||||
version=3.2
|
||||
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
|
||||
email=si_besoin@cen-rhonealpes.fr
|
||||
|
||||
@@ -20,7 +21,7 @@ email=si_besoin@cen-rhonealpes.fr
|
||||
# Recommended items:
|
||||
|
||||
# Uncomment the following line and add your changelog:
|
||||
changelog=<h2>CenRa_COPIE:</h2></br><p><h3>30/07/2025 - Version 3.1: </h3> - Correctife de bug.</p></br><p><h3>19/05/2025 - Version 3.0: </h3> - Compatible PyQt5 et PyQt6</p></br><p><h3>11/04/2025 - Version 2.5: </h3> - Correctif de bug.</p></br><p><h3>09/04/2025 - Version 2.4: </h3> - Correctif bug en TT.</p></br><p><h3>09/04/2025 - Version 2.3: </h3> - Optimisation pour le TT.</p></br><p><h3>03/04/2025 - Version 2.2: </h3> - Mise a jour de securite.</p></br><p><h3>07/01/2025 - Version 2.1: </h3> - ByPass du certif ssl ci erreur.</br></p><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>
|
||||
changelog=<h2>CenRa_COPIE:</h2></br><p><h3>12/03/2026 - Version 3.2: </h3> - qgisMaximumVersion est 4.0.</p></br><p><h3>30/07/2025 - Version 3.1: </h3> - Correctife de bug.</p></br><p><h3>19/05/2025 - Version 3.0: </h3> - Compatible PyQt5 et PyQt6</p></br><p><h3>11/04/2025 - Version 2.5: </h3> - Correctif de bug.</p></br><p><h3>09/04/2025 - Version 2.4: </h3> - Correctif bug en TT.</p></br><p><h3>09/04/2025 - Version 2.3: </h3> - Optimisation pour le TT.</p></br><p><h3>03/04/2025 - Version 2.2: </h3> - Mise a jour de securite.</p></br><p><h3>07/01/2025 - Version 2.1: </h3> - ByPass du certif ssl ci erreur.</br></p><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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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">
|
||||
<widget class="QDialog" name="CenRa_about_base">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@@ -13,10 +13,6 @@
|
||||
<property name="windowTitle">
|
||||
<string>Journal des modifications</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">
|
||||
@@ -38,7 +34,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>453</width>
|
||||
<height>570</height>
|
||||
<height>547</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
@@ -70,7 +66,7 @@
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::NoButton</set>
|
||||
<set>QDialogButtonBox::Close|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -20,7 +20,10 @@ from .tools.resources import (
|
||||
)
|
||||
pyperclip()
|
||||
|
||||
from .flux_editor import Flux_Editor
|
||||
try:
|
||||
from .flux_editor import Flux_Editor
|
||||
except NameError:
|
||||
print('404')
|
||||
|
||||
|
||||
class PgFlux:
|
||||
|
||||
@@ -1,30 +1,32 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Module Flux Editor pour le plugin CenRA_FLUX
|
||||
Permet de gérer et charger des couches depuis les bases de données PostGIS (SIG et REF)
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
# Import the PyQt and QGIS libraries
|
||||
# from builtins import next
|
||||
# Import des bibliothèques PyQt et QGIS
|
||||
from builtins import str
|
||||
# from builtins import object
|
||||
|
||||
from qgis.PyQt import QtCore, QtGui
|
||||
from qgis.PyQt.QtCore import QSettings
|
||||
from qgis.PyQt import QtWidgets
|
||||
# from qgis.PyQt.QtWidgets import QDialog
|
||||
from qgis.PyQt.QtGui import QIcon
|
||||
|
||||
# from qgis.PyQt.QtCore import *
|
||||
|
||||
# from qgis.core import QgsCoordinateReferenceSystem, QgsCoordinateTransform, QgsProject, QgsSettings
|
||||
from qgis.core import QgsDataSourceUri, QgsCoordinateReferenceSystem, QgsCoordinateTransform, QgsProject, QgsSettings, QgsApplication, QgsVectorLayer, QgsRasterLayer, QgsWkbTypes
|
||||
from qgis.core import (
|
||||
QgsDataSourceUri,
|
||||
QgsCoordinateReferenceSystem,
|
||||
QgsCoordinateTransform,
|
||||
QgsProject,
|
||||
QgsSettings,
|
||||
QgsApplication,
|
||||
QgsVectorLayer,
|
||||
QgsRasterLayer,
|
||||
QgsWkbTypes
|
||||
)
|
||||
from qgis.PyQt.QtWidgets import (
|
||||
QDialog,
|
||||
# QAction,
|
||||
# QDockWidget,
|
||||
# QFileDialog,
|
||||
# QInputDialog,
|
||||
# QMenu,
|
||||
# QToolButton,
|
||||
# QTableWidget,
|
||||
QPushButton,
|
||||
QTableWidgetItem,
|
||||
QMessageBox,
|
||||
QVBoxLayout,
|
||||
@@ -33,28 +35,21 @@ from .tools.SQLRequet import schemaname_list, schemaname_list_ref, schemaname_di
|
||||
from .tools.resources import (
|
||||
load_ui,
|
||||
resources_path,
|
||||
# send_issues,
|
||||
)
|
||||
try:
|
||||
from .tools.PythonSQL import login_base
|
||||
except NameError:
|
||||
print('Pas de fichier PythonSQL')
|
||||
|
||||
|
||||
# from .issues import CenRa_Issues
|
||||
|
||||
# from ast import literal_eval
|
||||
from qgis.utils import iface
|
||||
# import os.path
|
||||
# import os
|
||||
# import webbrowser
|
||||
import psycopg2
|
||||
import psycopg2.extras
|
||||
# import base64
|
||||
|
||||
# Variable globale pour le mode debug
|
||||
global DeBUG
|
||||
DeBUG = 0
|
||||
|
||||
# Création des icônes pour les couches raster et vecteur
|
||||
itemIconRaster = QTableWidgetItem()
|
||||
icon = QIcon()
|
||||
icon.addPixmap(QtGui.QPixmap(resources_path('icons', 'mIconRaster.svg')), QIcon.Mode(0), QIcon.State(1))
|
||||
@@ -65,28 +60,36 @@ icon = QIcon()
|
||||
icon.addPixmap(QtGui.QPixmap(resources_path('icons', 'mIconVecteur.svg')), QIcon.Mode(0), QIcon.State(1))
|
||||
itemIconVecteur.setIcon(icon)
|
||||
|
||||
# Récupération des informations de connexion à la base de données
|
||||
try:
|
||||
account = login_base('account')
|
||||
user = account[0]
|
||||
mdp = account[1]
|
||||
host = account[2]
|
||||
port = account[3]
|
||||
dbname = account[4]
|
||||
sigdb = account[5]
|
||||
refdb = account[6]
|
||||
user = account[0] # Nom d'utilisateur
|
||||
mdp = account[1] # Mot de passe
|
||||
host = account[2] # Hôte de la base de données
|
||||
port = account[3] # Port de connexion
|
||||
dbname = account[4] # Nom de la base de données
|
||||
sigdb = account[5] # Base de données SIG
|
||||
refdb = account[6] # Base de données REF
|
||||
|
||||
except NameError:
|
||||
print('Fails to login DB for account')
|
||||
|
||||
# Chargement de l'interface utilisateur depuis le fichier .ui
|
||||
EDITOR_CLASS = load_ui('CenRa_Flux_base.ui')
|
||||
|
||||
targetCrs = QgsCoordinateReferenceSystem('EPSG:4326')
|
||||
layerCrs = QgsCoordinateReferenceSystem('EPSG:2154')
|
||||
# Configuration des systèmes de coordonnées de référence (CRS)
|
||||
targetCrs = QgsCoordinateReferenceSystem('EPSG:4326') # WGS84 (coordonnées géographiques)
|
||||
layerCrs = QgsCoordinateReferenceSystem('EPSG:2154') # Lambert 93 (projection française)
|
||||
TranformCRS = QgsCoordinateTransform(layerCrs, targetCrs, QgsProject.instance())
|
||||
|
||||
|
||||
class Flux_Editor(QDialog, EDITOR_CLASS):
|
||||
"""
|
||||
Classe principale de l'éditeur de flux
|
||||
Gère l'interface de sélection et de chargement des couches depuis les bases de données
|
||||
"""
|
||||
def __init__(self, parent=None):
|
||||
"""Initialisation de l'interface et des composants"""
|
||||
_ = parent
|
||||
super().__init__()
|
||||
self.setupUi(self)
|
||||
@@ -95,29 +98,36 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
||||
self.setWindowIcon(QtGui.QIcon(resources_path('icons', 'icon.png')))
|
||||
self.first_start = None
|
||||
self.iface = iface
|
||||
# Configuration des éléments visuels de l'interface
|
||||
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')))
|
||||
|
||||
# Configuration du tableau des couches disponibles
|
||||
self.tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger(0))
|
||||
self.toolButton.setIcon(QtGui.QIcon(resources_path('ui', 'find.png')))
|
||||
self.toolButton_2.setIcon(QtGui.QIcon(resources_path('ui', 'star.png')))
|
||||
# Ajout des options de base de données (SIG ou REF)
|
||||
self.comboBox_2.addItem("SIG")
|
||||
self.comboBox_2.addItem('REF')
|
||||
|
||||
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)
|
||||
# Connexion des signaux aux slots (événements de l'interface)
|
||||
self.commandLinkButton.clicked.connect(self.selection_flux) # Bouton de sélection de flux
|
||||
self.tableWidget.itemDoubleClicked.connect(self.selection_flux) # Double-clic sur une couche
|
||||
self.pushButton_2.clicked.connect(self.limite_flux) # Bouton de chargement
|
||||
self.commandLinkButton_2.clicked.connect(self.suppression_flux) # Bouton de suppression
|
||||
self.tableWidget_2.itemDoubleClicked.connect(self.suppression_flux) # Double-clic pour supprimer
|
||||
self.comboBox_2.currentIndexChanged.connect(self.bd_source) # Changement de base de données
|
||||
self.checkBox.hide()
|
||||
# self.checkBox.stateChanged.connect(self.modeCarte)
|
||||
self.toolButton.clicked.connect(self.getCanevas)
|
||||
self.toolButton.clicked.connect(self.getCanevas) # Filtrer par emprise du canevas
|
||||
self.toolButton.setToolTip('Filtrer uniquement les couche Contour/Habitat/Travaux \nqui ce trouve dans le canvas de la carte.')
|
||||
self.toolButton_2.clicked.connect(self.filtre_favorit) # Filtrer par favoris
|
||||
self.toolButton_2.setToolTip('Afficher uniquement les favoris.')
|
||||
layout = QVBoxLayout()
|
||||
self.lineEdit.textChanged.connect(self.filtre_dynamique)
|
||||
# self.viewer.textChanged.connect(self.NewTitle)
|
||||
self.lineEdit.textChanged.connect(self.filtre_dynamique) # Recherche dynamique
|
||||
layout.addWidget(self.lineEdit)
|
||||
self.viewer.hide()
|
||||
# Configuration du menu de debug (caché par défaut)
|
||||
self.DeBUG.addItem('')
|
||||
self.DeBUG.addItem('Dev')
|
||||
self.DeBUG.addItem('01')
|
||||
@@ -126,13 +136,14 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
||||
self.comboBox.currentIndexChanged.connect(self.initialisation_flux)
|
||||
|
||||
self.DeBUG.currentIndexChanged.connect(self.SwitchDEBUG)
|
||||
self.DeBUG.hide()
|
||||
self.DeBUG.hide() # Menu debug caché par défaut
|
||||
|
||||
def raise_(self):
|
||||
"""Run method that performs all the real work"""
|
||||
self.bd_source()
|
||||
|
||||
def SwitchDEBUG(self):
|
||||
"""Change les paramètres de connexion selon le mode debug sélectionné"""
|
||||
try:
|
||||
global user, mdp, host, port, dbname, sigdb, refdb
|
||||
account = login_base(self.DeBUG.currentText())
|
||||
@@ -152,43 +163,40 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
||||
self.DeBUG.show()
|
||||
|
||||
def mousePressEvent(self, event):
|
||||
"""Détecte les clics sur le logo pour activer le mode debug (3 clics consécutifs)"""
|
||||
global DeBUG
|
||||
# Zone du logo (coordonnées x: 330-560, y: 5-75)
|
||||
if 330 <= event.pos().x() <= 560 and 5 <= event.pos().y() <= 75:
|
||||
DeBUG = DeBUG + 1
|
||||
if DeBUG == 3:
|
||||
if DeBUG == 3: # Activation après 3 clics
|
||||
DeBUG = 0
|
||||
self.ModeDeBUG()
|
||||
else:
|
||||
DeBUG = 0
|
||||
self.DeBUG.hide()
|
||||
|
||||
"""
|
||||
def NewTitle(self):
|
||||
if self.viewer.title() != '':
|
||||
Tsplit = ((self.viewer.title()).split('.'))
|
||||
print(Tsplit[0], Tsplit[1])
|
||||
self.openPostGIS(Tsplit[0], Tsplit[1])
|
||||
"""
|
||||
|
||||
def bd_source(self):
|
||||
"""Sélectionne la base de données source (SIG ou REF)"""
|
||||
self.activateWindow()
|
||||
bd_origine = self.comboBox_2.currentText()
|
||||
if bd_origine == 'REF':
|
||||
self.run_ref()
|
||||
self.run_ref() # Connexion à la base REF
|
||||
if bd_origine == 'SIG':
|
||||
self.run_sig()
|
||||
self.run_sig() # Connexion à la base SIG
|
||||
|
||||
def run_ref(self):
|
||||
"""Run method that performs all the real work"""
|
||||
"""Initialise la connexion à la base de données REF"""
|
||||
# Vider le tableau des flux sélectionnés
|
||||
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
|
||||
# Connexion à la base de données REF
|
||||
con = psycopg2.connect("host=" + host + " port=" + port + " dbname=" + dbtype + " user=" + user + " password=" + mdp)
|
||||
cur = con.cursor(cursor_factory=psycopg2.extras.DictCursor)
|
||||
self.combobox_custom()
|
||||
# self.initialisation_flux()
|
||||
self.initialisation_flux()
|
||||
# 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 is True:
|
||||
@@ -197,199 +205,330 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
||||
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"""
|
||||
"""Initialise la connexion à la base de données SIG"""
|
||||
# Vider le tableau des flux sélectionnés
|
||||
while self.tableWidget_2.rowCount() > 0:
|
||||
self.tableWidget_2.removeRow(self.tableWidget_2.rowCount() - 1)
|
||||
global cur, con, dbtype
|
||||
dbtype = sigdb
|
||||
# Connexion à la base de données SIG
|
||||
con = psycopg2.connect("host=" + host + " port=" + port + " dbname=" + dbtype + " user=" + user + " password=" + mdp)
|
||||
cur = con.cursor(cursor_factory=psycopg2.extras.DictCursor)
|
||||
self.combobox_custom()
|
||||
# self.initialisation_flux()
|
||||
# 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
|
||||
self.initialisation_flux()
|
||||
|
||||
if self.first_start is 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 AddOrDelToUserFav(self):
|
||||
"""Ajoute ou supprime une couche des favoris de l'utilisateur"""
|
||||
selected_items = self.tableWidget.selectedItems()
|
||||
favorit_statut = selected_items[4].text() # 0 = non favori, 1 = favori
|
||||
|
||||
selected_items[4].tableWidget().removeCellWidget(selected_items[4].row(), 4)
|
||||
|
||||
schema_name = selected_items[2].text()
|
||||
table_name = selected_items[3].text()
|
||||
|
||||
# Ajout aux favoris
|
||||
if favorit_statut == "0":
|
||||
FAV = "mStarIconDel.png" # Icône étoile pleine
|
||||
selected_items[4].setText("1")
|
||||
# Requête SQL pour ajouter aux favoris
|
||||
SQLAddFav = """INSERT INTO admin_sig.favtable (utilisateur, schema_name, table_name) VALUES ('""" + user + "','" + schema_name + "','" + table_name + """');"""
|
||||
if dbtype == sigdb:
|
||||
cur.execute(SQLAddFav)
|
||||
con.commit()
|
||||
else:
|
||||
conSIG = psycopg2.connect("host=" + host + " port=" + port + " dbname=" + sigdb + " user=" + user + " password=" + mdp)
|
||||
curSIG = conSIG.cursor(cursor_factory=psycopg2.extras.DictCursor)
|
||||
curSIG.execute(SQLAddFav)
|
||||
conSIG.commit()
|
||||
conSIG.close()
|
||||
|
||||
# Suppression des favoris
|
||||
else:
|
||||
FAV = "mStarIconAdd.png" # Icône étoile vide
|
||||
selected_items[4].setText("0")
|
||||
# Requête SQL pour supprimer des favoris
|
||||
SQLDelFav = """DELETE FROM admin_sig.favtable WHERE utilisateur LIKE '""" + user + """' AND schema_name LIKE '""" + schema_name + """' AND table_name LIKE '""" + table_name + """';"""
|
||||
if dbtype == sigdb:
|
||||
cur.execute(SQLDelFav)
|
||||
con.commit()
|
||||
else:
|
||||
conSIG = psycopg2.connect("host=" + host + " port=" + port + " dbname=" + sigdb + " user=" + user + " password=" + mdp)
|
||||
curSIG = conSIG.cursor(cursor_factory=psycopg2.extras.DictCursor)
|
||||
curSIG.execute(SQLDelFav)
|
||||
conSIG.commit()
|
||||
conSIG.close()
|
||||
|
||||
iconFav = QIcon()
|
||||
iconFav.addPixmap(QtGui.QPixmap(resources_path('icons', FAV)), QIcon.Mode(0), QIcon.State(1))
|
||||
self.FavButton = QPushButton(iconFav, "")
|
||||
selected_items[4].tableWidget().setCellWidget(selected_items[4].row(), 4, self.FavButton)
|
||||
self.FavButton.clicked.connect(self.AddOrDelToUserFav)
|
||||
|
||||
def initialisation_flux(self):
|
||||
print('run')
|
||||
if dbtype == sigdb:
|
||||
# self.toolButton.setEnabled(1)
|
||||
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()) + """' AND tablename NOT LIKE 'qgis_projects' order by schemaname, tablename;"""
|
||||
cur.execute(custom_list)
|
||||
list_schema = cur.fetchall()
|
||||
|
||||
SQLcountRaster = """SELECT schemaname,viewname FROM pg_catalog.pg_views
|
||||
WHERE schemaname LIKE 'public' AND viewname LIKE 'raster_columns';"""
|
||||
cur.execute(SQLcountRaster)
|
||||
RasterIF = len(cur.fetchall())
|
||||
|
||||
if RasterIF == 1:
|
||||
SQLloadRaster = """SELECT concat(r_table_schema,'.',r_table_name) from public.raster_columns; """
|
||||
cur.execute(SQLloadRaster)
|
||||
list_raster = cur.fetchall()
|
||||
RasterList = []
|
||||
for rasterFind in list_raster:
|
||||
RasterList.append(rasterFind[0])
|
||||
else:
|
||||
RasterList = []
|
||||
|
||||
SQLprojects = """SELECT schemaname, tablename FROM pg_catalog.pg_tables WHERE tablename LIKE 'qgis_projects'"""
|
||||
cur.execute(SQLprojects)
|
||||
list_projects = cur.fetchall()
|
||||
list_projects_qgis = []
|
||||
if len(list_projects) <= 1:
|
||||
for ProjectName in list_projects:
|
||||
SQLProjectsQgis = """SELECT name, metadata, content FROM """ + '"' + ProjectName[0] + '"."' + ProjectName[1] + '"'
|
||||
cur.execute(SQLProjectsQgis)
|
||||
list_projects_qgis.append(cur.fetchall())
|
||||
|
||||
if self.comboBox.currentText() == 'toutes les catégories':
|
||||
SQLGrands = """SELECT concat(table_schema,'.',table_name) FROM information_schema.role_table_grants WHERE grantee in(SELECT rolname FROM pg_catalog.pg_roles WHERE oid in(SELECT roleid FROM pg_auth_members WHERE member = (SELECT usesysid FROM pg_catalog.pg_user WHERE usename = '""" + user + """'))) and privilege_type = 'SELECT';"""
|
||||
else:
|
||||
SQLGrands = """SELECT concat(table_schema,'.',table_name) FROM information_schema.role_table_grants WHERE grantee in(SELECT rolname FROM pg_catalog.pg_roles WHERE oid in(SELECT roleid FROM pg_auth_members WHERE member = (SELECT usesysid FROM pg_catalog.pg_user WHERE usename = '""" + user + """'))) and privilege_type = 'SELECT' AND table_schema LIKE '_""" + str(self.comboBox.currentText()) + """_%';"""
|
||||
cur.execute(SQLGrands)
|
||||
list_grands = cur.fetchall()
|
||||
GrandUser = []
|
||||
for grandsFind in list_grands:
|
||||
GrandUser.append(grandsFind[0])
|
||||
|
||||
self.tableWidget.setRowCount(len(list_schema))
|
||||
self.tableWidget.setColumnCount(4)
|
||||
i = 0
|
||||
for value in list_schema:
|
||||
"""Initialise et remplit le tableau des couches disponibles"""
|
||||
if self.toolButton_2.text() == "1":
|
||||
self.filtre_favorit(None)
|
||||
self.tableWidget.clear()
|
||||
if NoSignals == 0: # Éviter les boucles infinies lors des mises à jour
|
||||
if dbtype == sigdb:
|
||||
type_val = str(value[0])[1:3]
|
||||
schema_name = str(value[0])[4:]
|
||||
table_name = str(value[1][len(value[0]) + 1:])
|
||||
if value[0] == value[1][:len(value[0])]:
|
||||
table_name = str(value[1][len(value[0]) + 1:])
|
||||
if self.comboBox.currentText() == 'toutes les catégories':
|
||||
custom_list = schemaname_list
|
||||
elif self.comboBox.currentText() == 'travaux':
|
||||
custom_list = schemaname_list[:-2] + """
|
||||
WHERE schemaname LIKE '""" + str(self.comboBox.currentText()) + """%';
|
||||
"""
|
||||
else:
|
||||
table_name = str(value[1])
|
||||
custom_list = schemaname_list[:-2] + """
|
||||
WHERE schemaname LIKE '_""" + str(self.comboBox.currentText()) + """%';
|
||||
"""
|
||||
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:]
|
||||
if value[0] == value[1][:len(value[0])]:
|
||||
table_name = str(value[1][len(value[0]) + 1:])
|
||||
if self.comboBox.currentText() == 'toutes les catégories':
|
||||
custom_list = schemaname_list_ref
|
||||
else:
|
||||
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])
|
||||
custom_list = schemaname_list_ref[:-2] + """
|
||||
WHERE schemaname LIKE '""" + str(self.comboBox.currentText()) + """%' AND tablename NOT LIKE 'qgis_projects';
|
||||
"""
|
||||
cur.execute(custom_list)
|
||||
list_schema = cur.fetchall()
|
||||
|
||||
if (str(value[0]) + '.' + str(value[1])) in RasterList:
|
||||
SVG = 'mIconRaster.svg'
|
||||
# Vérification de la présence de couches raster dans la base
|
||||
SQLcountRaster = """SELECT schemaname,viewname FROM pg_catalog.pg_views
|
||||
WHERE schemaname LIKE 'public' AND viewname LIKE 'raster_columns';"""
|
||||
cur.execute(SQLcountRaster)
|
||||
RasterIF = len(cur.fetchall())
|
||||
|
||||
# Récupération de la liste des couches raster si disponibles
|
||||
if RasterIF == 1:
|
||||
SQLloadRaster = """SELECT concat(r_table_schema,'.',r_table_name) from public.raster_columns; """
|
||||
cur.execute(SQLloadRaster)
|
||||
list_raster = cur.fetchall()
|
||||
RasterList = []
|
||||
for rasterFind in list_raster:
|
||||
RasterList.append(rasterFind[0])
|
||||
else:
|
||||
SVG = 'mIconVecteur.svg'
|
||||
RasterList = []
|
||||
|
||||
itemIcon = QTableWidgetItem()
|
||||
icon = QIcon()
|
||||
icon.addPixmap(QtGui.QPixmap(resources_path('icons', SVG)), QIcon.Mode(0), QIcon.State(1))
|
||||
itemIcon.setIcon(icon)
|
||||
# Récupération des projets QGIS stockés dans la base de données
|
||||
SQLprojects = """SELECT schemaname, tablename FROM pg_catalog.pg_tables WHERE tablename LIKE 'qgis_projects'"""
|
||||
cur.execute(SQLprojects)
|
||||
list_projects = cur.fetchall()
|
||||
list_projects_qgis = []
|
||||
if len(list_projects) <= 1:
|
||||
for ProjectName in list_projects:
|
||||
SQLProjectsQgis = """SELECT name, metadata, content FROM """ + '"' + ProjectName[0] + '"."' + ProjectName[1] + '"'
|
||||
cur.execute(SQLProjectsQgis)
|
||||
list_projects_qgis.append(cur.fetchall())
|
||||
|
||||
self.tableWidget.setItem(i, 0, itemIcon)
|
||||
item = QTableWidgetItem(type_val)
|
||||
self.tableWidget.setItem(i, 1, item)
|
||||
item = QTableWidgetItem(schema_name)
|
||||
self.tableWidget.setItem(i, 2, item)
|
||||
item = QTableWidgetItem(table_name)
|
||||
self.tableWidget.setItem(i, 3, item)
|
||||
# Récupération des droits d'accès de l'utilisateur sur les tables
|
||||
SQLGrands = """
|
||||
WITH t as (SELECT
|
||||
n.nspname AS table_schema,
|
||||
c.relname AS table_name,
|
||||
r.rolname AS grantee,
|
||||
CASE
|
||||
WHEN acl_text LIKE '%r%' THEN 'SELECT'
|
||||
WHEN acl_text LIKE '%w%' THEN 'UPDATE'
|
||||
WHEN acl_text LIKE '%a%' THEN 'INSERT'
|
||||
WHEN acl_text LIKE '%d%' THEN 'DELETE'
|
||||
WHEN acl_text LIKE '%x%' THEN 'REFERENCES'
|
||||
ELSE 'OTHER'
|
||||
END AS privilege_type
|
||||
FROM pg_class c
|
||||
JOIN pg_namespace n ON n.oid = c.relnamespace
|
||||
LEFT JOIN LATERAL unnest(c.relacl) AS acl_item(acl) ON TRUE
|
||||
LEFT JOIN LATERAL (
|
||||
SELECT acl::text AS acl_text,
|
||||
split_part(acl::text, '=', 1) AS grantee_name
|
||||
) priv ON TRUE
|
||||
LEFT JOIN pg_roles r ON r.rolname = priv.grantee_name
|
||||
WHERE c.relkind IN ('r', 'v','m'))
|
||||
"""
|
||||
if self.comboBox.currentText() == 'toutes les catégories':
|
||||
SQLGrands = SQLGrands + """SELECT concat(table_schema,'.',table_name) FROM t WHERE grantee in(SELECT rolname FROM pg_catalog.pg_roles WHERE oid in(SELECT roleid FROM pg_auth_members WHERE member = (SELECT usesysid FROM pg_catalog.pg_user WHERE usename = '""" + user + """'))) and privilege_type = 'SELECT';"""
|
||||
else:
|
||||
if dbtype == sigdb:
|
||||
SQLGrands = SQLGrands + """SELECT concat(table_schema,'.',table_name) FROM t WHERE grantee in(SELECT rolname FROM pg_catalog.pg_roles WHERE oid in(SELECT roleid FROM pg_auth_members WHERE member = (SELECT usesysid FROM pg_catalog.pg_user WHERE usename = '""" + user + """'))) and privilege_type = 'SELECT' AND table_schema LIKE '_""" + str(self.comboBox.currentText()) + """_%';"""
|
||||
elif dbtype == refdb:
|
||||
SQLGrands = SQLGrands + """SELECT concat(table_schema,'.',table_name) FROM t WHERE grantee in(SELECT rolname FROM pg_catalog.pg_roles WHERE oid in(SELECT roleid FROM pg_auth_members WHERE member = (SELECT usesysid FROM pg_catalog.pg_user WHERE usename = '""" + user + """'))) and privilege_type = 'SELECT' AND table_schema LIKE '""" + str(self.comboBox.currentText()) + """%';"""
|
||||
cur.execute(SQLGrands)
|
||||
list_grands = cur.fetchall()
|
||||
GrandUser = []
|
||||
for grandsFind in list_grands:
|
||||
GrandUser.append(grandsFind[0])
|
||||
|
||||
if dbtype == sigdb:
|
||||
if (str(value[0]) + '.' + str(value[1])) in GrandUser:
|
||||
pass
|
||||
# Récupération de la liste des favoris de l'utilisateur
|
||||
SQLFavTable = "SELECT concat(schema_name, '.', table_name) FROM admin_sig.favtable WHERE utilisateur LIKE '" + user + "';"
|
||||
if dbtype == refdb:
|
||||
conSIG = psycopg2.connect("host=" + host + " port=" + port + " dbname=" + sigdb + " user=" + user + " password=" + mdp)
|
||||
curSIG = conSIG.cursor(cursor_factory=psycopg2.extras.DictCursor)
|
||||
curSIG.execute(SQLFavTable)
|
||||
list_fav = curSIG.fetchall()
|
||||
conSIG.close()
|
||||
print('SIG')
|
||||
else:
|
||||
cur.execute(SQLFavTable)
|
||||
list_fav = cur.fetchall()
|
||||
FavList = []
|
||||
for favFind in list_fav:
|
||||
FavList.append(favFind[0])
|
||||
|
||||
# Remplissage du tableau avec les couches disponibles
|
||||
self.tableWidget.setRowCount(len(list_schema))
|
||||
self.tableWidget.setColumnCount(5)
|
||||
i = 0
|
||||
for value in list_schema:
|
||||
MetadataXML = value[2]
|
||||
if dbtype == sigdb:
|
||||
type_val = str(value[0])[1:3]
|
||||
schema_name = str(value[0])[4:]
|
||||
table_name = str(value[1][len(value[0]) + 1:])
|
||||
if value[0] == value[1][:len(value[0])]:
|
||||
table_name = str(value[1][len(value[0]) + 1:])
|
||||
else:
|
||||
table_name = str(value[1])
|
||||
if type_val == "00":
|
||||
table_name = value[1]
|
||||
else:
|
||||
# print(str(value[0]) + '.' + str(value[1]), 'bad')
|
||||
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:]
|
||||
if value[0] == value[1][:len(value[0])]:
|
||||
table_name = str(value[1][len(value[0]) + 1:])
|
||||
else:
|
||||
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])
|
||||
|
||||
FavStatut = 0
|
||||
if (schema_name + '.' + table_name) not in FavList:
|
||||
FAV = "mStarIconAdd.png"
|
||||
FavStatut = 0
|
||||
else:
|
||||
FAV = "mStarIconDel.png"
|
||||
FavStatut = 1
|
||||
iconFav = QIcon()
|
||||
iconFav.addPixmap(QtGui.QPixmap(resources_path('icons', FAV)), QIcon.Mode(0), QIcon.State(1))
|
||||
self.FavButton = QPushButton(iconFav, "")
|
||||
self.FavButton.clicked.connect(self.AddOrDelToUserFav)
|
||||
|
||||
if (str(value[0]) + '.' + str(value[1])) in RasterList:
|
||||
SVG = 'mIconRaster.svg'
|
||||
else:
|
||||
SVG = 'mIconVecteur.svg'
|
||||
|
||||
itemIcon = QTableWidgetItem()
|
||||
icon = QIcon()
|
||||
icon.addPixmap(QtGui.QPixmap(resources_path('icons', SVG)), QIcon.Mode(0), QIcon.State(1))
|
||||
itemIcon.setIcon(icon)
|
||||
|
||||
self.tableWidget.setItem(i, 0, itemIcon)
|
||||
item = QTableWidgetItem(type_val)
|
||||
self.tableWidget.setItem(i, 1, item)
|
||||
item = QTableWidgetItem(schema_name)
|
||||
self.tableWidget.setItem(i, 2, item)
|
||||
item = QTableWidgetItem(table_name)
|
||||
self.tableWidget.setItem(i, 3, item)
|
||||
item = QTableWidgetItem(str(FavStatut))
|
||||
self.tableWidget.setItem(i, 4, item)
|
||||
self.tableWidget.setCellWidget(i, 4, self.FavButton)
|
||||
|
||||
# Coloration des lignes selon les droits d'accès
|
||||
if (str(value[0]) + '.' + str(value[1])) in GrandUser: # L'utilisateur a les droits
|
||||
for j in range(self.tableWidget.columnCount()):
|
||||
self.tableWidget.item(i, j).setToolTip(MetadataXML)
|
||||
else:
|
||||
# Coloration en violet si droits insuffisants
|
||||
for j in range(self.tableWidget.columnCount()):
|
||||
self.tableWidget.item(i, j).setBackground(QtGui.QColor(187, 134, 192, 50))
|
||||
self.tableWidget.item(i, j).setToolTip('Droit insuffisant pour ouvrire la couche !')
|
||||
|
||||
i = i + 1
|
||||
i = i + 1
|
||||
|
||||
if self.comboBox.currentText() == 'toutes les catégories':
|
||||
SQLprojects = """SELECT schemaname, tablename FROM pg_catalog.pg_tables WHERE tablename LIKE 'qgis_projects'"""
|
||||
else:
|
||||
SQLprojects = """SELECT schemaname, tablename FROM pg_catalog.pg_tables WHERE tablename LIKE 'qgis_projects' AND schemaname LIKE '""" + str(self.comboBox.currentText()) + """';"""
|
||||
cur.execute(SQLprojects)
|
||||
list_projects = cur.fetchall()
|
||||
if self.comboBox.currentText() == 'toutes les catégories':
|
||||
SQLprojects = """SELECT schemaname, tablename FROM pg_catalog.pg_tables WHERE tablename LIKE 'qgis_projects'"""
|
||||
else:
|
||||
SQLprojects = """SELECT schemaname, tablename FROM pg_catalog.pg_tables WHERE tablename LIKE 'qgis_projects' AND schemaname LIKE '""" + str(self.comboBox.currentText()) + """';"""
|
||||
cur.execute(SQLprojects)
|
||||
list_projects = cur.fetchall()
|
||||
|
||||
list_projects_qgis = []
|
||||
if len(list_projects) >= 1:
|
||||
for ProjectName in list_projects:
|
||||
SQLProjectsQgis = """SELECT name, metadata, content FROM """ + '"' + ProjectName[0] + '"."' + ProjectName[1] + '"'
|
||||
cur.execute(SQLProjectsQgis)
|
||||
list_projects_qgis = cur.fetchall()
|
||||
for Project in list_projects_qgis:
|
||||
self.tableWidget.setRowCount(i + 1)
|
||||
itemIcon = QTableWidgetItem()
|
||||
icon = QIcon()
|
||||
icon.addPixmap(QtGui.QPixmap(resources_path('icons', 'mIconQgis.svg')), QIcon.Mode(0), QIcon.State(1))
|
||||
itemIcon.setIcon(icon)
|
||||
self.tableWidget.setItem(i, 0, itemIcon)
|
||||
list_projects_qgis = []
|
||||
if len(list_projects) >= 1:
|
||||
for ProjectName in list_projects:
|
||||
SQLProjectsQgis = """SELECT name, metadata, content FROM """ + '"' + ProjectName[0] + '"."' + ProjectName[1] + '"'
|
||||
cur.execute(SQLProjectsQgis)
|
||||
list_projects_qgis = cur.fetchall()
|
||||
for Project in list_projects_qgis:
|
||||
FavStatut = 0
|
||||
if (ProjectName[0] + '.' + Project[0]) not in FavList:
|
||||
FAV = "mStarIconAdd.png"
|
||||
FavStatut = 0
|
||||
else:
|
||||
FAV = "mStarIconDel.png"
|
||||
FavStatut = 1
|
||||
iconFav = QIcon()
|
||||
iconFav.addPixmap(QtGui.QPixmap(resources_path('icons', FAV)), QIcon.Mode(0), QIcon.State(1))
|
||||
self.FavButton = QPushButton(iconFav, "")
|
||||
self.FavButton.clicked.connect(self.AddOrDelToUserFav)
|
||||
if dbtype == refdb:
|
||||
self.FavButton.setEnabled(False)
|
||||
|
||||
item = QTableWidgetItem('qgis')
|
||||
self.tableWidget.setItem(i, 1, item)
|
||||
self.tableWidget.setRowCount(i + 1)
|
||||
itemIcon = QTableWidgetItem()
|
||||
icon = QIcon()
|
||||
icon.addPixmap(QtGui.QPixmap(resources_path('icons', 'mIconQgis.svg')), QIcon.Mode(0), QIcon.State(1))
|
||||
itemIcon.setIcon(icon)
|
||||
self.tableWidget.setItem(i, 0, itemIcon)
|
||||
|
||||
item = QTableWidgetItem(ProjectName[0])
|
||||
self.tableWidget.setItem(i, 2, item)
|
||||
item = QTableWidgetItem('qgis')
|
||||
self.tableWidget.setItem(i, 1, item)
|
||||
|
||||
item = QTableWidgetItem(Project[0])
|
||||
self.tableWidget.setItem(i, 3, item)
|
||||
item = QTableWidgetItem(ProjectName[0])
|
||||
self.tableWidget.setItem(i, 2, item)
|
||||
|
||||
i = i + 1
|
||||
item = QTableWidgetItem(Project[0])
|
||||
self.tableWidget.setItem(i, 3, item)
|
||||
|
||||
self.tableWidget.setColumnWidth(0, 20)
|
||||
self.tableWidget.setColumnWidth(1, 70)
|
||||
self.tableWidget.setColumnWidth(2, 300)
|
||||
self.tableWidget.setColumnWidth(3, 300)
|
||||
self.tableWidget.setHorizontalHeaderLabels(["Type", "Code", "Schema", "Table"])
|
||||
item = QTableWidgetItem(str(FavStatut))
|
||||
self.tableWidget.setItem(i, 4, item)
|
||||
self.tableWidget.setCellWidget(i, 4, self.FavButton)
|
||||
|
||||
i = i + 1
|
||||
|
||||
self.tableWidget.setColumnWidth(0, 20)
|
||||
self.tableWidget.setColumnWidth(1, 70)
|
||||
self.tableWidget.setColumnWidth(2, 300)
|
||||
self.tableWidget.setColumnWidth(3, 300)
|
||||
self.tableWidget.setColumnWidth(4, 20)
|
||||
self.tableWidget.setHorizontalHeaderLabels(["Type", "Code", "Schema", "Table", "Favorit"])
|
||||
|
||||
if self.lineEdit.text() != 'Recherche par mots-clés':
|
||||
self.filtre_dynamique(self.lineEdit.text())
|
||||
|
||||
def selection_flux(self):
|
||||
"""Ajoute une couche sélectionnée à la liste des flux à charger"""
|
||||
selected_row = 0
|
||||
selected_items = self.tableWidget.selectedItems()
|
||||
|
||||
# Assuming you want to compare items in the first column for uniqueness
|
||||
# svgTake = (selected_items[2].tableWidget().cellWidget(0,0))
|
||||
new_item_text = selected_items[3].text()
|
||||
|
||||
if not self.item_already_exists(new_item_text):
|
||||
@@ -397,14 +536,16 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
||||
|
||||
for column in range(self.tableWidget.columnCount()):
|
||||
cloned_item = selected_items[column].clone()
|
||||
self.tableWidget_2.setHorizontalHeaderLabels(["Type", "Code", "Schema", "Table"])
|
||||
self.tableWidget_2.setColumnCount(4)
|
||||
self.tableWidget_2.setHorizontalHeaderLabels(["Type", "Code", "Schema", "Table", "Favorit"])
|
||||
self.tableWidget_2.setColumnCount(5)
|
||||
self.tableWidget_2.setItem(selected_row, column, cloned_item)
|
||||
|
||||
self.tableWidget_2.setColumnWidth(0, 20)
|
||||
self.tableWidget_2.setColumnWidth(1, 70)
|
||||
self.tableWidget_2.setColumnWidth(2, 300)
|
||||
self.tableWidget_2.setColumnWidth(3, 300)
|
||||
self.tableWidget_2.setColumnWidth(4, 20)
|
||||
self.tableWidget_2.setColumnHidden(4, True)
|
||||
|
||||
def item_already_exists(self, new_item_text):
|
||||
# Assuming you want to compare items in the first column for uniqueness
|
||||
@@ -413,7 +554,8 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
||||
return len(existing_items) > 0
|
||||
|
||||
def limite_flux(self):
|
||||
|
||||
"""Vérifie le nombre de flux à charger et affiche un avertissement si > 5"""
|
||||
# Avertissement si plus de 5 couches sélectionnées (risque de performance)
|
||||
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(
|
||||
@@ -428,26 +570,8 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
||||
if self.tableWidget_2.rowCount() <= 5:
|
||||
self.chargement_flux()
|
||||
|
||||
"""
|
||||
def openPostGIS(self, schema, table):
|
||||
uri = QgsDataSourceUri()
|
||||
uri.setConnection(host, port, sigdb, user, mdp)
|
||||
|
||||
if (schema + '.' + table) in LRasterList:
|
||||
uri.setDataSource(schema, table, "rast")
|
||||
uri.setKeyColumn('rid')
|
||||
uri.setSrid('2154')
|
||||
layer = QgsRasterLayer(uri.uri(), table, "postgresraster")
|
||||
else:
|
||||
uri.setDataSource(schema, table, "geom")
|
||||
uri.setKeyColumn('gid')
|
||||
uri.setSrid('2154')
|
||||
layer = QgsVectorLayer(uri.uri(), table, "postgres")
|
||||
# Ajout de la couche au canevas QGIS
|
||||
QgsProject.instance().addMapLayer(layer)
|
||||
"""
|
||||
|
||||
def chargement_flux(self):
|
||||
"""Charge les couches sélectionnées dans QGIS"""
|
||||
managerAU = QgsApplication.authManager()
|
||||
managerAU.availableAuthMethodConfigs().keys()
|
||||
|
||||
@@ -461,9 +585,7 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
||||
}
|
||||
return switcher.get(type, "nothing")
|
||||
|
||||
# def displayOnWindows(type, uri, name):
|
||||
# p = []
|
||||
|
||||
# Vérification de la présence de l'extension PostGIS Raster
|
||||
SQLloadRaster = """SELECT concat(r_table_schema,'.',r_table_name) from public.raster_columns; """
|
||||
SQLextension = """SELECT count(extname) FROM pg_catalog.pg_extension WHERE extname LIKE 'postgis_raster';"""
|
||||
|
||||
@@ -480,10 +602,10 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
||||
for rasterFind in list_raster:
|
||||
RasterList.append(rasterFind[0])
|
||||
|
||||
# Chargement de chaque couche sélectionnée
|
||||
for row in range(0, self.tableWidget_2.rowCount()):
|
||||
color_rgba_db = 855030089
|
||||
color_rgba_droit = 851150528
|
||||
print(self.tableWidget_2.item(row, 1).background().color().rgba())
|
||||
color_rgba_db = 855030089 # Code couleur pour couche dans autre BD
|
||||
color_rgba_droit = 851150528 # Code couleur pour droits insuffisants
|
||||
if self.tableWidget_2.item(row, 1).background().color().rgba() == color_rgba_droit:
|
||||
self.QMBquestion = QMessageBox.question(iface.mainWindow(), u"Attention !", "Vous ne disposez pas des droit pour la couche «" + str(self.tableWidget_2.item(row, 1).text()) + ' ' + str(self.tableWidget_2.item(row, 2).text()) + "» !", QMessageBox.StandardButton(0x00004000))
|
||||
elif self.tableWidget_2.item(row, 1).background().color().rgba() != color_rgba_db:
|
||||
@@ -503,36 +625,33 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
||||
code = self.tableWidget_2.item(row, 1).text()
|
||||
schema = self.tableWidget_2.item(row, 2).text()
|
||||
table = self.tableWidget_2.item(row, 3).text()
|
||||
# .split("?", 1)[0]
|
||||
# Configuration de l'URI de connexion PostGIS
|
||||
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
|
||||
|
||||
# Chargement selon le type de couche (raster, vecteur ou projet QGIS)
|
||||
if (schema + '.' + table) in RasterList:
|
||||
# Chargement d'une couche raster
|
||||
uri.setDataSource(schema, table, "rast")
|
||||
uri.setKeyColumn('rid')
|
||||
uri.setSrid('2154')
|
||||
uri.setKeyColumn('rid') # Clé primaire pour les rasters
|
||||
uri.setSrid('2154') # Lambert 93
|
||||
layer = QgsRasterLayer(uri.uri(), table, "postgresraster")
|
||||
QgsProject.instance().addMapLayer(layer)
|
||||
elif code == 'qgis':
|
||||
# Chargement d'un projet QGIS stocké dans la base de données
|
||||
schema = self.tableWidget_2.item(row, 2).text()
|
||||
print(schema)
|
||||
table = self.tableWidget_2.item(row, 3).text()
|
||||
uri_project = 'postgresql://' + user + ':' + mdp + '@' + host + ':' + port + '?sslmode=disable&dbname=' + dbtype + "&schema=" + schema + '&project=' + table
|
||||
QgsProject.instance().read(uri_project)
|
||||
else:
|
||||
uri.setDataSource(schema, table, "geom")
|
||||
uri.setKeyColumn('gid')
|
||||
# Chargement d'une couche vecteur
|
||||
uri.setDataSource(schema, table, "geom") # Colonne géométrie
|
||||
uri.setKeyColumn('gid') # Clé primaire
|
||||
|
||||
# Chargement de la couche PostGIS
|
||||
# Détection du type de géométrie
|
||||
geom_type = 'SELECT right(st_geometrytype(geom),-3) as a FROM ' + schema + '.' + table + ' GROUP BY a'
|
||||
try:
|
||||
cur.execute(geom_type)
|
||||
list_typegeom = cur.fetchall()
|
||||
UndefinedTable = True
|
||||
except psycopg2.errors.UndefinedTable:
|
||||
print("Error table name")
|
||||
list_typegeom = ''
|
||||
UndefinedTable = False
|
||||
cur.execute(geom_type)
|
||||
list_typegeom = cur.fetchall()
|
||||
if len(list_typegeom) > 1:
|
||||
for typegeom in list_typegeom:
|
||||
if typegeom[0] == 'MultiPolygon':
|
||||
@@ -553,16 +672,16 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
||||
# Ajout de la couche au canevas QGIS
|
||||
QgsProject.instance().addMapLayer(layer)
|
||||
else:
|
||||
if UndefinedTable:
|
||||
layer = QgsVectorLayer(uri.uri(), table, "postgres")
|
||||
# Ajout de la couche au canevas QGIS
|
||||
QgsProject.instance().addMapLayer(layer)
|
||||
else:
|
||||
self.QMBquestion = QMessageBox.question(iface.mainWindow(), u"Attention !", "La couche «" + str(self.tableWidget_2.item(row, 1).text()) + ' ' + str(self.tableWidget_2.item(row, 2).text()) + "» semble ne pas avoir le même nom dans la BD, merci de contacter votre administrateur pour régler le problème !", QMessageBox.StandardButton(0x00004000))
|
||||
layer = QgsVectorLayer(uri.uri(), table, "postgres")
|
||||
# Ajout de la couche au canevas QGIS
|
||||
QgsProject.instance().addMapLayer(layer)
|
||||
else:
|
||||
self.QMBquestion = QMessageBox.question(iface.mainWindow(), u"Attention !", "La couche «" + str(self.tableWidget_2.item(row, 1).text()) + ' ' + str(self.tableWidget_2.item(row, 2).text()) + "» ne ce trouve pas dans cette BD !", QMessageBox.StandardButton(0x00004000))
|
||||
|
||||
def combobox_custom(self):
|
||||
"""Remplit la liste déroulante des catégories selon la base de données sélectionnée"""
|
||||
global NoSignals
|
||||
NoSignals = 1 # Désactive temporairement les signaux pour éviter les boucles
|
||||
if dbtype == sigdb:
|
||||
self.toolButton.setEnabled(1)
|
||||
self.comboBox.clear()
|
||||
@@ -586,19 +705,65 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
||||
self.comboBox.addItem("toutes les catégories")
|
||||
for baxval in list_schema:
|
||||
self.comboBox.addItem(baxval[0])
|
||||
NoSignals = 0
|
||||
|
||||
def filtre_favorit(self, filter_fav):
|
||||
"""Active ou désactive le filtre des favoris"""
|
||||
if self.toolButton_2.text() == "0": # Activation du filtre
|
||||
self.toolButton_2.setText("1")
|
||||
self.toolButton_2.setDown(True)
|
||||
if self.lineEdit.text() != 'Recherche par mots-clés':
|
||||
self.filtre_dynamique(self.lineEdit.text())
|
||||
else:
|
||||
for i in range(self.tableWidget.rowCount()):
|
||||
item = self.tableWidget.item(i, 4)
|
||||
match = self.toolButton_2.text() not in item.text().lower()
|
||||
self.tableWidget.setRowHidden(i, match)
|
||||
elif self.toolButton_2.text() == "1":
|
||||
self.toolButton_2.setText("0")
|
||||
self.toolButton_2.setDown(False)
|
||||
if self.lineEdit.text() != 'Recherche par mots-clés':
|
||||
self.filtre_dynamique(self.lineEdit.text())
|
||||
else:
|
||||
for i in range(self.tableWidget.rowCount()):
|
||||
self.tableWidget.setRowHidden(i, False)
|
||||
|
||||
def filtre_dynamique(self, filter_text):
|
||||
"""Filtre dynamique des couches selon le texte saisi"""
|
||||
# Remplacement des espaces par des underscores pour la recherche
|
||||
if filter_text.find(' ') >= 0:
|
||||
filter_text = filter_text.replace(" ", "_")
|
||||
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()
|
||||
if match is False:
|
||||
if self.toolButton_2.text() == "1":
|
||||
item = self.tableWidget.item(i, 4)
|
||||
match = self.toolButton_2.text() not in item.text().lower()
|
||||
self.tableWidget.setRowHidden(i, match)
|
||||
if not match:
|
||||
break
|
||||
|
||||
def getCanevas(self):
|
||||
"""Filtre les couches selon l'emprise du canevas QGIS actuel"""
|
||||
|
||||
# Récupération de la liste des favoris de l'utilisateur
|
||||
SQLFavTable = "SELECT concat(schema_name, '.', table_name) FROM admin_sig.favtable WHERE utilisateur LIKE '" + user + "';"
|
||||
if dbtype == refdb:
|
||||
conSIG = psycopg2.connect("host=" + host + " port=" + port + " dbname=" + sigdb + " user=" + user + " password=" + mdp)
|
||||
curSIG = conSIG.cursor(cursor_factory=psycopg2.extras.DictCursor)
|
||||
curSIG.execute(SQLFavTable)
|
||||
list_fav = curSIG.fetchall()
|
||||
conSIG.close()
|
||||
else:
|
||||
cur.execute(SQLFavTable)
|
||||
list_fav = cur.fetchall()
|
||||
FavList = []
|
||||
for favFind in list_fav:
|
||||
FavList.append(favFind[0])
|
||||
|
||||
# Récupération de l'emprise du canevas
|
||||
poly = iface.mapCanvas().extent()
|
||||
geom = (str(poly.xMinimum()) + ',' + str(poly.yMinimum()) + ',' + str(poly.xMaximum()) + ',' + str(poly.yMaximum()))
|
||||
|
||||
@@ -630,12 +795,28 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
||||
TableSomme = cur.fetchall()[0][0]
|
||||
|
||||
if e[0][1:3] != 'fo':
|
||||
schema_name = e[0][4:]
|
||||
DepName = QTableWidgetItem(e[0][1:3])
|
||||
SchemaName = QTableWidgetItem(e[0][4:])
|
||||
SchemaName = QTableWidgetItem(schema_name)
|
||||
else:
|
||||
schema_name = e[0][6:]
|
||||
DepName = QTableWidgetItem('form')
|
||||
SchemaName = QTableWidgetItem(e[0][6:])
|
||||
TableName = QTableWidgetItem(e[1][len(e[0]) + 1:])
|
||||
SchemaName = QTableWidgetItem(schema_name)
|
||||
table_name = e[1][len(e[0]) + 1:]
|
||||
TableName = QTableWidgetItem(table_name)
|
||||
|
||||
FavStatut = 0
|
||||
if (schema_name + '.' + table_name) not in FavList:
|
||||
FAV = "mStarIconAdd.png"
|
||||
FavStatut = 0
|
||||
else:
|
||||
FAV = "mStarIconDel.png"
|
||||
FavStatut = 1
|
||||
iconFav = QIcon()
|
||||
iconFav.addPixmap(QtGui.QPixmap(resources_path('icons', FAV)), QIcon.Mode(0), QIcon.State(1))
|
||||
self.FavButton = QPushButton(iconFav, "")
|
||||
self.FavButton.clicked.connect(self.AddOrDelToUserFav)
|
||||
|
||||
self.tableWidget.insertRow(row_count)
|
||||
|
||||
itemIcon = QTableWidgetItem()
|
||||
@@ -647,6 +828,9 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
||||
self.tableWidget.setItem(row_count, 1, DepName)
|
||||
self.tableWidget.setItem(row_count, 2, SchemaName)
|
||||
self.tableWidget.setItem(row_count, 3, TableName)
|
||||
item = QTableWidgetItem(str(FavStatut))
|
||||
self.tableWidget.setItem(row_count, 4, item)
|
||||
self.tableWidget.setCellWidget(row_count, 4, self.FavButton)
|
||||
if TableSomme == 0:
|
||||
for j in range(self.tableWidget.columnCount()):
|
||||
self.tableWidget.item(row_count, j).setBackground(QtGui.QColor(246, 185, 73, 50))
|
||||
@@ -662,7 +846,3 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
||||
new_object = new_object + '[' + str(obj_X[1]) + ',' + str(obj_X[0]) + '],'
|
||||
new_object = new_object[:-1] + ']'
|
||||
return (new_object)
|
||||
|
||||
# def popup(self):
|
||||
# self.dialog = Popup() # +++ - self
|
||||
# self.dialog.text_edit.show()
|
||||
|
||||
@@ -5,9 +5,10 @@
|
||||
[general]
|
||||
name=CenRa_FLUX
|
||||
qgisMinimumVersion=3.0
|
||||
qgisMaximumVersion=4.99
|
||||
supportsQt6=True
|
||||
description=Permet d'ouvrire une table dans la base PostGis
|
||||
version=3.14
|
||||
version=3.22
|
||||
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
|
||||
email=si_besoin@cen-rhonealpes.fr
|
||||
|
||||
@@ -32,7 +33,7 @@ icon=icon.png
|
||||
# experimental flag
|
||||
experimental=False
|
||||
|
||||
changelog=<h2>CenRa_FLUX:</h2></br><p><h3>08/12/2025 - Version 3.14: </h3> - message d'erreur pour les drois de couche sur la DB.</p></br><p><h3>08/12/2025 - Version 3.13: </h3> - Detection des droit utilisateur.</p></br><p><h3>25/09/2025 - Version 3.12: </h3> - version +1.</p></br><p><h3>25/09/2025 - Version 3.11: </h3> - Correctife sur les code 00.</p></br><p><h3>24/09/2025 - Version 3.10: </h3> - Erreur sur l ouverture des couche raster. </p></br><p><h3>24/09/2025 - Version 3.9: </h3> - bugfix lier aux extention pgsql.</p></br><p><h3>09/09/2025 - Version 3.8: </h3> - Bug REF fix.</p></br><p><h3>05/09/2025 - Version 3.7: </h3> - Ouverture de projet QGIS contenue dans la base de donnees.</p></br><p><h3>30/07/2025 - Version 3.6: </h3> - Correctife de bug.</p></br><p><h3>29/07/2025 - Version 3.5: </h3> - Bug fix sur les donnee raster.</p></br><p><h3>23/07/2025 - Version 3.4: </h3> - Ouverture raster dans la base SIG.</p></br><p><h3>23/07/2025 - Version 3.3: </h3> - Optimisation des chargement.</p></br><p><h3>22/07/2025 - Version 3.2: </h3> - Visualisation des format raster et vecteur dans REF.</p></br><p><h3>21/07/2025 - Version 3.1: </h3> - Bug fix pour l'ouverture de plus de 5 couches.</p></br><p><h3>19/05/2025 - Version 3.0: </h3> - Compatible PyQt5 et PyQt6.</p></br><p><h3>09/04/2025 - Version 2.9: </h3> - Correctif bug en TT.</p></br><p><h3>09/04/2025 - Version 2.8: </h3> - Optimisation pour le TT.</p></br><p><h3>07/04/2025 - Version 2.7: </h3> - mode debug.</p></br><p><h3>03/04/2025 - Version 2.6: </h3> - Mise a jour de securite.</p></br><p><h3>20/03/2025 - Version 2.5: </h3> - Visualisation distincte des couches ne se trouvant pas dans l'antenne.</p></br><p><h3>13/02/2025 - Version 2.4: </h3> - Ajoute redimensionnement et déplacement mollette.</p></br><p><h3>05/02/2025 - Version 2.3: </h3> - Bouton de visualisation des couches se trouvent uniquement dans le canva de la carte.</p></br><p><h3>07/01/2025 - Version 2.2: </h3> - ByPass du certif ssl ci erreur.</p></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>
|
||||
changelog=<h2>CenRa_FLUX:</h2></br><p><h3>23/03/2026 - Version 3.22: </h3> - Pache mineur.</p></br><p><h3>12/03/2026 - Version 3.21: </h3> - qgisMaximumVersion est 4.0.</p></br><p><h3>05/03/2026 - Version 3.20: </h3> - Visualisation des metadonnees avec un tooltip au survol de la couche.</p></br><p><h3>26/02/2026 - Version 3.19: </h3> - Visualisation des droits pour les vues materialisees.</p></br><p><h3>25/02/2026 - Version 3.18: </h3> - Filtre par secteur geographique compatible avec les favoris.</p></br><p><h3>12/02/2026 - Version 3.17: </h3> - Favorit dans la BD Ref.</p></br><p><h3>11/02/2026 - Version 3.16: </h3> - Creation de favori et visualisation.</p></br><p><h3>10/02/2026 - Version 3.15: </h3> - Sauvegarde la recherche.</p></br><p><h3>08/12/2025 - Version 3.14: </h3> - message d'erreur pour les drois de couche sur la DB.</p></br><p><h3>08/12/2025 - Version 3.13: </h3> - Detection des droit utilisateur.</p></br><p><h3>25/09/2025 - Version 3.12: </h3> - version +1.</p></br><p><h3>25/09/2025 - Version 3.11: </h3> - Correctife sur les code 00.</p></br><p><h3>24/09/2025 - Version 3.10: </h3> - Erreur sur l ouverture des couche raster. </p></br><p><h3>24/09/2025 - Version 3.9: </h3> - bugfix lier aux extention pgsql.</p></br><p><h3>09/09/2025 - Version 3.8: </h3> - Bug REF fix.</p></br><p><h3>05/09/2025 - Version 3.7: </h3> - Ouverture de projet QGIS contenue dans la base de donnees.</p></br><p><h3>30/07/2025 - Version 3.6: </h3> - Correctife de bug.</p></br><p><h3>29/07/2025 - Version 3.5: </h3> - Bug fix sur les donnee raster.</p></br><p><h3>23/07/2025 - Version 3.4: </h3> - Ouverture raster dans la base SIG.</p></br><p><h3>23/07/2025 - Version 3.3: </h3> - Optimisation des chargement.</p></br><p><h3>22/07/2025 - Version 3.2: </h3> - Visualisation des format raster et vecteur dans REF.</p></br><p><h3>21/07/2025 - Version 3.1: </h3> - Bug fix pour l'ouverture de plus de 5 couches.</p></br><p><h3>19/05/2025 - Version 3.0: </h3> - Compatible PyQt5 et PyQt6.</p></br><p><h3>09/04/2025 - Version 2.9: </h3> - Correctif bug en TT.</p></br><p><h3>09/04/2025 - Version 2.8: </h3> - Optimisation pour le TT.</p></br><p><h3>07/04/2025 - Version 2.7: </h3> - mode debug.</p></br><p><h3>03/04/2025 - Version 2.6: </h3> - Mise a jour de securite.</p></br><p><h3>20/03/2025 - Version 2.5: </h3> - Visualisation distincte des couches ne se trouvant pas dans l'antenne.</p></br><p><h3>13/02/2025 - Version 2.4: </h3> - Ajoute redimensionnement et déplacement mollette.</p></br><p><h3>05/02/2025 - Version 2.3: </h3> - Bouton de visualisation des couches se trouvent uniquement dans le canva de la carte.</p></br><p><h3>07/01/2025 - Version 2.2: </h3> - ByPass du certif ssl ci erreur.</p></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
|
||||
|
||||
@@ -2,13 +2,57 @@
|
||||
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;"""
|
||||
|
||||
schemaname_list_ref = """
|
||||
WITH TableList AS (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),
|
||||
TableDescription AS (SELECT
|
||||
schemaname,
|
||||
tablename,
|
||||
description
|
||||
FROM TableList
|
||||
LEFT JOIN pg_description ON objoid = (quote_ident(schemaname)||'.'||quote_ident(tablename))::regclass
|
||||
ORDER BY schemaname, tablename)
|
||||
SELECT * FROM TableDescription;
|
||||
"""
|
||||
|
||||
schemaname_list = """
|
||||
WITH
|
||||
TableList as (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),
|
||||
|
||||
ViewList as (SELECT
|
||||
schemaname,
|
||||
matviewname AS tablename
|
||||
FROM pg_catalog.pg_matviews
|
||||
ORDER BY schemaname,tablename),
|
||||
|
||||
TableAndView as (SELECT
|
||||
schemaname,
|
||||
tablename
|
||||
FROM TableList
|
||||
UNION SELECT schemaname,tablename FROM ViewList),
|
||||
|
||||
TableViewDescription as (SELECT
|
||||
schemaname,
|
||||
tablename,
|
||||
description
|
||||
FROM TableAndView
|
||||
LEFT JOIN pg_description ON objoid = (quote_ident(schemaname)||'.'||quote_ident(tablename))::regclass
|
||||
ORDER BY schemaname,tablename)
|
||||
|
||||
SELECT * FROM TableViewDescription;
|
||||
"""
|
||||
|
||||
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))"""
|
||||
|
||||
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 11 KiB |
@@ -155,7 +155,7 @@ def maj_verif(NAME):
|
||||
try:
|
||||
urllib.request.urlopen('https://google.com')
|
||||
binar = True
|
||||
except NameError:
|
||||
except urllib.error.URLError:
|
||||
binar = False
|
||||
if binar:
|
||||
try:
|
||||
|
||||
@@ -1,252 +0,0 @@
|
||||
<?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>
|
||||
@@ -386,6 +386,35 @@
|
||||
<string notr="true">background-color: rgba(255, 255, 255,0.50);</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QToolButton" name="toolButton_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>700</x>
|
||||
<y>130</y>
|
||||
<width>21</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
</widget>
|
||||
<zorder>commandLinkButton_2</zorder>
|
||||
<zorder>pushButton_2</zorder>
|
||||
<zorder>label</zorder>
|
||||
<zorder>tableWidget_2</zorder>
|
||||
<zorder>comboBox</zorder>
|
||||
<zorder>lineEdit</zorder>
|
||||
<zorder>toolButton</zorder>
|
||||
<zorder>tableWidget</zorder>
|
||||
<zorder>label_2</zorder>
|
||||
<zorder>label_3</zorder>
|
||||
<zorder>comboBox_2</zorder>
|
||||
<zorder>commandLinkButton</zorder>
|
||||
<zorder>checkBox</zorder>
|
||||
<zorder>DeBUG</zorder>
|
||||
<zorder>toolButton_2</zorder>
|
||||
<zorder>viewer</zorder>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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">
|
||||
<widget class="QDialog" name="CenRa_about_base">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@@ -13,10 +13,6 @@
|
||||
<property name="windowTitle">
|
||||
<string>Journal des modifications</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">
|
||||
@@ -38,7 +34,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>453</width>
|
||||
<height>570</height>
|
||||
<height>547</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
@@ -70,7 +66,7 @@
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::NoButton</set>
|
||||
<set>QDialogButtonBox::Close|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
|
After Width: | Height: | Size: 18 KiB |
@@ -31,8 +31,12 @@ from .tools.resources import (
|
||||
maj_verif,
|
||||
)
|
||||
pyperclip()
|
||||
from .dock import CenRa_Metabase
|
||||
from .editor import Metabase_Editor
|
||||
|
||||
try:
|
||||
from .dock import CenRa_Metabase
|
||||
from .editor import Metabase_Editor
|
||||
except NameError:
|
||||
print('404')
|
||||
|
||||
# from CenRa_Metabase.issues import CenRa_Issues
|
||||
|
||||
|
||||
@@ -5,9 +5,10 @@
|
||||
[general]
|
||||
name=CenRa_Metabase
|
||||
qgisMinimumVersion=3.0
|
||||
qgisMaximumVersion=4.99
|
||||
supportsQt6=True
|
||||
description=CenRa_METABASE
|
||||
version=0.3.1
|
||||
version=0.3.2
|
||||
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
|
||||
email=si_besoin@cen-rhonealpes.fr
|
||||
|
||||
@@ -22,7 +23,7 @@ tracker=https://gitea.cenra-outils.org/api/v1/repos/CEN-RA/Plugin_QGIS/issues
|
||||
|
||||
hasProcessingProvider=no
|
||||
# Uncomment the following line and add your changelog:
|
||||
changelog=<h2>CenRa_METABASE:</h2></br><p><h3>30/07/2025 - Version 0.3.1: </h3> - Correctife de bug.</p></br><p><h3>19/05/2025 - Version 0.3.0: </h3> - Compatible PyQt5 et PyQt6</p></br><p><h3>09/04/2025 - Version 0.2.3: </h3> - Correctif bug en TT.</p></br><p><h3>09/04/2025 - Version 0.2.2: </h3> - Optimisation pour le TT.</p></br><p><h3>03/04/2025 - Version 0.2.1: </h3> - Mise a jour de securite.</p></br><p><h3>07/01/2025 - Version 0.2.0: </h3> - Deployment sur serveur SIG.</p></br><p><h3>07/01/2025 - Version 0.1.6: </h3> - ByPass du certif ssl ci erreur</p></br><p><h3>19/12/2024 - Version 0.1.5: </h3> - Fix les problem de lenteur qu'en la base est down.</p></br><p><h3>12/12/2024 - Version 0.1.4: </h3> - Crash Fix .</p></br><p><h3>08/10/2024 - Version 0.1.3: </h3> - Lecture de métadonnée des flux WMS/WFS.</p></br><p><h3>07/10/2024 - Version 0.1.2: </h3> - Correctif de bug.</p></br><p><h3>03/10/2024 - Version 0.1.1: </h3> - Remonte la fênetre dans la pille.</p></br><p><h3>26/08/2024 - Version 0.1.0: </h3> - Lancement du plugin CenRa_Metabase </p>
|
||||
changelog=<h2>CenRa_METABASE:</h2></br><p><h3>12/03/2026 - Version 0.3.2: </h3> - qgisMaximumVersion est 4.0.</p></br><p><h3>30/07/2025 - Version 0.3.1: </h3> - Correctife de bug.</p></br><p><h3>19/05/2025 - Version 0.3.0: </h3> - Compatible PyQt5 et PyQt6</p></br><p><h3>09/04/2025 - Version 0.2.3: </h3> - Correctif bug en TT.</p></br><p><h3>09/04/2025 - Version 0.2.2: </h3> - Optimisation pour le TT.</p></br><p><h3>03/04/2025 - Version 0.2.1: </h3> - Mise a jour de securite.</p></br><p><h3>07/01/2025 - Version 0.2.0: </h3> - Deployment sur serveur SIG.</p></br><p><h3>07/01/2025 - Version 0.1.6: </h3> - ByPass du certif ssl ci erreur</p></br><p><h3>19/12/2024 - Version 0.1.5: </h3> - Fix les problem de lenteur qu'en la base est down.</p></br><p><h3>12/12/2024 - Version 0.1.4: </h3> - Crash Fix .</p></br><p><h3>08/10/2024 - Version 0.1.3: </h3> - Lecture de métadonnée des flux WMS/WFS.</p></br><p><h3>07/10/2024 - Version 0.1.2: </h3> - Correctif de bug.</p></br><p><h3>03/10/2024 - Version 0.1.1: </h3> - Remonte la fênetre dans la pille.</p></br><p><h3>26/08/2024 - Version 0.1.0: </h3> - Lancement du plugin CenRa_Metabase </p>
|
||||
|
||||
# Tags are comma separated with spaces allowed
|
||||
tags=python
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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">
|
||||
<widget class="QDialog" name="CenRa_about_base">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@@ -13,10 +13,6 @@
|
||||
<property name="windowTitle">
|
||||
<string>Journal des modifications</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">
|
||||
@@ -38,7 +34,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>453</width>
|
||||
<height>570</height>
|
||||
<height>547</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
@@ -70,7 +66,7 @@
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::NoButton</set>
|
||||
<set>QDialogButtonBox::Close|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -5,9 +5,10 @@
|
||||
[general]
|
||||
name=CenRa_PageRender
|
||||
qgisMinimumVersion=3.0
|
||||
qgisMaximumVersion=4.99
|
||||
supportsQt6=True
|
||||
description=CenRa_PageRender
|
||||
version=0.2.3
|
||||
version=0.2.5
|
||||
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
|
||||
email=si_besoin@cen-rhonealpes.fr
|
||||
|
||||
@@ -22,7 +23,7 @@ tracker=https://gitea.cenra-outils.org/api/v1/repos/CEN-RA/Plugin_QGIS/issues
|
||||
|
||||
hasProcessingProvider=no
|
||||
# Uncomment the following line and add your changelog:
|
||||
changelog=<h2>CenRa_PAGERENDER:</h2></br><p><h3>15/12/2025 - Version 0.2.3: </h3> - nouveau systeme de parametrage.</p></br><p><h3>12/12/2025 - Version 0.2.2: </h3> - bug sur le background.</p></br><p><h3>30/07/2025 - Version 0.2.1: </h3> - Correctife de bug.</p></br><p><h3>19/05/2025 - Version 0.2.0: </h3> - Compatible PyQt5 et PyQt6</p></br><p><h3>03/04/2025 - Version 0.1.6: </h3> - Mise a jour de securite.</p></br><p><h3>07/01/2025 - Version 0.1.5: </h3> - ByPass du certif ssl ci erreur.</br></p><p><h3>14/11/2024 - Version 0.1.4: </h3> - Implementation de la mollet. </br> - Implementation du dragging pour déplacer et modification de la taille </br></p></br><p><h3>08/11/2024 - Version 0.1.3: </h3> - Correctif de bug. </br><p><h3>21/10/2024 - Version 0.1.1: </h3> - Les match en if. </br> - Bouton de scroll et adaptation portrait.</p></br><p><h3>09/10/2024 - Version 0.1.0: </h3> - Création.</p>
|
||||
changelog=<h2>CenRa_PAGERENDER:</h2></br><p><h3>23/03/2026 - Version 0.2.5: </h3> - Pache mineur.</p></br><p><h3>12/03/2026 - Version 0.2.4: </h3> - qgisMaximumVersion est 4.0.</p></br><p><h3>15/12/2025 - Version 0.2.3: </h3> - nouveau systeme de parametrage.</p></br><p><h3>12/12/2025 - Version 0.2.2: </h3> - bug sur le background.</p></br><p><h3>30/07/2025 - Version 0.2.1: </h3> - Correctife de bug.</p></br><p><h3>19/05/2025 - Version 0.2.0: </h3> - Compatible PyQt5 et PyQt6</p></br><p><h3>03/04/2025 - Version 0.1.6: </h3> - Mise a jour de securite.</p></br><p><h3>07/01/2025 - Version 0.1.5: </h3> - ByPass du certif ssl ci erreur.</br></p><p><h3>14/11/2024 - Version 0.1.4: </h3> - Implementation de la mollet. </br> - Implementation du dragging pour déplacer et modification de la taille </br></p></br><p><h3>08/11/2024 - Version 0.1.3: </h3> - Correctif de bug. </br><p><h3>21/10/2024 - Version 0.1.1: </h3> - Les match en if. </br> - Bouton de scroll et adaptation portrait.</p></br><p><h3>09/10/2024 - Version 0.1.0: </h3> - Création.</p>
|
||||
|
||||
# Tags are comma separated with spaces allowed
|
||||
tags=python
|
||||
|
||||
@@ -147,7 +147,7 @@ def maj_verif(NAME):
|
||||
try:
|
||||
urllib.request.urlopen('https://google.com')
|
||||
binar = True
|
||||
except urllib.requests.URLError:
|
||||
except urllib.error.URLError:
|
||||
binar = False
|
||||
if binar:
|
||||
try:
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
<number>296</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QSlider" name="verticalSlider">
|
||||
@@ -100,7 +100,7 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="invertedAppearance">
|
||||
<bool>true</bool>
|
||||
@@ -118,12 +118,6 @@
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QFrame#frame{background-color: rgb(255, 255, 255, 170);}</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Shape::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Shadow::Raised</enum>
|
||||
</property>
|
||||
<widget class="QLabel" name="Carte">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
@@ -139,24 +133,9 @@
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgba(10, 10, 10, 50)</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Shape::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Shadow::Plain</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<property name="midLineWidth">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignCenter</set>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>5</number>
|
||||
</property>
|
||||
@@ -176,9 +155,6 @@
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgba(10, 10, 10, 50)</string>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Shadow::Plain</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
@@ -277,27 +253,12 @@
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgba(10, 10, 10, 50)</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Shape::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Shadow::Raised</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="midLineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTop|Qt::AlignmentFlag::AlignTrailing</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
@@ -364,27 +325,12 @@
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgba(10, 10, 10, 50)</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Shape::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Shadow::Raised</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="midLineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignRight|Qt::AlignmentFlag::AlignTop|Qt::AlignmentFlag::AlignTrailing</set>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
@@ -446,12 +392,6 @@
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QFrame#frame_2{background-color: rgb(255, 255, 255, 170);}</string>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Shape::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Shadow::Raised</enum>
|
||||
</property>
|
||||
<widget class="QTableWidget" name="tableWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
@@ -465,13 +405,13 @@
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
|
||||
<enum>Qt::ScrollBarAsNeeded</enum>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QAbstractScrollArea::SizeAdjustPolicy::AdjustToContentsOnFirstShow</enum>
|
||||
<enum>QAbstractScrollArea::AdjustIgnored</enum>
|
||||
</property>
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::EditTrigger::NoEditTriggers</set>
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="tabKeyNavigation">
|
||||
<bool>false</bool>
|
||||
@@ -483,19 +423,19 @@
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="dragDropMode">
|
||||
<enum>QAbstractItemView::DragDropMode::NoDragDrop</enum>
|
||||
<enum>QAbstractItemView::NoDragDrop</enum>
|
||||
</property>
|
||||
<property name="defaultDropAction">
|
||||
<enum>Qt::DropAction::IgnoreAction</enum>
|
||||
<enum>Qt::IgnoreAction</enum>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SelectionMode::SingleSelection</enum>
|
||||
<enum>QAbstractItemView::NoSelection</enum>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectionBehavior::SelectRows</enum>
|
||||
<enum>QAbstractItemView::SelectItems</enum>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
@@ -504,7 +444,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="textElideMode">
|
||||
<enum>Qt::TextElideMode::ElideMiddle</enum>
|
||||
<enum>Qt::ElideLeft</enum>
|
||||
</property>
|
||||
<property name="showGrid">
|
||||
<bool>true</bool>
|
||||
@@ -590,13 +530,13 @@
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
|
||||
<enum>Qt::ScrollBarAsNeeded</enum>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QAbstractScrollArea::SizeAdjustPolicy::AdjustToContentsOnFirstShow</enum>
|
||||
<enum>QAbstractScrollArea::AdjustIgnored</enum>
|
||||
</property>
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::EditTrigger::DoubleClicked</set>
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="tabKeyNavigation">
|
||||
<bool>false</bool>
|
||||
@@ -608,19 +548,19 @@
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="dragDropMode">
|
||||
<enum>QAbstractItemView::DragDropMode::NoDragDrop</enum>
|
||||
<enum>QAbstractItemView::NoDragDrop</enum>
|
||||
</property>
|
||||
<property name="defaultDropAction">
|
||||
<enum>Qt::DropAction::IgnoreAction</enum>
|
||||
<enum>Qt::IgnoreAction</enum>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SelectionMode::SingleSelection</enum>
|
||||
<enum>QAbstractItemView::NoSelection</enum>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectionBehavior::SelectRows</enum>
|
||||
<enum>QAbstractItemView::SelectItems</enum>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
@@ -629,7 +569,7 @@
|
||||
</size>
|
||||
</property>
|
||||
<property name="textElideMode">
|
||||
<enum>Qt::TextElideMode::ElideMiddle</enum>
|
||||
<enum>Qt::ElideLeft</enum>
|
||||
</property>
|
||||
<property name="showGrid">
|
||||
<bool>true</bool>
|
||||
@@ -707,16 +647,16 @@
|
||||
</font>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::FocusPolicy::NoFocus</enum>
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LayoutDirection::LeftToRight</enum>
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="inputMethodHints">
|
||||
<set>Qt::InputMethodHint::ImhNone</set>
|
||||
<set>Qt::ImhNone</set>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
@@ -741,7 +681,7 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::ButtonSymbols::NoButtons</enum>
|
||||
<enum>QAbstractSpinBox::UpDownArrows</enum>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string/>
|
||||
@@ -763,7 +703,7 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::ButtonSymbols::NoButtons</enum>
|
||||
<enum>QAbstractSpinBox::UpDownArrows</enum>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string/>
|
||||
@@ -812,9 +752,6 @@
|
||||
<property name="value">
|
||||
<number>40</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="invertedAppearance">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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">
|
||||
<widget class="QDialog" name="CenRa_about_base">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@@ -13,10 +13,6 @@
|
||||
<property name="windowTitle">
|
||||
<string>Journal des modifications</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">
|
||||
@@ -38,7 +34,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>453</width>
|
||||
<height>570</height>
|
||||
<height>547</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
@@ -70,7 +66,7 @@
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::NoButton</set>
|
||||
<set>QDialogButtonBox::Close|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -25,10 +25,12 @@ from .tools.resources import (
|
||||
)
|
||||
pyperclip()
|
||||
|
||||
from .postgis_editor import Postgis_Editor
|
||||
from .postgis_creator import Postgis_Creator
|
||||
from .postgis_rename import Postgis_Rename
|
||||
|
||||
try:
|
||||
from .postgis_editor import Postgis_Editor
|
||||
from .postgis_creator import Postgis_Creator
|
||||
from .postgis_rename import Postgis_Rename
|
||||
except NameError:
|
||||
print('Module introuvable...')
|
||||
|
||||
IPAddr = socket.gethostbyname(socket.gethostname())
|
||||
|
||||
@@ -101,19 +103,13 @@ class PgPostgis:
|
||||
self.postgis_rename = QAction(icon3, 'dossier_rename', None)
|
||||
self.toolBar.addAction(self.postgis_rename)
|
||||
self.postgis_rename.triggered.connect(self.open_rename)
|
||||
self.postgis_rename.setEnabled(False)
|
||||
self.postgis_rename.setVisible(0)
|
||||
|
||||
if os.environ['USERNAME'] == 'tlaveille' or os.environ['USERNAME'] == 'lpoulin' or os.environ['USERNAME'] == 'rclement':
|
||||
self.action_rename.setEnabled(True)
|
||||
self.postgis_rename.setEnabled(True)
|
||||
if os.access('N:/', os.R_OK):
|
||||
self.postgis_rename.setEnabled(True)
|
||||
self.postgis_rename.setVisible(1)
|
||||
else:
|
||||
self.action_rename.setEnabled(False)
|
||||
self.postgis_rename.setEnabled(False)
|
||||
self.postgis_rename.setVisible(0)
|
||||
|
||||
self.postgis_rename.setEnabled(False)
|
||||
if os.access('N:/', os.R_OK):
|
||||
self.postgis_rename.setEnabled(True)
|
||||
|
||||
def open_about_dialog(self):
|
||||
"""
|
||||
|
||||
@@ -11,9 +11,10 @@
|
||||
[general]
|
||||
name=CenRa_POSTGIS
|
||||
qgisMinimumVersion=3.0
|
||||
qgisMaximumVersion=4.99
|
||||
supportsQt6=True
|
||||
description=Permet de crée un dossier dans la base PostGis
|
||||
version=3.1
|
||||
version=3.3
|
||||
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
|
||||
email=si_besoin@cen-rhonealpes.fr
|
||||
|
||||
@@ -22,7 +23,7 @@ email=si_besoin@cen-rhonealpes.fr
|
||||
# Optional items:
|
||||
|
||||
# Uncomment the following line and add your changelog entries:
|
||||
changelog=<h2>CenRa_POSTGIS:</h2></br><p><h3>30/07/2025 - Version 3.1: </h3> - Correctife de bug.</p></br><p><h3>19/05/2025 - Version 3.0: </h3> - Compatible PyQt5 et PyQt6</p></br><p><h3>09/04/2025 - Version 2.9: </h3> - Correctif bug en TT.</p></br><p><h3>09/04/2025 - Version 2.8: </h3> - Optimisation pour le TT.</p></br><p><h3>03/04/2025 - Version 2.7: </h3> - Mise a jour de securite.</p></br><p><h3>12/02/2025 - Version 2.6: </h3> - InDev:renomé les schema et table.</p></br><p><h3>04/02/2025 - Version 2.5: </h3> - Correctif bug création de couche.</p></br><p><h3>23/01/2025 - Version 2.4: </h3> - Correctif sur les pkey.</p></br><p><h3>22/01/2025 - Version 2.3: </h3> - Correctif sur la creation de projet.</p></br><p><h3>21/01/2025 - Version 2.2: </h3> - Correctif sur la longeur des nom.</p></br><p><h3>07/01/2025 - Version 2.1: </h3> - ByPass du certif ssl ci erreur.</p></br><p><h3>22/10/2024 - Version 2.0:</h3>- Refont du code.</p>
|
||||
changelog=<h2>CenRa_POSTGIS:</h2></br><p><h3>23/03/2026 - Version 3.3: </h3> - Optimisation pour QGIS.</p></br><p><h3>12/03/2026 - Version 3.2: </h3> - qgisMaximumVersion est 4.0.</p></br><p><h3>30/07/2025 - Version 3.1: </h3> - Correctife de bug.</p></br><p><h3>19/05/2025 - Version 3.0: </h3> - Compatible PyQt5 et PyQt6</p></br><p><h3>09/04/2025 - Version 2.9: </h3> - Correctif bug en TT.</p></br><p><h3>09/04/2025 - Version 2.8: </h3> - Optimisation pour le TT.</p></br><p><h3>03/04/2025 - Version 2.7: </h3> - Mise a jour de securite.</p></br><p><h3>12/02/2025 - Version 2.6: </h3> - InDev:renomé les schema et table.</p></br><p><h3>04/02/2025 - Version 2.5: </h3> - Correctif bug création de couche.</p></br><p><h3>23/01/2025 - Version 2.4: </h3> - Correctif sur les pkey.</p></br><p><h3>22/01/2025 - Version 2.3: </h3> - Correctif sur la creation de projet.</p></br><p><h3>21/01/2025 - Version 2.2: </h3> - Correctif sur la longeur des nom.</p></br><p><h3>07/01/2025 - Version 2.1: </h3> - ByPass du certif ssl ci erreur.</p></br><p><h3>22/10/2024 - Version 2.0:</h3>- Refont du code.</p>
|
||||
|
||||
# tags are comma separated with spaces allowed
|
||||
tags=cenra, postgis, database
|
||||
|
||||
@@ -48,8 +48,8 @@ try:
|
||||
dbname = account[4]
|
||||
cur = account[7]
|
||||
con = account[8]
|
||||
except ValueError:
|
||||
print('')
|
||||
except NameError:
|
||||
print('Fails to login DB for account')
|
||||
|
||||
|
||||
class Postgis_Rename(QDialog, EDITOR_CLASS):
|
||||
|
||||
@@ -156,7 +156,7 @@ def maj_verif(NAME):
|
||||
# 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/latest/plugins.xml'
|
||||
# print(URL)
|
||||
# print(URL)
|
||||
version = qgis.utils.pluginMetadata(NAME, 'version')
|
||||
len_version = len(version)
|
||||
try:
|
||||
@@ -169,10 +169,10 @@ def maj_verif(NAME):
|
||||
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]
|
||||
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)
|
||||
except urllib.error.URLError:
|
||||
except NameError:
|
||||
print("error gitea version ssl")
|
||||
else:
|
||||
iface.messageBar().pushMessage("WiFi :", "Pas de connection à internet.", level=Qgis.Warning, duration=30)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?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">
|
||||
<widget class="QDialog" name="CenRa_about_base">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@@ -13,10 +13,6 @@
|
||||
<property name="windowTitle">
|
||||
<string>Journal des modifications</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">
|
||||
@@ -38,7 +34,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>453</width>
|
||||
<height>570</height>
|
||||
<height>547</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
@@ -70,7 +66,7 @@
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::NoButton</set>
|
||||
<set>QDialogButtonBox::Close|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -11,9 +11,10 @@
|
||||
[general]
|
||||
name=CenRa SICEN
|
||||
qgisMinimumVersion=3.0
|
||||
qgisMaximumVersion=4.99
|
||||
supportsQt6=True
|
||||
description=Filtre des données saisies dans SICEN et export d'une liste d'espèces.
|
||||
version=2.1
|
||||
version=2.2
|
||||
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
|
||||
email=si_besoin@cen-rhonealpes.fr
|
||||
|
||||
@@ -22,7 +23,7 @@ email=si_besoin@cen-rhonealpes.fr
|
||||
# Optional items:
|
||||
|
||||
# Uncomment the following line and add your changelog entries:
|
||||
changelog=<h2>CenRa_SICEN:</h2></br><p><h3>30/07/2025 - Version 2.1: </h3> - Correctife de bug.</p></br><p><h3>19/05/2025 - Version 2.0: </h3> - Compatible PyQt5 et PyQt6</p></br><p><h3>09/04/2025 - Version 1.11: </h3> - Correctif bug en TT.</p></br><p><h3>09/04/2025 - Version 1.10: </h3> - Optimisation pour le TT.</p></br><p><h3>03/04/2025 - Version 1.9: </h3> - Mise a jour de securite.</p></br><p><h3>07/01/2025 - Version 1.8: </h3> - ByPass du certif ssl ci erreur.</br></p><p><h3>13/09/2024 - Version 1.7:</h3> - Il est maintenant possible de sélectionné plusieurs entité pour le filtre par Emprise.</br>- Ajoute d'un changelog.</br>- Ajoute une vérification de mise à jour.</p>
|
||||
changelog=<h2>CenRa_SICEN:</h2></br><p><h3>12/03/2026 - Version 2.2: </h3> - qgisMaximumVersion est 4.0.</p></br><p><h3>30/07/2025 - Version 2.1: </h3> - Correctife de bug.</p></br><p><h3>19/05/2025 - Version 2.0: </h3> - Compatible PyQt5 et PyQt6</p></br><p><h3>09/04/2025 - Version 1.11: </h3> - Correctif bug en TT.</p></br><p><h3>09/04/2025 - Version 1.10: </h3> - Optimisation pour le TT.</p></br><p><h3>03/04/2025 - Version 1.9: </h3> - Mise a jour de securite.</p></br><p><h3>07/01/2025 - Version 1.8: </h3> - ByPass du certif ssl ci erreur.</br></p><p><h3>13/09/2024 - Version 1.7:</h3> - Il est maintenant possible de sélectionné plusieurs entité pour le filtre par Emprise.</br>- Ajoute d'un changelog.</br>- Ajoute une vérification de mise à jour.</p>
|
||||
|
||||
# tags are comma separated with spaces allowed
|
||||
tags=cenra, postgis, sicen
|
||||
|
||||
@@ -11,7 +11,7 @@ from qgis.PyQt.QtWidgets import QMenu, QAction, QFileDialog
|
||||
from qgis.PyQt.QtCore import QSettings, QTranslator, QCoreApplication, qVersion
|
||||
|
||||
# Initialize Qt resources from file resources.py
|
||||
from . import resources_rc
|
||||
# from . import resources_rc
|
||||
# Import the code for the dialog
|
||||
from .sicendialog import SICENDialog
|
||||
|
||||
@@ -22,21 +22,16 @@ import csv
|
||||
|
||||
from .forms.about_form import AboutDialog
|
||||
|
||||
# import psycopg2
|
||||
# import psycopg2.extras
|
||||
# import base64
|
||||
import socket
|
||||
import os
|
||||
|
||||
from .tools.resources import maj_verif, pyperclip
|
||||
from .tools.resources import maj_verif, pyperclip, resources_path
|
||||
pyperclip()
|
||||
try:
|
||||
from .tools.PythonSQL import login_base
|
||||
except ValueError:
|
||||
print('Pas de fichier PythonSQL')
|
||||
|
||||
# import sys
|
||||
|
||||
|
||||
class SICEN(object):
|
||||
|
||||
@@ -73,43 +68,43 @@ class SICEN(object):
|
||||
self.toolBar.setObjectName("SICEN")
|
||||
|
||||
# Create action that will start plugin configuration
|
||||
self.action = QAction(
|
||||
QIcon(":/plugins/sicen/sicen.png"),
|
||||
self.action_open = QAction(
|
||||
QIcon(resources_path("icon", "sicen.png")),
|
||||
u"Ouverture des données SICEN", self.iface.mainWindow())
|
||||
self.action.setEnabled(False)
|
||||
self.action_open.setEnabled(False)
|
||||
if os.access('N:/', os.R_OK):
|
||||
self.action.setEnabled(True)
|
||||
self.action_open.setEnabled(True)
|
||||
# connect the action to the run method
|
||||
self.action.triggered.connect(self.ouverture)
|
||||
self.action_open.triggered.connect(self.ouverture)
|
||||
|
||||
# Add toolbar button and menu item
|
||||
self.toolBar.addAction(self.action)
|
||||
self.iface.addPluginToMenu(u"SICEN", self.action)
|
||||
self.toolBar.addAction(self.action_open)
|
||||
self.iface.addPluginToMenu(u"SICEN", self.action_open)
|
||||
|
||||
# Create action that will start plugin configuration
|
||||
self.action = QAction(
|
||||
QIcon(":/plugins/sicen/sicen_export.png"),
|
||||
self.action_export = QAction(
|
||||
QIcon(resources_path("icon", "sicen_export.png")),
|
||||
u"Export liste d'espèces", self.iface.mainWindow())
|
||||
self.action.setEnabled(False)
|
||||
self.action_export.setEnabled(False)
|
||||
IPAddr = socket.gethostbyname(socket.gethostname())
|
||||
if IPAddr[0:11] == "100.100.100":
|
||||
self.action.setEnabled(True)
|
||||
self.action_export.setEnabled(True)
|
||||
elif IPAddr[0:9] == "192.168.0":
|
||||
self.action.setEnabled(True)
|
||||
self.action_export.setEnabled(True)
|
||||
elif IPAddr[0:9] == "192.168.1":
|
||||
self.action.setEnabled(True)
|
||||
self.action_export.setEnabled(True)
|
||||
# connect the action to the run method
|
||||
self.action.triggered.connect(self.export)
|
||||
self.action_export.triggered.connect(self.export)
|
||||
|
||||
# Add toolbar button and menu item
|
||||
self.toolBar.addAction(self.action)
|
||||
self.iface.addPluginToMenu(u"SICEN", self.action)
|
||||
self.toolBar.addAction(self.action_export)
|
||||
self.iface.addPluginToMenu(u"SICEN", self.action_export)
|
||||
|
||||
self.menu = QMenu()
|
||||
self.menu.setTitle(QCoreApplication.translate("SICEN", "&SICEN"))
|
||||
|
||||
self.sicen_ouverture = QAction(QIcon(":/plugins/SICEN/sicen.png"), QCoreApplication.translate("SICEN", u"Ouverture des données SICEN"), self.iface.mainWindow())
|
||||
self.sicen_export = QAction(QIcon(":/plugins/SICEN/sicen_export.png"), QCoreApplication.translate("SICEN", u"Export liste d'espèces"), self.iface.mainWindow())
|
||||
self.sicen_ouverture = QAction(QIcon(resources_path("icon", "sicen.png")), QCoreApplication.translate("SICEN", u"Ouverture des données SICEN"), self.iface.mainWindow())
|
||||
self.sicen_export = QAction(QIcon(resources_path("icon", "sicen_export.png")), QCoreApplication.translate("SICEN", u"Export liste d'espèces"), self.iface.mainWindow())
|
||||
|
||||
self.menu.addActions([self.sicen_ouverture, self.sicen_export])
|
||||
|
||||
@@ -127,8 +122,10 @@ class SICEN(object):
|
||||
|
||||
def unload(self):
|
||||
# Remove the plugin menu item and icon
|
||||
self.iface.removePluginMenu(u"&SICEN", self.action)
|
||||
self.iface.removeToolBarIcon(self.action)
|
||||
self.iface.removePluginMenu(u"&SICEN", self.action_open)
|
||||
self.iface.removeToolBarIcon(self.action_open)
|
||||
self.iface.removePluginMenu(u"&SICEN", self.action_export)
|
||||
self.iface.removeToolBarIcon(self.action_export)
|
||||
|
||||
# run method that performs all the real work
|
||||
def ouverture(self):
|
||||
|
||||
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
@@ -90,7 +90,7 @@ def resources_path(*args):
|
||||
:return: Absolute path to the resources folder.
|
||||
:rtype: str
|
||||
"""
|
||||
path = abspath(abspath(join(plugin_path(), "CenRa_COPIE\\tools")))
|
||||
path = abspath(abspath(join(plugin_path(), "CenRa_SICEN\\tools")))
|
||||
for item in args:
|
||||
path = abspath(join(path, item))
|
||||
return path
|
||||
|
||||
@@ -1,25 +1,27 @@
|
||||
<plugins>
|
||||
<pyqgis_plugin name="CenRa_POSTGIS" version="3.1">
|
||||
<pyqgis_plugin name="CenRa_POSTGIS" version="3.3">
|
||||
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
|
||||
<version>3.1</version>
|
||||
<version>3.3</version>
|
||||
<qgis_minimum_version>3.16</qgis_minimum_version>
|
||||
<qgis_maximum_version>4.99</qgis_maximum_version>
|
||||
<homepage>https://plateformesig.cenra-outils.org/</homepage>
|
||||
<file_name>CenRa_POSTGIS.zip</file_name>
|
||||
<icon>CEN-Rhone-Alpes.png</icon>
|
||||
<author_name>CEN-Rhone-Alpes</author_name>
|
||||
<download_url>https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/CenRa_POSTGIS.zip</download_url>
|
||||
<uploaded_by>CEN-Rhone-Alpes</uploaded_by>
|
||||
<create_date>2024-02-06</create_date>
|
||||
<update_date>2025-07-30</update_date>
|
||||
<create_date>2026-03-23</create_date>
|
||||
<update_date>2026-03-12</update_date>
|
||||
<experimental>False</experimental>
|
||||
<deprecated>False</deprecated>
|
||||
<tags>cenra,postgis</tags>
|
||||
</pyqgis_plugin>
|
||||
|
||||
<pyqgis_plugin name="CenRa_COPIE" version="3.1">
|
||||
<pyqgis_plugin name="CenRa_COPIE" version="3.2">
|
||||
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
|
||||
<version>3.1</version>
|
||||
<version>3.2</version>
|
||||
<qgis_minimum_version>3.16</qgis_minimum_version>
|
||||
<qgis_maximum_version>4.99</qgis_maximum_version>
|
||||
<homepage>https://plateformesig.cenra-outils.org/</homepage>
|
||||
<file_name>CenRa_COPIE.zip</file_name>
|
||||
<icon>CEN-Rhone-Alpes.png</icon>
|
||||
@@ -27,16 +29,17 @@
|
||||
<download_url>https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/CenRa_COPIE.zip</download_url>
|
||||
<uploaded_by>CEN-Rhone-Alpes</uploaded_by>
|
||||
<create_date>2024-02-06</create_date>
|
||||
<update_date>2025-07-30</update_date>
|
||||
<update_date>2026-03-12</update_date>
|
||||
<experimental>False</experimental>
|
||||
<deprecated>False</deprecated>
|
||||
<tags>cenra,copie</tags>
|
||||
</pyqgis_plugin>
|
||||
|
||||
<pyqgis_plugin name="CenRa_SICEN" version="2.1">
|
||||
<pyqgis_plugin name="CenRa_SICEN" version="2.2">
|
||||
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
|
||||
<version>2.1</version>
|
||||
<version>2.2</version>
|
||||
<qgis_minimum_version>3.16</qgis_minimum_version>
|
||||
<qgis_maximum_version>4.99</qgis_maximum_version>
|
||||
<homepage>https://plateformesig.cenra-outils.org/</homepage>
|
||||
<file_name>CenRa_SICEN.zip</file_name>
|
||||
<icon>CEN-Rhone-Alpes.png</icon>
|
||||
@@ -44,33 +47,35 @@
|
||||
<download_url>https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/CenRa_SICEN.zip</download_url>
|
||||
<uploaded_by>CEN-Rhone-Alpes</uploaded_by>
|
||||
<create_date>2024-02-06</create_date>
|
||||
<update_date>2025-07-30</update_date>
|
||||
<update_date>2026-03-12</update_date>
|
||||
<experimental>False</experimental>
|
||||
<deprecated>False</deprecated>
|
||||
<tags>cenra,sicen</tags>
|
||||
</pyqgis_plugin>
|
||||
|
||||
<pyqgis_plugin name="CenRa_FLUX" version="3.14">
|
||||
<pyqgis_plugin name="CenRa_FLUX" version="3.22">
|
||||
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
|
||||
<version>3.14</version>
|
||||
<version>3.22</version>
|
||||
<qgis_minimum_version>3.16</qgis_minimum_version>
|
||||
<qgis_maximum_version>4.99</qgis_maximum_version>
|
||||
<homepage>https://plateformesig.cenra-outils.org/</homepage>
|
||||
<file_name>CenRa_FLUX.zip</file_name>
|
||||
<icon>CEN-Rhone-Alpes.png</icon>
|
||||
<author_name>CEN-Rhone-Alpes</author_name>
|
||||
<download_url>https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/CenRa_FLUX.zip</download_url>
|
||||
<uploaded_by>CEN-Rhone-Alpes</uploaded_by>
|
||||
<create_date>2024-02-06</create_date>
|
||||
<update_date>2025-12-08</update_date>
|
||||
<create_date>2026-03-23</create_date>
|
||||
<update_date>2026-03-12</update_date>
|
||||
<experimental>False</experimental>
|
||||
<deprecated>False</deprecated>
|
||||
<tags>cenra,flux</tags>
|
||||
</pyqgis_plugin>
|
||||
|
||||
<pyqgis_plugin name="CenRa_METABASE" version="0.3.1">
|
||||
<pyqgis_plugin name="CenRa_METABASE" version="0.3.2">
|
||||
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
|
||||
<version>0.3.1</version>
|
||||
<version>0.3.2</version>
|
||||
<qgis_minimum_version>3.16</qgis_minimum_version>
|
||||
<qgis_maximum_version>4.99</qgis_maximum_version>
|
||||
<homepage>https://plateformesig.cenra-outils.org/</homepage>
|
||||
<file_name>CenRa_METABASE.zip</file_name>
|
||||
<icon>CEN-Rhone-Alpes.png</icon>
|
||||
@@ -78,16 +83,17 @@
|
||||
<download_url>https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/CenRa_METABASE.zip</download_url>
|
||||
<uploaded_by>CEN-Rhone-Alpes</uploaded_by>
|
||||
<create_date>2024-09-12</create_date>
|
||||
<update_date>2025-07-30</update_date>
|
||||
<update_date>2026-03-12</update_date>
|
||||
<experimental>True</experimental>
|
||||
<deprecated>False</deprecated>
|
||||
<tags>cenra,metabase</tags>
|
||||
</pyqgis_plugin>
|
||||
|
||||
<pyqgis_plugin name="CenRa_AUTOMAP" version="2.3">
|
||||
<pyqgis_plugin name="CenRa_AUTOMAP" version="2.9">
|
||||
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
|
||||
<version>2.3</version>
|
||||
<version>2.9</version>
|
||||
<qgis_minimum_version>3.16</qgis_minimum_version>
|
||||
<qgis_maximum_version>4.99</qgis_maximum_version>
|
||||
<homepage>https://plateformesig.cenra-outils.org/</homepage>
|
||||
<file_name>CenRa_AUTOMAP.zip</file_name>
|
||||
<icon>CEN-Rhone-Alpes.png</icon>
|
||||
@@ -95,24 +101,25 @@
|
||||
<download_url>https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/CenRa_AUTOMAP.zip</download_url>
|
||||
<uploaded_by>CEN-Rhone-Alpes</uploaded_by>
|
||||
<create_date>2024-09-25</create_date>
|
||||
<update_date>2025-12-15</update_date>
|
||||
<update_date>2026-03-12</update_date>
|
||||
<experimental>False</experimental>
|
||||
<deprecated>False</deprecated>
|
||||
<tags>cenra,mise en page,atlas</tags>
|
||||
</pyqgis_plugin>
|
||||
|
||||
<pyqgis_plugin name="CenRa_PAGERENDER" version="0.2.3">
|
||||
<pyqgis_plugin name="CenRa_PAGERENDER" version="0.2.5">
|
||||
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
|
||||
<version>0.2.3</version>
|
||||
<version>0.2.5</version>
|
||||
<qgis_minimum_version>3.16</qgis_minimum_version>
|
||||
<qgis_maximum_version>4.99</qgis_maximum_version>
|
||||
<homepage>https://plateformesig.cenra-outils.org/</homepage>
|
||||
<file_name>CenRa_PAGERENDER.zip</file_name>
|
||||
<icon>CEN-Rhone-Alpes.png</icon>
|
||||
<author_name>CEN-Rhone-Alpes</author_name>
|
||||
<download_url>https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/CenRa_PAGERENDER.zip</download_url>
|
||||
<uploaded_by>CEN-Rhone-Alpes</uploaded_by>
|
||||
<create_date>2024-10-09</create_date>
|
||||
<update_date>2025-12-15</update_date>
|
||||
<create_date>2026-03-23</create_date>
|
||||
<update_date>2026-03-12</update_date>
|
||||
<experimental>True</experimental>
|
||||
<deprecated>False</deprecated>
|
||||
<tags>cenra,mise en page,atlas</tags>
|
||||
@@ -122,6 +129,7 @@
|
||||
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
|
||||
<version>0.1.0</version>
|
||||
<qgis_minimum_version>3.16</qgis_minimum_version>
|
||||
<qgis_maximum_version>4.99</qgis_maximum_version>
|
||||
<homepage>https://plateformesig.cenra-outils.org/</homepage>
|
||||
<file_name>CenRa_gn2qgis.zip</file_name>
|
||||
<icon>CEN-Rhone-Alpes.png</icon>
|
||||
@@ -139,6 +147,7 @@
|
||||
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
|
||||
<version>0.1.0</version>
|
||||
<qgis_minimum_version>3.16</qgis_minimum_version>
|
||||
<qgis_maximum_version>4.99</qgis_maximum_version>
|
||||
<homepage>https://plateformesig.cenra-outils.org/</homepage>
|
||||
<file_name>BiodivAURA.zip</file_name>
|
||||
<icon>CEN-Rhone-Alpes.png</icon>
|
||||
|
||||