Compare commits

..
18 Commits
Author SHA1 Message Date
tlaveille c02da75f0b bug fix pg no raster_columnes views 2025-07-29 10:17:45 +02:00
tlaveille d4b181ff61 flake8 2025-07-28 16:53:26 +02:00
tlaveille 7a3814a429 flake8 2025-07-28 16:45:44 +02:00
tlaveille 1cd816c706 flake8 2025-07-28 16:23:25 +02:00
tlaveille 94cac31fbb Vue du type vecteur ou raster dans SIG 2025-07-23 16:15:28 +02:00
tlaveille 2690220a02 Vue du type vecteur ou raster dans SIG 2025-07-23 16:00:36 +02:00
tlaveille 3719456f04 Optimisation et Compatibiliter Qt6 2025-07-23 11:59:48 +02:00
tlaveille bea31c870b Ouverture de Raster en base psql 2025-07-22 16:55:07 +02:00
tlaveille 2d04e34ed2 Ouverture de Raster en base psql 2025-07-22 16:52:32 +02:00
tlaveille ac070f866e Nouvelle version 2025-07-21 11:48:35 +02:00
tlaveille 4851339008 Fix Erreur sur QMessageBox 2025-07-21 11:27:11 +02:00
tlaveille f2d11a64e4 PyQt5 & PyQt6 2025-05-19 15:38:35 +02:00
tlaveille 4c52c85efb v1.7 2025-05-19 14:03:49 +02:00
tlaveille 3ef37aa696 Plugin PyQt5 and PyQt6 compatible & CenRa_Copie bug fix 2025-05-19 14:00:58 +02:00
tlaveille 3b0758ea5c v1.6 2025-04-11 10:28:16 +02:00
tlaveille 852301a537 bug correctif 2025-04-11 10:26:02 +02:00
tlaveille b3451773be v1.6 2025-04-09 15:42:06 +02:00
tlaveille 72a4a8a7b7 Suite maj TT 2025-04-09 15:36:24 +02:00
46 changed files with 1323 additions and 1000 deletions
+12 -11
View File
@@ -11,7 +11,7 @@ from qgis.utils import iface
import qgis
#include <QSettings>
# include <QSettings>
'''
from pg_metadata.connection_manager import (
store_connections,
@@ -24,8 +24,9 @@ from pg_metadata.processing.provider import PgMetadataProvider
from pg_metadata.qgis_plugin_tools.tools.custom_logging import setup_logger
'''
import os
from qgis.PyQt.QtCore import QSettings
from .tools.resources import (
plugin_path,
# plugin_path,
resources_path,
pyperclip,
maj_verif,
@@ -36,7 +37,6 @@ from .canvas_editor import AutoMap_Editor
from .style_invoke import AutoMap_Style
from .about_form import AboutDialog
from PyQt5.QtCore import *
class PgAutoMap:
def __init__(self):
@@ -49,18 +49,18 @@ class PgAutoMap:
self.dock_action = None
self.help_action = None
plugin_dir = os.path.dirname(__file__)
end_find = plugin_dir.rfind('\\')+1
end_find = plugin_dir.rfind('\\') + 1
global NAME
NAME = plugin_dir[end_find:]
maj_verif(NAME)
# Display About window on first use
version = qgis.utils.pluginMetadata('CenRa_AUTOMAP','version')
version = qgis.utils.pluginMetadata('CenRa_AUTOMAP', 'version')
s = QSettings()
versionUse = s.value("automap/version", 1, type=str)
if str(versionUse) != str(version) :
if str(versionUse) != str(version):
s.setValue("automap/version", str(version))
print(versionUse,version)
print(versionUse, version)
self.open_about_dialog()
def initGui(self):
@@ -78,7 +78,7 @@ class PgAutoMap:
if not self.canvas_editor:
self.canvas_editor = AutoMap_Editor()
self.automap_action = QAction(icon, 'CenRa_AutoMap',None)
self.automap_action = QAction(icon, 'CenRa_AutoMap', None)
self.toolBar.addAction(self.automap_action)
self.automap_action.triggered.connect(self.open_editor)
@@ -86,7 +86,7 @@ class PgAutoMap:
self.style_dock = AutoMap_Style()
if os.environ['USERNAME'] == 'tlaveille' or os.environ['USERNAME'] == 'lpoulin' or os.environ['USERNAME'] == 'rclement':
iface.addDockWidget(Qt.LeftDockWidgetArea, self.style_dock)
iface.addDockWidget(Qt.DockWidgetArea(0x1), self.style_dock)
'''
if not self.locator_filter:
@@ -126,7 +126,8 @@ class PgAutoMap:
About dialog
"""
dialog = AboutDialog(iface)
dialog.exec_()
dialog.exec()
def open_help():
""" Open the online help. """
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
@@ -138,7 +139,7 @@ class PgAutoMap:
def unload(self):
""" Unload the plugin. """
if self.canvas_editor:
iface.removePluginMenu('CenRa_AutoMap',self.automap_action)
iface.removePluginMenu('CenRa_AutoMap', self.automap_action)
if self.provider:
QgsApplication.processingRegistry().removeProvider(self.provider)
+167 -157
View File
@@ -1,6 +1,6 @@
import logging
import os
from PyQt5.QtCore import QSettings
from collections import namedtuple
from enum import Enum
from functools import partial
@@ -44,7 +44,7 @@ from qgis.core import (
from qgis.PyQt.QtCore import QLocale, QUrl, QDateTime, Qt
from qgis.PyQt.QtGui import QDesktopServices, QIcon, QColor, QFont, QMovie
from qgis.PyQt.QtPrintSupport import QPrinter
from qgis.PyQt.QtWebKitWidgets import QWebPage
# from qgis.PyQt.QtWebKitWidgets import QWebPage
from qgis.PyQt.QtWidgets import (
QDialog,
QAction,
@@ -55,19 +55,22 @@ from qgis.PyQt.QtWidgets import (
QInputDialog,
QMenu,
QToolButton,
QTableWidget,
QTableWidget,
QTableWidgetItem,
QVBoxLayout,
)
from PyQt5 import QtGui
from PyQt5 import QtWidgets
from qgis.PyQt.QtCore import QSettings
from qgis.PyQt import QtGui, QtWidgets
from qgis.PyQt.QtXml import QDomDocument
from qgis.utils import iface
import glob
from .tools.resources import (
load_ui,
resources_path,
send_issues,
# send_issues,
)
from .issues import CenRa_Issues
@@ -80,48 +83,48 @@ url_ortho = 'http://tiles.craig.fr/ortho/service/?crs=EPSG:2154&featureCount=10&
url_mnt = 'http://tiles.craig.fr/mnt/crs=EPSG:2154&featureCount=10&format=image/png&layers=relief&maxHeight=256&maxWidth=256&styles=&url=http://tiles.craig.fr/mnt'
url_pente = 'http://tiles.craig.fr/mnt/crs=EPSG:2154&featureCount=10&format=image/png&layers=pente&maxHeight=256&maxWidth=256&styles=&url=http://tiles.craig.fr/mnt'
data_source = [
'CENRA',
'IGN',
'CRAIG',
'OpenStreetMap',
'Sandre',
'BRGM',
'MUSÉUM NATIONAL D’HISTOIRE NATURELLE',
"Muséum national d'Histoire naturelle",
'ONF',
'20xx LPO',
'ofb.gouv.fr',
'Stamen Design',
'MTES',
'MTES',
'FEDER',
'DREAL Auvergne-Rhône-Alpes',
'INSEE',
'DGFiP',
'Fédération des Conservatoires d’espaces naturels',
'Plan cadastral informatisé - Etalab - juillet 202X',
'Parcellaire Express - IGN - 202X',
'CENRA',
'IGN',
'CRAIG',
'OpenStreetMap',
'Sandre',
'BRGM',
'MUSÉUM NATIONAL D’HISTOIRE NATURELLE',
"Muséum national d'Histoire naturelle",
'ONF',
'20xx LPO',
'ofb.gouv.fr',
'Stamen Design',
'MTES',
'MTES',
'FEDER',
'DREAL Auvergne-Rhône-Alpes',
'INSEE',
'DGFiP',
'Fédération des Conservatoires d’espaces naturels',
'Plan cadastral informatisé - Etalab - juillet 202X',
'Parcellaire Express - IGN - 202X',
]
A4_size = {'Portrait':{'RIGHT':210,'LEFT':0,'TOP':0,'BOTTOM':297},'Landscape':{'RIGHT':297,'LEFT':0,'TOP':0,'BOTTOM':210}}
A3_size = {'Portrait':{'RIGHT':298,'LEFT':0,'TOP':0,'BOTTOM':420},'Landscape':{'RIGHT':420,'LEFT':0,'TOP':0,'BOTTOM':298}}
A4_size = {'Portrait': {'RIGHT': 210, 'LEFT': 0, 'TOP': 0, 'BOTTOM': 297}, 'Landscape': {'RIGHT': 297, 'LEFT': 0, 'TOP': 0, 'BOTTOM': 210}}
A3_size = {'Portrait': {'RIGHT': 298, 'LEFT': 0, 'TOP': 0, 'BOTTOM': 420}, 'Landscape': {'RIGHT': 420, 'LEFT': 0, 'TOP': 0, 'BOTTOM': 298}}
class AutoMap_Editor(QDialog, EDITOR_CLASS):
def __init__(self, parent=None):
_ = parent
super().__init__()
self.setupUi(self)
self.settings = QgsSettings()
self.s = QSettings()
self.setWindowIcon(QtGui.QIcon(resources_path('icons','icon.png')))
self.setWindowIcon(QtGui.QIcon(resources_path('icons', 'icon.png')))
path = ''
ix = 0
plugin_dir = str(os.path.dirname(os.path.abspath(__file__))).split(os.sep)
for i in plugin_dir[1:]:
ix = ix+1
path = path+'/'+i
self.tabWidget.setStyleSheet('background-image: url('+path+'/tools/bg/Capture.png);')
ix = ix + 1
path = path + '/' + i
# self.tabWidget.setStyleSheet('background-image: url('+path+'/tools/bg/Capture.png);')
self.verticalScrollBar.hide()
self.commandLinkButton.clicked.connect(self.chargement_qpt)
@@ -136,13 +139,12 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
self.CustomeLogo.clicked.connect(self.deflogoteck)
self.verticalScrollBar.valueChanged.connect(self.moveFrame)
## On ajoute le nom des templates à la liste déroulante de l'onglet "mises en page" :
# On ajoute le nom des templates à la liste déroulante de l'onglet "mises en page" :
mises_en_page = []
for filename in glob.glob(resources_path("mises_en_pages","*.py")):
for filename in glob.glob(resources_path("mises_en_pages", "*.py")):
mises_en_page.append(filename)
for i, filename in enumerate(mises_en_page):
nom_fichier = os.path.basename(filename)
self.comboBox.addItem(nom_fichier)
@@ -150,35 +152,35 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
self.template_parameters = {
'Carte_size': None,
'Carte_locals' : None,
'Carte_rotate':None,
'Carte_2_size' : None,
'Carte_2_locals' : None,
'Carte_2_rotate':None,
'Carte_locals': None,
'Carte_rotate': None,
'Carte_2_size': None,
'Carte_2_locals': None,
'Carte_2_rotate': None,
'Legande_size': None,
'Legande_locals': None,
'Legande_rotate':None,
'Legande_rotate': None,
'Arrow_size': None,
'Arrow_locals': None,
'Arrow_rotate':None,
'Arrow_rotate': None,
'Echelle_size': None,
'Echelle_locals': None,
'Echelle_rotate':None,
'Echelle_rotate': None,
'Logo_size': None,
'Logo_locals': None,
'Logo_rotate':None,
'Titre_size':None,
'Titre_locals':None,
'Titre_rotate':None,
'Sous_titre_size':None,
'Sous_titre_locals':None,
'Sous_titre_rotate':None,
'Logo_rotate': None,
'Titre_size': None,
'Titre_locals': None,
'Titre_rotate': None,
'Sous_titre_size': None,
'Sous_titre_locals': None,
'Sous_titre_rotate': None,
'Credit_size': None,
'Credit_locals': None,
'Credit_rotate':None,
'Credit_rotate': None,
'Source_size': None,
'Source_locals': None,
'Source_rotate':None,
'Source_rotate': None,
'Logo_2_size': None,
'Logo_2_locals': None,
'Logo_2_rotate': None,
@@ -194,23 +196,25 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
self.hide_source()
self.hide_atlas()
def wheelEvent(self,event):
def wheelEvent(self, event):
if (event.angleDelta().y() >= 1):
vsb = self.verticalScrollBar.value()+20
vsb = self.verticalScrollBar.value() + 20
else:
vsb = self.verticalScrollBar.value()-20
vsb = self.verticalScrollBar.value() - 20
self.verticalScrollBar.setValue(vsb)
def moveFrame(self):
self.frame.move(self.frame.x(),self.verticalScrollBar.value())
self.frame.move(self.frame.x(), self.verticalScrollBar.value())
def update_logo_library(self):
self.mComboBox_4.clear()
logo_library = []
custome_bibliotech = glob.glob(self.s.value("automap/logoteck", 1, type=str)+'*.*')
for l,logo_x in enumerate(custome_bibliotech):
logo_library.append(' '+os.path.basename(logo_x))
custome_bibliotech = glob.glob(self.s.value("automap/logoteck", 1, type=str) + '*.*')
for l, logo_x in enumerate(custome_bibliotech):
logo_library.append(' ' + os.path.basename(logo_x))
bibliotech = glob.glob(resources_path("logo_library","*.png"))
for l,logo_x in enumerate(bibliotech):
bibliotech = glob.glob(resources_path("logo_library", "*.png"))
for l, logo_x in enumerate(bibliotech):
logo_library.append(os.path.basename(logo_x))
self.mComboBox_4.addItems(sorted(logo_library))
@@ -218,7 +222,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
options = QFileDialog.Options()
options |= QFileDialog.ShowDirsOnly
folder = QFileDialog.getExistingDirectory(self, "Sélection du dossier parent", options=options)
return folder+'/'
return folder + '/'
def deflogoteck(self):
folder = self.select_file()
@@ -233,16 +237,20 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
try:
layout_subtitle = project_subtitle.layoutManager().layoutByName(self.comboBox_7.currentText())
self.lineEdit_3.setText(layout_subtitle.itemById("SubTitle").text())
except:
except NameError:
print("")
def load_ortho(self):
global myGroup,last_group
global myGroup, last_group
runing = False
try: myGroup
except NameError: runing = True
try: last_group
except NameError: last_group = ''
try:
myGroup
except NameError:
runing = True
try:
last_group
except NameError:
last_group = ''
if runing or (last_group != '' and last_group != 'ortho'):
layername = False
layerAll = QgsProject.instance().layerTreeRoot().children()
@@ -251,7 +259,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
if layeritem.name() == 'SuperFont':
myGroup = layerAll[xl]
layername = True
xl = xl+1
xl = xl + 1
if layername:
(QgsProject.instance().layerTreeRoot()).removeChildNode(myGroup)
runing = True
@@ -261,32 +269,36 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
myGroup = (QgsProject.instance().layerTreeRoot()).addGroup("SuperFont")
last_group = 'ortho'
#OSM_RASTER = QgsRasterLayer(url_osm, 'OpenStreetMap Backgound', 'wms')
# OSM_RASTER = QgsRasterLayer(url_osm, 'OpenStreetMap Backgound', 'wms')
ORTHO_RASTER = QgsRasterLayer(url_ortho, 'Orthophoto AURA', 'wms')
MNT_RASTER = QgsRasterLayer(url_mnt, 'MNT RGE Alti (<= 1:100000)', 'wms')
PENTE_RASTER = QgsRasterLayer(url_pente, 'Pente RGE Alti 0 à 90°(<= 1:100000)', 'wms')
#OSM_RASTER.loadNamedStyle(resources_path("font","osm_background.qml"))
ORTHO_RASTER.loadNamedStyle(resources_path("font","ortho_aura.qml"))
MNT_RASTER.loadNamedStyle(resources_path("font","mnt_alti.qml"))
# OSM_RASTER.loadNamedStyle(resources_path("font", "osm_background.qml"))
ORTHO_RASTER.loadNamedStyle(resources_path("font", "ortho_aura.qml"))
MNT_RASTER.loadNamedStyle(resources_path("font", "mnt_alti.qml"))
#QgsProject.instance().addMapLayer(OSM_RASTER,False)
QgsProject.instance().addMapLayer(ORTHO_RASTER,False)
QgsProject.instance().addMapLayer(MNT_RASTER,False)
QgsProject.instance().addMapLayer(PENTE_RASTER,False)
# QgsProject.instance().addMapLayer(OSM_RASTER,False)
QgsProject.instance().addMapLayer(ORTHO_RASTER, False)
QgsProject.instance().addMapLayer(MNT_RASTER, False)
QgsProject.instance().addMapLayer(PENTE_RASTER, False)
#myGroup.addLayer(OSM_RASTER)
# myGroup.addLayer(OSM_RASTER)
myGroup.addLayer(ORTHO_RASTER)
myGroup.addLayer(MNT_RASTER)
myGroup.addLayer(PENTE_RASTER)
def load_osm(self):
global myGroup,last_group
global myGroup, last_group
runing = False
try: myGroup
except NameError: runing = True
try: last_group
except NameError: last_group = ''
try:
myGroup
except NameError:
runing = True
try:
last_group
except NameError:
last_group = ''
if runing or (last_group != '' and last_group != 'osm'):
layername = False
layerAll = QgsProject.instance().layerTreeRoot().children()
@@ -295,7 +307,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
if layeritem.name() == 'SuperFont':
myGroup = layerAll[xl]
layername = True
xl = xl+1
xl = xl + 1
if layername:
(QgsProject.instance().layerTreeRoot()).removeChildNode(myGroup)
runing = True
@@ -305,21 +317,21 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
last_group = 'osm'
OSM_RASTER = QgsRasterLayer(url_osm, 'OpenStreetMap Backgound', 'wms')
#ORTHO_RASTER = QgsRasterLayer(url_ortho, 'Orthophoto AURA', 'wms')
# ORTHO_RASTER = QgsRasterLayer(url_ortho, 'Orthophoto AURA', 'wms')
MNT_RASTER = QgsRasterLayer(url_mnt, 'MNT RGE Alti (<= 1:100000)', 'wms')
PENTE_RASTER = QgsRasterLayer(url_pente, 'Pente RGE Alti 0 à 90°(<= 1:100000)', 'wms')
OSM_RASTER.loadNamedStyle(resources_path("font","osm_background.qml"))
#ORTHO_RASTER.loadNamedStyle(resources_path("font","ortho_aura.qml"))
MNT_RASTER.loadNamedStyle(resources_path("font","mnt_alti.qml"))
OSM_RASTER.loadNamedStyle(resources_path("font", "osm_background.qml"))
# ORTHO_RASTER.loadNamedStyle(resources_path("font","ortho_aura.qml"))
MNT_RASTER.loadNamedStyle(resources_path("font", "mnt_alti.qml"))
QgsProject.instance().addMapLayer(OSM_RASTER,False)
#QgsProject.instance().addMapLayer(ORTHO_RASTER,False)
QgsProject.instance().addMapLayer(MNT_RASTER,False)
QgsProject.instance().addMapLayer(PENTE_RASTER,False)
QgsProject.instance().addMapLayer(OSM_RASTER, False)
# QgsProject.instance().addMapLayer(ORTHO_RASTER,False)
QgsProject.instance().addMapLayer(MNT_RASTER, False)
QgsProject.instance().addMapLayer(PENTE_RASTER, False)
myGroup.addLayer(OSM_RASTER)
#myGroup.addLayer(ORTHO_RASTER)
# myGroup.addLayer(ORTHO_RASTER)
myGroup.addLayer(MNT_RASTER)
myGroup.addLayer(PENTE_RASTER)
@@ -361,6 +373,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
self.show_map()
else:
self.hide_map()
def show_map(self):
self.groupBox_3.setEnabled(True)
self.groupBox_3.show()
@@ -374,6 +387,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
self.show_titre()
else:
self.hide_titre()
def show_titre(self):
self.lineEdit_2.setEnabled(False)
self.lineEdit_2.hide()
@@ -391,6 +405,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
self.show_source()
else:
self.hide_source()
def show_source(self):
self.lineEdit_4.setEnabled(False)
self.lineEdit_4.hide()
@@ -423,7 +438,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
self.comboBox_4.clear()
if self.comboBox_2.currentText() != '':
layer = QgsProject.instance().mapLayersByName(self.comboBox_2.currentText())[0]
#BUG sur layer.fields() pas défini sur ce qui est pas vecteur
# BUG sur layer.fields() pas défini sur ce qui est pas vecteur
for vfields in layer.fields():
fields.append(vfields.name())
self.comboBox_3.addItems(sorted(fields))
@@ -439,11 +454,11 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
layout_name = self.lineEdit_2.text()
layouts_list = self.manager.printLayouts()
for filename in glob.glob(resources_path("mises_en_pages","*.qpt")):
for filename in glob.glob(resources_path("mises_en_pages", "*.qpt")):
with open(os.path.join(os.getcwd(), filename), 'r') as f:
self.layout = QgsPrintLayout(project)
self.layout.initializeDefaults()
myAtlas=self.layout.atlas()
myAtlas = self.layout.atlas()
template_content = f.read()
doc = QDomDocument()
doc.setContent(template_content)
@@ -453,10 +468,10 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
cutLayout = layout_name.index("")
except:
cutLayout = 0
if cutLayout >= 1:
self.layout.setName(layout_name)
titre_layout_name=layout_name[:cutLayout]
titre_layout_name = layout_name[:cutLayout]
else:
self.layout.setName(layout_name)
titre_layout_name = layout_name
@@ -469,11 +484,12 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
logo_div = A3_size['Portrait']['RIGHT']
if self.radioButton_5.isChecked() and self.radioButton_8.isChecked():
logo_div = A3_size['Portrait']['BOTTOM']
if True:#os.path.basename(filename) == "1. Modèle carto standard (consolidé).qpt":
# os.path.basename(filename) == "1. Modèle carto standard (consolidé).qpt":
if True:
self.actualisation_mise_en_page()
## Add map to layout
# Add map to layout
self.map_modele_test = QgsLayoutItemMap(self.layout)
# Charger une carte vide
self.map_modele_test.setRect(20, 20, 20, 20)
@@ -495,18 +511,18 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
if self.radioButton_12.isChecked() == 1:
self.position_map = QgsLayoutItemMap(self.layout)
self.position_map.setRect(20, 20, 20, 20)
self.position_map.setExtent(QgsRectangle(641552,6647386, 995856,6331104))
self.position_map.setExtent(QgsRectangle(641552, 6647386, 995856, 6331104))
self.position_map.setFollowVisibilityPreset(True)
self.position_map.setFollowVisibilityPresetName(self.comboBox_6.currentText())
self.position_map.setItemRotation(self.template_parameters['Carte_2_rotate'])
self.position_map.attemptResize(self.template_parameters['Carte_2_size'])
self.position_map.attemptMove(self.template_parameters['Carte_2_locals'])
self.position_map.overview().setLinkedMap(self.map_modele_test)
#overviewitem = QgsLayoutItemMapOverviewStack(self.position_map)
#map_overview = self.position_map.overview()
#map_overview.setLinkedMap(self.map_modele_test)
#map_overview.setCentered(True)
#overviewitem.addOverview(map_overview)
# overviewitem = QgsLayoutItemMapOverviewStack(self.position_map)
# map_overview = self.position_map.overview()
# map_overview.setLinkedMap(self.map_modele_test)
# map_overview.setCentered(True)
# overviewitem.addOverview(map_overview)
self.position_map.refresh()
self.map_modele_test.setFrameEnabled(True)
@@ -521,12 +537,12 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
self.layout.addLayoutItem(self.map_modele_test)
self.map_modele_test.setId("carte_principale")
## Ajout d'un titre à la mise en page
# Ajout d'un titre à la mise en page
title = QgsLayoutItemLabel(self.layout)
self.layout.addLayoutItem(title)
titre = titre_layout_name
title.setText(titre)
title.setFont(QFont("Calibri", 15, QFont.Bold))
title.setFont(QFont("Calibri", 15, False))
title.setItemRotation(self.template_parameters['Titre_rotate'])
title.attemptResize(self.template_parameters['Titre_size'])
title.attemptMove(self.template_parameters['Titre_locals'])
@@ -535,11 +551,10 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
title.setBackgroundColor(QColor(255, 255, 255, 130))
self.layout.addItem(title)
# title.adjustSizeToText() on n'utilise plutot setFixedSize pour pouvoir centrer le titre de manière plus optimale ici
title.setHAlign(Qt.AlignHCenter)
title.setVAlign(Qt.AlignVCenter)
title.setHAlign(Qt.AlignmentFlag(0x0004))
title.setVAlign(Qt.AlignmentFlag(0x0080))
## Ajout d'un sous titre à la mise en page
# Ajout d'un sous titre à la mise en page
subtitle = QgsLayoutItemLabel(self.layout)
self.layout.addLayoutItem(subtitle)
titre = self.lineEdit_3.text()
@@ -554,23 +569,21 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
subtitle.setBackgroundEnabled(True)
subtitle.setBackgroundColor(QColor(255, 255, 255, 130))
self.layout.addItem(subtitle)
subtitle.setHAlign(Qt.AlignHCenter)
subtitle.setVAlign(Qt.AlignVCenter)
subtitle.setHAlign(Qt.AlignmentFlag(0x0004))
subtitle.setVAlign(Qt.AlignmentFlag(0x0080))
## Ajout du logo CEN NA en haut à gauche de la page
# Ajout du logo CEN NA en haut à gauche de la page
logo = QgsLayoutItemPicture(self.layout)
logo.setResizeMode(QgsLayoutItemPicture.Zoom)
logo.setMode(QgsLayoutItemPicture.FormatRaster)
logo.setItemRotation(self.template_parameters['Logo_rotate'])
logo.setFixedSize(self.template_parameters['Logo_size'])
logo.attemptMove(self.template_parameters['Logo_locals'])
logo.setPicturePath(resources_path("icons","CEN_RA.png"))
logo.setPicturePath(resources_path("icons", "CEN_RA.png"))
logo.setId('logo')
self.layout.addLayoutItem(logo)
## Ajout de la legende :
# Ajout de la legende :
legend = QgsLayoutItemLegend(self.layout)
legend.setId('legende_model1')
@@ -615,7 +628,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
layertreelayer = root.findLayer(layer.id())
# get the parent of the layer tree layer (layer tree root, or group)
if layertreelayer != None:
if layertreelayer is not None:
parent = layertreelayer.parent()
# if the parent is a group and has a name, find it and remove the layer
@@ -626,7 +639,6 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
else:
root_group.removeLayer(layer)
legend.setEqualColumnWidth(True)
legend.setSplitLayer(True)
legend.setColumnSpace(5)
@@ -643,7 +655,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
legend.updateLegend()
legend.attemptMove(self.template_parameters['Legande_locals'])
## Ajout de l'échelle numeric à la mise en page
# Ajout de l'échelle numeric à la mise en page
self.scalebarnumeric_qpt = QgsLayoutItemScaleBar(self.layout)
self.scalebarnumeric_qpt.setStyle('Numeric')
self.scalebarnumeric_qpt.setLinkedMap(self.map_modele_test)
@@ -663,7 +675,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
self.layout.addLayoutItem(self.scalebarnumeric_qpt)
## Ajout de l'échelle à la mise en page
# Ajout de l'échelle à la mise en page
self.scalebar_qpt = QgsLayoutItemScaleBar(self.layout)
self.scalebar_qpt.setStyle('Single Box')
self.scalebar_qpt.setLinkedMap(self.map_modele_test)
@@ -686,7 +698,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
# ajout de la fleche du Nord
north = QgsLayoutItemPicture(self.layout)
north.setPicturePath(resources_path("mises_en_pages","NorthArrow_02.svg"))
north.setPicturePath(resources_path("mises_en_pages", "NorthArrow_02.svg"))
self.layout.addLayoutItem(north)
north.attemptMove(self.template_parameters['Arrow_locals'])
north.attemptResize(self.template_parameters['Arrow_size'])
@@ -697,30 +709,30 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
if self.radioButton_10.isChecked() == 1:
text_source = ' '
for Item_mComboBox_3 in self.mComboBox_3.checkedItems():
text_source = text_source+Item_mComboBox_3+','
text_source = text_source + Item_mComboBox_3 + ','
text_source = text_source[:-1]
info_text = ["Source :" + text_source][0]
else:
info_text = ["Source : " + self.lineEdit_4.text()][0]
# ajout note info:
if self.radioButton_14.isChecked() == 1:
self.s.setValue("automap/prenom_nom",self.lineEdit_5.text())
self.s.setValue("automap/prenom_nom", self.lineEdit_5.text())
prenom_nom = self.s.value("automap/prenom_nom", 1, type=str)
info = ["Réalisation : " + "CEN Rhône-Alpes (" + date.today().strftime("%d/%m/%Y") + ") par "+prenom_nom]
info = ["Réalisation : " + "CEN Rhône-Alpes (" + date.today().strftime("%d/%m/%Y") + ") par " + prenom_nom]
else:
info = ["Réalisation : " + "CEN Rhône-Alpes (" + date.today().strftime("%d/%m/%Y") + ")"]
credit_text = QgsLayoutItemLabel(self.layout)
credit_text.setText(info[0])
credit_text.setFont(QFont("Calibri", 9))
credit_text.setHAlign(Qt.AlignRight)
credit_text.setVAlign(Qt.AlignVCenter)
credit_text.setHAlign(Qt.AlignmentFlag(0x0002))
credit_text.setVAlign(Qt.AlignmentFlag(0x0080))
credit_text.setBackgroundEnabled(True)
credit_text.setBackgroundColor(QColor(255, 255, 255, 130))
credit_text2 = QgsLayoutItemLabel(self.layout)
credit_text2.setText(info_text)
credit_text2.setFont(QFont("Calibri", 9))
credit_text2.setHAlign(Qt.AlignRight)
credit_text2.setVAlign(Qt.AlignVCenter)
credit_text2.setHAlign(Qt.AlignmentFlag(0x0002))
credit_text2.setVAlign(Qt.AlignmentFlag(0x0080))
credit_text.setItemRotation(self.template_parameters['Credit_rotate'])
credit_text.attemptResize(self.template_parameters['Credit_size'])
credit_text.attemptMove(self.template_parameters['Credit_locals'])
@@ -732,7 +744,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
self.layout.addLayoutItem(credit_text)
self.layout.addLayoutItem(credit_text2)
## Ajout du logo credit en bas à droit de la page
# Ajout du logo credit en bas à droit de la page
len_item = (len(self.mComboBox_4.checkedItems()))
for logo_run in self.mComboBox_4.checkedItems():
logo_credit = QgsLayoutItemPicture(self.layout)
@@ -740,14 +752,15 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
logo_credit.setMode(QgsLayoutItemPicture.FormatRaster)
cur_x = self.template_parameters['Logo_2_locals'].x()
logo_credit.attemptMove(self.template_parameters['Logo_2_locals'])
logo_credit.setPictureAnchor(4)
self.template_parameters['Logo_2_locals'].setX(cur_x+(logo_div/len_item))
print(logo_credit.pictureAnchor())
# logo_credit.setPictureAnchor(4)
self.template_parameters['Logo_2_locals'].setX(cur_x + (logo_div / len_item))
logo_credit.setFixedSize(self.template_parameters['Logo_2_size'])
if logo_run[0] == ' ':
logo_credit.setPicturePath(self.s.value("automap/logoteck", 1, type=str)+logo_run[1:])
logo_credit.setPicturePath(self.s.value("automap/logoteck", 1, type=str) + logo_run[1:])
else:
logo_credit.setPicturePath(resources_path("logo_library",logo_run))
logo_credit.setId('logo_'+logo_run)
logo_credit.setPicturePath(resources_path("logo_library", logo_run))
logo_credit.setId('logo_' + logo_run)
logo_credit.setBackgroundEnabled(True)
logo_credit.setBackgroundColor(QColor(255, 255, 255, 130))
self.layout.addLayoutItem(logo_credit)
@@ -760,35 +773,33 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
if existing_layout:
self.QMBquestion = QMessageBox()
self.QMBquestion.setWindowTitle(u"Attention !")
self.QMBquestion.setIcon(QMessageBox.Warning)
self.QMBquestion.setText("Mise en page existente, la mise en page vas être écraser !")
self.QMBquestion.setStandardButtons(QMessageBox.Yes|QMessageBox.No)
self.QMBquestion.addButton(QPushButton('Autre mise en page'),QMessageBox.AcceptRole)
self.QMBquestion.setIcon(QMessageBox.Icon.Warning)
self.QMBquestion.setText("Mise en page existante, la mise en page va être écrasée !")
self.QMBquestion.setStandardButtons(QMessageBox.StandardButton(0x00004000) | QMessageBox.StandardButton(0x00010000))
self.QMBquestion.addButton(QPushButton('Autre mise en page'), QMessageBox.ButtonRole(0))
self.QMBquestion = self.QMBquestion.exec()
#if self.radioButton_12.isChecked() != 1:
if self.QMBquestion == QMessageBox.Yes:
# if self.radioButton_12.isChecked() != 1:
if self.QMBquestion == QMessageBox.StandardButton(0x00004000):
project.layoutManager().removeLayout(existing_layout)
result = project.layoutManager().addLayout(self.layout)
if self.QMBquestion == QMessageBox.AcceptRole:
LayoutCOUNT=0
elif self.QMBquestion != QMessageBox.StandardButton(0x00010000):
LayoutCOUNT = 0
arrayManager = []
for AddArrayManager in project.layoutManager().layouts():
arrayManager.append(AddArrayManager.name())
arrayManager.sort()
for LayoutNAME in arrayManager:
if LayoutNAME == layout_name:
LayoutCOUNT = LayoutCOUNT+1
if LayoutNAME == layout_name+""+str(LayoutCOUNT):
LayoutCOUNT=LayoutCOUNT+1
layout_name = (layout_name+""+str(LayoutCOUNT))
LayoutCOUNT = LayoutCOUNT + 1
if LayoutNAME == layout_name + "" + str(LayoutCOUNT):
LayoutCOUNT = LayoutCOUNT + 1
layout_name = (layout_name + "" + str(LayoutCOUNT))
self.layout.setName(layout_name)
else:
existing_layout = True
self.manager.addLayout(self.layout)
if self.radioButton_9.isChecked() == 1:
self.layout.atlas().setEnabled(True)
@@ -809,7 +820,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
except:
TryMessage = True
if TryMessage == True:
if TryMessage is True:
iface.openLayoutDesigner(layout_modifie)
self.close()
else:
@@ -839,15 +850,14 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
eval("exec('self.template_parameters = '+ values_page_import + '.fletch_canvas(self)')")
def bar_echelle_auto(self, echelle, bar_echelle):
if True:
if echelle.scale() >= 40000:
bar_echelle.setUnits(QgsUnitTypes.DistanceKilometers)
bar_echelle.setUnitLabel("km")
bar_echelle.setUnitsPerSegment(round((echelle.scale()*0.04)/1000))
bar_echelle.setUnitsPerSegment(round((echelle.scale() * 0.04) / 1000))
else:
bar_echelle.setUnits(QgsUnitTypes.DistanceMeters)
bar_echelle.setUnitLabel("m")
bar_echelle.setUnitsPerSegment(round(echelle.scale()*0.04))
bar_echelle.setUnitsPerSegment(round(echelle.scale() * 0.04))
bar_echelle.update()
+22 -17
View File
@@ -1,10 +1,4 @@
import os
plugin_dir = os.path.dirname(__file__)
end_find = plugin_dir.rfind('\\')+1
NAME = plugin_dir[end_find:]
#print(NAME)
from qgis.gui import *
from qgis.core import (
@@ -27,7 +21,7 @@ from qgis.PyQt.QtWidgets import (
QInputDialog,
QMenu,
QToolButton,
QTableWidget,
QTableWidget,
QTableWidgetItem,
)
from qgis.utils import iface
@@ -35,21 +29,27 @@ from qgis.utils import iface
from .tools.resources import (
load_ui,
resources_path,
# resources_path,
send_issues,
)
plugin_dir = os.path.dirname(__file__)
end_find = plugin_dir.rfind('\\') + 1
NAME = plugin_dir[end_find:]
# print(NAME)
EDITOR_CLASS = load_ui('CenRa_IssuesSend.ui')
class CenRa_Issues(QDialog, EDITOR_CLASS):
class CenRa_Issues(QDialog, EDITOR_CLASS):
def __init__(self, parent=None):
_ = parent
super().__init__()
self.setupUi(self)
self.settings = QgsSettings()
#place connect here
# place connect here
self.annuler_button.clicked.connect(self.close)
self.ok_button.clicked.connect(self.run_sendissues)
@@ -63,17 +63,22 @@ class CenRa_Issues(QDialog, EDITOR_CLASS):
statu_autre = self.check_autre.isChecked()
statu = []
if statu_bug == True : statu = statu + [1]
if statu_aide == True : statu = statu + [3]
if statu_question == True : statu = statu + [5]
if statu_amelioration == True : statu = statu + [2]
if statu_autre == True : statu = statu + [6]
if statu_bug is True:
statu = statu + [1]
if statu_aide is True:
statu = statu + [3]
if statu_question is True:
statu = statu + [5]
if statu_amelioration is True:
statu = statu + [2]
if statu_autre is True:
statu = statu + [6]
if len(statu) >= 1:
import qgis
url = qgis.utils.pluginMetadata(NAME,'tracker')
url = qgis.utils.pluginMetadata(NAME, 'tracker')
print(text_message)
send_info = send_issues(url,text_titre,text_message,statu)
send_info = send_issues(url, text_titre, text_message, statu)
code = send_info.status_code
print(code)
else:
+3 -2
View File
@@ -5,8 +5,9 @@
[general]
name=CenRa_AutoMap
qgisMinimumVersion=3.0
supportsQt6=True
description=CenRa_AutoMap
version=1.4
version=2.0
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
email=si_besoin@cen-rhonealpes.fr
@@ -21,7 +22,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>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>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
+8 -4
View File
@@ -1,6 +1,5 @@
import logging
import os
from PyQt5.QtCore import QSettings
from collections import namedtuple
from enum import Enum
from functools import partial
@@ -45,7 +44,6 @@ from qgis.core import (
from qgis.PyQt.QtCore import QLocale, QUrl, QDateTime, Qt
from qgis.PyQt.QtGui import QDesktopServices, QIcon, QColor, QFont, QMovie
from qgis.PyQt.QtPrintSupport import QPrinter
from qgis.PyQt.QtWebKitWidgets import QWebPage
from qgis.PyQt.QtWidgets import (
QDockWidget,
QAction,
@@ -61,8 +59,14 @@ from qgis.PyQt.QtWidgets import (
QVBoxLayout,
)
import psycopg2
from PyQt5 import QtGui
from PyQt5 import QtWidgets
try:
from PyQt5.QtCore import QSettings
from PyQt5 import QtGui
from PyQt5 import QtWidgets
except:
from PyQt6.QtCore import QSettings
from PyQt6 import QtGui
from PyQt6 import QtWidgets
from qgis.PyQt.QtXml import QDomDocument
from qgis.utils import iface
import glob
+3 -18
View File
@@ -29,9 +29,6 @@
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
@@ -41,7 +38,7 @@
<x>0</x>
<y>0</y>
<width>453</width>
<height>547</height>
<height>570</height>
</rect>
</property>
<widget class="QGroupBox" name="groupBox">
@@ -56,7 +53,7 @@
<property name="title">
<string>DevLog</string>
</property>
<widget class="QWebView" name="viewer" native="true">
<widget class="QTextBrowser" name="viewer">
<property name="geometry">
<rect>
<x>10</x>
@@ -65,11 +62,6 @@
<height>511</height>
</rect>
</property>
<property name="url" stdset="0">
<url>
<string>about:blank</string>
</url>
</property>
</widget>
</widget>
</widget>
@@ -78,19 +70,12 @@
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
<set>QDialogButtonBox::NoButton</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header location="global">QtWebKitWidgets/QWebView</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
+2 -2
View File
@@ -24,7 +24,7 @@ pyperclip()
from .copie_editor import Copie_Editor
from .about_form import AboutDialog
from PyQt5.QtCore import *
from qgis.PyQt.QtCore import *
class PgCopie:
def __init__(self):
@@ -78,7 +78,7 @@ class PgCopie:
About dialog
"""
dialog = AboutDialog(iface)
dialog.exec_()
dialog.exec()
def open_help():
""" Open the online help. """
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
+19 -7
View File
@@ -9,13 +9,19 @@ import qgis
from qgis.PyQt.QtCore import QSettings
from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog
from qgis.PyQt.QtGui import QIcon
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5 import QtGui
from qgis.PyQt.QtCore import *
from qgis.PyQt.QtGui import *
from qgis.PyQt import QtGui
from qgis.core import *
from qgis.core import QgsDataSourceUri
import os
from .tools.PythonSQL import login_base
try:
from .tools.PythonSQL import login_base
except:
print('Pas de fichier PythonSQL')
from .tools.SQLRequet import *
from .tools.resources import (
load_ui,
@@ -110,7 +116,7 @@ class Copie_Editor(QDialog, EDITOR_CLASS):
# show the dialog
self.show()
# Run the dialog event loop
result = self.exec_()
result = self.exec()
# See if OK was pressed
if result:
#******************************debut script*********************************
@@ -159,7 +165,6 @@ class Copie_Editor(QDialog, EDITOR_CLASS):
else :
SQL_table = "CREATE TABLE " + schema + "." + tablename + " AS SELECT * FROM " + source_schema + "." + source_tablename
SQL_pkey = "ALTER TABLE " + schema + "." + tablename + " ADD CONSTRAINT " + tablename + "_pkey" + " PRIMARY KEY (gid)"
SQL_sequence_01 = "CREATE SEQUENCE " + schema + "." + tablename + "_gid_seq" + " INCREMENT 1 MINVALUE 1 MAXVALUE 9223372036854775807 START 1 CACHE 1;"
SQL_sequence_02 = "ALTER TABLE " + schema + "." + tablename + " ALTER COLUMN gid SET DEFAULT nextval(\'" + schema + "." + tablename + "_gid_seq\'::regclass);"
@@ -170,7 +175,7 @@ class Copie_Editor(QDialog, EDITOR_CLASS):
SQL_trigger_area_ha = "CREATE TRIGGER area_ha" + tablename + " BEFORE INSERT OR UPDATE ON " + schema + "." + tablename + " FOR EACH ROW EXECUTE PROCEDURE ref.area_ha();"
SQL_trigger_length_m = "CREATE TRIGGER length_m" + tablename + " BEFORE INSERT OR UPDATE ON " + schema + "." + tablename + " FOR EACH ROW EXECUTE PROCEDURE ref.length_m();"
SQL_trigger_length_km = "CREATE TRIGGER length_km" + tablename + " BEFORE INSERT OR UPDATE ON " + schema + "." + tablename + " FOR EACH ROW EXECUTE PROCEDURE ref.length_km();"
SQL_trigger_coordonnees = "CREATE TRIGGER coordonnees" + tablename + " BEFORE INSERT OR UPDATE ON " + schema + "." + tablename + " FOR EACH ROW EXECUTE PROCEDURE ref.coordonnees();"
SQL_trigger_coordonnees = "CREATE TRIGGER coordonnees" + tablename + " BEFORE INSERT OR UPDATE ON " + schema + "." + tablename + " FOR EACH ROW EXECUTE PROCEDURE ref.coordonnees();"
cur.execute(SQL_table)
cur.execute(SQL_pkey)
@@ -179,6 +184,13 @@ class Copie_Editor(QDialog, EDITOR_CLASS):
cur.execute(SQL_sequence_03)
cur.execute(SQL_sequence_04)
RETURNE = "SELECT pg_get_serial_sequence('"+schema + "."+ tablename+"','gid')"
cur.execute(RETURNE)
sequence_name = cur.fetchone()[0]
print(sequence_name)
SQL_GRANT_TABLE="GRANT DELETE, INSERT, REFERENCES, SELECT, TRIGGER, TRUNCATE, UPDATE ON "+schema+"."+tablename+" TO grp_qgis;GRANT DELETE, INSERT, REFERENCES, SELECT, TRIGGER, TRUNCATE, UPDATE ON "+schema+"."+tablename+" TO grp_sig;GRANT ALL ON SEQUENCE "+sequence_name+" TO grp_qgis;"
cur.execute(SQL_GRANT_TABLE)
if layer.wkbType() == QgsWkbTypes.PointGeometry :
cur.execute(SQL_trigger_coordonnees)
+3 -2
View File
@@ -9,8 +9,9 @@
[general]
name=CenRA_COPIE
qgisMinimumVersion=3.0
supportsQt6=True
description=Permet la copie d'une table dans une base PostGis
version=2.2
version=3.0
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
email=si_besoin@cen-rhonealpes.fr
@@ -19,7 +20,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>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>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
+3 -18
View File
@@ -29,9 +29,6 @@
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
@@ -41,7 +38,7 @@
<x>0</x>
<y>0</y>
<width>453</width>
<height>547</height>
<height>570</height>
</rect>
</property>
<widget class="QGroupBox" name="groupBox">
@@ -56,7 +53,7 @@
<property name="title">
<string>DevLog</string>
</property>
<widget class="QWebView" name="viewer" native="true">
<widget class="QTextBrowser" name="viewer">
<property name="geometry">
<rect>
<x>10</x>
@@ -65,11 +62,6 @@
<height>511</height>
</rect>
</property>
<property name="url" stdset="0">
<url>
<string>about:blank</string>
</url>
</property>
</widget>
</widget>
</widget>
@@ -78,19 +70,12 @@
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
<set>QDialogButtonBox::NoButton</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header location="global">QtWebKitWidgets/QWebView</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
+13 -17
View File
@@ -4,27 +4,25 @@ __email__ = "info@3liz.org"
from qgis.core import QgsApplication
from qgis.PyQt.QtCore import QCoreApplication, Qt, QTranslator, QUrl
from qgis.PyQt.QtCore import QUrl, QSettings
from qgis.PyQt.QtGui import QDesktopServices, QIcon
from qgis.PyQt.QtWidgets import QAction, QMessageBox
from qgis.PyQt.QtWidgets import QAction
from qgis.utils import iface
import qgis
# include <QSettings>
#include <QSettings>
import socket
import os
from .tools.resources import (
plugin_path,
pyperclip,
resources_path,
maj_verif,
)
pyperclip()
from .flux_editor import Flux_Editor
from .about_form import AboutDialog
from PyQt5.QtCore import *
class PgFlux:
def __init__(self):
@@ -36,18 +34,18 @@ class PgFlux:
self.dock_action = None
self.help_action = None
plugin_dir = os.path.dirname(__file__)
end_find = plugin_dir.rfind('\\')+1
end_find = plugin_dir.rfind('\\') + 1
global NAME
NAME = plugin_dir[end_find:]
maj_verif(NAME)
# Display About window on first use
version = qgis.utils.pluginMetadata('CenRa_FLUX','version')
version = qgis.utils.pluginMetadata('CenRa_FLUX', 'version')
s = QSettings()
versionUse = s.value("flux/version", 1, type=str)
if str(versionUse) != str(version) :
if str(versionUse) != str(version):
s.setValue("flux/version", str(version))
print(versionUse,version)
print(versionUse, version)
self.open_about_dialog()
def initGui(self):
@@ -64,13 +62,11 @@ class PgFlux:
self.help_action.triggered.connect(self.open_help)
if not self.action_editor:
self.action_editor = Flux_Editor()
self.flux_editor = QAction(icon, 'SigCEN',None)
self.flux_editor = QAction(icon, 'SigCEN', None)
self.toolBar.addAction(self.flux_editor)
self.flux_editor.triggered.connect(self.open_editor)
self.flux_editor.setEnabled(False)
if os.access('N:/',os.R_OK):
if os.access('N:/', os.R_OK):
self.flux_editor.setEnabled(True)
def open_about_dialog(self):
@@ -78,7 +74,8 @@ class PgFlux:
About dialog
"""
dialog = AboutDialog(iface)
dialog.exec_()
dialog.exec()
def open_help():
""" Open the online help. """
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
@@ -90,8 +87,7 @@ class PgFlux:
def unload(self):
""" Unload the plugin. """
if self.action_editor:
iface.removePluginMenu('CenRa_Flux',self.flux_editor)
iface.removePluginMenu('CenRa_Flux', self.flux_editor)
if self.provider:
QgsApplication.processingRegistry().removeProvider(self.provider)
+2 -2
View File
@@ -3,7 +3,7 @@ import os.path
from pathlib import Path
from qgis.PyQt import uic
from qgis.PyQt.QtGui import QPixmap
# from qgis.PyQt.QtGui import QPixmap
from qgis.PyQt.QtWidgets import QDialog
from .tools.resources import devlog
@@ -43,4 +43,4 @@ class AboutDialog(QDialog, ABOUT_FORM_CLASS):
Run some actions when
the user closes the dialog
"""
self.close()
self.close()
+249 -414
View File
@@ -2,57 +2,69 @@
from __future__ import absolute_import
# Import the PyQt and QGIS libraries
from builtins import next
# from builtins import next
from builtins import str
from builtins import object
import qgis
from qgis.PyQt import QtCore
# 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 QAction, QMenu, QDialog
# from qgis.PyQt.QtWidgets import QDialog
from qgis.PyQt.QtGui import QIcon
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5 import QtGui
from qgis.core import *
from qgis.core import QgsDataSourceUri
# from qgis.PyQt.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.PyQt.QtWidgets import (
QDialog,
QAction,
QDockWidget,
QFileDialog,
QInputDialog,
QMenu,
QToolButton,
QTableWidget,
# QAction,
# QDockWidget,
# QFileDialog,
# QInputDialog,
# QMenu,
# QToolButton,
# QTableWidget,
QTableWidgetItem,
QMessageBox,
QVBoxLayout,
)
from .tools.SQLRequet import *
from .tools.SQLRequet import schemaname_list, schemaname_list_ref, schemaname_distinct
from .tools.resources import (
load_ui,
resources_path,
send_issues,
# send_issues,
)
try:
from .tools.PythonSQL import login_base
except:
except NameError:
print('Pas de fichier PythonSQL')
from .issues import CenRa_Issues
from ast import literal_eval
# from .issues import CenRa_Issues
# from ast import literal_eval
from qgis.utils import iface
import os.path
import webbrowser, os
# import os.path
# import os
# import webbrowser
import psycopg2
import psycopg2.extras
import base64
# import base64
global DeBUG
DeBUG = 0
itemIconRaster = QTableWidgetItem()
icon = QIcon()
icon.addPixmap(QtGui.QPixmap(resources_path('icons', 'mIconRaster.svg')), QIcon.Mode(0), QIcon.State(1))
itemIconRaster.setIcon(icon)
itemIconVecteur = QTableWidgetItem()
icon = QIcon()
icon.addPixmap(QtGui.QPixmap(resources_path('icons', 'mIconVecteur.svg')), QIcon.Mode(0), QIcon.State(1))
itemIconVecteur.setIcon(icon)
try:
account = login_base('account')
user = account[0]
@@ -63,142 +75,32 @@ try:
sigdb = account[5]
refdb = account[6]
except NameError:
print('Fails to login DB for account')
except:
print('')
EDITOR_CLASS = load_ui('CenRa_Flux_base.ui')
html = '''<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"
integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY="
crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"
integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo="
crossorigin=""></script>
<style>
body { padding: 0; margin: 0; }
html, body, #map { height: 100%; }
.leaflet-control-layers-toggle {
background-image: url(https://intranet.cenra-outils.org/Intranet/css/images/layers.png);
}
.legend_parc {
border-radius: 15px;
box-shadow: 2px 2px 3px 0 #6a6a6a;
background-color: #fefafab3;
opacity:0;
}
.legend_parc:hover{
opacity:1;
}
.popup-with-no-events {
pointer-events: none;
}
</style>
</head>
<body>
<div id="map"></div>
<script src="map.js"></script>
</body>
</html>
<script>'''
font = '''var OrthoIGN = L.tileLayer('https://wmts.geopf.fr/wmts?'+
'&LAYER={ignLayer}&STYLE={style}&TILEMATRIXSET=PM'+
'&SERVICE={service}&REQUEST=GetTile&VERSION=1.0.0'+
'&FORMAT={format}&TILECOL={x}&TILEROW={y}&TILEMATRIX={z}',
{
ignLayer: 'ORTHOIMAGERY.ORTHOPHOTOS',
style: 'normal',
service: 'WMTS',
format: 'image/jpeg',
minZoom: 0,
maxZoom: 19,
attribution: '&copy; IGN'
}).addTo(map);
// Plan IGN avec une transparence de 50%
var PlanIGN = L.tileLayer('https://wmts.geopf.fr/wmts?'+
'&LAYER={ignLayer}&STYLE={style}&TILEMATRIXSET=PM'+
'&SERVICE={service}&REQUEST=GetTile&VERSION=1.0.0'+
'&FORMAT={format}&TILECOL={x}&TILEROW={y}&TILEMATRIX={z}',
{
ignLayer: 'GEOGRAPHICALGRIDSYSTEMS.PLANIGNV2',
style: 'normal',
service: 'WMTS',
format: 'image/png',
minZoom: 0,
maxZoom: 19,
attribution: '&copy; IGN'
});
var baseMaps = {
// "BDORTHO2" : bdortho,
// "Openstreetmap": openStreetMap,
// "Opentopomap": openTopoMap,
"BDORTHO" : OrthoIGN,
"PlanIGN": PlanIGN
};
var overlayMaps = {
"Sites": Sites,
//"Parcelle":JSON
};
L.control.layers(baseMaps,overlayMaps).addTo(map);
var scale = L.control.scale({position: 'bottomleft', metric:true, imperial:false});
scale.addTo(map);
var legend = L.control({position: 'bottomleft'});
legend.onAdd = function (map) {
var div = L.DomUtil.create('div', 'info legend_parc'),
labels = [];
labels.push('<i style="background:#73004c;width:18px;height:18px;float:left;margin-right:8px;opacity: 0.7;"></i> Acquisition')
labels.push('<i style="background:#ff00c5;width:18px;height:18px;float:left;margin-right:8px;opacity: 0.7;"></i> Acquis en partie BND')
labels.push('<i style="background:#f0ade1ab;width:18px;height:18px;float:left;margin-right:8px;opacity: 0.7;"></i> Acquisition pour partie')
labels.push('<i style="background:#73462e;width:18px;height:18px;float:left;margin-right:8px;opacity: 0.7;"></i> Acquisition / Convention')
labels.push('<i style="background:#e69800;width:18px;height:18px;float:left;margin-right:8px;opacity: 0.7;"></i> Convention')
labels.push('<i style="background:#ffd37f;width:18px;height:18px;float:left;margin-right:8px;opacity: 0.7;"></i> Convention en partie BND')
labels.push('<i style="background:#ffebaf;width:18px;height:18px;float:left;margin-right:8px;opacity: 0.7;"></i> Convention pour partie')
labels.push('<i style="background:#c8c8c8;width:18px;height:18px;float:left;margin-right:8px;opacity: 0.7;"></i> Autre')
labels.push('<i style="background:#f9ff08;width:18px;height:18px;float:left;margin-right:8px;opacity: 0.7;"></i> Projet en cours')
labels.push('<i style="background:#fe0000;width:18px;height:18px;float:left;margin-right:8px;opacity: 0.7;"></i> Problème de mise à jour')
labels.push('<i style="background:#000;width:18px;height:18px;float:left;margin-right:8px;opacity: 0.7;"></i> Pas de maitrise')
div.innerHTML = labels.join('<br>');
return div;
};
legend.addTo(map);
</script>'''
targetCrs = QgsCoordinateReferenceSystem('EPSG:4326')
layerCrs = QgsCoordinateReferenceSystem('EPSG:2154')
TranformCRS = QgsCoordinateTransform(layerCrs, targetCrs,QgsProject.instance())
TranformCRS = QgsCoordinateTransform(layerCrs, targetCrs, QgsProject.instance())
class Flux_Editor(QDialog, EDITOR_CLASS):
def __init__(self, parent=None):
_ = parent
super().__init__()
self.setupUi(self)
self.settings = QgsSettings()
self.s = QSettings()
self.setWindowIcon(QtGui.QIcon(resources_path('icons','icon.png')))
self.setWindowIcon(QtGui.QIcon(resources_path('icons', 'icon.png')))
self.first_start = None
self.iface = iface
self.label_3.setPixmap(QtGui.QPixmap(resources_path('ui','logo.png')))
self.commandLinkButton.setIcon(QtGui.QIcon(resources_path('ui','arrow-bottom.png')))
self.commandLinkButton_2.setIcon(QtGui.QIcon(resources_path('ui','arrow-up.png')))
self.label_3.setPixmap(QtGui.QPixmap(resources_path('ui', 'logo.png')))
self.commandLinkButton.setIcon(QtGui.QIcon(resources_path('ui', 'arrow-bottom.png')))
self.commandLinkButton_2.setIcon(QtGui.QIcon(resources_path('ui', 'arrow-up.png')))
self.tableWidget.setSelectionBehavior(QTableWidget.SelectRows)
self.tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
self.toolButton.setIcon(QtGui.QIcon(resources_path('ui','find.png')))
self.tableWidget.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger(0))
self.toolButton.setIcon(QtGui.QIcon(resources_path('ui', 'find.png')))
self.comboBox_2.addItem("SIG")
self.comboBox_2.addItem('REF')
self.comboBox.currentIndexChanged.connect(self.initialisation_flux)
@@ -209,11 +111,11 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
self.tableWidget_2.itemDoubleClicked.connect(self.suppression_flux)
self.comboBox_2.currentIndexChanged.connect(self.bd_source)
self.checkBox.hide()
self.checkBox.stateChanged.connect(self.modeCarte)
# self.checkBox.stateChanged.connect(self.modeCarte)
self.toolButton.clicked.connect(self.getCanevas)
layout = QVBoxLayout()
self.lineEdit.textChanged.connect(self.filtre_dynamique)
self.viewer.titleChanged.connect(self.NewTitle)
# self.viewer.textChanged.connect(self.NewTitle)
layout.addWidget(self.lineEdit)
self.viewer.hide()
self.DeBUG.addItem('')
@@ -222,21 +124,18 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
self.DeBUG.addItem('4269')
self.DeBUG.hide()
#self.lineEdit.mousePressEvent = self._mousePressEvent
#metadonnees_plugin = open(self.plugin_path + '/metadata.txt')
#infos_metadonnees = metadonnees_plugin.readlines()
def raise_(self):
"""Run method that performs all the real work"""
self.bd_source()
def ModeDeBUG(self):
self.DeBUG.show()
def mousePressEvent(self, event):
global DeBUG
if 330 <= event.pos().x() <= 560 and 5 <= event.pos().y() <= 75:
DeBUG = DeBUG+1
DeBUG = DeBUG + 1
if DeBUG == 3:
DeBUG = 0
self.ModeDeBUG()
@@ -244,131 +143,17 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
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 modeCarte(self):
if self.checkBox.isChecked():
self.viewer.show()
cur.execute("SELECT ST_AsGeoJSON(st_centroid(ST_Transform(geom,4326))) FROM _agregation_ra._agreg_contour")
varcenter = literal_eval(cur.fetchall()[0][0])
varcenter = [varcenter['coordinates'][1],varcenter['coordinates'][0]]
cur.execute("SELECT ST_AsGeoJSON(ST_Transform(st_collect(geom),4326)),tschema,tname FROM _agregation_ra._agreg_contour WHERE geom IS NOT NULL GROUP BY tschema,tname;" )
varSite = cur.fetchall()
cur.execute("SELECT ST_AsGeoJSON(ST_Transform(st_collect(geom),4326)),tschema,tname FROM _agregation_ra._agreg_travaux_prevus_poly WHERE geom IS NOT NULL GROUP BY tschema,tname;")
varTravaux = cur.fetchall()
cur.execute("SELECT ST_AsGeoJSON(ST_Transform(geom,4326)),milieu_libelle ,lb_eu_01,tschema,tname FROM _agregation_ra._agreg_eu_habitat WHERE geom IS NOT NULL;")
varHabitat = cur.fetchall()
vargeomS = literal_eval(varSite[0][0])
vargeomT = literal_eval(varTravaux[0][0])
vargeomH = literal_eval(varHabitat[0][0])
#new_objectS = self.SwitchGeom(vargeomS)
#new_objectT = self.SwitchGeom(vargeomT)
#new_objectH = self.SwitchGeom(vargeomH)
script = 'var map = L.map("map").setView('+str(varcenter)+', 13);'
id = 0
varSiteJSON = '''var ParcelleJSON = {
"type": "FeatureCollection",
"features":['''
for varP in varSite:
id = id+1
varSiteJSON = varSiteJSON+'{"properties": {"code": "'+str(varP[1])+'.'+str(varP[2])+'" },'+str(varP[0][1:])+','
varSiteJSON = varSiteJSON[:-1]+''']};
var Sites = L.geoJSON(ParcelleJSON,{
style: function(feature) {
switch (feature.geometry.properties.code) {
case 'Ensemble de sites': return {fillColor: "#9a7863",color:"white",weight: 1,fillOpacity: 0.7};
case 'Sous-site conservatoire': return {fillColor: "#e69800",color:"white",weight: 1,fillOpacity: 0.7};
case 'Site non géré': return {fillColor: "#73004c",color:"white",weight: 1,fillOpacity: 0.7};
case 'Animation territoriale': return {fillColor: "#ffebaf",color:"white",weight: 1,fillOpacity: 0.7};
case 'Site conservatoire': return {fillColor: "#f9ff08",color:"white",weight: 1,fillOpacity: 0.7};
default: return {fillColor: "#c8c8c8",color:"white",weight: 1,fillOpacity: 0.7};
}
},
onEachFeature: function (feature,layer) {
layer.on('click', function(e) {
map.fitBounds(layer.getBounds());
document.title = feature.properties.code.toString();
});
layer.on('mouseover', function(e) {
layer.setStyle({
weight: 5,
color: '#fe0000',
dashArray: '',
});
});
//layer.on('mousemove', function(e) {
//layer.openPopup(e.latlng);
//});
layer.on('mouseout', function(e) {
layer.setStyle({
color:"white",
weight: 1,
});
});
layer.bindTooltip(feature.properties.code.toString(), {
sticky: true,
permanent: false,
direction: 'right',
className: 'label_parc'
});
}
}).addTo(map);'''
id = 0
varTravauxJSON = '''var TravauxJSON = {
"type": "FeatureCollection",
"features":['''
for varT in varTravaux:
id = id+1
varTravauxJSON = varTravauxJSON+'{"properties": {"code": "'+str(varT[1])+'.'+str(varT[2])+'" },'+str(varT[0][1:])+','
varTravauxJSON = varTravauxJSON[:-1]+''']};
var Travaux = L.geoJSON(TravauxJSON,{
onEachFeature: function (feature,layer) {
layer.on('click', function(e) {
map.fitBounds(layer.getBounds());
document.title = feature.properties.code.toString();
});
layer.on('mouseover', function(e) {
layer.setStyle({
weight: 5,
color: '#fe0000',
dashArray: '',
});
});
//layer.on('mousemove', function(e) {
//layer.openPopup(e.latlng);
//});
layer.on('mouseout', function(e) {
layer.setStyle({
color:"white",
weight: 1,
});
});
layer.bindTooltip(feature.properties.code.toString(), {
sticky: true,
permanent: false,
direction: 'right',
className: 'label_parc'
});
}
}).addTo(map);'''
script = script+varSiteJSON+varTravauxJSON
self.viewer.setHtml(html+script+font)
else:
self.viewer.hide()
print(Tsplit[0], Tsplit[1])
self.openPostGIS(Tsplit[0], Tsplit[1])
"""
def bd_source(self):
self.activateWindow()
bd_origine=self.comboBox_2.currentText()
bd_origine = self.comboBox_2.currentText()
if bd_origine == 'REF':
self.run_ref()
if bd_origine == 'SIG':
@@ -377,22 +162,22 @@ var Travaux = L.geoJSON(TravauxJSON,{
def run_ref(self):
"""Run method that performs all the real work"""
while self.tableWidget_2.rowCount() > 0:
self.tableWidget_2.removeRow(self.tableWidget_2.rowCount()-1)
self.tableWidget_2.removeRow(self.tableWidget_2.rowCount() - 1)
# print(self.tableWidget_2.rowCount())
global cur,con,dbtype
dbtype=refdb
con = psycopg2.connect("host=" + host + " port=" + port + " dbname="+dbtype+" user=" + user + " password=" + mdp)
cur = con.cursor(cursor_factory = psycopg2.extras.DictCursor)
global cur, con, dbtype
dbtype = refdb
con = psycopg2.connect("host=" + host + " port=" + port + " dbname=" + dbtype + " user=" + user + " password=" + mdp)
cur = con.cursor(cursor_factory=psycopg2.extras.DictCursor)
self.initialisation_flux()
self.combobox_custom()
# Create the dialog with elements (after translation) and keep reference
# Only create GUI ONCE in callback, so that it will only load when the plugin is started
if self.first_start == True:
if self.first_start is True:
self.first_start = False
# show the dialog
self.show()
# Run the dialog event loop
result = self.exec_()
result = self.exec()
# See if OK was pressed
if result:
# Do something useful here - delete the line containing pass and
@@ -402,21 +187,21 @@ var Travaux = L.geoJSON(TravauxJSON,{
def run_sig(self):
"""Run method that performs all the real work"""
while self.tableWidget_2.rowCount() > 0:
self.tableWidget_2.removeRow(self.tableWidget_2.rowCount()-1)
global cur,con,dbtype
dbtype=sigdb
con = psycopg2.connect("host=" + host + " port=" + port + " dbname="+dbtype+" user=" + user + " password=" + mdp)
cur = con.cursor(cursor_factory = psycopg2.extras.DictCursor)
self.tableWidget_2.removeRow(self.tableWidget_2.rowCount() - 1)
global cur, con, dbtype
dbtype = sigdb
con = psycopg2.connect("host=" + host + " port=" + port + " dbname=" + dbtype + " user=" + user + " password=" + mdp)
cur = con.cursor(cursor_factory=psycopg2.extras.DictCursor)
self.initialisation_flux()
self.combobox_custom()
# Create the dialog with elements (after translation) and keep reference
# Only create GUI ONCE in callback, so that it will only load when the plugin is started
if self.first_start == True:
if self.first_start is True:
self.first_start = False
# show the dialog
self.show()
# Run the dialog event loop
result = self.exec_()
result = self.exec()
# See if OK was pressed
if result:
# Do something useful here - delete the line containing pass and
@@ -426,132 +211,163 @@ var Travaux = L.geoJSON(TravauxJSON,{
def suppression_flux(self):
self.tableWidget_2.removeRow(self.tableWidget_2.currentRow())
def open_url(self, item):
url = item.data(Qt.UserRole)
def initialisation_flux(self):
if dbtype == sigdb:
# self.toolButton.setEnabled(1)
if self.comboBox.currentText() == 'toutes les catégories':
custom_list=schemaname_list
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;"""
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;"""
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
custom_list = schemaname_list_ref
else:
custom_list="""SELECT schemaname,tablename from pg_catalog.pg_tables
where schemaname like '"""+ str(self.comboBox.currentText()) +"""' order by schemaname,tablename;"""
custom_list = """SELECT schemaname,tablename from pg_catalog.pg_tables
where schemaname like '""" + str(self.comboBox.currentText()) + """' order by schemaname,tablename;"""
cur.execute(custom_list)
list_schema = cur.fetchall()
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 = []
self.tableWidget.setRowCount(len(list_schema))
self.tableWidget.setColumnCount(3)
i=0
self.tableWidget.setColumnCount(4)
i = 0
for value in list_schema:
if dbtype == sigdb:
type_val = str(value[0])[1:3]
schema_name=str(value[0])[4:]
table_name=str(value[1][len(value[0])+1:])
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:])
table_name = str(value[1][len(value[0]) + 1:])
else:
table_name=str(value[1])
table_name = str(value[1])
else:
type_val = ''
schema_name=str(value[0])
table_name=str(value[1])
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:]
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:])
table_name = str(value[1][len(value[0]) + 1:])
else:
table_name=str(value[1])
table_name = str(value[1])
elif type_val == 'ra':
type_val='travaux'
schema_name=str(value[0])
table_name=str(value[1])
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])
type_val = 'agregation'
schema_name = str(value[0])
table_name = str(value[1])
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,0,item)
self.tableWidget.setItem(i, 1, item)
item = QTableWidgetItem(schema_name)
self.tableWidget.setItem(i,1,item)
self.tableWidget.setItem(i, 2, item)
item = QTableWidgetItem(table_name)
self.tableWidget.setItem(i,2,item)
i=i+1
self.tableWidget.setItem(i, 3, item)
i = i + 1
self.tableWidget.setColumnWidth(0, 20)
self.tableWidget.setColumnWidth(1, 300)
self.tableWidget.setColumnWidth(1, 70)
self.tableWidget.setColumnWidth(2, 300)
self.tableWidget.setHorizontalHeaderLabels(["Code","Schema","Table"])
self.tableWidget.setColumnWidth(3, 300)
self.tableWidget.setHorizontalHeaderLabels(["Type", "Code", "Schema", "Table"])
def selection_flux(self):
selected_row = 0
selected_items = self.tableWidget.selectedItems()
# Assuming you want to compare items in the first column for uniqueness
new_item_text = selected_items[2].text()
# svgTake = (selected_items[2].tableWidget().cellWidget(0,0))
new_item_text = selected_items[3].text()
if not self.item_already_exists(new_item_text):
self.tableWidget_2.insertRow(selected_row)
for column in range(self.tableWidget.columnCount()):
cloned_item = selected_items[column].clone()
self.tableWidget_2.setHorizontalHeaderLabels(["Code","Schema", "Table"])
self.tableWidget_2.setColumnCount(3)
self.tableWidget_2.setHorizontalHeaderLabels(["Type", "Code", "Schema", "Table"])
self.tableWidget_2.setColumnCount(4)
self.tableWidget_2.setItem(selected_row, column, cloned_item)
self.tableWidget_2.setColumnWidth(0, 50)
self.tableWidget_2.setColumnWidth(1, 300)
self.tableWidget_2.setColumnWidth(0, 20)
self.tableWidget_2.setColumnWidth(1, 70)
self.tableWidget_2.setColumnWidth(2, 300)
self.tableWidget_2.setColumnWidth(3, 300)
def item_already_exists(self, new_item_text):
# Assuming you want to compare items in the first column for uniqueness
existing_items = self.tableWidget_2.findItems(new_item_text, QtCore.Qt.MatchExactly)
existing_items = self.tableWidget_2.findItems(new_item_text, QtCore.Qt.MatchFlag(0))
# Check if there are any existing items with the same text in the first column
return len(existing_items) > 0
def limite_flux(self):
if self.tableWidget_2.rowCount() > 5:
self.QMBquestion = QMessageBox.question(iface.mainWindow(), u"Attention !",
"Le nombre de flux à charger en une seule fois est limité à 5 pour des questions de performances. Souhaitez vous tout de même charger les " + str(
self.tableWidget_2.rowCount()) + " flux sélectionnés ? (risque de plantage de QGIS)",
QMessageBox.Yes | QMessageBox.No)
if self.QMBquestion == QMessageBox.Yes:
QMessageBox.StandardButton(0x00004000) | QMessageBox.StandardButton(0x00010000))
if self.QMBquestion == QMessageBox.StandardButton(0x00004000):
self.chargement_flux()
if self.QMBquestion == QMessageBox.No:
if self.QMBquestion == QMessageBox.StandardButton(0x00001000):
print("Annulation du chargement des couches")
if self.tableWidget_2.rowCount() <= 5:
self.chargement_flux()
def openPostGIS(self,schema,table):
"""
def openPostGIS(self, schema, table):
uri = QgsDataSourceUri()
uri.setConnection(host ,port ,sigdb ,user ,mdp)
uri.setDataSource(schema, table, "geom")
uri.setKeyColumn('gid')
uri.setSrid('2154')
layer = QgsVectorLayer(uri.uri(), table, "postgres")
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):
managerAU = QgsApplication.authManager()
k = managerAU.availableAuthMethodConfigs().keys()
managerAU.availableAuthMethodConfigs().keys()
def REQUEST(type):
switcher = {
@@ -563,65 +379,78 @@ var Travaux = L.geoJSON(TravauxJSON,{
}
return switcher.get(type, "nothing")
# def displayOnWindows(type, uri, name):
# p = []
def displayOnWindows(type, uri, name):
p = []
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])
for row in range(0, self.tableWidget_2.rowCount()):
color_rgba = 855030089
if self.tableWidget_2.item(row, 0).background().color().rgba() != 855030089:
## supression de la partie de l'url après le point d'interrogation
if self.tableWidget_2.item(row, 1).background().color().rgba() != color_rgba:
# supression de la partie de l'url après le point d'interrogation
if dbtype == sigdb:
code = self.tableWidget_2.item(row,0).text()
schema = '_'+code+'_'+self.tableWidget_2.item(row,1).text()
code = self.tableWidget_2.item(row, 1).text()
schema = '_' + code + '_' + self.tableWidget_2.item(row, 2).text()
if code == 'travaux' or code == 'agregation':
schema = self.tableWidget_2.item(row,1).text()
table = self.tableWidget_2.item(row,2).text()
schema = self.tableWidget_2.item(row, 2).text()
table = self.tableWidget_2.item(row, 3).text()
else:
table = self.tableWidget_2.item(row,2).text()
table = schema+'_'+table
if dbtype == refdb:
# code = self.tableWidget_2.item(row,0).text()
schema = self.tableWidget_2.item(row,1).text()
table = self.tableWidget_2.item(row,2).text()#.split("?", 1)[0]
table = self.tableWidget_2.item(row, 3).text()
table = schema + '_' + table
elif dbtype == refdb:
# 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]
uri = QgsDataSourceUri()
uri.setConnection(host ,port ,dbtype ,user ,mdp)
uri.setConnection(host, port, dbtype, user, mdp)
# nom du schéma à remplacer: "hydrographie" à supprimer et mettre "couches_collaboratives" lorsqu'on aura regroupé les couches à modifier dans un même schéma
uri.setDataSource(schema, table, "geom")
uri.setKeyColumn('gid')
# Chargement de la couche PostGIS
geom_type ='SELECT right(st_geometrytype(geom),-3) as a FROM '+schema+'.'+table+' GROUP BY a'
cur.execute(geom_type)
list_typegeom = cur.fetchall()
if len(list_typegeom) > 1:
for typegeom in list_typegeom:
if typegeom[0] == 'MultiPolygon':
uri.setWkbType(QgsWkbTypes.MultiPolygon)
elif typegeom[0] == 'MultiLineString':
uri.setWkbType(QgsWkbTypes.MultiLineString)
elif typegeom[0] == 'Point':
uri.setWkbType(QgsWkbTypes.Point)
if typegeom[0] == 'Polygon':
uri.setWkbType(QgsWkbTypes.Polygon)
elif typegeom[0] == 'LineString':
uri.setWkbType(QgsWkbTypes.LineString)
elif typegeom[0] == 'MultiPoint':
uri.setWkbType(QgsWkbTypes.MultiPoint)
if (typegeom[0] != None and typegeom[0] != 'Polygon'):
uri.setSrid('2154')
layer = QgsVectorLayer(uri.uri(), table, "postgres")
# Ajout de la couche au canevas QGIS
QgsProject.instance().addMapLayer(layer)
else:
layer = QgsVectorLayer(uri.uri(), table, "postgres")
# Ajout de la couche au canevas QGIS
if (schema + '.' + table) in RasterList:
uri.setDataSource(schema, table, "rast")
uri.setKeyColumn('rid')
uri.setSrid('2154')
layer = QgsRasterLayer(uri.uri(), table, "postgresraster")
QgsProject.instance().addMapLayer(layer)
else:
uri.setDataSource(schema, table, "geom")
uri.setKeyColumn('gid')
# Chargement de la couche PostGIS
geom_type = 'SELECT right(st_geometrytype(geom),-3) as a FROM ' + schema + '.' + table + ' GROUP BY a'
cur.execute(geom_type)
list_typegeom = cur.fetchall()
if len(list_typegeom) > 1:
for typegeom in list_typegeom:
if typegeom[0] == 'MultiPolygon':
uri.setWkbType(QgsWkbTypes.MultiPolygon)
elif typegeom[0] == 'MultiLineString':
uri.setWkbType(QgsWkbTypes.MultiLineString)
elif typegeom[0] == 'Point':
uri.setWkbType(QgsWkbTypes.Point)
if typegeom[0] == 'Polygon':
uri.setWkbType(QgsWkbTypes.Polygon)
elif typegeom[0] == 'LineString':
uri.setWkbType(QgsWkbTypes.LineString)
elif typegeom[0] == 'MultiPoint':
uri.setWkbType(QgsWkbTypes.MultiPoint)
if (typegeom[0] is not None and typegeom[0] != 'Polygon'):
uri.setSrid('2154')
layer = QgsVectorLayer(uri.uri(), table, "postgres")
# Ajout de la couche au canevas QGIS
QgsProject.instance().addMapLayer(layer)
else:
layer = QgsVectorLayer(uri.uri(), table, "postgres")
# Ajout de la couche au canevas QGIS
QgsProject.instance().addMapLayer(layer)
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.Yes)
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):
if dbtype == sigdb:
self.toolButton.setEnabled(1)
@@ -638,7 +467,7 @@ var Travaux = L.geoJSON(TravauxJSON,{
self.comboBox.addItem('form')
if dbtype == refdb:
self.toolButton.setEnabled(0)
custom_list=schemaname_distinct
custom_list = schemaname_distinct
cur.execute(custom_list)
list_schema = cur.fetchall()
self.comboBox.clear()
@@ -648,7 +477,7 @@ var Travaux = L.geoJSON(TravauxJSON,{
def filtre_dynamique(self, filter_text):
if filter_text.find(' ') >= 0:
filter_text=filter_text.replace(" ","_")
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)
@@ -659,14 +488,14 @@ var Travaux = L.geoJSON(TravauxJSON,{
def getCanevas(self):
poly = iface.mapCanvas().extent()
geom = (str(poly.xMinimum())+','+str(poly.yMinimum())+','+str(poly.xMaximum())+','+str(poly.yMaximum()))
geom = (str(poly.xMinimum()) + ',' + str(poly.yMinimum()) + ',' + str(poly.xMaximum()) + ',' + str(poly.yMaximum()))
SQL_GEOM_CONTOUR = """SELECT DISTINCT tschema,tname FROM "_agregation_ra"."_agreg_contour" WHERE st_intersects(geom,ST_MakeEnvelope("""+geom+",2154)) ORDER BY tname"
SQL_GEOM_HABITAT = """SELECT DISTINCT tschema,tname FROM "_agregation_ra"."_agreg_habitat" WHERE st_intersects(geom,ST_MakeEnvelope("""+geom+",2154)) ORDER BY tname"
SQL_GEOM_EU_HABITAT = """SELECT DISTINCT tschema,tname FROM "_agregation_ra"."_agreg_eu_habitat" WHERE st_intersects(geom,ST_MakeEnvelope("""+geom+",2154)) ORDER BY tname"
SQL_GEOM_TRAVAUX_PREVUS_LIGNE = """SELECT DISTINCT tschema,tname FROM "_agregation_ra"."_agreg_travaux_prevus_ligne" WHERE st_intersects(geom,ST_MakeEnvelope("""+geom+",2154)) ORDER BY tname"
SQL_GEOM_TRAVAUX_PREVUS_POINT = """SELECT DISTINCT tschema,tname FROM "_agregation_ra"."_agreg_travaux_prevus_point" WHERE st_intersects(geom,ST_MakeEnvelope("""+geom+",2154)) ORDER BY tname"
SQL_GEOM_TRAVAUX_PREVUS_POLY = """SELECT DISTINCT tschema,tname FROM "_agregation_ra"."_agreg_travaux_prevus_poly" WHERE st_intersects(geom,ST_MakeEnvelope("""+geom+",2154)) ORDER BY tname"
SQL_GEOM_CONTOUR = """SELECT DISTINCT tschema,tname FROM "_agregation_ra"."_agreg_contour" WHERE st_intersects(geom,ST_MakeEnvelope(""" + geom + ",2154)) ORDER BY tname"
SQL_GEOM_HABITAT = """SELECT DISTINCT tschema,tname FROM "_agregation_ra"."_agreg_habitat" WHERE st_intersects(geom,ST_MakeEnvelope(""" + geom + ",2154)) ORDER BY tname"
SQL_GEOM_EU_HABITAT = """SELECT DISTINCT tschema,tname FROM "_agregation_ra"."_agreg_eu_habitat" WHERE st_intersects(geom,ST_MakeEnvelope(""" + geom + ",2154)) ORDER BY tname"
SQL_GEOM_TRAVAUX_PREVUS_LIGNE = """SELECT DISTINCT tschema,tname FROM "_agregation_ra"."_agreg_travaux_prevus_ligne" WHERE st_intersects(geom,ST_MakeEnvelope(""" + geom + ",2154)) ORDER BY tname"
SQL_GEOM_TRAVAUX_PREVUS_POINT = """SELECT DISTINCT tschema,tname FROM "_agregation_ra"."_agreg_travaux_prevus_point" WHERE st_intersects(geom,ST_MakeEnvelope(""" + geom + ",2154)) ORDER BY tname"
SQL_GEOM_TRAVAUX_PREVUS_POLY = """SELECT DISTINCT tschema,tname FROM "_agregation_ra"."_agreg_travaux_prevus_poly" WHERE st_intersects(geom,ST_MakeEnvelope(""" + geom + ",2154)) ORDER BY tname"
cur.execute(SQL_GEOM_CONTOUR)
TableContour = cur.fetchall()
@@ -681,11 +510,11 @@ var Travaux = L.geoJSON(TravauxJSON,{
cur.execute(SQL_GEOM_TRAVAUX_PREVUS_POLY)
TableTravauxPoly = cur.fetchall()
TableHaveGeom = sorted(TableContour+TableHabitat+TableEuHabitat+TableTravauxLigne+TableTravauxPoint+TableTravauxPoly)
TableHaveGeom = sorted(TableContour + TableHabitat + TableEuHabitat + TableTravauxLigne + TableTravauxPoint + TableTravauxPoly)
row_count = 0
self.tableWidget.setRowCount(0)
for e in TableHaveGeom:
cur.execute("""SELECT DISTINCT count(*) FROM pg_catalog.pg_tables WHERE schemaname LIKE '"""+e[0]+"""' AND tablename LIKE '"""+e[1]+"""';""")
cur.execute("""SELECT DISTINCT count(*) FROM pg_catalog.pg_tables WHERE schemaname LIKE '""" + e[0] + """' AND tablename LIKE '""" + e[1] + """';""")
TableSomme = cur.fetchall()[0][0]
if e[0][1:3] != 'fo':
@@ -694,28 +523,34 @@ var Travaux = L.geoJSON(TravauxJSON,{
else:
DepName = QTableWidgetItem('form')
SchemaName = QTableWidgetItem(e[0][6:])
TableName = QTableWidgetItem(e[1][len(e[0])+1:])
TableName = QTableWidgetItem(e[1][len(e[0]) + 1:])
self.tableWidget.insertRow(row_count)
self.tableWidget.setItem(row_count,0,DepName)
self.tableWidget.setItem(row_count,1,SchemaName)
self.tableWidget.setItem(row_count,2,TableName)
itemIcon = QTableWidgetItem()
icon = QIcon()
icon.addPixmap(QtGui.QPixmap(resources_path('icons', 'mIconVecteur.svg')), QIcon.Mode(0), QIcon.State(1))
itemIcon.setIcon(icon)
self.tableWidget.setItem(row_count, 0, itemIcon)
self.tableWidget.setItem(row_count, 1, DepName)
self.tableWidget.setItem(row_count, 2, SchemaName)
self.tableWidget.setItem(row_count, 3, TableName)
if TableSomme == 0:
for j in range(self.tableWidget.columnCount()):
self.tableWidget.item(row_count, j).setBackground(QtGui.QColor(246, 185, 73,50))
self.tableWidget.item(row_count,j).setToolTip('Couche dans une autre BD !')
row_count = row_count+1
self.tableWidget.item(row_count, j).setBackground(QtGui.QColor(246, 185, 73, 50))
self.tableWidget.item(row_count, j).setToolTip('Couche dans une autre BD !')
row_count = row_count + 1
if self.lineEdit.text() != 'Recherche par mots-clés':
self.filtre_dynamique(self.lineEdit.text())
def SwitchGeom(self,vargeom):
def SwitchGeom(self, vargeom):
new_object = '['
obj = vargeom['coordinates'][0][0]
for obj_X in obj:
new_object = new_object+'['+str(obj_X[1])+','+str(obj_X[0])+'],'
new_object = new_object[:-1]+']'
return(new_object)
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()
# def popup(self):
# self.dialog = Popup() # +++ - self
# self.dialog.text_edit.show()
+19 -15
View File
@@ -1,9 +1,4 @@
import os
plugin_dir = os.path.dirname(__file__)
end_find = plugin_dir.rfind('\\')+1
NAME = plugin_dir[end_find:]
from qgis.gui import *
from qgis.core import (
@@ -34,21 +29,25 @@ from qgis.utils import iface
from .tools.resources import (
load_ui,
resources_path,
# resources_path,
send_issues,
)
plugin_dir = os.path.dirname(__file__)
end_find = plugin_dir.rfind('\\') + 1
NAME = plugin_dir[end_find:]
EDITOR_CLASS = load_ui('CenRa_IssuesSend.ui')
class CenRa_Issues(QDialog, EDITOR_CLASS):
class CenRa_Issues(QDialog, EDITOR_CLASS):
def __init__(self, parent=None):
_ = parent
super().__init__()
self.setupUi(self)
self.settings = QgsSettings()
#place connect here
# place connect here
self.annuler_button.clicked.connect(self.close)
self.ok_button.clicked.connect(self.run_sendissues)
@@ -62,17 +61,22 @@ class CenRa_Issues(QDialog, EDITOR_CLASS):
statu_autre = self.check_autre.isChecked()
statu = []
if statu_bug == True : statu = statu + [1]
if statu_aide == True : statu = statu + [3]
if statu_question == True : statu = statu + [5]
if statu_amelioration == True : statu = statu + [2]
if statu_autre == True : statu = statu + [6]
if statu_bug is True:
statu = statu + [1]
if statu_aide is True:
statu = statu + [3]
if statu_question is True:
statu = statu + [5]
if statu_amelioration is True:
statu = statu + [2]
if statu_autre is True:
statu = statu + [6]
if len(statu) >= 1:
import qgis
url = qgis.utils.pluginMetadata(NAME,'tracker')
url = qgis.utils.pluginMetadata(NAME, 'tracker')
print(text_message)
send_info = send_issues(url,text_titre,text_message,statu)
send_info = send_issues(url, text_titre, text_message, statu)
code = send_info.status_code
print(code)
else:
+3 -4
View File
@@ -5,8 +5,9 @@
[general]
name=CenRa_FLUX
qgisMinimumVersion=3.0
supportsQt6=True
description=Permet d'ouvrire une table dans la base PostGis
version=2.7
version=3.4
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
email=si_besoin@cen-rhonealpes.fr
@@ -18,7 +19,6 @@ email=si_besoin@cen-rhonealpes.fr
hasProcessingProvider=no
# Uncomment the following line and add your changelog:
# changelog= correctif de sécurité: envoi du certificat d'authentification seulement pour les couches fonciercen et drone / intégration des styles RPG geoportail / modification des noms de couches pour plus de clarté
# Tags are comma separated with spaces allowed
tags=cenra, postgis, database
@@ -32,7 +32,7 @@ icon=icon.png
# experimental flag
experimental=False
changelog=<h2>CenRa_FLUX:</h2></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/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
@@ -45,4 +45,3 @@ deprecated=False
# If the plugin can run on QGIS Server.
server=False
+3 -2
View File
@@ -1,7 +1,8 @@
from qgis.core import QgsApplication
def gitea():
file_url = QgsApplication.qgisSettingsDirPath()+'QGIS/QGIS3.ini'
file_url = QgsApplication.qgisSettingsDirPath() + 'QGIS/QGIS3.ini'
recherche_1 = 'plugin_repositories\\github\\url=https://github.com/CEN-Rhone-Alpes/Plugin_QGIS/releases/latest/download/plugins.xml'
replace_1 = 'plugin_repositories\\gitea\\url=https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/plugins.xml'
@@ -18,4 +19,4 @@ def gitea():
# Write the file out again
with open(file_url, 'w') as file:
file.write(filedata)
file.write(filedata)
+12 -12
View File
@@ -1,17 +1,17 @@
schemaname_distinct="""SELECT DISTINCT schemaname from pg_catalog.pg_tables
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 = """SELECT schemaname,tablename from pg_catalog.pg_tables
WHERE schemaname NOT LIKE '_archives' AND schemaname NOT LIKE 'topology' AND schemaname NOT LIKE 'information_schema' AND schemaname NOT LIKE 'pg_catalog' and schemaname NOT LIKE 'public' AND schemaname NOT LIKE '_trier'
order by schemaname,tablename;"""
schemaname_list = """(SELECT schemaname,tablename from pg_catalog.pg_tables
where schemaname like 'trav%' or schemaname like '\\_ag%' or schemaname like '\\_00%' or schemaname like '\\_01%' or schemaname like '\\_07%' or schemaname like '\\_26%' or schemaname like '\\_form%' or schemaname like '\\_42%' or schemaname like '\\_69%' order by schemaname,tablename)
UNION
(SELECT schemaname,matviewname AS tablename FROM pg_catalog.pg_matviews order by schemaname,tablename) order by schemaname,tablename;"""
geom = "geom"
champ_travaux_prevus_multipolygon="""(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, surface_m2 double precision, surface_ha double precision, date_creation date, date_maj date, geom geometry(MultiPolygon,2154))"""
champ_travaux_prevus_multilinestring="""(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, longueur_m double precision, longueur_km double precision, date_creation date, date_maj date, geom geometry(MultiLineString,2154))"""
champ_travaux_prevus_multipolygon = """(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, surface_m2 double precision, surface_ha double precision, date_creation date, date_maj date, geom geometry(MultiPolygon,2154))"""
champ_travaux_prevus_multilinestring = """(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, longueur_m double precision, longueur_km double precision, date_creation date, date_maj date, geom geometry(MultiLineString,2154))"""
champ_travaux_prevus_point = """(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, x_wgs84 double precision, y_wgs84 double precision, date_creation date, date_maj date, geom geometry(Point,2154))"""
champ_viergePolygone = """(gid serial NOT NULL, commentaire text, surface_m2 double precision, surface_ha double precision, geom geometry(MultiPolygon,2154))"""
@@ -20,7 +20,7 @@ champ_viergePoint = """(gid serial NOT NULL, commentaire text, x_wgs84 double pr
champ_habitat = """(gid serial NOT NULL, cd_cb_01 text, lb_cb97_fr_01 text, occupation_01 integer, cd_cb_02 text, lb_cb97_fr_02 text, occupation_02 integer, cd_cb_03 text, lb_cb97_fr_03 text, occupation_03 integer, milieu_code text, milieu_libelle text, surface_m2 double precision, surface_ha double precision, commentaire text, date_creation date, date_maj date, geom geometry(MultiPolygon,2154))"""
champ_contour="""(gid serial NOT NULL, date_creation date, date_maj date, utilisateur character varying, dept character(2), nom character varying, surface_m2 double precision, surface_ha double precision, type_site character varying, type_milieu character varying, date_premier_pg integer, date_debut_pg integer, date_fin_pg integer, referent character varying, gestion_deleguee character varying, terrain_militaire character(3), ens character(3), zh character(3), adapt_pmr character(3), inform character(3), guide character(3), ouverture_public character(3), obs character(3), anim character(3), n2000_anim character(3), contrat_n2000_conseil character(3), n2000_op character(3), contrat_n2000_benef character(3), contrat_agri character(3), bc_habitat integer, bc_amphibien integer, bc_coleoptere integer, bc_crustace integer, bc_mammifere integer, bc_chiroptere integer, bc_mollusque integer, bc_odonate integer, bc_oiseau integer, bc_orthoptere integer, bc_poisson integer, bc_reptile integer, bc_rhopalocere integer, bc_heterocere integer, bc_autre_invertebre integer, bc_flore integer, bc_bryophyte integer, bc_champignon integer, suiv_analyse_sol character(3), suiv_piezo character(3), suiv_climat character(3), suiv_topo character(3), suiv_habitat character(3), suiv_amphibien character(3), suiv_coleoptere character(3), suiv_crustace character(3), suiv_mammifere character(3), suiv_chiroptere character(3), suiv_mollusque character(3), suiv_odonate character(3), suiv_oiseau character(3), suiv_orthoptere character(3), suiv_poisson character(3), suiv_reptile character(3), suiv_rhopalocere character(3), suiv_heterocere character(3), suiv_autre_invertebre character(3), suiv_flore character(3), suiv_bryophyte character(3), suiv_champignon character(3), suiv_analyse_eau character(3), suiv_phenologie character(3), suiv_frequentation character(3), suiv_paysager character(3), suiv_autre character(3), commentaire text, geom geometry(MultiPolygon,2154))
champ_contour = """(gid serial NOT NULL, date_creation date, date_maj date, utilisateur character varying, dept character(2), nom character varying, surface_m2 double precision, surface_ha double precision, type_site character varying, type_milieu character varying, date_premier_pg integer, date_debut_pg integer, date_fin_pg integer, referent character varying, gestion_deleguee character varying, terrain_militaire character(3), ens character(3), zh character(3), adapt_pmr character(3), inform character(3), guide character(3), ouverture_public character(3), obs character(3), anim character(3), n2000_anim character(3), contrat_n2000_conseil character(3), n2000_op character(3), contrat_n2000_benef character(3), contrat_agri character(3), bc_habitat integer, bc_amphibien integer, bc_coleoptere integer, bc_crustace integer, bc_mammifere integer, bc_chiroptere integer, bc_mollusque integer, bc_odonate integer, bc_oiseau integer, bc_orthoptere integer, bc_poisson integer, bc_reptile integer, bc_rhopalocere integer, bc_heterocere integer, bc_autre_invertebre integer, bc_flore integer, bc_bryophyte integer, bc_champignon integer, suiv_analyse_sol character(3), suiv_piezo character(3), suiv_climat character(3), suiv_topo character(3), suiv_habitat character(3), suiv_amphibien character(3), suiv_coleoptere character(3), suiv_crustace character(3), suiv_mammifere character(3), suiv_chiroptere character(3), suiv_mollusque character(3), suiv_odonate character(3), suiv_oiseau character(3), suiv_orthoptere character(3), suiv_poisson character(3), suiv_reptile character(3), suiv_rhopalocere character(3), suiv_heterocere character(3), suiv_autre_invertebre character(3), suiv_flore character(3), suiv_bryophyte character(3), suiv_champignon character(3), suiv_analyse_eau character(3), suiv_phenologie character(3), suiv_frequentation character(3), suiv_paysager character(3), suiv_autre character(3), commentaire text, geom geometry(MultiPolygon,2154))
"""
champ_vegethab_point = """(
@@ -148,4 +148,4 @@ champ_vegethab_multipolygon = """(
class_name character varying(254) COLLATE pg_catalog."default",
geom geometry(MultiPolygon,2154)
)
"""
"""
+230
View File
@@ -0,0 +1,230 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="24"
height="24"
id="svg5692"
version="1.1"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="mActionAddRasterLayer.svg"
inkscape:export-filename="/home/denis/Desktop/oracle.png"
inkscape:export-xdpi="67.5"
inkscape:export-ydpi="67.5">
<title
id="title2829">GIS icon theme 0.2</title>
<defs
id="defs5694">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 16 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="32 : 16 : 1"
inkscape:persp3d-origin="16 : 10.666667 : 1"
id="perspective3486" />
<inkscape:perspective
id="perspective3496"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3600"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective7871"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective8710"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective9811"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective4762"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="22.539029"
inkscape:cx="0.66325675"
inkscape:cy="15.235866"
inkscape:current-layer="layer2"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
borderlayer="false"
inkscape:window-width="1855"
inkscape:window-height="1056"
inkscape:window-x="65"
inkscape:window-y="24"
inkscape:window-maximized="1"
inkscape:snap-global="true"
showguides="true"
inkscape:guide-bbox="true"
inkscape:snap-object-midpoints="false"
inkscape:snap-grids="true"
inkscape:object-paths="false">
<inkscape:grid
type="xygrid"
id="grid5700"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
dotted="true"
originx="2.5px"
originy="2.5px" />
</sodipodi:namedview>
<metadata
id="metadata5697">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>GIS icon theme 0.2</dc:title>
<dc:creator>
<cc:Agent>
<dc:title>Robert Szczepanek</dc:title>
</cc:Agent>
</dc:creator>
<dc:rights>
<cc:Agent>
<dc:title>Robert Szczepanek</dc:title>
</cc:Agent>
</dc:rights>
<dc:subject>
<rdf:Bag>
<rdf:li>GIS icons</rdf:li>
</rdf:Bag>
</dc:subject>
<dc:coverage>GIS icons</dc:coverage>
<dc:description>http://robert.szczepanek.pl/</dc:description>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/3.0/" />
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/3.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Layer"
style="display:inline"
transform="translate(0,-8)">
<rect
style="fill:#6e97c4;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="rect6419"
width="7.999999"
height="7.999999"
x="7.9999986"
y="7.9999995" />
<rect
style="fill:#2b3b4d;fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
id="rect6419-6"
width="7.999999"
height="7.999999"
x="16.000002"
y="7.9999995" />
<rect
style="fill:#2b3b4d;fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
id="rect6419-6-9"
width="7.999999"
height="7.999999"
x="7.9999986"
y="16"
inkscape:transform-center-x="-3.9999992"
inkscape:transform-center-y="-5.3333316" />
<rect
style="fill:#6d97c4;fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
id="rect6419-0"
width="7.999999"
height="7.999999"
x="16.000002"
y="16" />
<rect
style="fill:#2d3e4d;fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
id="rect6419-6-7"
width="7.999999"
height="7.999999"
x="-4.7683716e-07"
y="7.9999995" />
<rect
style="fill:#6d97c4;fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
id="rect6419-3"
width="7.999999"
height="7.999999"
x="-4.7683716e-07"
y="16" />
<rect
style="fill:#6d97c4;fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
id="rect6419-5"
width="7.999999"
height="7.999999"
x="7.9999986"
y="24.000002" />
<rect
style="fill:#2b3b4d;fill-opacity:1;fill-rule:nonzero;stroke:none;display:inline"
id="rect6419-6-6"
width="7.999999"
height="7.999999"
x="-4.7683716e-07"
y="24.000002" />
<rect
style="fill:none;stroke:none"
id="rect6554"
width="23.999998"
height="23.999998"
x="-4.7683716e-07"
y="7.9999995" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.2 KiB

+312
View File
@@ -0,0 +1,312 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="24"
height="24"
id="svg5692"
version="1.1"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="mActionAddWfsLayer.svg"
inkscape:export-filename="/media/home1/robert/svn/graphics/trunk/toolbar-icons/32x32/layer-vector.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<title
id="title2829">GIS icon theme 0.2</title>
<defs
id="defs5694">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 16 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="32 : 16 : 1"
inkscape:persp3d-origin="16 : 10.666667 : 1"
id="perspective3486" />
<inkscape:perspective
id="perspective3496"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3600"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective7871"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective8710"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective9811"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective4762"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective4762-4" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective9811-2" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective8710-0" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective7871-7" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective3600-9" />
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
id="perspective3496-4" />
<inkscape:perspective
id="perspective3486-0"
inkscape:persp3d-origin="16 : 10.666667 : 1"
inkscape:vp_z="32 : 16 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 16 : 1"
sodipodi:type="inkscape:persp3d" />
<inkscape:perspective
id="perspective3952"
inkscape:persp3d-origin="12 : 8 : 1"
inkscape:vp_z="24 : 12 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 12 : 1"
sodipodi:type="inkscape:persp3d" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="16"
inkscape:cx="-0.094554179"
inkscape:cy="17.125349"
inkscape:current-layer="layer2"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
borderlayer="false"
inkscape:window-width="1855"
inkscape:window-height="1056"
inkscape:window-x="65"
inkscape:window-y="24"
inkscape:window-maximized="1"
inkscape:snap-global="true"
showguides="true"
inkscape:guide-bbox="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-grids="false"
inkscape:object-paths="false"
inkscape:snap-bbox="true"
inkscape:object-nodes="true">
<inkscape:grid
type="xygrid"
id="grid5700"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true"
dotted="true"
originx="2.5px"
originy="2.5px" />
</sodipodi:namedview>
<metadata
id="metadata5697">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>GIS icon theme 0.2</dc:title>
<dc:creator>
<cc:Agent>
<dc:title>Robert Szczepanek</dc:title>
</cc:Agent>
</dc:creator>
<dc:rights>
<cc:Agent>
<dc:title>Robert Szczepanek</dc:title>
</cc:Agent>
</dc:rights>
<dc:subject>
<rdf:Bag>
<rdf:li>GIS icons</rdf:li>
</rdf:Bag>
</dc:subject>
<dc:coverage>GIS icons</dc:coverage>
<dc:description>http://robert.szczepanek.pl/</dc:description>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/3.0/" />
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/3.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Layer"
style="display:inline"
transform="translate(0,-8)">
<g
id="g3028"
transform="matrix(0.75161647,0,0,0.75161647,-0.02586348,9.4769448)">
<path
sodipodi:nodetypes="cc"
inkscape:connector-curvature="0"
id="path3775"
d="m 16.000001,1.0775438 c 9.467477,4.6992805 8.114981,22.3215822 0,25.8460432"
style="fill:none;stroke:#749fcf;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
inkscape:connector-curvature="0"
id="path3773"
d="m 1.1225356,14.000566 29.7549294,0"
style="fill:none;stroke:#749fcf;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
sodipodi:nodetypes="cc"
inkscape:connector-curvature="0"
id="path3773-1"
d="m 2.9484075,6.9340877 c 7.5739815,1.0094969 18.3939565,1.0094969 25.9679385,0"
style="fill:none;stroke:#749fcf;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" />
<path
sodipodi:nodetypes="cc"
inkscape:connector-curvature="0"
id="path3773-4"
d="m 2.9484075,21.067042 c 7.5739815,-1.009496 18.3939565,-1.009496 25.9679385,0"
style="fill:none;stroke:#749fcf;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" />
<path
sodipodi:nodetypes="cc"
inkscape:connector-curvature="0"
id="path3777"
d="m 16.000001,1.0775438 c -8.1149812,3.5244605 -9.467478,21.1467632 0,25.8460432"
style="fill:none;stroke:#749fcf;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
transform="matrix(1.2562074,0,0,1.0871977,22.465232,-1.0129089)"
d="m 6.9656949,13.809332 c 0,6.713955 -5.4228716,12.15669 -12.1123228,12.15669 -6.6894511,0 -12.1123231,-5.442735 -12.1123231,-12.15669 0,-6.7139549 5.422872,-12.1566907 12.1123231,-12.1566907 6.6894512,0 12.1123228,5.4427358 12.1123228,12.1566907 z"
sodipodi:ry="12.156691"
sodipodi:rx="12.112323"
sodipodi:cy="13.809332"
sodipodi:cx="-5.1466279"
id="path3003"
style="fill:none;stroke:#5488c4;stroke-width:1.28353083;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
sodipodi:type="arc" />
<path
sodipodi:nodetypes="cccc"
id="path2960"
d="M 7.3400991,7.2779254 13.185401,22.026434 19.613856,7.4154701 24.89957,7.3945152"
style="color:#000000;fill:none;stroke:#172739;stroke-width:1.29794168;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
inkscape:connector-curvature="0" />
<path
transform="matrix(1.5475161,0,0,1.6212881,1.923793,-12.988176)"
d="m 4.5,12.5 c 0,0.552285 -0.4477153,1 -1,1 -0.5522847,0 -1,-0.447715 -1,-1 0,-0.552285 0.4477153,-1 1,-1 0.5522847,0 1,0.447715 1,1 z"
sodipodi:ry="1"
sodipodi:rx="1"
sodipodi:cy="12.5"
sodipodi:cx="3.5"
id="path2958"
style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#172739;stroke-width:0.94698602;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
sodipodi:type="arc" />
<path
transform="matrix(1.5839392,0,0,1.6212881,7.641614,1.7603321)"
d="m 4.5,12.5 c 0,0.552285 -0.4477153,1 -1,1 -0.5522847,0 -1,-0.447715 -1,-1 0,-0.552285 0.4477153,-1 1,-1 0.5522847,0 1,0.447715 1,1 z"
sodipodi:ry="1"
sodipodi:rx="1"
sodipodi:cy="12.5"
sodipodi:cx="3.5"
id="path2958-0"
style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#172739;stroke-width:0.93603462;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
sodipodi:type="arc" />
<path
transform="matrix(1.5475161,0,0,1.6212881,14.034218,-12.884972)"
d="m 4.5,12.5 c 0,0.552285 -0.4477153,1 -1,1 -0.5522847,0 -1,-0.447715 -1,-1 0,-0.552285 0.4477153,-1 1,-1 0.5522847,0 1,0.447715 1,1 z"
sodipodi:ry="1"
sodipodi:rx="1"
sodipodi:cy="12.5"
sodipodi:cx="3.5"
id="path2958-9"
style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#172739;stroke-width:0.94698602;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
sodipodi:type="arc" />
<path
transform="matrix(1.5475161,0,0,1.6212881,19.483264,-12.871586)"
d="m 4.5,12.5 c 0,0.552285 -0.4477153,1 -1,1 -0.5522847,0 -1,-0.447715 -1,-1 0,-0.552285 0.4477153,-1 1,-1 0.5522847,0 1,0.447715 1,1 z"
sodipodi:ry="1"
sodipodi:rx="1"
sodipodi:cy="12.5"
sodipodi:cx="3.5"
id="path2958-6"
style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#172739;stroke-width:0.94698602;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
sodipodi:type="arc" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 13 KiB

+26 -21
View File
@@ -77,15 +77,17 @@ def plugin_test_data_path(*args, copy=False):
else:
return path
def pyperclip():
dst = dirname(dirname(__file__))+"\\tools\\"
if os.access('N:/',os.R_OK):
dst = dirname(dirname(__file__)) + "\\tools\\"
if os.access('N:/', os.R_OK):
src = 'N:/SI_Systeme d information/Z_QGIS/PLUGIN/PythonSQL.py'
try:
shutil.copy(src, dst)
except:
except NameError:
print('404')
def resources_path(*args):
"""Get the path to our resources folder.
@@ -112,62 +114,65 @@ def load_ui(*args):
ui_class, _ = uic.loadUiType(resources_path("ui", *args))
return ui_class
def send_issues(url,titre,body,labels):
def send_issues(url, titre, body, labels):
import requests
import json
import os
import qgis
# import os
# import qgis
usr = os.environ['USERNAME']
# usr = os.environ['USERNAME']
token = '9d0a4e0bea561710e0728f161f7edf4e5201e112'
url=url+'?token='+token
headers = {'Authorization': 'token ' + token,'accept': 'application/json','Content-Type': 'application/json'}
url = url + '?token=' + token
headers = {'Authorization': 'token ' + token, 'accept': 'application/json', 'Content-Type': 'application/json'}
payload = {'title': titre, 'body': body, 'labels': labels}
try:
urllib.request.urlopen('https://google.com')
binar = True
except:
except NameError:
binar = False
r = ''
if binar:
r = requests.post(url, data=json.dumps(payload), headers=headers)
return r
def maj_verif(NAME):
import qgis
import urllib.request
iface = qgis.utils.iface
from qgis.core import Qgis
url = qgis.utils.pluginMetadata(NAME,'repository')
#URL = url+'/raw/branch/main/plugins.xml'
# url = 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)
version = qgis.utils.pluginMetadata(NAME,'version')
# print(URL)
version = qgis.utils.pluginMetadata(NAME, 'version')
len_version = len(version)
try:
urllib.request.urlopen('https://google.com')
binar = True
except:
except NameError:
binar = False
if binar:
try:
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]
valeur_version_web = version_web.find('<version>', plugin_num) + 9
version_plugin = version_web[valeur_version_web: valeur_version_web + len_version]
if version_plugin != version:
iface.messageBar().pushMessage("MAJ :", "Des mise à jour de plugin sont disponibles.", level=Qgis.Info, duration=30)
except:
except NameError:
print("error gitea version ssl")
else:
iface.messageBar().pushMessage("WiFi :", "Pas de connection à internet.", level=Qgis.Warning, duration=30)
def devlog(NAME):
import qgis
devmaj = '<head><style>* {margin:0; padding:0; }</style></head>'
devmaj = devmaj+qgis.utils.pluginMetadata(NAME,'changelog')
return devmaj
devmaj = devmaj + qgis.utils.pluginMetadata(NAME, 'changelog')
return devmaj
+26 -41
View File
@@ -59,7 +59,7 @@
</size>
</property>
<property name="inputMethodHints">
<set>Qt::ImhNoEditMenu</set>
<set>Qt::ImhNoEditMenu|Qt::ImhNoTextHandles</set>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
@@ -159,9 +159,15 @@
<height>181</height>
</rect>
</property>
<property name="inputMethodHints">
<set>Qt::ImhNoEditMenu|Qt::ImhNoTextHandles</set>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
</widget>
<widget class="QComboBox" name="comboBox">
<property name="geometry">
@@ -235,9 +241,15 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="editTriggers">
<set>QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked</set>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
@@ -326,24 +338,6 @@
</size>
</property>
</widget>
<widget class="QWebView" name="viewer" native="true">
<property name="geometry">
<rect>
<x>90</x>
<y>10</y>
<width>730</width>
<height>730</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(255, 255, 255,0.50);</string>
</property>
<property name="url" stdset="0">
<url>
<string>about:blank</string>
</url>
</property>
</widget>
<widget class="QCheckBox" name="checkBox">
<property name="geometry">
<rect>
@@ -379,33 +373,24 @@
<string notr="true"/>
</property>
</widget>
<zorder>viewer</zorder>
<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>
<widget class="QTextBrowser" name="viewer">
<property name="geometry">
<rect>
<x>90</x>
<y>10</y>
<width>731</width>
<height>731</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(255, 255, 255,0.50);</string>
</property>
</widget>
</widget>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header location="global">QtWebKitWidgets/QWebView</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
+3 -18
View File
@@ -29,9 +29,6 @@
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
@@ -41,7 +38,7 @@
<x>0</x>
<y>0</y>
<width>453</width>
<height>547</height>
<height>570</height>
</rect>
</property>
<widget class="QGroupBox" name="groupBox">
@@ -56,7 +53,7 @@
<property name="title">
<string>DevLog</string>
</property>
<widget class="QWebView" name="viewer" native="true">
<widget class="QTextBrowser" name="viewer">
<property name="geometry">
<rect>
<x>10</x>
@@ -65,11 +62,6 @@
<height>511</height>
</rect>
</property>
<property name="url" stdset="0">
<url>
<string>about:blank</string>
</url>
</property>
</widget>
</widget>
</widget>
@@ -78,19 +70,12 @@
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
<set>QDialogButtonBox::NoButton</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header location="global">QtWebKitWidgets/QWebView</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
+4 -3
View File
@@ -36,7 +36,8 @@ from .editor import Metabase_Editor
from .about_form import MetabaseAboutDialog
#from CenRa_Metabase.issues import CenRa_Issues
from PyQt5.QtCore import *
from qgis.PyQt.QtCore import *
class PgMetadata:
def __init__(self):
@@ -106,7 +107,7 @@ class PgMetadata:
if not self.dock:
self.dock = CenRa_Metabase()
iface.addDockWidget(Qt.RightDockWidgetArea, self.dock)
iface.addDockWidget(Qt.DockWidgetArea(0x2), self.dock)
# Open/close the dock from plugin menu
self.dock_action = QAction(icon, 'CenRa_Metabase', iface.mainWindow())
@@ -157,7 +158,7 @@ class PgMetadata:
About dialog
"""
dialog = MetabaseAboutDialog(iface)
dialog.exec_()
dialog.exec()
def open_help():
""" Open the online help. """
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
+1 -1
View File
@@ -12,7 +12,7 @@ ABOUT_FORM_CLASS, _ = uic.loadUiType(
os.path.join(
str(Path(__file__).resolve().parent),
'tools/ui',
'CenRa_Metabase_about_form.ui'
'CenRa_about_form.ui'
)
)
+13 -9
View File
@@ -27,7 +27,7 @@ from qgis.core import (
from qgis.PyQt.QtCore import QLocale, QUrl
from qgis.PyQt.QtGui import QDesktopServices, QIcon
from qgis.PyQt.QtPrintSupport import QPrinter
from qgis.PyQt.QtWebKitWidgets import QWebPage
#from qgis.PyQt.QtWebKitWidgets import QWebPage
from qgis.PyQt.QtWidgets import (
QDialog,
QAction,
@@ -47,7 +47,11 @@ from pg_metadata.connection_manager import (
settings_connections_names,
)
'''
from .tools.PythonSQL import login_base
try:
from .tools.PythonSQL import login_base
except:
print('Pas de fichier PythonSQL')
from .tools.resources import (
load_ui,
resources_path,
@@ -80,8 +84,8 @@ class CenRa_Metabase(QDockWidget, DOCK_CLASS):
self.current_datasource_uri = None
self.current_connection = None
self.viewer.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks)
self.viewer.page().linkClicked.connect(self.open_link)
#self.viewer.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks)
#self.viewer.page().linkClicked.connect(self.open_link)
# Help button
self.external_help.setText('')
@@ -97,7 +101,7 @@ class CenRa_Metabase(QDockWidget, DOCK_CLASS):
# Settings menu
self.config.setAutoRaise(True)
#self.config.setToolTip(tr("Settings"))
self.config.setPopupMode(QToolButton.InstantPopup)
self.config.setPopupMode(QToolButton.ToolButtonPopupMode(2))
self.config.setIcon(QgsApplication.getThemeIcon("/mActionOptions.svg"))
self.auto_open_dock_action = QAction(
@@ -115,7 +119,7 @@ class CenRa_Metabase(QDockWidget, DOCK_CLASS):
# Setting PDF/HTML menu
self.save_button.setAutoRaise(True)
#self.save_button.setToolTip(tr("Save metadata"))
self.save_button.setPopupMode(QToolButton.InstantPopup)
self.save_button.setPopupMode(QToolButton.ToolButtonPopupMode(2))
self.save_button.setIcon(QIcon(QgsApplication.iconPath('mActionFileSave.svg')))
self.save_as_pdf = QAction(
@@ -187,8 +191,8 @@ class CenRa_Metabase(QDockWidget, DOCK_CLASS):
if output_format == OutputFormats.PDF:
printer = QPrinter()
printer.setOutputFormat(QPrinter.PdfFormat)
printer.setPageMargins(20, 20, 20, 20, QPrinter.Millimeter)
printer.setOutputFormat(QPrinter.OutputFormat(1))
#printer.setPageMargins(20,20,20,20,QPrinter.Unit(0))
printer.setOutputFileName(output_file_path)
self.viewer.print(printer)
iface.messageBar().pushSuccess(
@@ -353,7 +357,7 @@ publisher+
# It must be a file, even if it does not exist on the file system.
base_url = QUrl.fromLocalFile(resources_path('images', 'must_be_a_file.png'))
self.viewer.setHtml(html, base_url)
self.viewer.setHtml(html)#, base_url)
def ce_trouve_dans_psql(self,layer):
try:
+7 -3
View File
@@ -20,11 +20,11 @@ from qgis.core import (
QgsGeometry,
QgsWkbTypes,
)
from PyQt5 import QtGui
from qgis.PyQt import QtGui
from qgis.PyQt.QtCore import QLocale, QUrl, QDateTime
from qgis.PyQt.QtGui import QDesktopServices, QIcon
from qgis.PyQt.QtPrintSupport import QPrinter
from qgis.PyQt.QtWebKitWidgets import QWebPage
#from qgis.PyQt.QtWebKitWidgets import QWebPage
from qgis.PyQt.QtWidgets import (
QDialog,
QAction,
@@ -38,7 +38,11 @@ from qgis.PyQt.QtWidgets import (
)
from qgis.utils import iface
from .tools.PythonSQL import login_base
try:
from .tools.PythonSQL import login_base
except:
print('Pas de fichier PythonSQL')
from .tools.resources import (
load_ui,
resources_path,
+3 -2
View File
@@ -5,8 +5,9 @@
[general]
name=CenRa_Metabase
qgisMinimumVersion=3.0
supportsQt6=True
description=CenRa_METABASE
version=0.2.1
version=0.3.0
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
email=si_besoin@cen-rhonealpes.fr
@@ -21,7 +22,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>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>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
@@ -64,24 +64,11 @@
</layout>
</item>
<item>
<widget class="QWebView" name="viewer" native="true">
<property name="url" stdset="0">
<url>
<string>about:blank</string>
</url>
</property>
</widget>
<widget class="QTextBrowser" name="viewer"/>
</item>
</layout>
</widget>
</widget>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header location="global">QtWebKitWidgets/QWebView</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
@@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>Metabase</string>
<string>Journal des modifications</string>
</property>
<property name="windowIcon">
<iconset>
@@ -29,9 +29,6 @@
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
@@ -41,7 +38,7 @@
<x>0</x>
<y>0</y>
<width>453</width>
<height>547</height>
<height>570</height>
</rect>
</property>
<widget class="QGroupBox" name="groupBox">
@@ -56,7 +53,7 @@
<property name="title">
<string>DevLog</string>
</property>
<widget class="QWebView" name="viewer" native="true">
<widget class="QTextBrowser" name="viewer">
<property name="geometry">
<rect>
<x>10</x>
@@ -65,11 +62,6 @@
<height>511</height>
</rect>
</property>
<property name="url" stdset="0">
<url>
<string>about:blank</string>
</url>
</property>
</widget>
</widget>
</widget>
@@ -78,19 +70,12 @@
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
<set>QDialogButtonBox::NoButton</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header location="global">QtWebKitWidgets/QWebView</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
+3 -2
View File
@@ -32,7 +32,8 @@ from .tools.resources import (
from .canvas_editor import PageRender_Editor
from .about_form import AboutDialog
from PyQt5.QtCore import *
from qgis.PyQt.QtCore import *
class PgPageRender:
def __init__(self):
@@ -115,7 +116,7 @@ class PgPageRender:
About dialog
"""
dialog = AboutDialog(iface)
dialog.exec_()
dialog.exec()
def open_help():
""" Open the online help. """
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
+11 -9
View File
@@ -1,6 +1,5 @@
import logging
import os
from PyQt5.QtCore import QSettings,QPointF
from collections import namedtuple
from enum import Enum
from functools import partial
@@ -44,7 +43,7 @@ from qgis.core import (
from qgis.PyQt.QtCore import QLocale, QUrl, QDateTime, Qt
from qgis.PyQt.QtGui import QDesktopServices, QIcon, QColor, QFont, QMovie
from qgis.PyQt.QtPrintSupport import QPrinter
from qgis.PyQt.QtWebKitWidgets import QWebPage
#from qgis.PyQt.QtWebKitWidgets import QWebPage
from qgis.PyQt.QtWidgets import (
QDialog,
QAction,
@@ -57,8 +56,11 @@ from qgis.PyQt.QtWidgets import (
QTableWidgetItem,
QVBoxLayout,
)
from PyQt5 import QtGui
from PyQt5.QtWidgets import QApplication
from qgis.PyQt import QtGui
from qgis.PyQt.QtWidgets import QApplication
from qgis.PyQt.QtCore import QSettings,QPointF
from qgis.PyQt.QtXml import QDomDocument
from qgis.utils import iface
import glob
@@ -158,7 +160,7 @@ class PageRender_Editor(QDialog, EDITOR_CLASS):
self.verticalScrollBar.setValue(self.frame.y())
def mousePressEvent(self, event):
if self.tableWidget.currentItem() != None:
QApplication.setOverrideCursor(Qt.OpenHandCursor)
QApplication.setOverrideCursor(Qt.CursorShape(18))
global lastPos
lastPos = {'x':event.pos().x(),'y':event.pos().y()}
@@ -167,13 +169,13 @@ class PageRender_Editor(QDialog, EDITOR_CLASS):
def keyPressEvent(self, event):
#if event.modifiers() & Qt.ControlModifier:
if event.key() == Qt.Key_Up:
if event.key() == Qt.Key(0x01000015):
self.verticalSlider.setValue(self.spinBox_2.value()+1)
if event.key() == Qt.Key_Down:
if event.key() == Qt.Key(0x01000013):
self.verticalSlider.setValue(self.spinBox_2.value()-1)
if event.key() == Qt.Key_Right:
if event.key() == Qt.Key(0x01000014):
self.horizontalSlider.setValue(self.spinBox.value()+1)
if event.key() == Qt.Key_Left:
if event.key() == Qt.Key(0x01000012):
self.horizontalSlider.setValue(self.spinBox.value()-1)
+3 -2
View File
@@ -5,8 +5,9 @@
[general]
name=CenRa_PageRender
qgisMinimumVersion=3.0
supportsQt6=True
description=CenRa_PageRender
version=0.1.6
version=0.2.0
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
email=si_besoin@cen-rhonealpes.fr
@@ -21,7 +22,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>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>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
+3 -18
View File
@@ -29,9 +29,6 @@
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
@@ -41,7 +38,7 @@
<x>0</x>
<y>0</y>
<width>453</width>
<height>547</height>
<height>570</height>
</rect>
</property>
<widget class="QGroupBox" name="groupBox">
@@ -56,7 +53,7 @@
<property name="title">
<string>DevLog</string>
</property>
<widget class="QWebView" name="viewer" native="true">
<widget class="QTextBrowser" name="viewer">
<property name="geometry">
<rect>
<x>10</x>
@@ -65,11 +62,6 @@
<height>511</height>
</rect>
</property>
<property name="url" stdset="0">
<url>
<string>about:blank</string>
</url>
</property>
</widget>
</widget>
</widget>
@@ -78,19 +70,12 @@
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
<set>QDialogButtonBox::NoButton</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header location="global">QtWebKitWidgets/QWebView</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
+3 -2
View File
@@ -28,7 +28,8 @@ from .postgis_creator import Postgis_Creator
from .postgis_rename import Postgis_Rename
from .about_form import AboutDialog
from PyQt5.QtCore import *
from qgis.PyQt.QtCore import *
IPAddr=socket.gethostbyname(socket.gethostname())
@@ -119,7 +120,7 @@ class PgPostgis:
About dialog
"""
dialog = AboutDialog(iface)
dialog.exec_()
dialog.exec()
def open_help():
""" Open the online help. """
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
+1 -1
View File
@@ -3,7 +3,7 @@ import os.path
from pathlib import Path
from qgis.PyQt import uic
from qgis.PyQt.QtGui import QPixmap
# from qgis.PyQt.QtGui import QPixmap
from qgis.PyQt.QtWidgets import QDialog
from .tools.resources import devlog
+3 -2
View File
@@ -11,8 +11,9 @@
[general]
name=CenRa_POSTGIS
qgisMinimumVersion=3.0
supportsQt6=True
description=Permet de crée un dossier dans la base PostGis
version=2.7
version=3.0
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
email=si_besoin@cen-rhonealpes.fr
@@ -21,7 +22,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>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>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
+11 -5
View File
@@ -9,13 +9,19 @@ import qgis
from qgis.PyQt.QtCore import QSettings
from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog,QMessageBox
from qgis.PyQt.QtGui import QIcon
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5 import QtGui
from qgis.PyQt.QtCore import *
from qgis.PyQt.QtGui import *
from qgis.PyQt import QtGui
from qgis.core import *
from qgis.core import QgsDataSourceUri
from .tools.PythonSQL import login_base
try:
from .tools.PythonSQL import login_base
except:
print('Pas de fichier PythonSQL')
from .tools.SQLRequet import *
from .tools.resources import (
@@ -55,7 +61,7 @@ class Postgis_Creator(QDialog, EDITOR_CLASS):
# show the dialog
self.show()
# Run the dialog event loop
result = self.exec_()
result = self.exec()
# See if OK was pressed
if result == 1:
+10 -5
View File
@@ -9,13 +9,18 @@ import qgis
from qgis.PyQt.QtCore import QSettings
from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog
from qgis.PyQt.QtGui import QIcon
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5 import QtGui
from qgis.PyQt.QtCore import *
from qgis.PyQt.QtGui import *
from qgis.PyQt import QtGui
from qgis.core import *
from qgis.core import QgsDataSourceUri
from .tools.PythonSQL import login_base
try:
from .tools.PythonSQL import login_base
except:
print('Pas de fichier PythonSQL')
from .tools.SQLRequet import *
from .tools.resources import (
@@ -86,7 +91,7 @@ class Postgis_Editor(QDialog, EDITOR_CLASS):
# show the dialog
self.show()
# Run the dialog event loop
result = self.exec_()
result = self.exec()
# See if OK was pressed
if result == 1:
#******************************debut script*********************************
+15 -10
View File
@@ -9,13 +9,18 @@ import qgis
from qgis.PyQt.QtCore import QSettings
from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog, QMessageBox,QDialogButtonBox
from qgis.PyQt.QtGui import QIcon
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5 import QtGui
from qgis.PyQt.QtCore import *
from qgis.PyQt.QtGui import *
from qgis.PyQt import QtGui
from qgis.core import *
from qgis.core import QgsDataSourceUri
from .tools.PythonSQL import login_base
try:
from .tools.PythonSQL import login_base
except:
print('Pas de fichier PythonSQL')
from .tools.SQLRequet import *
from .tools.resources import (
@@ -66,7 +71,7 @@ class Postgis_Rename(QDialog, EDITOR_CLASS):
def raise_(self):
self.activateWindow()
self.groupBox_3.hide()
self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False)
self.buttonBox.button(QDialogButtonBox.StandardButton(0x00000400)).setEnabled(False)
GET_ALL_SCHEMA = """SELECT DISTINCT table_schema FROM information_schema.tables WHERE table_schema LIKE '_form_%' OR table_schema LIKE '_01_%' OR table_schema LIKE '_07_%' OR table_schema LIKE '_26_%' OR table_schema LIKE '_42_%' OR table_schema LIKE '_69_%' ORDER BY table_schema;"""
cur.execute(GET_ALL_SCHEMA)
AllSchema = cur.fetchall()
@@ -115,10 +120,10 @@ class Postgis_Rename(QDialog, EDITOR_CLASS):
if allIsGood == 2:
self.groupBox_3.show()
self.loadValue()
self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(True)
self.buttonBox.button(QDialogButtonBox.StandardButton(0x00000400)).setEnabled(True)
else:
self.groupBox_3.hide()
self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False)
self.buttonBox.button(QDialogButtonBox.StandardButton(0x00000400)).setEnabled(False)
else:
self.old_name.setText('')
self.compte.setChecked(0)
@@ -217,9 +222,9 @@ class Postgis_Rename(QDialog, EDITOR_CLASS):
def msgBox(self):
self.QMBquestion = QMessageBox()
self.QMBquestion.setWindowTitle(u"Attention !")
self.QMBquestion.setIcon(QMessageBox.Warning)
self.QMBquestion.setIcon(QMessageBox.Icon.Warning)
self.QMBquestion.setText("Attention, le renommage de dossier PostGIS peut engendrer des pertes de liaisons avec des projets QGIS !")
self.QMBquestion.setStandardButtons(QMessageBox.Yes|QMessageBox.No)
self.QMBquestion.setStandardButtons(QMessageBox.StandardButton(0x00004000)|QMessageBox.StandardButton(0x00010000))
if self.new_name.text() != '':
error_caracteres = 0
for caracteres in ch :
@@ -231,5 +236,5 @@ class Postgis_Rename(QDialog, EDITOR_CLASS):
QMessageBox.warning(None, "Oups :", u"Le nom de dossier ne doit pas comporter de caractères spéciaux, ni d'espaces !\n\n\t" + self.new_name.text().lower() )
else:
QMessageBox.warning(None, "Oups :", "Votre projet doit avoire un nom !")
if self.QMBquestion == QMessageBox.Yes:
if self.QMBquestion == QMessageBox.StandardButton(0x00004000):
self.updateName()
+3 -18
View File
@@ -29,9 +29,6 @@
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
@@ -41,7 +38,7 @@
<x>0</x>
<y>0</y>
<width>453</width>
<height>547</height>
<height>570</height>
</rect>
</property>
<widget class="QGroupBox" name="groupBox">
@@ -56,7 +53,7 @@
<property name="title">
<string>DevLog</string>
</property>
<widget class="QWebView" name="viewer" native="true">
<widget class="QTextBrowser" name="viewer">
<property name="geometry">
<rect>
<x>10</x>
@@ -65,11 +62,6 @@
<height>511</height>
</rect>
</property>
<property name="url" stdset="0">
<url>
<string>about:blank</string>
</url>
</property>
</widget>
</widget>
</widget>
@@ -78,19 +70,12 @@
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
<set>QDialogButtonBox::NoButton</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header location="global">QtWebKitWidgets/QWebView</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
+3 -18
View File
@@ -29,9 +29,6 @@
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
@@ -41,7 +38,7 @@
<x>0</x>
<y>0</y>
<width>453</width>
<height>547</height>
<height>570</height>
</rect>
</property>
<widget class="QGroupBox" name="groupBox">
@@ -56,7 +53,7 @@
<property name="title">
<string>DevLog</string>
</property>
<widget class="QWebView" name="viewer" native="true">
<widget class="QTextBrowser" name="viewer">
<property name="geometry">
<rect>
<x>10</x>
@@ -65,11 +62,6 @@
<height>511</height>
</rect>
</property>
<property name="url" stdset="0">
<url>
<string>about:blank</string>
</url>
</property>
</widget>
</widget>
</widget>
@@ -78,19 +70,12 @@
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
<set>QDialogButtonBox::NoButton</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header location="global">QtWebKitWidgets/QWebView</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
+3 -2
View File
@@ -11,8 +11,9 @@
[general]
name=CenRa SICEN
qgisMinimumVersion=3.0
supportsQt6=True
description=Filtre des données saisies dans SICEN et export d'une liste d'espèces.
version=1.9
version=2.0
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
email=si_besoin@cen-rhonealpes.fr
@@ -21,7 +22,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>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>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
+4 -3
View File
@@ -5,9 +5,10 @@
# Created by: The Resource Compiler for PyQt5 (Qt v5.15.2)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
try:
from PyQt5 import QtCore
except:
from PyQt6 import QtCore
qt_resource_data = b"\
\x00\x00\x0d\x89\
\x89\
+12 -6
View File
@@ -32,8 +32,12 @@ from qgis.utils import iface"""
from builtins import str
from builtins import object
import os
from PyQt5.QtCore import *
from PyQt5.QtGui import *
try:
from PyQt5.QtCore import *
from PyQt5.QtGui import *
except:
from PyQt6.QtCore import *
from PyQt6.QtGui import *
from qgis.PyQt import uic
from qgis.core import *
from qgis.core import QgsDataSourceUri, QgsWkbTypes, QgsLayerTreeGroup, QgsLayerTreeLayer
@@ -48,8 +52,10 @@ from .sicendialog import SICENDialog
from .tools.resources import maj_verif,pyperclip
pyperclip()
from .tools.PythonSQL import login_base
try:
from .tools.PythonSQL import login_base
except:
print('Pas de fichier PythonSQL')
import os.path
import qgis
import datetime
@@ -150,7 +156,7 @@ class SICEN(object):
def open_about_dialog(self):
dialog = AboutDialog(self.iface)
dialog.exec_()
dialog.exec()
def unload(self):
# Remove the plugin menu item and icon
@@ -263,7 +269,7 @@ class SICEN(object):
# show the dialog
self.dlg.show()
# Run the dialog event loop
result = self.dlg.exec_()
result = self.dlg.exec()
# See if OK was pressed
if result == 1:
+41 -41
View File
@@ -33,8 +33,8 @@ class Ui_SICEN(object):
SICEN.resize(592, 556)
self.buttonBox = QDialogButtonBox(SICEN)
self.buttonBox.setGeometry(QtCore.QRect(390, 520, 161, 32))
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel|QDialogButtonBox.Ok)
#self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QDialogButtonBox.StandardButton(0x00400000)|QDialogButtonBox.StandardButton(0x00000400))
self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
self.Titre = QLabel(SICEN)
self.Titre.setGeometry(QtCore.QRect(110, 10, 331, 31))
@@ -46,8 +46,8 @@ class Ui_SICEN(object):
self.Titre.setObjectName(_fromUtf8("Titre"))
self.Emprise = QTabWidget(SICEN)
self.Emprise.setGeometry(QtCore.QRect(10, 80, 571, 431))
self.Emprise.setTabPosition(QTabWidget.North)
self.Emprise.setTabShape(QTabWidget.Rounded)
self.Emprise.setTabPosition(QTabWidget.TabPosition(0))
self.Emprise.setTabShape(QTabWidget.TabShape(0))
self.Emprise.setObjectName(_fromUtf8("Emprise"))
self.tab_2 = QWidget()
self.tab_2.setObjectName(_fromUtf8("tab_2"))
@@ -57,7 +57,7 @@ class Ui_SICEN(object):
font.setBold(True)
font.setWeight(75)
self.groupBox_4.setFont(font)
self.groupBox_4.setAlignment(QtCore.Qt.AlignCenter)
self.groupBox_4.setAlignment(QtCore.Qt.Alignment(5))
self.groupBox_4.setObjectName(_fromUtf8("groupBox_4"))
self.gridLayoutWidget_5 = QWidget(self.groupBox_4)
self.gridLayoutWidget_5.setGeometry(QtCore.QRect(10, 20, 521, 51))
@@ -99,7 +99,7 @@ class Ui_SICEN(object):
font.setBold(True)
font.setWeight(75)
self.groupBox_5.setFont(font)
self.groupBox_5.setAlignment(QtCore.Qt.AlignCenter)
self.groupBox_5.setAlignment(QtCore.Qt.Alignment(5))
self.groupBox_5.setObjectName(_fromUtf8("groupBox_5"))
self.gridLayoutWidget_6 = QWidget(self.groupBox_5)
self.gridLayoutWidget_6.setGeometry(QtCore.QRect(10, 20, 521, 41))
@@ -113,7 +113,7 @@ class Ui_SICEN(object):
font.setItalic(True)
font.setWeight(50)
self.label.setFont(font)
self.label.setAlignment(QtCore.Qt.AlignCenter)
self.label.setAlignment(QtCore.Qt.Alignment(5))
self.label.setObjectName(_fromUtf8("label"))
self.gridLayout_6.addWidget(self.label, 0, 0, 1, 1)
self.label_2 = QLabel(self.gridLayoutWidget_6)
@@ -122,7 +122,7 @@ class Ui_SICEN(object):
font.setItalic(True)
font.setWeight(50)
self.label_2.setFont(font)
self.label_2.setAlignment(QtCore.Qt.AlignCenter)
self.label_2.setAlignment(QtCore.Qt.Alignment(5))
self.label_2.setObjectName(_fromUtf8("label_2"))
self.gridLayout_6.addWidget(self.label_2, 0, 1, 1, 1)
self.nom_com_1 = QComboBox(self.gridLayoutWidget_6)
@@ -147,7 +147,7 @@ class Ui_SICEN(object):
font.setBold(True)
font.setWeight(75)
self.groupBox_7.setFont(font)
self.groupBox_7.setAlignment(QtCore.Qt.AlignCenter)
self.groupBox_7.setAlignment(QtCore.Qt.Alignment(5))
self.groupBox_7.setObjectName(_fromUtf8("groupBox_7"))
self.gridLayoutWidget_8 = QWidget(self.groupBox_7)
self.gridLayoutWidget_8.setGeometry(QtCore.QRect(10, 20, 520, 191))
@@ -161,7 +161,7 @@ class Ui_SICEN(object):
font.setItalic(True)
font.setWeight(50)
self.label_3.setFont(font)
self.label_3.setAlignment(QtCore.Qt.AlignCenter)
self.label_3.setAlignment(QtCore.Qt.Alignment(5))
self.label_3.setObjectName(_fromUtf8("label_3"))
self.gridLayout_8.addWidget(self.label_3, 0, 0, 1, 1)
self.label_4 = QLabel(self.gridLayoutWidget_8)
@@ -170,7 +170,7 @@ class Ui_SICEN(object):
font.setItalic(True)
font.setWeight(50)
self.label_4.setFont(font)
self.label_4.setAlignment(QtCore.Qt.AlignCenter)
self.label_4.setAlignment(QtCore.Qt.Alignment(5))
self.label_4.setObjectName(_fromUtf8("label_4"))
self.gridLayout_8.addWidget(self.label_4, 0, 1, 1, 1)
self.date_min = QCalendarWidget(self.gridLayoutWidget_8)
@@ -188,7 +188,7 @@ class Ui_SICEN(object):
font.setBold(True)
font.setWeight(75)
self.groupBox_8.setFont(font)
self.groupBox_8.setAlignment(QtCore.Qt.AlignCenter)
self.groupBox_8.setAlignment(QtCore.Qt.Alignment(5))
self.groupBox_8.setObjectName(_fromUtf8("groupBox_8"))
self.gridLayoutWidget_9 = QWidget(self.groupBox_8)
self.gridLayoutWidget_9.setGeometry(QtCore.QRect(10, 20, 491, 21))
@@ -202,7 +202,7 @@ class Ui_SICEN(object):
font.setBold(False)
font.setWeight(50)
self.Animalia.setFont(font)
self.Animalia.setLayoutDirection(QtCore.Qt.RightToLeft)
self.Animalia.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.Animalia.setObjectName(_fromUtf8("Animalia"))
self.gridLayout_9.addWidget(self.Animalia, 0, 0, 1, 1)
self.Plantae = QCheckBox(self.gridLayoutWidget_9)
@@ -226,8 +226,8 @@ class Ui_SICEN(object):
font.setItalic(True)
font.setWeight(50)
self.label_6.setFont(font)
self.label_6.setLayoutDirection(QtCore.Qt.LeftToRight)
self.label_6.setAlignment(QtCore.Qt.AlignCenter)
self.label_6.setLayoutDirection(QtCore.Qt.LayoutDirection(0))
self.label_6.setAlignment(QtCore.Qt.Alignment(5))
self.label_6.setObjectName(_fromUtf8("label_6"))
self.gridLayout_11.addWidget(self.label_6, 4, 0, 1, 1)
self.nom_vern = QComboBox(self.gridLayoutWidget_10)
@@ -245,7 +245,7 @@ class Ui_SICEN(object):
font.setItalic(True)
font.setWeight(50)
self.label_5.setFont(font)
self.label_5.setAlignment(QtCore.Qt.AlignCenter)
self.label_5.setAlignment(QtCore.Qt.Alignment(5))
self.label_5.setObjectName(_fromUtf8("label_5"))
self.gridLayout_11.addWidget(self.label_5, 2, 0, 1, 1)
self.nom_complet = QComboBox(self.gridLayoutWidget_10)
@@ -271,7 +271,7 @@ class Ui_SICEN(object):
font.setItalic(True)
font.setWeight(50)
self.label_13.setFont(font)
self.label_13.setAlignment(QtCore.Qt.AlignCenter)
self.label_13.setAlignment(QtCore.Qt.Alignment(5))
self.label_13.setObjectName(_fromUtf8("label_13"))
self.gridLayout_11.addWidget(self.label_13, 0, 0, 1, 1)
self.Emprise.addTab(self.tab, _fromUtf8(""))
@@ -279,8 +279,8 @@ class Ui_SICEN(object):
self.tab_3.setObjectName(_fromUtf8("tab_3"))
self.protections = QToolBox(self.tab_3)
self.protections.setGeometry(QtCore.QRect(10, 10, 511, 391))
self.protections.setFrameShape(QFrame.NoFrame)
self.protections.setFrameShadow(QFrame.Plain)
self.protections.setFrameShape(QFrame.Shape(0))
self.protections.setFrameShadow(QFrame.Shadow(0x0010))
self.protections.setLineWidth(1)
self.protections.setObjectName(_fromUtf8("protections"))
self.page_2 = QWidget()
@@ -292,7 +292,7 @@ class Ui_SICEN(object):
font.setBold(True)
font.setWeight(75)
self.groupBox.setFont(font)
self.groupBox.setAlignment(QtCore.Qt.AlignCenter)
self.groupBox.setAlignment(QtCore.Qt.Alignment(5))
self.groupBox.setObjectName(_fromUtf8("groupBox"))
self.gridLayoutWidget_2 = QWidget(self.groupBox)
self.gridLayoutWidget_2.setGeometry(QtCore.QRect(10, 20, 491, 88))
@@ -306,7 +306,7 @@ class Ui_SICEN(object):
font.setBold(False)
font.setWeight(50)
self.LRD_38.setFont(font)
self.LRD_38.setLayoutDirection(QtCore.Qt.RightToLeft)
self.LRD_38.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.LRD_38.setObjectName(_fromUtf8("LRD_38"))
self.gridLayout_2.addWidget(self.LRD_38, 3, 0, 1, 1)
self.LRD_01 = QCheckBox(self.gridLayoutWidget_2)
@@ -314,7 +314,7 @@ class Ui_SICEN(object):
font.setBold(False)
font.setWeight(50)
self.LRD_01.setFont(font)
self.LRD_01.setLayoutDirection(QtCore.Qt.RightToLeft)
self.LRD_01.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.LRD_01.setObjectName(_fromUtf8("LRD_01"))
self.gridLayout_2.addWidget(self.LRD_01, 0, 0, 1, 1)
self.LRD_07 = QCheckBox(self.gridLayoutWidget_2)
@@ -322,7 +322,7 @@ class Ui_SICEN(object):
font.setBold(False)
font.setWeight(50)
self.LRD_07.setFont(font)
self.LRD_07.setLayoutDirection(QtCore.Qt.RightToLeft)
self.LRD_07.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.LRD_07.setObjectName(_fromUtf8("LRD_07"))
self.gridLayout_2.addWidget(self.LRD_07, 1, 0, 1, 1)
self.LRD_26 = QCheckBox(self.gridLayoutWidget_2)
@@ -330,7 +330,7 @@ class Ui_SICEN(object):
font.setBold(False)
font.setWeight(50)
self.LRD_26.setFont(font)
self.LRD_26.setLayoutDirection(QtCore.Qt.RightToLeft)
self.LRD_26.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.LRD_26.setObjectName(_fromUtf8("LRD_26"))
self.gridLayout_2.addWidget(self.LRD_26, 2, 0, 1, 1)
self.LRD_42 = QCheckBox(self.gridLayoutWidget_2)
@@ -367,7 +367,7 @@ class Ui_SICEN(object):
font.setBold(True)
font.setWeight(75)
self.groupBox_2.setFont(font)
self.groupBox_2.setAlignment(QtCore.Qt.AlignCenter)
self.groupBox_2.setAlignment(QtCore.Qt.Alignment(5))
self.groupBox_2.setObjectName(_fromUtf8("groupBox_2"))
self.gridLayoutWidget_3 = QWidget(self.groupBox_2)
self.gridLayoutWidget_3.setGeometry(QtCore.QRect(10, 20, 491, 42))
@@ -381,7 +381,7 @@ class Ui_SICEN(object):
font.setBold(False)
font.setWeight(50)
self.LRR_Flore.setFont(font)
self.LRR_Flore.setLayoutDirection(QtCore.Qt.RightToLeft)
self.LRR_Flore.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.LRR_Flore.setObjectName(_fromUtf8("LRR_Flore"))
self.gridLayout_3.addWidget(self.LRR_Flore, 0, 0, 1, 1)
self.LRR_Oiseaux = QCheckBox(self.gridLayoutWidget_3)
@@ -389,7 +389,7 @@ class Ui_SICEN(object):
font.setBold(False)
font.setWeight(50)
self.LRR_Oiseaux.setFont(font)
self.LRR_Oiseaux.setLayoutDirection(QtCore.Qt.RightToLeft)
self.LRR_Oiseaux.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.LRR_Oiseaux.setObjectName(_fromUtf8("LRR_Oiseaux"))
self.gridLayout_3.addWidget(self.LRR_Oiseaux, 1, 0, 1, 1)
self.LRR_Autre = QCheckBox(self.gridLayoutWidget_3)
@@ -405,7 +405,7 @@ class Ui_SICEN(object):
font.setBold(True)
font.setWeight(75)
self.groupBox_3.setFont(font)
self.groupBox_3.setAlignment(QtCore.Qt.AlignCenter)
self.groupBox_3.setAlignment(QtCore.Qt.Alignment(5))
self.groupBox_3.setObjectName(_fromUtf8("groupBox_3"))
self.gridLayoutWidget_4 = QWidget(self.groupBox_3)
self.gridLayoutWidget_4.setGeometry(QtCore.QRect(10, 20, 491, 42))
@@ -426,7 +426,7 @@ class Ui_SICEN(object):
font.setBold(False)
font.setWeight(50)
self.LRN_Flore.setFont(font)
self.LRN_Flore.setLayoutDirection(QtCore.Qt.RightToLeft)
self.LRN_Flore.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.LRN_Flore.setObjectName(_fromUtf8("LRN_Flore"))
self.gridLayout_4.addWidget(self.LRN_Flore, 0, 0, 1, 1)
self.LRN_Oiseaux = QCheckBox(self.gridLayoutWidget_4)
@@ -434,7 +434,7 @@ class Ui_SICEN(object):
font.setBold(False)
font.setWeight(50)
self.LRN_Oiseaux.setFont(font)
self.LRN_Oiseaux.setLayoutDirection(QtCore.Qt.RightToLeft)
self.LRN_Oiseaux.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.LRN_Oiseaux.setObjectName(_fromUtf8("LRN_Oiseaux"))
self.gridLayout_4.addWidget(self.LRN_Oiseaux, 1, 0, 1, 1)
self.LRN_Ortho = QCheckBox(self.gridLayoutWidget_4)
@@ -456,7 +456,7 @@ class Ui_SICEN(object):
font.setBold(True)
font.setWeight(75)
self.UICN.setFont(font)
self.UICN.setLayoutDirection(QtCore.Qt.RightToLeft)
self.UICN.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.UICN.setObjectName(_fromUtf8("UICN"))
self.gridLayout_12.addWidget(self.UICN, 0, 0, 1, 1)
self.LRE = QCheckBox(self.gridLayoutWidget_11)
@@ -485,19 +485,19 @@ class Ui_SICEN(object):
self.gridLayout.setHorizontalSpacing(50)
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
self.PATRI38 = QCheckBox(self.gridLayoutWidget)
self.PATRI38.setLayoutDirection(QtCore.Qt.RightToLeft)
self.PATRI38.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.PATRI38.setObjectName(_fromUtf8("PATRI38"))
self.gridLayout.addWidget(self.PATRI38, 3, 0, 1, 1)
self.PATRI01 = QCheckBox(self.gridLayoutWidget)
self.PATRI01.setLayoutDirection(QtCore.Qt.RightToLeft)
self.PATRI01.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.PATRI01.setObjectName(_fromUtf8("PATRI01"))
self.gridLayout.addWidget(self.PATRI01, 0, 0, 1, 1)
self.PATRI07 = QCheckBox(self.gridLayoutWidget)
self.PATRI07.setLayoutDirection(QtCore.Qt.RightToLeft)
self.PATRI07.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.PATRI07.setObjectName(_fromUtf8("PATRI07"))
self.gridLayout.addWidget(self.PATRI07, 1, 0, 1, 1)
self.PATRI26 = QCheckBox(self.gridLayoutWidget)
self.PATRI26.setLayoutDirection(QtCore.Qt.RightToLeft)
self.PATRI26.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.PATRI26.setObjectName(_fromUtf8("PATRI26"))
self.gridLayout.addWidget(self.PATRI26, 2, 0, 1, 1)
self.PATRI42 = QCheckBox(self.gridLayoutWidget)
@@ -529,7 +529,7 @@ class Ui_SICEN(object):
font.setBold(True)
font.setWeight(75)
self.groupBox_6.setFont(font)
self.groupBox_6.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
self.groupBox_6.setAlignment(QtCore.Qt.AlignmentFlag(0x0001)|QtCore.Qt.AlignmentFlag(0x0001)|QtCore.Qt.AlignmentFlag(0x0080))
self.groupBox_6.setObjectName(_fromUtf8("groupBox_6"))
self.gridLayoutWidget_7 = QWidget(self.groupBox_6)
self.gridLayoutWidget_7.setGeometry(QtCore.QRect(10, 20, 491, 21))
@@ -550,7 +550,7 @@ class Ui_SICEN(object):
font.setBold(False)
font.setWeight(50)
self.PD_38.setFont(font)
self.PD_38.setLayoutDirection(QtCore.Qt.RightToLeft)
self.PD_38.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
self.PD_38.setObjectName(_fromUtf8("PD_38"))
self.gridLayout_7.addWidget(self.PD_38, 0, 0, 1, 1)
self.PR = QCheckBox(self.page_3)
@@ -604,14 +604,14 @@ class Ui_SICEN(object):
self.label_12.setObjectName(_fromUtf8("label_12"))
self.gridLayout_10.addWidget(self.label_12, 1, 1, 1, 1)
self.buffer = QLineEdit(self.gridLayoutWidget_12)
sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
sizePolicy = QSizePolicy(QSizePolicy.Policy(4), QSizePolicy.Policy(0))
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.buffer.sizePolicy().hasHeightForWidth())
self.buffer.setSizePolicy(sizePolicy)
self.buffer.setMaximumSize(QtCore.QSize(100, 16777215))
self.buffer.setInputMethodHints(QtCore.Qt.ImhPreferNumbers)
self.buffer.setAlignment(QtCore.Qt.AlignCenter)
self.buffer.setInputMethodHints(QtCore.Qt.InputMethodHint(0x8))
self.buffer.setAlignment(QtCore.Qt.Alignment(5))
self.buffer.setObjectName(_fromUtf8("buffer"))
self.gridLayout_10.addWidget(self.buffer, 2, 2, 1, 1)
self.label_8 = QLabel(self.gridLayoutWidget_12)
@@ -664,7 +664,7 @@ class Ui_SICEN(object):
font.setBold(False)
font.setWeight(50)
self.bouton_geom.setFont(font)
self.bouton_geom.setLayoutDirection(QtCore.Qt.LeftToRight)
self.bouton_geom.setLayoutDirection(QtCore.Qt.LayoutDirection(0))
self.bouton_geom.setText(_fromUtf8(""))
self.bouton_geom.setIconSize(QtCore.QSize(20, 20))
self.bouton_geom.setObjectName(_fromUtf8("bouton_geom"))
+21 -21
View File
@@ -1,7 +1,7 @@
<plugins>
<pyqgis_plugin name="CenRa_POSTGIS" version="2.7">
<pyqgis_plugin name="CenRa_POSTGIS" version="3.0">
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
<version>2.7</version>
<version>3.0</version>
<qgis_minimum_version>3.16</qgis_minimum_version>
<homepage>https://plateformesig.cenra-outils.org/</homepage>
<file_name>CenRa_POSTGIS.zip</file_name>
@@ -10,15 +10,15 @@
<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-04-03</update_date>
<update_date>2025-05-19</update_date>
<experimental>False</experimental>
<deprecated>False</deprecated>
<tags>cenra,postgis</tags>
</pyqgis_plugin>
<pyqgis_plugin name="CenRa_COPIE" version="2.2">
<pyqgis_plugin name="CenRa_COPIE" version="3.0">
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
<version>2.2</version>
<version>3.0</version>
<qgis_minimum_version>3.16</qgis_minimum_version>
<homepage>https://plateformesig.cenra-outils.org/</homepage>
<file_name>CenRa_COPIE.zip</file_name>
@@ -27,15 +27,15 @@
<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-04-03</update_date>
<update_date>2025-05-19</update_date>
<experimental>False</experimental>
<deprecated>False</deprecated>
<tags>cenra,copie</tags>
</pyqgis_plugin>
<pyqgis_plugin name="CenRa_SICEN" version="1.9">
<pyqgis_plugin name="CenRa_SICEN" version="2.0">
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
<version>1.9</version>
<version>2.0</version>
<qgis_minimum_version>3.16</qgis_minimum_version>
<homepage>https://plateformesig.cenra-outils.org/</homepage>
<file_name>CenRa_SICEN.zip</file_name>
@@ -44,15 +44,15 @@
<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-04-03</update_date>
<update_date>2025-05-19</update_date>
<experimental>False</experimental>
<deprecated>False</deprecated>
<tags>cenra,sicen</tags>
</pyqgis_plugin>
<pyqgis_plugin name="CenRa_FLUX" version="2.7">
<pyqgis_plugin name="CenRa_FLUX" version="3.4">
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
<version>2.7</version>
<version>3.4</version>
<qgis_minimum_version>3.16</qgis_minimum_version>
<homepage>https://plateformesig.cenra-outils.org/</homepage>
<file_name>CenRa_FLUX.zip</file_name>
@@ -61,15 +61,15 @@
<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-04-07</update_date>
<update_date>2025-07-23</update_date>
<experimental>False</experimental>
<deprecated>False</deprecated>
<tags>cenra,flux</tags>
</pyqgis_plugin>
<pyqgis_plugin name="CenRa_METABASE" version="0.2.1">
<pyqgis_plugin name="CenRa_METABASE" version="0.3.0">
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
<version>0.2.1</version>
<version>0.3.0</version>
<qgis_minimum_version>3.16</qgis_minimum_version>
<homepage>https://plateformesig.cenra-outils.org/</homepage>
<file_name>CenRa_METABASE.zip</file_name>
@@ -78,15 +78,15 @@
<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-04-03</update_date>
<update_date>2025-05-19</update_date>
<experimental>True</experimental>
<deprecated>False</deprecated>
<tags>cenra,metabase</tags>
</pyqgis_plugin>
<pyqgis_plugin name="CenRa_AUTOMAP" version="1.4">
<pyqgis_plugin name="CenRa_AUTOMAP" version="2.0">
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
<version>1.4</version>
<version>2.0</version>
<qgis_minimum_version>3.16</qgis_minimum_version>
<homepage>https://plateformesig.cenra-outils.org/</homepage>
<file_name>CenRa_AUTOMAP.zip</file_name>
@@ -95,15 +95,15 @@
<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-04-03</update_date>
<update_date>2025-05-19</update_date>
<experimental>False</experimental>
<deprecated>False</deprecated>
<tags>cenra,mise en page,atlas</tags>
</pyqgis_plugin>
<pyqgis_plugin name="CenRa_PAGERENDER" version="0.1.6">
<pyqgis_plugin name="CenRa_PAGERENDER" version="0.2.0">
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
<version>0.1.6</version>
<version>0.2.0</version>
<qgis_minimum_version>3.16</qgis_minimum_version>
<homepage>https://plateformesig.cenra-outils.org/</homepage>
<file_name>CenRa_PAGERENDER.zip</file_name>
@@ -112,7 +112,7 @@
<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-04-03</update_date>
<update_date>2025-05-19</update_date>
<experimental>True</experimental>
<deprecated>False</deprecated>
<tags>cenra,mise en page,atlas</tags>