Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e23b9e80c0 | ||
|
|
5fd101543e | ||
|
|
def79fdaa9 | ||
|
|
eae3a80f31 | ||
|
|
61ed7b286a | ||
|
|
4a3d0a38c3 | ||
|
|
1185a7313d | ||
|
|
d844b9d416 | ||
|
|
5200a3b3c2 | ||
|
|
8c8068b330 | ||
|
|
8a1e7e6d70 | ||
|
|
2765093f1d | ||
|
|
614195fbaf | ||
|
|
ebeefb78b9 | ||
|
|
256a0ac6d4 | ||
|
|
af10bce94c | ||
|
|
8c55d902c0 | ||
|
|
5a03084daa | ||
|
|
a3b634d514 | ||
|
|
728f72cffd | ||
|
|
272b47a174 | ||
|
|
21a652fdb2 | ||
|
|
799a635edc | ||
|
|
ff2e0f22be | ||
|
|
8c1ee42080 | ||
|
|
a3479085b6 | ||
|
|
1b54026a13 | ||
|
|
670c698b77 | ||
|
|
9b438f5bf1 | ||
|
|
02681490f6 | ||
|
|
4b8bc74386 | ||
|
|
9a85e9aaae | ||
|
|
910ba14dc9 | ||
|
|
d9f27eaa0f | ||
|
|
2842526605 | ||
|
|
ec677ffc5a | ||
|
|
3c9a6a8b88 | ||
|
|
06321e4e26 | ||
|
|
83e22782f7 | ||
|
|
43acfca13b | ||
|
|
102fd30686 | ||
|
|
b3186f6e16 | ||
|
|
8e93f7051a | ||
|
|
b893764961 | ||
|
|
4051a6855b | ||
|
|
42f33f619c | ||
|
|
e4725c4ece | ||
|
|
28ee42d3ea | ||
|
|
2d2337057f | ||
|
|
ce6f30ea2c | ||
|
|
d50f601bd9 | ||
|
|
26678fb257 | ||
|
|
cef46278bc | ||
|
|
f34842bfac | ||
|
|
897ed3ae58 | ||
|
|
2236123050 | ||
|
|
9ad5baa4ed | ||
|
|
36de24532a | ||
|
|
6c1af3c61c | ||
|
|
d7267c0542 | ||
|
|
fd5d516f14 | ||
|
|
ca1d895eb1 | ||
|
|
e503423e49 | ||
|
|
3564209574 | ||
|
|
7df08ae02a | ||
|
|
133e785568 | ||
|
|
9b7ab9ab15 | ||
|
|
c02da75f0b | ||
|
|
d4b181ff61 | ||
|
|
7a3814a429 | ||
|
|
1cd816c706 | ||
|
|
94cac31fbb | ||
|
|
2690220a02 | ||
|
|
3719456f04 | ||
|
|
bea31c870b | ||
|
|
2d04e34ed2 | ||
|
|
ac070f866e | ||
|
|
4851339008 | ||
|
|
f2d11a64e4 | ||
|
|
4c52c85efb | ||
|
|
3ef37aa696 | ||
|
|
3b0758ea5c | ||
|
|
852301a537 | ||
|
|
b3451773be | ||
|
|
72a4a8a7b7 | ||
|
|
c809c12c9f | ||
|
|
bc538524fb | ||
|
|
23f21a4c39 | ||
|
|
2b00cf9106 | ||
|
|
ad49b80b5a |
@@ -4,9 +4,10 @@ __email__ = "info@3liz.org"
|
|||||||
|
|
||||||
|
|
||||||
from qgis.core import QgsApplication
|
from qgis.core import QgsApplication
|
||||||
from qgis.PyQt.QtCore import QCoreApplication, Qt, QTranslator, QUrl
|
from qgis.PyQt.QtCore import QUrl
|
||||||
|
# from qgis.PyQt.QtCore import Qt
|
||||||
from qgis.PyQt.QtGui import QDesktopServices, QIcon
|
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
|
from qgis.utils import iface
|
||||||
import qgis
|
import qgis
|
||||||
|
|
||||||
@@ -24,19 +25,22 @@ from pg_metadata.processing.provider import PgMetadataProvider
|
|||||||
from pg_metadata.qgis_plugin_tools.tools.custom_logging import setup_logger
|
from pg_metadata.qgis_plugin_tools.tools.custom_logging import setup_logger
|
||||||
'''
|
'''
|
||||||
import os
|
import os
|
||||||
|
from qgis.PyQt.QtCore import QSettings
|
||||||
|
from .about_form import AboutDialog
|
||||||
from .tools.resources import (
|
from .tools.resources import (
|
||||||
plugin_path,
|
# plugin_path,
|
||||||
resources_path,
|
resources_path,
|
||||||
pyperclip,
|
pyperclip,
|
||||||
maj_verif,
|
maj_verif,
|
||||||
)
|
)
|
||||||
pyperclip()
|
pyperclip()
|
||||||
|
|
||||||
|
try:
|
||||||
from .canvas_editor import AutoMap_Editor
|
from .canvas_editor import AutoMap_Editor
|
||||||
from .style_invoke import AutoMap_Style
|
# from .style_invoke import AutoMap_Style
|
||||||
from .about_form import AboutDialog
|
except NameError:
|
||||||
|
print('404')
|
||||||
|
|
||||||
from PyQt5.QtCore import *
|
|
||||||
|
|
||||||
class PgAutoMap:
|
class PgAutoMap:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@@ -82,51 +86,19 @@ class PgAutoMap:
|
|||||||
self.toolBar.addAction(self.automap_action)
|
self.toolBar.addAction(self.automap_action)
|
||||||
self.automap_action.triggered.connect(self.open_editor)
|
self.automap_action.triggered.connect(self.open_editor)
|
||||||
|
|
||||||
if not self.style_dock:
|
# if not self.style_dock:
|
||||||
self.style_dock = AutoMap_Style()
|
# self.style_dock = AutoMap_Style()
|
||||||
|
|
||||||
if os.environ['USERNAME'] == 'tlaveille' or os.environ['USERNAME'] == 'lpoulin' or os.environ['USERNAME'] == 'rclement':
|
# 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:
|
|
||||||
self.locator_filter = LocatorFilter(iface)
|
|
||||||
iface.registerLocatorFilter(self.locator_filter)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def check_invalid_connection_names():
|
|
||||||
""" Check for invalid connection names in the QgsSettings. """
|
|
||||||
valid, invalid = validate_connections_names()
|
|
||||||
n_invalid = len(invalid)
|
|
||||||
|
|
||||||
if n_invalid == 0:
|
|
||||||
return
|
|
||||||
|
|
||||||
invalid_text = ', '.join(invalid)
|
|
||||||
msg = QMessageBox()
|
|
||||||
msg.setIcon(QMessageBox.Warning)
|
|
||||||
msg.setWindowTitle(tr('PgMetadata: Database connection(s) not available'))
|
|
||||||
msg.setText(tr(
|
|
||||||
f'{n_invalid} connection(s) listed in PgMetadata’s settings are invalid or '
|
|
||||||
f'no longer available: {invalid_text}'))
|
|
||||||
msg.setInformativeText(tr(
|
|
||||||
'Do you want to remove these connection(s) from the PgMetadata settings? '
|
|
||||||
'(You can also do this later with the “Set Connections” tool.)'))
|
|
||||||
msg.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
|
|
||||||
clicked = msg.exec()
|
|
||||||
|
|
||||||
if clicked == QMessageBox.Yes:
|
|
||||||
iface.messageBar().pushSuccess('PgMetadata', tr(f'{n_invalid} invalid connection(s) removed.'))
|
|
||||||
store_connections(valid)
|
|
||||||
if clicked == QMessageBox.No:
|
|
||||||
iface.messageBar().pushInfo('PgMetadata', tr(f'Keeping {n_invalid} invalid connections.'))
|
|
||||||
'''
|
|
||||||
def open_about_dialog(self):
|
def open_about_dialog(self):
|
||||||
"""
|
"""
|
||||||
About dialog
|
About dialog
|
||||||
"""
|
"""
|
||||||
dialog = AboutDialog(iface)
|
dialog = AboutDialog(iface)
|
||||||
dialog.exec_()
|
dialog.exec()
|
||||||
|
|
||||||
def open_help():
|
def open_help():
|
||||||
""" Open the online help. """
|
""" Open the online help. """
|
||||||
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
|
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import os.path
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from qgis.PyQt import uic
|
from qgis.PyQt import uic
|
||||||
from qgis.PyQt.QtGui import QPixmap
|
# from qgis.PyQt.QtGui import QPixmap
|
||||||
from qgis.PyQt.QtWidgets import QDialog
|
from qgis.PyQt.QtWidgets import QDialog
|
||||||
|
|
||||||
from .tools.resources import devlog
|
from .tools.resources import devlog
|
||||||
|
|||||||
@@ -1,76 +1,42 @@
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
from PyQt5.QtCore import QSettings
|
|
||||||
from collections import namedtuple
|
|
||||||
from enum import Enum
|
|
||||||
from functools import partial
|
|
||||||
from pathlib import Path
|
|
||||||
from xml.dom.minidom import parseString
|
|
||||||
from qgis.gui import *
|
|
||||||
import qgis
|
|
||||||
from importlib import import_module
|
|
||||||
from qgis.core import (
|
from qgis.core import (
|
||||||
NULL,
|
|
||||||
QgsApplication,
|
|
||||||
QgsScaleBarSettings,
|
QgsScaleBarSettings,
|
||||||
QgsDataSourceUri,
|
|
||||||
QgsProject,
|
QgsProject,
|
||||||
QgsProviderConnectionException,
|
|
||||||
QgsProviderRegistry,
|
|
||||||
QgsRasterLayer,
|
QgsRasterLayer,
|
||||||
QgsSettings,
|
QgsSettings,
|
||||||
QgsVectorLayer,
|
QgsVectorLayer,
|
||||||
QgsGeometry,
|
|
||||||
QgsPrintLayout,
|
QgsPrintLayout,
|
||||||
QgsReadWriteContext,
|
QgsReadWriteContext,
|
||||||
QgsLayoutItemMap,
|
QgsLayoutItemMap,
|
||||||
QgsLayoutItemPage,
|
QgsLayoutItemPage,
|
||||||
QgsLayoutSize,
|
|
||||||
QgsUnitTypes,
|
QgsUnitTypes,
|
||||||
QgsLayoutPoint,
|
|
||||||
QgsLayoutItemLabel,
|
QgsLayoutItemLabel,
|
||||||
QgsLayoutItemPicture,
|
QgsLayoutItemPicture,
|
||||||
QgsLayoutItemLegend,
|
QgsLayoutItemLegend,
|
||||||
|
QgsLayoutItem,
|
||||||
QgsLegendStyle,
|
QgsLegendStyle,
|
||||||
QgsLayoutItemScaleBar,
|
QgsLayoutItemScaleBar,
|
||||||
QgsLayerTreeGroup,
|
QgsLayerTreeGroup,
|
||||||
QgsCoordinateReferenceSystem,
|
|
||||||
QgsCoordinateTransform,
|
|
||||||
QgsLayerTree,
|
|
||||||
QgsLayoutTableColumn,
|
|
||||||
QgsRectangle,
|
QgsRectangle,
|
||||||
QgsLayoutItemMapOverviewStack,
|
|
||||||
)
|
)
|
||||||
from qgis.PyQt.QtCore import QLocale, QUrl, QDateTime, Qt
|
from qgis.PyQt.QtCore import Qt
|
||||||
from qgis.PyQt.QtGui import QDesktopServices, QIcon, QColor, QFont, QMovie
|
from qgis.PyQt.QtGui import QColor, QFont
|
||||||
from qgis.PyQt.QtPrintSupport import QPrinter
|
|
||||||
from qgis.PyQt.QtWebKitWidgets import QWebPage
|
|
||||||
from qgis.PyQt.QtWidgets import (
|
from qgis.PyQt.QtWidgets import (
|
||||||
QDialog,
|
QDialog,
|
||||||
QAction,
|
|
||||||
QMessageBox,
|
QMessageBox,
|
||||||
QPushButton,
|
QPushButton,
|
||||||
QDockWidget,
|
|
||||||
QFileDialog,
|
QFileDialog,
|
||||||
QInputDialog,
|
|
||||||
QMenu,
|
|
||||||
QToolButton,
|
|
||||||
QTableWidget,
|
|
||||||
QTableWidgetItem,
|
|
||||||
QVBoxLayout,
|
|
||||||
)
|
)
|
||||||
from PyQt5 import QtGui
|
from qgis.PyQt.QtCore import QSettings
|
||||||
from PyQt5 import QtWidgets
|
from qgis.PyQt import QtGui
|
||||||
from qgis.PyQt.QtXml import QDomDocument
|
from qgis.PyQt.QtXml import QDomDocument
|
||||||
from qgis.utils import iface
|
from qgis.utils import iface
|
||||||
import glob
|
import glob
|
||||||
from .tools.resources import (
|
from .tools.resources import (
|
||||||
load_ui,
|
load_ui,
|
||||||
resources_path,
|
resources_path,
|
||||||
send_issues,
|
|
||||||
)
|
)
|
||||||
from .issues import CenRa_Issues
|
|
||||||
|
|
||||||
from datetime import date
|
from datetime import date
|
||||||
|
|
||||||
EDITOR_CLASS = load_ui('CenRa_AutoMap_base.ui')
|
EDITOR_CLASS = load_ui('CenRa_AutoMap_base.ui')
|
||||||
@@ -105,8 +71,8 @@ data_source = [
|
|||||||
A4_size = {'Portrait': {'RIGHT': 210, 'LEFT': 0, 'TOP': 0, 'BOTTOM': 297}, 'Landscape': {'RIGHT': 297, 'LEFT': 0, 'TOP': 0, 'BOTTOM': 210}}
|
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}}
|
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):
|
|
||||||
|
|
||||||
|
class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
_ = parent
|
_ = parent
|
||||||
super().__init__()
|
super().__init__()
|
||||||
@@ -121,7 +87,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
for i in plugin_dir[1:]:
|
for i in plugin_dir[1:]:
|
||||||
ix = ix + 1
|
ix = ix + 1
|
||||||
path = path + '/' + i
|
path = path + '/' + i
|
||||||
self.tabWidget.setStyleSheet('background-image: url('+path+'/tools/bg/Capture.png);')
|
# self.tabWidget.setStyleSheet('background-image: url('+path+'/tools/bg/Capture.png);')
|
||||||
|
|
||||||
self.verticalScrollBar.hide()
|
self.verticalScrollBar.hide()
|
||||||
self.commandLinkButton.clicked.connect(self.chargement_qpt)
|
self.commandLinkButton.clicked.connect(self.chargement_qpt)
|
||||||
@@ -136,13 +102,12 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.CustomeLogo.clicked.connect(self.deflogoteck)
|
self.CustomeLogo.clicked.connect(self.deflogoteck)
|
||||||
self.verticalScrollBar.valueChanged.connect(self.moveFrame)
|
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 = []
|
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)
|
mises_en_page.append(filename)
|
||||||
|
|
||||||
|
|
||||||
for i, filename in enumerate(mises_en_page):
|
for i, filename in enumerate(mises_en_page):
|
||||||
nom_fichier = os.path.basename(filename)
|
nom_fichier = os.path.basename(filename)
|
||||||
self.comboBox.addItem(nom_fichier)
|
self.comboBox.addItem(nom_fichier)
|
||||||
@@ -152,15 +117,19 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
'Carte_size': None,
|
'Carte_size': None,
|
||||||
'Carte_locals': None,
|
'Carte_locals': None,
|
||||||
'Carte_rotate': None,
|
'Carte_rotate': None,
|
||||||
|
'Carte_frame': None,
|
||||||
'Carte_2_size': None,
|
'Carte_2_size': None,
|
||||||
'Carte_2_locals': None,
|
'Carte_2_locals': None,
|
||||||
'Carte_2_rotate': None,
|
'Carte_2_rotate': None,
|
||||||
'Legande_size': None,
|
'Legande_size': None,
|
||||||
'Legande_locals': None,
|
'Legande_locals': None,
|
||||||
'Legande_rotate': None,
|
'Legande_rotate': None,
|
||||||
|
'Legande_frame': None,
|
||||||
'Arrow_size': None,
|
'Arrow_size': None,
|
||||||
'Arrow_locals': None,
|
'Arrow_locals': None,
|
||||||
'Arrow_rotate': None,
|
'Arrow_rotate': None,
|
||||||
|
'Arrow_background': None,
|
||||||
|
'Arrow_path': None,
|
||||||
'Echelle_size': None,
|
'Echelle_size': None,
|
||||||
'Echelle_locals': None,
|
'Echelle_locals': None,
|
||||||
'Echelle_rotate': None,
|
'Echelle_rotate': None,
|
||||||
@@ -176,9 +145,11 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
'Credit_size': None,
|
'Credit_size': None,
|
||||||
'Credit_locals': None,
|
'Credit_locals': None,
|
||||||
'Credit_rotate': None,
|
'Credit_rotate': None,
|
||||||
|
'Credit_alignment': None,
|
||||||
'Source_size': None,
|
'Source_size': None,
|
||||||
'Source_locals': None,
|
'Source_locals': None,
|
||||||
'Source_rotate': None,
|
'Source_rotate': None,
|
||||||
|
'Source_alignment': None,
|
||||||
'Logo_2_size': None,
|
'Logo_2_size': None,
|
||||||
'Logo_2_locals': None,
|
'Logo_2_locals': None,
|
||||||
'Logo_2_rotate': None,
|
'Logo_2_rotate': None,
|
||||||
@@ -200,17 +171,19 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
else:
|
else:
|
||||||
vsb = self.verticalScrollBar.value() - 20
|
vsb = self.verticalScrollBar.value() - 20
|
||||||
self.verticalScrollBar.setValue(vsb)
|
self.verticalScrollBar.setValue(vsb)
|
||||||
|
|
||||||
def moveFrame(self):
|
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):
|
def update_logo_library(self):
|
||||||
self.mComboBox_4.clear()
|
self.mComboBox_4.clear()
|
||||||
logo_library = []
|
logo_library = []
|
||||||
custome_bibliotech = glob.glob(self.s.value("automap/logoteck", 1, type=str) + '*.*')
|
custome_bibliotech = glob.glob(self.s.value("automap/logoteck", 1, type=str) + '*.*')
|
||||||
for l,logo_x in enumerate(custome_bibliotech):
|
for number, logo_x in enumerate(custome_bibliotech):
|
||||||
logo_library.append(' ' + os.path.basename(logo_x))
|
logo_library.append(' ' + os.path.basename(logo_x))
|
||||||
|
|
||||||
bibliotech = glob.glob(resources_path("logo_library", "*.png"))
|
bibliotech = glob.glob(resources_path("logo_library", "*.png"))
|
||||||
for l,logo_x in enumerate(bibliotech):
|
for number, logo_x in enumerate(bibliotech):
|
||||||
logo_library.append(os.path.basename(logo_x))
|
logo_library.append(os.path.basename(logo_x))
|
||||||
self.mComboBox_4.addItems(sorted(logo_library))
|
self.mComboBox_4.addItems(sorted(logo_library))
|
||||||
|
|
||||||
@@ -233,16 +206,20 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
try:
|
try:
|
||||||
layout_subtitle = project_subtitle.layoutManager().layoutByName(self.comboBox_7.currentText())
|
layout_subtitle = project_subtitle.layoutManager().layoutByName(self.comboBox_7.currentText())
|
||||||
self.lineEdit_3.setText(layout_subtitle.itemById("SubTitle").text())
|
self.lineEdit_3.setText(layout_subtitle.itemById("SubTitle").text())
|
||||||
except:
|
except NameError:
|
||||||
print("")
|
print("")
|
||||||
|
|
||||||
def load_ortho(self):
|
def load_ortho(self):
|
||||||
global myGroup, last_group
|
global myGroup, last_group
|
||||||
runing = False
|
runing = False
|
||||||
try: myGroup
|
try:
|
||||||
except NameError: runing = True
|
myGroup
|
||||||
try: last_group
|
except NameError:
|
||||||
except NameError: last_group = ''
|
runing = True
|
||||||
|
try:
|
||||||
|
last_group
|
||||||
|
except NameError:
|
||||||
|
last_group = ''
|
||||||
if runing or (last_group != '' and last_group != 'ortho'):
|
if runing or (last_group != '' and last_group != 'ortho'):
|
||||||
layername = False
|
layername = False
|
||||||
layerAll = QgsProject.instance().layerTreeRoot().children()
|
layerAll = QgsProject.instance().layerTreeRoot().children()
|
||||||
@@ -283,10 +260,14 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
def load_osm(self):
|
def load_osm(self):
|
||||||
global myGroup, last_group
|
global myGroup, last_group
|
||||||
runing = False
|
runing = False
|
||||||
try: myGroup
|
try:
|
||||||
except NameError: runing = True
|
myGroup
|
||||||
try: last_group
|
except NameError:
|
||||||
except NameError: last_group = ''
|
runing = True
|
||||||
|
try:
|
||||||
|
last_group
|
||||||
|
except NameError:
|
||||||
|
last_group = ''
|
||||||
if runing or (last_group != '' and last_group != 'osm'):
|
if runing or (last_group != '' and last_group != 'osm'):
|
||||||
layername = False
|
layername = False
|
||||||
layerAll = QgsProject.instance().layerTreeRoot().children()
|
layerAll = QgsProject.instance().layerTreeRoot().children()
|
||||||
@@ -361,6 +342,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.show_map()
|
self.show_map()
|
||||||
else:
|
else:
|
||||||
self.hide_map()
|
self.hide_map()
|
||||||
|
|
||||||
def show_map(self):
|
def show_map(self):
|
||||||
self.groupBox_3.setEnabled(True)
|
self.groupBox_3.setEnabled(True)
|
||||||
self.groupBox_3.show()
|
self.groupBox_3.show()
|
||||||
@@ -374,6 +356,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.show_titre()
|
self.show_titre()
|
||||||
else:
|
else:
|
||||||
self.hide_titre()
|
self.hide_titre()
|
||||||
|
|
||||||
def show_titre(self):
|
def show_titre(self):
|
||||||
self.lineEdit_2.setEnabled(False)
|
self.lineEdit_2.setEnabled(False)
|
||||||
self.lineEdit_2.hide()
|
self.lineEdit_2.hide()
|
||||||
@@ -391,6 +374,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.show_source()
|
self.show_source()
|
||||||
else:
|
else:
|
||||||
self.hide_source()
|
self.hide_source()
|
||||||
|
|
||||||
def show_source(self):
|
def show_source(self):
|
||||||
self.lineEdit_4.setEnabled(False)
|
self.lineEdit_4.setEnabled(False)
|
||||||
self.lineEdit_4.hide()
|
self.lineEdit_4.hide()
|
||||||
@@ -437,13 +421,13 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
layout_name = self.comboBox_7.currentText()
|
layout_name = self.comboBox_7.currentText()
|
||||||
else:
|
else:
|
||||||
layout_name = self.lineEdit_2.text()
|
layout_name = self.lineEdit_2.text()
|
||||||
layouts_list = self.manager.printLayouts()
|
# 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:
|
with open(os.path.join(os.getcwd(), filename), 'r') as f:
|
||||||
self.layout = QgsPrintLayout(project)
|
self.layout = QgsPrintLayout(project)
|
||||||
self.layout.initializeDefaults()
|
self.layout.initializeDefaults()
|
||||||
myAtlas=self.layout.atlas()
|
# myAtlas = self.layout.atlas()
|
||||||
template_content = f.read()
|
template_content = f.read()
|
||||||
doc = QDomDocument()
|
doc = QDomDocument()
|
||||||
doc.setContent(template_content)
|
doc.setContent(template_content)
|
||||||
@@ -451,7 +435,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
cutLayout = layout_name.index("¶")
|
cutLayout = layout_name.index("¶")
|
||||||
except:
|
except ValueError:
|
||||||
cutLayout = 0
|
cutLayout = 0
|
||||||
|
|
||||||
if cutLayout >= 1:
|
if cutLayout >= 1:
|
||||||
@@ -469,11 +453,12 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
logo_div = A3_size['Portrait']['RIGHT']
|
logo_div = A3_size['Portrait']['RIGHT']
|
||||||
if self.radioButton_5.isChecked() and self.radioButton_8.isChecked():
|
if self.radioButton_5.isChecked() and self.radioButton_8.isChecked():
|
||||||
logo_div = A3_size['Portrait']['BOTTOM']
|
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()
|
self.actualisation_mise_en_page()
|
||||||
|
|
||||||
## Add map to layout
|
# Add map to layout
|
||||||
self.map_modele_test = QgsLayoutItemMap(self.layout)
|
self.map_modele_test = QgsLayoutItemMap(self.layout)
|
||||||
# Charger une carte vide
|
# Charger une carte vide
|
||||||
self.map_modele_test.setRect(20, 20, 20, 20)
|
self.map_modele_test.setRect(20, 20, 20, 20)
|
||||||
@@ -481,7 +466,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.map_modele_test.setExtent(iface.mapCanvas().extent())
|
self.map_modele_test.setExtent(iface.mapCanvas().extent())
|
||||||
# Position de la carte dans le composeur
|
# Position de la carte dans le composeur
|
||||||
|
|
||||||
self.map_modele_test.setItemRotation(self.template_parameters['Carte_rotate'])
|
self.map_modele_test.setMapRotation(self.template_parameters['Carte_rotate'])
|
||||||
self.map_modele_test.attemptResize(self.template_parameters['Carte_size'])
|
self.map_modele_test.attemptResize(self.template_parameters['Carte_size'])
|
||||||
self.map_modele_test.attemptMove(self.template_parameters['Carte_locals'])
|
self.map_modele_test.attemptMove(self.template_parameters['Carte_locals'])
|
||||||
# on dimensionne le rendu de la carte (pour référence la page totale est une page A4 donc 297*210)
|
# on dimensionne le rendu de la carte (pour référence la page totale est une page A4 donc 297*210)
|
||||||
@@ -495,7 +480,8 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
if self.radioButton_12.isChecked() == 1:
|
if self.radioButton_12.isChecked() == 1:
|
||||||
self.position_map = QgsLayoutItemMap(self.layout)
|
self.position_map = QgsLayoutItemMap(self.layout)
|
||||||
self.position_map.setRect(20, 20, 20, 20)
|
self.position_map.setRect(20, 20, 20, 20)
|
||||||
self.position_map.setExtent(QgsRectangle(641552,6647386, 995856,6331104))
|
self.position_map.setExtent(QgsRectangle(618704, 6329245, 1018704, 6649245))
|
||||||
|
# self.position_map.setExtent(QgsRectangle(641552, 6647386, 995856, 6331104))
|
||||||
self.position_map.setFollowVisibilityPreset(True)
|
self.position_map.setFollowVisibilityPreset(True)
|
||||||
self.position_map.setFollowVisibilityPresetName(self.comboBox_6.currentText())
|
self.position_map.setFollowVisibilityPresetName(self.comboBox_6.currentText())
|
||||||
self.position_map.setItemRotation(self.template_parameters['Carte_2_rotate'])
|
self.position_map.setItemRotation(self.template_parameters['Carte_2_rotate'])
|
||||||
@@ -509,24 +495,27 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
# overviewitem.addOverview(map_overview)
|
# overviewitem.addOverview(map_overview)
|
||||||
|
|
||||||
self.position_map.refresh()
|
self.position_map.refresh()
|
||||||
self.map_modele_test.setFrameEnabled(True)
|
self.map_modele_test.setFrameEnabled(self.template_parameters['Carte_frame'])
|
||||||
|
self.position_map.setFrameEnabled(self.template_parameters['Carte_2_frame'])
|
||||||
self.layout.addLayoutItem(self.position_map)
|
self.layout.addLayoutItem(self.position_map)
|
||||||
self.position_map.setId("Carte_locals")
|
self.position_map.setId("Carte_locals")
|
||||||
self.map_modele_test.refresh()
|
self.map_modele_test.refresh()
|
||||||
|
|
||||||
self.map_modele_test.setBackgroundColor(QColor(255, 255, 255, 255))
|
self.map_modele_test.setBackgroundColor(QColor(255, 255, 255, 255))
|
||||||
self.map_modele_test.setFrameEnabled(True)
|
self.map_modele_test.setFrameEnabled(self.template_parameters['Carte_frame'])
|
||||||
if self.radioButton_9.isChecked() == 1:
|
if self.radioButton_9.isChecked() == 1:
|
||||||
self.map_modele_test.setAtlasDriven(True)
|
self.map_modele_test.setAtlasDriven(True)
|
||||||
self.layout.addLayoutItem(self.map_modele_test)
|
self.layout.addLayoutItem(self.map_modele_test)
|
||||||
self.map_modele_test.setId("carte_principale")
|
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)
|
title = QgsLayoutItemLabel(self.layout)
|
||||||
self.layout.addLayoutItem(title)
|
self.layout.addLayoutItem(title)
|
||||||
titre = titre_layout_name
|
titre = titre_layout_name
|
||||||
title.setText(titre)
|
title.setText(titre)
|
||||||
title.setFont(QFont("Calibri", 15, QFont.Bold))
|
Font = QFont("Calibri", 15, False)
|
||||||
|
Font.setBold(True)
|
||||||
|
title.setFont(Font)
|
||||||
title.setItemRotation(self.template_parameters['Titre_rotate'])
|
title.setItemRotation(self.template_parameters['Titre_rotate'])
|
||||||
title.attemptResize(self.template_parameters['Titre_size'])
|
title.attemptResize(self.template_parameters['Titre_size'])
|
||||||
title.attemptMove(self.template_parameters['Titre_locals'])
|
title.attemptMove(self.template_parameters['Titre_locals'])
|
||||||
@@ -535,11 +524,10 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
title.setBackgroundColor(QColor(255, 255, 255, 130))
|
title.setBackgroundColor(QColor(255, 255, 255, 130))
|
||||||
self.layout.addItem(title)
|
self.layout.addItem(title)
|
||||||
# title.adjustSizeToText() on n'utilise plutot setFixedSize pour pouvoir centrer le titre de manière plus optimale ici
|
# title.adjustSizeToText() on n'utilise plutot setFixedSize pour pouvoir centrer le titre de manière plus optimale ici
|
||||||
title.setHAlign(Qt.AlignHCenter)
|
title.setHAlign(Qt.AlignmentFlag(0x0004))
|
||||||
title.setVAlign(Qt.AlignVCenter)
|
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)
|
subtitle = QgsLayoutItemLabel(self.layout)
|
||||||
self.layout.addLayoutItem(subtitle)
|
self.layout.addLayoutItem(subtitle)
|
||||||
titre = self.lineEdit_3.text()
|
titre = self.lineEdit_3.text()
|
||||||
@@ -554,13 +542,13 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
subtitle.setBackgroundEnabled(True)
|
subtitle.setBackgroundEnabled(True)
|
||||||
subtitle.setBackgroundColor(QColor(255, 255, 255, 130))
|
subtitle.setBackgroundColor(QColor(255, 255, 255, 130))
|
||||||
self.layout.addItem(subtitle)
|
self.layout.addItem(subtitle)
|
||||||
subtitle.setHAlign(Qt.AlignHCenter)
|
subtitle.setHAlign(Qt.AlignmentFlag(0x0004))
|
||||||
subtitle.setVAlign(Qt.AlignVCenter)
|
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 = QgsLayoutItemPicture(self.layout)
|
||||||
logo.setResizeMode(QgsLayoutItemPicture.Zoom)
|
logo.setResizeMode(QgsLayoutItemPicture.Zoom)
|
||||||
|
logo.setPictureAnchor(QgsLayoutItem.ReferencePoint(4))
|
||||||
logo.setMode(QgsLayoutItemPicture.FormatRaster)
|
logo.setMode(QgsLayoutItemPicture.FormatRaster)
|
||||||
logo.setItemRotation(self.template_parameters['Logo_rotate'])
|
logo.setItemRotation(self.template_parameters['Logo_rotate'])
|
||||||
logo.setFixedSize(self.template_parameters['Logo_size'])
|
logo.setFixedSize(self.template_parameters['Logo_size'])
|
||||||
@@ -569,14 +557,13 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
logo.setId('logo')
|
logo.setId('logo')
|
||||||
self.layout.addLayoutItem(logo)
|
self.layout.addLayoutItem(logo)
|
||||||
|
|
||||||
|
# Ajout de la legende :
|
||||||
## Ajout de la legende :
|
|
||||||
legend = QgsLayoutItemLegend(self.layout)
|
legend = QgsLayoutItemLegend(self.layout)
|
||||||
|
|
||||||
legend.setId('legende_model1')
|
legend.setId('legende_model1')
|
||||||
# legend.setTitle('Legende')
|
# legend.setTitle('Legende')
|
||||||
legend.adjustBoxSize()
|
legend.adjustBoxSize()
|
||||||
legend.setFrameEnabled(False)
|
legend.setFrameEnabled(self.template_parameters['Legande_frame'])
|
||||||
legend.setAutoUpdateModel(False)
|
legend.setAutoUpdateModel(False)
|
||||||
|
|
||||||
legend.setLinkedMap(self.map_modele_test)
|
legend.setLinkedMap(self.map_modele_test)
|
||||||
@@ -615,7 +602,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
layertreelayer = root.findLayer(layer.id())
|
layertreelayer = root.findLayer(layer.id())
|
||||||
|
|
||||||
# get the parent of the layer tree layer (layer tree root, or group)
|
# get the parent of the layer tree layer (layer tree root, or group)
|
||||||
if layertreelayer != None:
|
if layertreelayer is not None:
|
||||||
parent = layertreelayer.parent()
|
parent = layertreelayer.parent()
|
||||||
|
|
||||||
# if the parent is a group and has a name, find it and remove the layer
|
# if the parent is a group and has a name, find it and remove the layer
|
||||||
@@ -626,7 +613,6 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
else:
|
else:
|
||||||
root_group.removeLayer(layer)
|
root_group.removeLayer(layer)
|
||||||
|
|
||||||
|
|
||||||
legend.setEqualColumnWidth(True)
|
legend.setEqualColumnWidth(True)
|
||||||
legend.setSplitLayer(True)
|
legend.setSplitLayer(True)
|
||||||
legend.setColumnSpace(5)
|
legend.setColumnSpace(5)
|
||||||
@@ -634,6 +620,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
legend.rstyle(QgsLegendStyle.Group).setMargin(QgsLegendStyle.Top, 3)
|
legend.rstyle(QgsLegendStyle.Group).setMargin(QgsLegendStyle.Top, 3)
|
||||||
legend.rstyle(QgsLegendStyle.Subgroup).setMargin(QgsLegendStyle.Top, 3)
|
legend.rstyle(QgsLegendStyle.Subgroup).setMargin(QgsLegendStyle.Top, 3)
|
||||||
legend.setColumnCount(self.spinBox.value())
|
legend.setColumnCount(self.spinBox.value())
|
||||||
|
legend.setItemRotation(self.template_parameters['Legande_rotate'])
|
||||||
|
|
||||||
legend.adjustBoxSize()
|
legend.adjustBoxSize()
|
||||||
legend.setBackgroundEnabled(True)
|
legend.setBackgroundEnabled(True)
|
||||||
@@ -643,7 +630,7 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
legend.updateLegend()
|
legend.updateLegend()
|
||||||
legend.attemptMove(self.template_parameters['Legande_locals'])
|
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 = QgsLayoutItemScaleBar(self.layout)
|
||||||
self.scalebarnumeric_qpt.setStyle('Numeric')
|
self.scalebarnumeric_qpt.setStyle('Numeric')
|
||||||
self.scalebarnumeric_qpt.setLinkedMap(self.map_modele_test)
|
self.scalebarnumeric_qpt.setLinkedMap(self.map_modele_test)
|
||||||
@@ -654,19 +641,20 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.scalebarnumeric_qpt.setNumberOfSegmentsLeft(0)
|
self.scalebarnumeric_qpt.setNumberOfSegmentsLeft(0)
|
||||||
|
|
||||||
self.scalebarnumeric_qpt.setFont(QFont("Calibri", 12))
|
self.scalebarnumeric_qpt.setFont(QFont("Calibri", 12))
|
||||||
|
self.scalebarnumeric_qpt.setItemRotation(self.template_parameters['Echelle_rotate'])
|
||||||
self.scalebarnumeric_qpt.attemptMove(self.template_parameters['Echelle_locals'])
|
self.scalebarnumeric_qpt.attemptMove(self.template_parameters['Echelle_locals'])
|
||||||
self.scalebarnumeric_qpt.attemptResize(self.template_parameters['Echelle_size'])
|
self.scalebarnumeric_qpt.attemptResize(self.template_parameters['Echelle_size'])
|
||||||
self.scalebarnumeric_qpt.setItemRotation(self.template_parameters['Echelle_rotate'])
|
|
||||||
self.scalebarnumeric_qpt.setAlignment(QgsScaleBarSettings.Alignment(1))
|
self.scalebarnumeric_qpt.setAlignment(QgsScaleBarSettings.Alignment(1))
|
||||||
self.scalebarnumeric_qpt.setBackgroundEnabled(True)
|
self.scalebarnumeric_qpt.setBackgroundEnabled(True)
|
||||||
self.scalebarnumeric_qpt.setBackgroundColor(QColor(255, 255, 255, 130))
|
self.scalebarnumeric_qpt.setBackgroundColor(QColor(255, 255, 255, 130))
|
||||||
|
|
||||||
self.layout.addLayoutItem(self.scalebarnumeric_qpt)
|
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 = QgsLayoutItemScaleBar(self.layout)
|
||||||
self.scalebar_qpt.setStyle('Single Box')
|
self.scalebar_qpt.setStyle('Single Box')
|
||||||
self.scalebar_qpt.setLinkedMap(self.map_modele_test)
|
self.scalebar_qpt.setLinkedMap(self.map_modele_test)
|
||||||
|
self.scalebar_qpt.setFillColor(QColor(144, 144, 144, 255))
|
||||||
self.scalebar_qpt.applyDefaultSize()
|
self.scalebar_qpt.applyDefaultSize()
|
||||||
self.scalebar_qpt.applyDefaultSettings()
|
self.scalebar_qpt.applyDefaultSettings()
|
||||||
|
|
||||||
@@ -674,9 +662,9 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.scalebar_qpt.setNumberOfSegmentsLeft(0)
|
self.scalebar_qpt.setNumberOfSegmentsLeft(0)
|
||||||
|
|
||||||
self.scalebar_qpt.setFont(QFont("Calibri", 12))
|
self.scalebar_qpt.setFont(QFont("Calibri", 12))
|
||||||
|
self.scalebar_qpt.setItemRotation(self.template_parameters['Echelle_2_rotate'])
|
||||||
self.scalebar_qpt.attemptMove(self.template_parameters['Echelle_2_locals'])
|
self.scalebar_qpt.attemptMove(self.template_parameters['Echelle_2_locals'])
|
||||||
self.scalebar_qpt.attemptResize(self.template_parameters['Echelle_2_size'])
|
self.scalebar_qpt.attemptResize(self.template_parameters['Echelle_2_size'])
|
||||||
self.scalebar_qpt.setItemRotation(self.template_parameters['Echelle_2_rotate'])
|
|
||||||
self.scalebar_qpt.setAlignment(QgsScaleBarSettings.Alignment(1))
|
self.scalebar_qpt.setAlignment(QgsScaleBarSettings.Alignment(1))
|
||||||
self.scalebar_qpt.setBackgroundEnabled(True)
|
self.scalebar_qpt.setBackgroundEnabled(True)
|
||||||
self.scalebar_qpt.setBackgroundColor(QColor(255, 255, 255, 130))
|
self.scalebar_qpt.setBackgroundColor(QColor(255, 255, 255, 130))
|
||||||
@@ -686,12 +674,16 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
|
|
||||||
# ajout de la fleche du Nord
|
# ajout de la fleche du Nord
|
||||||
north = QgsLayoutItemPicture(self.layout)
|
north = QgsLayoutItemPicture(self.layout)
|
||||||
north.setPicturePath(resources_path("mises_en_pages","NorthArrow_02.svg"))
|
north.setPicturePath(resources_path("mises_en_pages", self.template_parameters['Arrow_path']))
|
||||||
|
north.setLinkedMap(self.map_modele_test)
|
||||||
self.layout.addLayoutItem(north)
|
self.layout.addLayoutItem(north)
|
||||||
|
north.setPictureAnchor(QgsLayoutItem.ReferencePoint(4))
|
||||||
|
north.setItemRotation(self.template_parameters['Arrow_rotate'])
|
||||||
north.attemptMove(self.template_parameters['Arrow_locals'])
|
north.attemptMove(self.template_parameters['Arrow_locals'])
|
||||||
north.attemptResize(self.template_parameters['Arrow_size'])
|
north.attemptResize(self.template_parameters['Arrow_size'])
|
||||||
north.setItemRotation(self.template_parameters['Arrow_rotate'])
|
north.setSvgStrokeColor(QColor(255, 255, 255, 255))
|
||||||
north.setBackgroundEnabled(True)
|
north.setSvgFillColor(QColor(76, 76, 76, 255))
|
||||||
|
north.setBackgroundEnabled(self.template_parameters['Arrow_background'])
|
||||||
north.setBackgroundColor(QColor(255, 255, 255, 130))
|
north.setBackgroundColor(QColor(255, 255, 255, 130))
|
||||||
|
|
||||||
if self.radioButton_10.isChecked() == 1:
|
if self.radioButton_10.isChecked() == 1:
|
||||||
@@ -712,15 +704,17 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
credit_text = QgsLayoutItemLabel(self.layout)
|
credit_text = QgsLayoutItemLabel(self.layout)
|
||||||
credit_text.setText(info[0])
|
credit_text.setText(info[0])
|
||||||
credit_text.setFont(QFont("Calibri", 9))
|
credit_text.setFont(QFont("Calibri", 9))
|
||||||
credit_text.setHAlign(Qt.AlignRight)
|
credit_text.setHAlign(Qt.AlignmentFlag(self.template_parameters['Credit_alignment']))
|
||||||
credit_text.setVAlign(Qt.AlignVCenter)
|
credit_text.setVAlign(Qt.AlignmentFlag(0x0080))
|
||||||
|
credit_text.setMarginX(2)
|
||||||
credit_text.setBackgroundEnabled(True)
|
credit_text.setBackgroundEnabled(True)
|
||||||
credit_text.setBackgroundColor(QColor(255, 255, 255, 130))
|
credit_text.setBackgroundColor(QColor(255, 255, 255, 130))
|
||||||
credit_text2 = QgsLayoutItemLabel(self.layout)
|
credit_text2 = QgsLayoutItemLabel(self.layout)
|
||||||
credit_text2.setText(info_text)
|
credit_text2.setText(info_text)
|
||||||
credit_text2.setFont(QFont("Calibri", 9))
|
credit_text2.setFont(QFont("Calibri", 9))
|
||||||
credit_text2.setHAlign(Qt.AlignRight)
|
credit_text2.setHAlign(Qt.AlignmentFlag(self.template_parameters['Source_alignment']))
|
||||||
credit_text2.setVAlign(Qt.AlignVCenter)
|
credit_text2.setVAlign(Qt.AlignmentFlag(0x0080))
|
||||||
|
credit_text2.setMarginX(2)
|
||||||
credit_text.setItemRotation(self.template_parameters['Credit_rotate'])
|
credit_text.setItemRotation(self.template_parameters['Credit_rotate'])
|
||||||
credit_text.attemptResize(self.template_parameters['Credit_size'])
|
credit_text.attemptResize(self.template_parameters['Credit_size'])
|
||||||
credit_text.attemptMove(self.template_parameters['Credit_locals'])
|
credit_text.attemptMove(self.template_parameters['Credit_locals'])
|
||||||
@@ -732,15 +726,16 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.layout.addLayoutItem(credit_text)
|
self.layout.addLayoutItem(credit_text)
|
||||||
self.layout.addLayoutItem(credit_text2)
|
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()))
|
len_item = (len(self.mComboBox_4.checkedItems()))
|
||||||
for logo_run in self.mComboBox_4.checkedItems():
|
for logo_run in self.mComboBox_4.checkedItems():
|
||||||
logo_credit = QgsLayoutItemPicture(self.layout)
|
logo_credit = QgsLayoutItemPicture(self.layout)
|
||||||
logo_credit.setResizeMode(QgsLayoutItemPicture.Zoom)
|
logo_credit.setResizeMode(QgsLayoutItemPicture.Zoom)
|
||||||
|
logo_credit.setPictureAnchor(QgsLayoutItem.ReferencePoint(4))
|
||||||
logo_credit.setMode(QgsLayoutItemPicture.FormatRaster)
|
logo_credit.setMode(QgsLayoutItemPicture.FormatRaster)
|
||||||
cur_x = self.template_parameters['Logo_2_locals'].x()
|
cur_x = self.template_parameters['Logo_2_locals'].x()
|
||||||
|
logo_credit.setItemRotation(self.template_parameters['Logo_2_rotate'])
|
||||||
logo_credit.attemptMove(self.template_parameters['Logo_2_locals'])
|
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))
|
self.template_parameters['Logo_2_locals'].setX(cur_x + (logo_div / len_item))
|
||||||
logo_credit.setFixedSize(self.template_parameters['Logo_2_size'])
|
logo_credit.setFixedSize(self.template_parameters['Logo_2_size'])
|
||||||
if logo_run[0] == ' ':
|
if logo_run[0] == ' ':
|
||||||
@@ -760,17 +755,17 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
if existing_layout:
|
if existing_layout:
|
||||||
self.QMBquestion = QMessageBox()
|
self.QMBquestion = QMessageBox()
|
||||||
self.QMBquestion.setWindowTitle(u"Attention !")
|
self.QMBquestion.setWindowTitle(u"Attention !")
|
||||||
self.QMBquestion.setIcon(QMessageBox.Warning)
|
self.QMBquestion.setIcon(QMessageBox.Icon.Warning)
|
||||||
self.QMBquestion.setText("Mise en page existente, la mise en page vas être écraser !")
|
self.QMBquestion.setText("Mise en page existante, la mise en page va être écrasée !")
|
||||||
self.QMBquestion.setStandardButtons(QMessageBox.Yes|QMessageBox.No)
|
self.QMBquestion.setStandardButtons(QMessageBox.StandardButton(0x00004000) | QMessageBox.StandardButton(0x00010000))
|
||||||
self.QMBquestion.addButton(QPushButton('Autre mise en page'),QMessageBox.AcceptRole)
|
self.QMBquestion.addButton(QPushButton('Autre mise en page'), QMessageBox.ButtonRole(0))
|
||||||
self.QMBquestion = self.QMBquestion.exec()
|
self.QMBquestion = self.QMBquestion.exec()
|
||||||
|
|
||||||
# if self.radioButton_12.isChecked() != 1:
|
# if self.radioButton_12.isChecked() != 1:
|
||||||
if self.QMBquestion == QMessageBox.Yes:
|
if self.QMBquestion == QMessageBox.StandardButton(0x00004000):
|
||||||
project.layoutManager().removeLayout(existing_layout)
|
project.layoutManager().removeLayout(existing_layout)
|
||||||
result = project.layoutManager().addLayout(self.layout)
|
# result = project.layoutManager().addLayout(self.layout)
|
||||||
if self.QMBquestion == QMessageBox.AcceptRole:
|
elif self.QMBquestion != QMessageBox.StandardButton(0x00010000):
|
||||||
LayoutCOUNT = 0
|
LayoutCOUNT = 0
|
||||||
arrayManager = []
|
arrayManager = []
|
||||||
for AddArrayManager in project.layoutManager().layouts():
|
for AddArrayManager in project.layoutManager().layouts():
|
||||||
@@ -787,8 +782,6 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
else:
|
else:
|
||||||
existing_layout = True
|
existing_layout = True
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
self.manager.addLayout(self.layout)
|
self.manager.addLayout(self.layout)
|
||||||
if self.radioButton_9.isChecked() == 1:
|
if self.radioButton_9.isChecked() == 1:
|
||||||
self.layout.atlas().setEnabled(True)
|
self.layout.atlas().setEnabled(True)
|
||||||
@@ -806,10 +799,12 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
else:
|
else:
|
||||||
TryMessage = False
|
TryMessage = False
|
||||||
del self.QMBquestion
|
del self.QMBquestion
|
||||||
except:
|
except ValueError:
|
||||||
|
TryMessage = True
|
||||||
|
except AttributeError:
|
||||||
TryMessage = True
|
TryMessage = True
|
||||||
|
|
||||||
if TryMessage == True:
|
if TryMessage is True:
|
||||||
iface.openLayoutDesigner(layout_modifie)
|
iface.openLayoutDesigner(layout_modifie)
|
||||||
self.close()
|
self.close()
|
||||||
else:
|
else:
|
||||||
@@ -839,7 +834,6 @@ class AutoMap_Editor(QDialog, EDITOR_CLASS):
|
|||||||
eval("exec('self.template_parameters = '+ values_page_import + '.fletch_canvas(self)')")
|
eval("exec('self.template_parameters = '+ values_page_import + '.fletch_canvas(self)')")
|
||||||
|
|
||||||
def bar_echelle_auto(self, echelle, bar_echelle):
|
def bar_echelle_auto(self, echelle, bar_echelle):
|
||||||
|
|
||||||
if True:
|
if True:
|
||||||
if echelle.scale() >= 40000:
|
if echelle.scale() >= 40000:
|
||||||
bar_echelle.setUnits(QgsUnitTypes.DistanceKilometers)
|
bar_echelle.setUnits(QgsUnitTypes.DistanceKilometers)
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
import os
|
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.gui import *
|
||||||
|
|
||||||
from qgis.core import (
|
from qgis.core import (
|
||||||
@@ -35,14 +29,20 @@ from qgis.utils import iface
|
|||||||
|
|
||||||
from .tools.resources import (
|
from .tools.resources import (
|
||||||
load_ui,
|
load_ui,
|
||||||
resources_path,
|
# resources_path,
|
||||||
send_issues,
|
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')
|
EDITOR_CLASS = load_ui('CenRa_IssuesSend.ui')
|
||||||
|
|
||||||
class CenRa_Issues(QDialog, EDITOR_CLASS):
|
|
||||||
|
|
||||||
|
class CenRa_Issues(QDialog, EDITOR_CLASS):
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
_ = parent
|
_ = parent
|
||||||
super().__init__()
|
super().__init__()
|
||||||
@@ -63,11 +63,16 @@ class CenRa_Issues(QDialog, EDITOR_CLASS):
|
|||||||
statu_autre = self.check_autre.isChecked()
|
statu_autre = self.check_autre.isChecked()
|
||||||
|
|
||||||
statu = []
|
statu = []
|
||||||
if statu_bug == True : statu = statu + [1]
|
if statu_bug is True:
|
||||||
if statu_aide == True : statu = statu + [3]
|
statu = statu + [1]
|
||||||
if statu_question == True : statu = statu + [5]
|
if statu_aide is True:
|
||||||
if statu_amelioration == True : statu = statu + [2]
|
statu = statu + [3]
|
||||||
if statu_autre == True : statu = statu + [6]
|
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:
|
if len(statu) >= 1:
|
||||||
import qgis
|
import qgis
|
||||||
|
|||||||
@@ -5,8 +5,10 @@
|
|||||||
[general]
|
[general]
|
||||||
name=CenRa_AutoMap
|
name=CenRa_AutoMap
|
||||||
qgisMinimumVersion=3.0
|
qgisMinimumVersion=3.0
|
||||||
|
qgisMaximumVersion=4.99
|
||||||
|
supportsQt6=True
|
||||||
description=CenRa_AutoMap
|
description=CenRa_AutoMap
|
||||||
version=1.4
|
version=2.11
|
||||||
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
|
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
|
||||||
email=si_besoin@cen-rhonealpes.fr
|
email=si_besoin@cen-rhonealpes.fr
|
||||||
|
|
||||||
@@ -21,7 +23,7 @@ tracker=https://gitea.cenra-outils.org/api/v1/repos/CEN-RA/Plugin_QGIS/issues
|
|||||||
|
|
||||||
hasProcessingProvider=no
|
hasProcessingProvider=no
|
||||||
# Uncomment the following line and add your changelog:
|
# 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>21/05/2026 - Version 2.11: </h3> - Optimisation des performances hors connexion.</br></p></br><p><h3>04/05/2026 - Version 2.10: </h3> - Suppression ancien logo n2000.</p></br><p><h3>12/03/2026 - Version 2.9: </h3> - qgisMaximumVersion est 4.0.</p></br><p><h3>09/01/2026 - Version 2.8: </h3> - deplacement de l'echelle.</p></br><p><h3>18/12/2025 - Version 2.7: </h3> - fix de bug gitea.</p></br><p><h3>18/12/2025 - Version 2.6: </h3> - ajoue du logo n2000 et region.</p></br><p><h3>17/12/2025 - Version 2.5: </h3> - Carte n2000 mise a jour landscape et portrait.</p></br><p><h3>15/12/2025 - Version 2.4: </h3> - Landescape pour n2000.</p></br><p><h3>15/12/2025 - Version 2.3: </h3> - nouvelle mise en page n2000.</p></br><p><h3>12/12/2025 - Version 2.2: </h3> - nouvelle mise en page pour n2000.</p></br><p><h3>30/07/2025 - Version 2.1: </h3> - Correctife de bug.</p></br><p><h3>19/05/2025 - Version 2.0: </h3> - Compatible PyQt5 et PyQt6</p></br><p><h3>11/04/2025 - Version 1.7: </h3> - Correctif d'orthographe.</p></br><p><h3>09/04/2025 - Version 1.6: </h3> - Correctif bug en TT.</p></br><p><h3>09/04/2025 - Version 1.5: </h3> - Optimisation pour le TT.</p></br><p><h3>03/04/2025 - Version 1.4: </h3> - Mise a jour de securite.</p></br><p><h3>20/03/2025 - Version 1.3: </h3> - Fenêtre redimensionnable avec déplaçable avec la mollette sourit.</p></br><p><h3>25/02/2025 - Version 1.2: </h3> - DockWidget pour ouverture de couche avec theme.</p></br><p><h3>28/01/2025 - Version 1.1: </h3> - Multi-Composeur pris en charge.</p></br><p><h3>27/01/2025 - Version 1.0: </h3> - Version releases.</br> - Ajoute un message d'avertissement au moment d'écraser la mise en page.</br> - Ajoute prénom et nom dans la réalisation.</br> - Utilisation de Calibri.</p></br><p><h3>13/01/2025 - Version 0.1.10: </h3> - Correctif.</p></br><p><h3>07/01/2025 - Version 0.1.9: </h3> - ByPass du certif ssl ci erreur.</p></br><p><h3>19/12/2024 - Version 0.1.8: </h3> - Nouvelle mise en page.</br> - Incrémentation automatique de nouveau modele de mise en page. </br> - Correctif de bug.</p></br><p><h3>21/10/2024 - Version 0.1.7: </h3> - Epurations du code.</p></br><p><h3>07/10/2024 - Version 0.1.6: </h3> - Option de bibliotheque de logo custome.</p></br><p><h3>03/10/2024 - Version 0.1.5: </h3> - Remonte la fênetre dans la pille.</br> - Gestion du nombre de colonne dans la légend.</br></p></br><p><h3>02/10/2024 - Version 0.1.4: </h3> - Mise en page plein écrant.</br></p></br><p><h3>01/10/2024 - Version 0.1.3: </h3> - Récupération du titre et sous-titre pour mise en page existente.</br> - Integration de bibliotheque de logo.</br> - Integration de gestionaire pour les source de donnée.</br> - Mise en place d'une bar d'echelle adaptative. </br></p></br><p><h3>30/09/2024 - Version 0.1.2: </h3> - Activation du thème. </br> - Ajouter une carte de suivie. </br><p></br><h3>27/09/2024 - Version 0.1.1: </h3> - Ajout d'une liste déroulante pour les sources de données. </br>- Bouton pour ajouter des fonts de carte customisés. </br>- Fonctionnalité de génération d'atlas. </p></br><p><h3>26/09/2024 - Version 0.1.0: </h3> - Lancement du plugin CenRa_AutoMap avec une seul mise en page. </p></br>
|
||||||
|
|
||||||
# Tags are comma separated with spaces allowed
|
# Tags are comma separated with spaces allowed
|
||||||
tags=python
|
tags=python
|
||||||
|
|||||||
@@ -1,91 +1,41 @@
|
|||||||
import logging
|
import logging
|
||||||
import os
|
# from qgis.gui import *
|
||||||
from PyQt5.QtCore import QSettings
|
|
||||||
from collections import namedtuple
|
|
||||||
from enum import Enum
|
|
||||||
from functools import partial
|
|
||||||
from pathlib import Path
|
|
||||||
from xml.dom.minidom import parseString
|
|
||||||
from qgis.gui import *
|
|
||||||
import qgis
|
|
||||||
from importlib import import_module
|
|
||||||
from qgis.core import (
|
from qgis.core import (
|
||||||
NULL,
|
|
||||||
QgsApplication,
|
|
||||||
QgsScaleBarSettings,
|
|
||||||
QgsDataSourceUri,
|
QgsDataSourceUri,
|
||||||
QgsProject,
|
QgsProject,
|
||||||
QgsProviderConnectionException,
|
|
||||||
QgsProviderRegistry,
|
|
||||||
QgsRasterLayer,
|
|
||||||
QgsSettings,
|
QgsSettings,
|
||||||
QgsVectorLayer,
|
QgsVectorLayer,
|
||||||
QgsGeometry,
|
|
||||||
QgsPrintLayout,
|
|
||||||
QgsReadWriteContext,
|
|
||||||
QgsLayoutItemMap,
|
|
||||||
QgsLayoutItemPage,
|
|
||||||
QgsLayoutSize,
|
|
||||||
QgsUnitTypes,
|
|
||||||
QgsLayoutPoint,
|
|
||||||
QgsLayoutItemLabel,
|
|
||||||
QgsLayoutItemPicture,
|
|
||||||
QgsLayoutItemLegend,
|
|
||||||
QgsLegendStyle,
|
|
||||||
QgsLayoutItemScaleBar,
|
|
||||||
QgsLayerTreeGroup,
|
|
||||||
QgsCoordinateReferenceSystem,
|
|
||||||
QgsCoordinateTransform,
|
|
||||||
QgsLayerTree,
|
|
||||||
QgsLayoutTableColumn,
|
|
||||||
QgsRectangle,
|
|
||||||
QgsLayoutItemMapOverviewStack,
|
|
||||||
QgsMapThemeCollection,
|
QgsMapThemeCollection,
|
||||||
)
|
)
|
||||||
from qgis.PyQt.QtCore import QLocale, QUrl, QDateTime, Qt
|
from qgis.PyQt.QtCore import QSettings
|
||||||
from qgis.PyQt.QtGui import QDesktopServices, QIcon, QColor, QFont, QMovie
|
from qgis.PyQt.QtGui import QIcon
|
||||||
from qgis.PyQt.QtPrintSupport import QPrinter
|
|
||||||
from qgis.PyQt.QtWebKitWidgets import QWebPage
|
|
||||||
from qgis.PyQt.QtWidgets import (
|
from qgis.PyQt.QtWidgets import (
|
||||||
QDockWidget,
|
QDockWidget,
|
||||||
QAction,
|
|
||||||
QMessageBox,
|
|
||||||
QPushButton,
|
|
||||||
QDockWidget,
|
|
||||||
QFileDialog,
|
|
||||||
QInputDialog,
|
QInputDialog,
|
||||||
QMenu,
|
|
||||||
QToolButton,
|
|
||||||
QTableWidget,
|
|
||||||
QTableWidgetItem,
|
|
||||||
QVBoxLayout,
|
|
||||||
)
|
)
|
||||||
import psycopg2
|
|
||||||
from PyQt5 import QtGui
|
|
||||||
from PyQt5 import QtWidgets
|
|
||||||
from qgis.PyQt.QtXml import QDomDocument
|
|
||||||
from qgis.utils import iface
|
|
||||||
import glob
|
|
||||||
try:
|
|
||||||
|
|
||||||
|
from qgis.PyQt.QtXml import QDomDocument
|
||||||
|
|
||||||
|
try:
|
||||||
Enabled = True
|
Enabled = True
|
||||||
from .tools.StyleLayer import *
|
from .tools.StyleLayer import host, port, dbname, os_user
|
||||||
except:
|
except ValueError:
|
||||||
Enabled = False
|
Enabled = False
|
||||||
from .tools.resources import (
|
from .tools.resources import (
|
||||||
load_ui,
|
load_ui,
|
||||||
resources_path,
|
resources_path,
|
||||||
send_issues,
|
# send_issues,
|
||||||
)
|
)
|
||||||
from .issues import CenRa_Issues
|
# from .issues import CenRa_Issues
|
||||||
|
|
||||||
from datetime import date
|
# from datetime import date
|
||||||
|
|
||||||
EDITOR_CLASS = load_ui('CenRa_AutoMapStyle_base.ui')
|
EDITOR_CLASS = load_ui('CenRa_AutoMapStyle_base.ui')
|
||||||
LOGGER = logging.getLogger('CenRa_AutoMapStyle')
|
LOGGER = logging.getLogger('CenRa_AutoMapStyle')
|
||||||
|
|
||||||
class AutoMap_Style(QDockWidget, EDITOR_CLASS):
|
|
||||||
|
|
||||||
|
class AutoMap_Style(QDockWidget, EDITOR_CLASS):
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
_ = parent
|
_ = parent
|
||||||
super().__init__()
|
super().__init__()
|
||||||
@@ -93,7 +43,7 @@ class AutoMap_Style(QDockWidget, EDITOR_CLASS):
|
|||||||
self.settings = QgsSettings()
|
self.settings = QgsSettings()
|
||||||
self.s = QSettings()
|
self.s = QSettings()
|
||||||
|
|
||||||
self.toolButton.setIcon(QtGui.QIcon(resources_path('icons','loader.png')))
|
self.toolButton.setIcon(QIcon(resources_path('icons', 'loader.png')))
|
||||||
|
|
||||||
self.loadComboBox()
|
self.loadComboBox()
|
||||||
self.toolButton.clicked.connect(self.loadStyle)
|
self.toolButton.clicked.connect(self.loadStyle)
|
||||||
@@ -136,13 +86,13 @@ class AutoMap_Style(QDockWidget, EDITOR_CLASS):
|
|||||||
uri.setDataSource(schema, table, "geom")
|
uri.setDataSource(schema, table, "geom")
|
||||||
uri.setKeyColumn(key)
|
uri.setKeyColumn(key)
|
||||||
layer = QgsVectorLayer(uri.uri(), table, "postgres")
|
layer = QgsVectorLayer(uri.uri(), table, "postgres")
|
||||||
if layer.isValid() == True:
|
if layer.isValid() is True:
|
||||||
layerName = layer.name()
|
layerName = layer.name()
|
||||||
listStyle = layer.listStylesInDatabase()
|
listStyle = layer.listStylesInDatabase()
|
||||||
try:
|
try:
|
||||||
StyleExist = True
|
StyleExist = True
|
||||||
indexStyle = (listStyle[2].index(layerName))
|
indexStyle = (listStyle[2].index(layerName))
|
||||||
except:
|
except ValueError:
|
||||||
StyleExist = False
|
StyleExist = False
|
||||||
if StyleExist:
|
if StyleExist:
|
||||||
StyleId = (listStyle[1][indexStyle])
|
StyleId = (listStyle[1][indexStyle])
|
||||||
@@ -177,13 +127,13 @@ class AutoMap_Style(QDockWidget, EDITOR_CLASS):
|
|||||||
uri.setDataSource(schema, table, "geom")
|
uri.setDataSource(schema, table, "geom")
|
||||||
uri.setKeyColumn('gid')
|
uri.setKeyColumn('gid')
|
||||||
layer = QgsVectorLayer(uri.uri(), table, "postgres")
|
layer = QgsVectorLayer(uri.uri(), table, "postgres")
|
||||||
if layer.isValid() == True:
|
if layer.isValid() is True:
|
||||||
layerName = layer.name()
|
layerName = layer.name()
|
||||||
listStyle = layer.listStylesInDatabase()
|
listStyle = layer.listStylesInDatabase()
|
||||||
try:
|
try:
|
||||||
StyleExist = True
|
StyleExist = True
|
||||||
indexStyle = (listStyle[2].index(layerName))
|
indexStyle = (listStyle[2].index(layerName))
|
||||||
except:
|
except ValueError:
|
||||||
StyleExist = False
|
StyleExist = False
|
||||||
if StyleExist:
|
if StyleExist:
|
||||||
StyleId = (listStyle[1][indexStyle])
|
StyleId = (listStyle[1][indexStyle])
|
||||||
|
|||||||
|
After Width: | Height: | Size: 113 KiB |
@@ -3,6 +3,8 @@ from qgis.core import (
|
|||||||
QgsUnitTypes,
|
QgsUnitTypes,
|
||||||
QgsLayoutPoint,
|
QgsLayoutPoint,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def fletch_canvas(self):
|
def fletch_canvas(self):
|
||||||
if self.radioButton_6.isChecked():
|
if self.radioButton_6.isChecked():
|
||||||
values_page = 'A4'
|
values_page = 'A4'
|
||||||
@@ -18,15 +20,20 @@ def fletch_canvas(self):
|
|||||||
self.template_parameters['Carte_size'] = QgsLayoutSize(198.85714285714286, 175, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_size'] = QgsLayoutSize(198.85714285714286, 175, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Carte_locals'] = QgsLayoutPoint(5, 25, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_locals'] = QgsLayoutPoint(5, 25, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Carte_rotate'] = 0.0
|
self.template_parameters['Carte_rotate'] = 0.0
|
||||||
|
self.template_parameters['Carte_frame'] = True
|
||||||
self.template_parameters['Carte_2_size'] = QgsLayoutSize(50.0, 50, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_2_size'] = QgsLayoutSize(50.0, 50, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(5, 25, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(5, 25, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Carte_2_rotate'] = 0.0
|
self.template_parameters['Carte_2_rotate'] = 0.0
|
||||||
|
self.template_parameters['Carte_2_frame'] = False
|
||||||
self.template_parameters['Legande_size'] = QgsLayoutSize(198.85714285714286, 90, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Legande_size'] = QgsLayoutSize(198.85714285714286, 90, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Legande_locals'] = QgsLayoutPoint(5, 205, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Legande_locals'] = QgsLayoutPoint(5, 205, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Legande_rotate'] = 0.0
|
self.template_parameters['Legande_rotate'] = 0.0
|
||||||
|
self.template_parameters['Legande_frame'] = False
|
||||||
self.template_parameters['Arrow_size'] = QgsLayoutSize(12.0, 12, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Arrow_size'] = QgsLayoutSize(12.0, 12, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(191, 6, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(191, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Arrow_rotate'] = 0.0
|
self.template_parameters['Arrow_rotate'] = 0.0
|
||||||
|
self.template_parameters['Arrow_background'] = True
|
||||||
|
self.template_parameters['Arrow_path'] = "NorthArrow_02.svg"
|
||||||
self.template_parameters['Echelle_size'] = QgsLayoutSize(54.857142857142854, 5, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Echelle_size'] = QgsLayoutSize(54.857142857142854, 5, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(145, 229, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(145, 229, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Echelle_rotate'] = 0.0
|
self.template_parameters['Echelle_rotate'] = 0.0
|
||||||
@@ -39,9 +46,11 @@ def fletch_canvas(self):
|
|||||||
self.template_parameters['Credit_size'] = QgsLayoutSize(100.0, 4, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Credit_size'] = QgsLayoutSize(100.0, 4, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Credit_locals'] = QgsLayoutPoint(205, 158.0, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Credit_locals'] = QgsLayoutPoint(205, 158.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Credit_rotate'] = 270.0
|
self.template_parameters['Credit_rotate'] = 270.0
|
||||||
|
self.template_parameters['Credit_alignment'] = 0x0002
|
||||||
self.template_parameters['Source_size'] = QgsLayoutSize(100.0, 4, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Source_size'] = QgsLayoutSize(100.0, 4, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Source_locals'] = QgsLayoutPoint(104, 200, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Source_locals'] = QgsLayoutPoint(104, 200, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Source_rotate'] = 0.0
|
self.template_parameters['Source_rotate'] = 0.0
|
||||||
|
self.template_parameters['Source_alignment'] = 0x0002
|
||||||
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(198.85714285714286, 8, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(198.85714285714286, 8, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(5, 12, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(5, 12, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Sous_titre_rotate'] = 0.0
|
self.template_parameters['Sous_titre_rotate'] = 0.0
|
||||||
@@ -55,15 +64,20 @@ def fletch_canvas(self):
|
|||||||
self.template_parameters['Carte_size'] = QgsLayoutSize(280, 247, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_size'] = QgsLayoutSize(280, 247, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Carte_locals'] = QgsLayoutPoint(7, 35, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_locals'] = QgsLayoutPoint(7, 35, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Carte_rotate'] = 0.0
|
self.template_parameters['Carte_rotate'] = 0.0
|
||||||
|
self.template_parameters['Carte_frame'] = True
|
||||||
self.template_parameters['Carte_2_size'] = QgsLayoutSize(70, 70, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_2_size'] = QgsLayoutSize(70, 70, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(7, 35, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(7, 35, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Carte_2_rotate'] = 0.0
|
self.template_parameters['Carte_2_rotate'] = 0.0
|
||||||
|
self.template_parameters['Carte_2_frame'] = False
|
||||||
self.template_parameters['Legande_size'] = QgsLayoutSize(280, 127, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Legande_size'] = QgsLayoutSize(280, 127, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Legande_locals'] = QgsLayoutPoint(7, 289, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Legande_locals'] = QgsLayoutPoint(7, 289, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Legande_rotate'] = 0.0
|
self.template_parameters['Legande_rotate'] = 0.0
|
||||||
|
self.template_parameters['Legande_frame'] = False
|
||||||
self.template_parameters['Arrow_size'] = QgsLayoutSize(17, 17, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Arrow_size'] = QgsLayoutSize(17, 17, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(269, 8, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(269, 8, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Arrow_rotate'] = 0.0
|
self.template_parameters['Arrow_rotate'] = 0.0
|
||||||
|
self.template_parameters['Arrow_background'] = True
|
||||||
|
self.template_parameters['Arrow_path'] = "NorthArrow_02.svg"
|
||||||
self.template_parameters['Echelle_size'] = QgsLayoutSize(77, 7, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Echelle_size'] = QgsLayoutSize(77, 7, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(205, 323, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(205, 323, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Echelle_rotate'] = 0.0
|
self.template_parameters['Echelle_rotate'] = 0.0
|
||||||
@@ -76,9 +90,11 @@ def fletch_canvas(self):
|
|||||||
self.template_parameters['Credit_size'] = QgsLayoutSize(141, 6, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Credit_size'] = QgsLayoutSize(141, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Credit_locals'] = QgsLayoutPoint(289, 223, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Credit_locals'] = QgsLayoutPoint(289, 223, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Credit_rotate'] = 270.0
|
self.template_parameters['Credit_rotate'] = 270.0
|
||||||
|
self.template_parameters['Credit_alignment'] = 0x0002
|
||||||
self.template_parameters['Source_size'] = QgsLayoutSize(141, 6, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Source_size'] = QgsLayoutSize(141, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Source_locals'] = QgsLayoutPoint(147, 282, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Source_locals'] = QgsLayoutPoint(147, 282, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Source_rotate'] = 0.0
|
self.template_parameters['Source_rotate'] = 0.0
|
||||||
|
self.template_parameters['Source_alignment'] = 0x0002
|
||||||
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(280, 11, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(280, 11, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(7, 17, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(7, 17, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Sous_titre_rotate'] = 0.0
|
self.template_parameters['Sous_titre_rotate'] = 0.0
|
||||||
@@ -94,15 +110,20 @@ def fletch_canvas(self):
|
|||||||
self.template_parameters['Carte_size'] = QgsLayoutSize(285.14285714285717, 145, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_size'] = QgsLayoutSize(285.14285714285717, 145, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Carte_locals'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_locals'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Carte_rotate'] = 0.0
|
self.template_parameters['Carte_rotate'] = 0.0
|
||||||
|
self.template_parameters['Carte_frame'] = True
|
||||||
self.template_parameters['Carte_2_size'] = QgsLayoutSize(100.0, 100, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_2_size'] = QgsLayoutSize(100.0, 100, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Carte_2_rotate'] = 0.0
|
self.template_parameters['Carte_2_rotate'] = 0.0
|
||||||
|
self.template_parameters['Carte_2_frame'] = False
|
||||||
self.template_parameters['Legande_size'] = QgsLayoutSize(285.14285714285717, 41, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Legande_size'] = QgsLayoutSize(285.14285714285717, 41, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Legande_locals'] = QgsLayoutPoint(6, 168, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Legande_locals'] = QgsLayoutPoint(6, 168, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Legande_rotate'] = 0.0
|
self.template_parameters['Legande_rotate'] = 0.0
|
||||||
|
self.template_parameters['Legande_frame'] = False
|
||||||
self.template_parameters['Arrow_size'] = QgsLayoutSize(13.142857142857142, 12, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Arrow_size'] = QgsLayoutSize(13.142857142857142, 12, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(277, 6, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(277, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Arrow_rotate'] = 0.0
|
self.template_parameters['Arrow_rotate'] = 0.0
|
||||||
|
self.template_parameters['Arrow_background'] = True
|
||||||
|
self.template_parameters['Arrow_path'] = "NorthArrow_02.svg"
|
||||||
self.template_parameters['Echelle_size'] = QgsLayoutSize(54.857142857142854, 15, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Echelle_size'] = QgsLayoutSize(54.857142857142854, 15, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(232, 193, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(232, 193, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Echelle_rotate'] = 0.0
|
self.template_parameters['Echelle_rotate'] = 0.0
|
||||||
@@ -115,9 +136,11 @@ def fletch_canvas(self):
|
|||||||
self.template_parameters['Credit_size'] = QgsLayoutSize(100.0, 4, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Credit_size'] = QgsLayoutSize(100.0, 4, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Credit_locals'] = QgsLayoutPoint(291, 127.0, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Credit_locals'] = QgsLayoutPoint(291, 127.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Credit_rotate'] = 270.0
|
self.template_parameters['Credit_rotate'] = 270.0
|
||||||
|
self.template_parameters['Credit_alignment'] = 0x0002
|
||||||
self.template_parameters['Source_size'] = QgsLayoutSize(100.0, 4, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Source_size'] = QgsLayoutSize(100.0, 4, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Source_locals'] = QgsLayoutPoint(189, 169, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Source_locals'] = QgsLayoutPoint(189, 169, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Source_rotate'] = 0.0
|
self.template_parameters['Source_rotate'] = 0.0
|
||||||
|
self.template_parameters['Source_alignment'] = 0x0002
|
||||||
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(286.0, 8, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(286.0, 8, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(5, 12, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(5, 12, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Sous_titre_rotate'] = 0.0
|
self.template_parameters['Sous_titre_rotate'] = 0.0
|
||||||
@@ -131,15 +154,20 @@ def fletch_canvas(self):
|
|||||||
self.template_parameters['Carte_size'] = QgsLayoutSize(402, 205, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_size'] = QgsLayoutSize(402, 205, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Carte_locals'] = QgsLayoutPoint(8, 32, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_locals'] = QgsLayoutPoint(8, 32, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Carte_rotate'] = 0.0
|
self.template_parameters['Carte_rotate'] = 0.0
|
||||||
|
self.template_parameters['Carte_frame'] = True
|
||||||
self.template_parameters['Carte_2_size'] = QgsLayoutSize(141, 141, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_2_size'] = QgsLayoutSize(141, 141, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(8, 32, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(8, 32, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Carte_2_rotate'] = 0.0
|
self.template_parameters['Carte_2_rotate'] = 0.0
|
||||||
|
self.template_parameters['Carte_2_frame'] = False
|
||||||
self.template_parameters['Legande_size'] = QgsLayoutSize(402, 58, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Legande_size'] = QgsLayoutSize(402, 58, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Legande_locals'] = QgsLayoutPoint(8, 237, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Legande_locals'] = QgsLayoutPoint(8, 237, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Legande_rotate'] = 0.0
|
self.template_parameters['Legande_rotate'] = 0.0
|
||||||
|
self.template_parameters['Legande_frame'] = False
|
||||||
self.template_parameters['Arrow_size'] = QgsLayoutSize(19, 17, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Arrow_size'] = QgsLayoutSize(19, 17, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(391, 8, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(391, 8, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Arrow_rotate'] = 0.0
|
self.template_parameters['Arrow_rotate'] = 0.0
|
||||||
|
self.template_parameters['Arrow_background'] = True
|
||||||
|
self.template_parameters['Arrow_path'] = "NorthArrow_02.svg"
|
||||||
self.template_parameters['Echelle_size'] = QgsLayoutSize(77, 21, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Echelle_size'] = QgsLayoutSize(77, 21, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(327, 272, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(327, 272, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Echelle_rotate'] = 0.0
|
self.template_parameters['Echelle_rotate'] = 0.0
|
||||||
@@ -152,9 +180,11 @@ def fletch_canvas(self):
|
|||||||
self.template_parameters['Credit_size'] = QgsLayoutSize(141, 6, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Credit_size'] = QgsLayoutSize(141, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Credit_locals'] = QgsLayoutPoint(410, 179, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Credit_locals'] = QgsLayoutPoint(410, 179, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Credit_rotate'] = 270.0
|
self.template_parameters['Credit_rotate'] = 270.0
|
||||||
|
self.template_parameters['Credit_alignment'] = 0x0002
|
||||||
self.template_parameters['Source_size'] = QgsLayoutSize(141, 6, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Source_size'] = QgsLayoutSize(141, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Source_locals'] = QgsLayoutPoint(267, 238, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Source_locals'] = QgsLayoutPoint(267, 238, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Source_rotate'] = 0.0
|
self.template_parameters['Source_rotate'] = 0.0
|
||||||
|
self.template_parameters['Source_alignment'] = 0x0002
|
||||||
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(403, 11, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(403, 11, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(7, 17, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(7, 17, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Sous_titre_rotate'] = 0.0
|
self.template_parameters['Sous_titre_rotate'] = 0.0
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ from qgis.core import (
|
|||||||
QgsUnitTypes,
|
QgsUnitTypes,
|
||||||
QgsLayoutPoint,
|
QgsLayoutPoint,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def fletch_canvas(self):
|
def fletch_canvas(self):
|
||||||
if self.radioButton_6.isChecked():
|
if self.radioButton_6.isChecked():
|
||||||
values_page = 'A4'
|
values_page = 'A4'
|
||||||
@@ -52,6 +54,13 @@ def fletch_canvas(self):
|
|||||||
self.template_parameters['Sous_titre_rotate'] = 0
|
self.template_parameters['Sous_titre_rotate'] = 0
|
||||||
self.template_parameters['Echelle_2_rotate'] = 0
|
self.template_parameters['Echelle_2_rotate'] = 0
|
||||||
self.template_parameters['Logo_2_rotate'] = 0
|
self.template_parameters['Logo_2_rotate'] = 0
|
||||||
|
self.template_parameters['Carte_frame'] = True
|
||||||
|
self.template_parameters['Carte_2_frame'] = False
|
||||||
|
self.template_parameters['Legande_frame'] = False
|
||||||
|
self.template_parameters['Arrow_background'] = True
|
||||||
|
self.template_parameters['Arrow_path'] = "NorthArrow_02.svg"
|
||||||
|
self.template_parameters['Credit_alignment'] = 0x0002
|
||||||
|
self.template_parameters['Source_alignment'] = 0x0002
|
||||||
if values_page == 'A3':
|
if values_page == 'A3':
|
||||||
self.template_parameters['Carte_2_size'] = QgsLayoutSize(50, 50, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_2_size'] = QgsLayoutSize(50, 50, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(2.5, 20, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(2.5, 20, QgsUnitTypes.LayoutMillimeters)
|
||||||
@@ -89,6 +98,14 @@ def fletch_canvas(self):
|
|||||||
self.template_parameters['Sous_titre_rotate'] = 0
|
self.template_parameters['Sous_titre_rotate'] = 0
|
||||||
self.template_parameters['Echelle_2_rotate'] = 0
|
self.template_parameters['Echelle_2_rotate'] = 0
|
||||||
self.template_parameters['Logo_2_rotate'] = 0
|
self.template_parameters['Logo_2_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_2_rotate'] = 0
|
||||||
|
self.template_parameters['Carte_frame'] = True
|
||||||
|
self.template_parameters['Carte_2_frame'] = False
|
||||||
|
self.template_parameters['Legande_frame'] = False
|
||||||
|
self.template_parameters['Arrow_background'] = True
|
||||||
|
self.template_parameters['Arrow_path'] = "NorthArrow_02.svg"
|
||||||
|
self.template_parameters['Credit_alignment'] = 0x0002
|
||||||
|
self.template_parameters['Source_alignment'] = 0x0002
|
||||||
|
|
||||||
if page_rotate == 'Landscape':
|
if page_rotate == 'Landscape':
|
||||||
if values_page == 'A3':
|
if values_page == 'A3':
|
||||||
@@ -128,6 +145,14 @@ def fletch_canvas(self):
|
|||||||
self.template_parameters['Sous_titre_rotate'] = 0
|
self.template_parameters['Sous_titre_rotate'] = 0
|
||||||
self.template_parameters['Echelle_2_rotate'] = 0
|
self.template_parameters['Echelle_2_rotate'] = 0
|
||||||
self.template_parameters['Logo_2_rotate'] = 0
|
self.template_parameters['Logo_2_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_2_rotate'] = 0
|
||||||
|
self.template_parameters['Carte_frame'] = True
|
||||||
|
self.template_parameters['Carte_2_frame'] = False
|
||||||
|
self.template_parameters['Legande_frame'] = False
|
||||||
|
self.template_parameters['Arrow_background'] = True
|
||||||
|
self.template_parameters['Arrow_path'] = "NorthArrow_02.svg"
|
||||||
|
self.template_parameters['Credit_alignment'] = 0x0002
|
||||||
|
self.template_parameters['Source_alignment'] = 0x0002
|
||||||
if values_page == 'A4':
|
if values_page == 'A4':
|
||||||
self.template_parameters['Carte_2_size'] = QgsLayoutSize(100, 100, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_2_size'] = QgsLayoutSize(100, 100, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(6, 23, QgsUnitTypes.LayoutMillimeters)
|
||||||
@@ -165,6 +190,14 @@ def fletch_canvas(self):
|
|||||||
self.template_parameters['Sous_titre_rotate'] = 0
|
self.template_parameters['Sous_titre_rotate'] = 0
|
||||||
self.template_parameters['Echelle_2_rotate'] = 0
|
self.template_parameters['Echelle_2_rotate'] = 0
|
||||||
self.template_parameters['Logo_2_rotate'] = 0
|
self.template_parameters['Logo_2_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_2_rotate'] = 0
|
||||||
|
self.template_parameters['Carte_frame'] = True
|
||||||
|
self.template_parameters['Carte_2_frame'] = False
|
||||||
|
self.template_parameters['Legande_frame'] = False
|
||||||
|
self.template_parameters['Arrow_background'] = True
|
||||||
|
self.template_parameters['Arrow_path'] = "NorthArrow_02.svg"
|
||||||
|
self.template_parameters['Credit_alignment'] = 0x0002
|
||||||
|
self.template_parameters['Source_alignment'] = 0x0002
|
||||||
|
|
||||||
# Retour des info #
|
# Retour des info #
|
||||||
return self.template_parameters
|
return self.template_parameters
|
||||||
@@ -4,6 +4,8 @@ from qgis.core import (
|
|||||||
QgsUnitTypes,
|
QgsUnitTypes,
|
||||||
QgsLayoutPoint,
|
QgsLayoutPoint,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def fletch_canvas(self):
|
def fletch_canvas(self):
|
||||||
if self.radioButton_6.isChecked():
|
if self.radioButton_6.isChecked():
|
||||||
values_page = 'A4'
|
values_page = 'A4'
|
||||||
@@ -52,6 +54,14 @@ def fletch_canvas(self):
|
|||||||
self.template_parameters['Logo_2_size'] = QgsLayoutSize(30.0, 30, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Logo_2_size'] = QgsLayoutSize(30.0, 30, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(41, 233, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(41, 233, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Logo_2_rotate'] = 0
|
self.template_parameters['Logo_2_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_2_rotate'] = 0
|
||||||
|
self.template_parameters['Carte_frame'] = True
|
||||||
|
self.template_parameters['Carte_2_frame'] = False
|
||||||
|
self.template_parameters['Legande_frame'] = False
|
||||||
|
self.template_parameters['Arrow_background'] = True
|
||||||
|
self.template_parameters['Arrow_path'] = "NorthArrow_02.svg"
|
||||||
|
self.template_parameters['Credit_alignment'] = 0x0002
|
||||||
|
self.template_parameters['Source_alignment'] = 0x0002
|
||||||
if values_page == 'A3':
|
if values_page == 'A3':
|
||||||
self.template_parameters['Carte_size'] = QgsLayoutSize(237, 369, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_size'] = QgsLayoutSize(237, 369, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Carte_locals'] = QgsLayoutPoint(58, 2, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_locals'] = QgsLayoutPoint(58, 2, QgsUnitTypes.LayoutMillimeters)
|
||||||
@@ -89,6 +99,15 @@ def fletch_canvas(self):
|
|||||||
self.template_parameters['Logo_2_size'] = QgsLayoutSize(42, 42, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Logo_2_size'] = QgsLayoutSize(42, 42, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(58, 329, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(58, 329, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Logo_2_rotate'] = 0
|
self.template_parameters['Logo_2_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_2_rotate'] = 0
|
||||||
|
self.template_parameters['Carte_frame'] = True
|
||||||
|
self.template_parameters['Carte_2_frame'] = False
|
||||||
|
self.template_parameters['Legande_frame'] = False
|
||||||
|
self.template_parameters['Arrow_background'] = True
|
||||||
|
self.template_parameters['Arrow_path'] = "NorthArrow_02.svg"
|
||||||
|
self.template_parameters['Credit_alignment'] = 0x0002
|
||||||
|
self.template_parameters['Source_alignment'] = 0x0002
|
||||||
|
|
||||||
if page_rotate == 'Landscape':
|
if page_rotate == 'Landscape':
|
||||||
if values_page == 'A4':
|
if values_page == 'A4':
|
||||||
self.template_parameters['Carte_size'] = QgsLayoutSize(254.85714285714286, 175, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_size'] = QgsLayoutSize(254.85714285714286, 175, QgsUnitTypes.LayoutMillimeters)
|
||||||
@@ -127,6 +146,14 @@ def fletch_canvas(self):
|
|||||||
self.template_parameters['Logo_2_size'] = QgsLayoutSize(30.0, 30, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Logo_2_size'] = QgsLayoutSize(30.0, 30, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(41, 146, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(41, 146, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Logo_2_rotate'] = 0
|
self.template_parameters['Logo_2_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_2_rotate'] = 0
|
||||||
|
self.template_parameters['Carte_frame'] = True
|
||||||
|
self.template_parameters['Carte_2_frame'] = False
|
||||||
|
self.template_parameters['Legande_frame'] = False
|
||||||
|
self.template_parameters['Arrow_background'] = True
|
||||||
|
self.template_parameters['Arrow_path'] = "NorthArrow_02.svg"
|
||||||
|
self.template_parameters['Credit_alignment'] = 0x0002
|
||||||
|
self.template_parameters['Source_alignment'] = 0x0002
|
||||||
if values_page == 'A3':
|
if values_page == 'A3':
|
||||||
self.template_parameters['Carte_size'] = QgsLayoutSize(359, 247, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_size'] = QgsLayoutSize(359, 247, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Carte_locals'] = QgsLayoutPoint(58, 2, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Carte_locals'] = QgsLayoutPoint(58, 2, QgsUnitTypes.LayoutMillimeters)
|
||||||
@@ -164,4 +191,13 @@ def fletch_canvas(self):
|
|||||||
self.template_parameters['Logo_2_size'] = QgsLayoutSize(42, 42, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Logo_2_size'] = QgsLayoutSize(42, 42, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(58, 206, QgsUnitTypes.LayoutMillimeters)
|
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(58, 206, QgsUnitTypes.LayoutMillimeters)
|
||||||
self.template_parameters['Logo_2_rotate'] = 0
|
self.template_parameters['Logo_2_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_2_rotate'] = 0
|
||||||
|
self.template_parameters['Carte_frame'] = True
|
||||||
|
self.template_parameters['Carte_2_frame'] = False
|
||||||
|
self.template_parameters['Legande_frame'] = False
|
||||||
|
self.template_parameters['Arrow_background'] = True
|
||||||
|
self.template_parameters['Arrow_path'] = "NorthArrow_02.svg"
|
||||||
|
self.template_parameters['Credit_alignment'] = 0x0002
|
||||||
|
self.template_parameters['Source_alignment'] = 0x0002
|
||||||
|
|
||||||
return self.template_parameters
|
return self.template_parameters
|
||||||
|
|||||||
@@ -0,0 +1,197 @@
|
|||||||
|
|
||||||
|
from qgis.core import (
|
||||||
|
QgsLayoutSize,
|
||||||
|
QgsUnitTypes,
|
||||||
|
QgsLayoutPoint,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def fletch_canvas(self):
|
||||||
|
if self.radioButton_6.isChecked():
|
||||||
|
values_page = 'A4'
|
||||||
|
else:
|
||||||
|
values_page = 'A3'
|
||||||
|
if self.radioButton_7.isChecked():
|
||||||
|
page_rotate = 'Portrait'
|
||||||
|
else:
|
||||||
|
page_rotate = 'Landscape'
|
||||||
|
|
||||||
|
if page_rotate == 'Portrait':
|
||||||
|
if values_page == 'A4':
|
||||||
|
self.template_parameters['Carte_size'] = QgsLayoutSize(206.0, 200, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_locals'] = QgsLayoutPoint(2, 29, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_rotate'] = 0
|
||||||
|
self.template_parameters['Carte_frame'] = True
|
||||||
|
self.template_parameters['Carte_2_size'] = QgsLayoutSize(58.857142857142854, 40, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(146, 218, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_rotate'] = 0
|
||||||
|
self.template_parameters['Carte_2_frame'] = True
|
||||||
|
self.template_parameters['Legande_size'] = QgsLayoutSize(198.85714285714286, 36, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_locals'] = QgsLayoutPoint(6, 260, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_rotate'] = 0
|
||||||
|
self.template_parameters['Legande_frame'] = True
|
||||||
|
self.template_parameters['Arrow_size'] = QgsLayoutSize(14.0, 14, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(191, 32, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_rotate'] = 0
|
||||||
|
self.template_parameters['Arrow_background'] = False
|
||||||
|
self.template_parameters['Arrow_path'] = "NorthArrow_03.svg"
|
||||||
|
self.template_parameters['Echelle_size'] = QgsLayoutSize(50.0, 10, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(90, 244, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_size'] = QgsLayoutSize(40.0, 20, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_locals'] = QgsLayoutPoint(6, 234, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_rotate'] = 0
|
||||||
|
self.template_parameters['Titre_size'] = QgsLayoutSize(206.0, 10, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_locals'] = QgsLayoutPoint(2, 3, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_rotate'] = 0
|
||||||
|
self.template_parameters['Credit_size'] = QgsLayoutSize(198.0, 5, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_locals'] = QgsLayoutPoint(3, 228.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_rotate'] = 270
|
||||||
|
self.template_parameters['Credit_alignment'] = 0x0001
|
||||||
|
self.template_parameters['Source_size'] = QgsLayoutSize(198.0, 5, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_locals'] = QgsLayoutPoint(8, 228.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_rotate'] = 270
|
||||||
|
self.template_parameters['Source_alignment'] = 0x0001
|
||||||
|
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(202.0, 14, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(4, 13, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_rotate'] = 0
|
||||||
|
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(50.0, 13, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(90, 233, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_2_size'] = QgsLayoutSize(40.0, 20, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(48, 234, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_rotate'] = 0
|
||||||
|
if values_page == 'A3':
|
||||||
|
self.template_parameters['Carte_size'] = QgsLayoutSize(290, 282, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_locals'] = QgsLayoutPoint(3, 41, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_rotate'] = 0
|
||||||
|
self.template_parameters['Carte_frame'] = True
|
||||||
|
self.template_parameters['Carte_2_size'] = QgsLayoutSize(83, 56, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(206, 307, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_rotate'] = 0
|
||||||
|
self.template_parameters['Carte_2_frame'] = True
|
||||||
|
self.template_parameters['Legande_size'] = QgsLayoutSize(280, 51, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_locals'] = QgsLayoutPoint(8, 367, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_rotate'] = 0
|
||||||
|
self.template_parameters['Legande_frame'] = True
|
||||||
|
self.template_parameters['Arrow_size'] = QgsLayoutSize(20, 20, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(269, 45, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_rotate'] = 0
|
||||||
|
self.template_parameters['Arrow_background'] = False
|
||||||
|
self.template_parameters['Arrow_path'] = "NorthArrow_03.svg"
|
||||||
|
self.template_parameters['Echelle_size'] = QgsLayoutSize(70, 14, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(125, 350, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_size'] = QgsLayoutSize(56, 28, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_locals'] = QgsLayoutPoint(8, 330, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_rotate'] = 0
|
||||||
|
self.template_parameters['Titre_size'] = QgsLayoutSize(290, 14, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_locals'] = QgsLayoutPoint(3, 4, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_rotate'] = 0
|
||||||
|
self.template_parameters['Credit_size'] = QgsLayoutSize(280, 7, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_locals'] = QgsLayoutPoint(4, 322, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_rotate'] = 270
|
||||||
|
self.template_parameters['Credit_alignment'] = 0x0001
|
||||||
|
self.template_parameters['Source_size'] = QgsLayoutSize(280, 7, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_locals'] = QgsLayoutPoint(11, 322, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_rotate'] = 270
|
||||||
|
self.template_parameters['Source_alignment'] = 0x0001
|
||||||
|
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(285, 20, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(6, 19, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_rotate'] = 0
|
||||||
|
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(70, 19, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(125, 330, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_2_size'] = QgsLayoutSize(56, 28, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(68, 330, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_rotate'] = 0
|
||||||
|
if page_rotate == 'Landscape':
|
||||||
|
if values_page == 'A4':
|
||||||
|
self.template_parameters['Carte_size'] = QgsLayoutSize(189.0, 189, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_locals'] = QgsLayoutPoint(9, 18.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_rotate'] = 0
|
||||||
|
self.template_parameters['Carte_frame'] = True
|
||||||
|
self.template_parameters['Carte_2_size'] = QgsLayoutSize(50.0, 40, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(194, 20.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_rotate'] = 0
|
||||||
|
self.template_parameters['Carte_2_frame'] = True
|
||||||
|
self.template_parameters['Legande_size'] = QgsLayoutSize(203.0, 62, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_locals'] = QgsLayoutPoint(199, 63.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_rotate'] = 0
|
||||||
|
self.template_parameters['Legande_frame'] = True
|
||||||
|
self.template_parameters['Arrow_size'] = QgsLayoutSize(14.0, 14, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(177, 20.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_rotate'] = 0
|
||||||
|
self.template_parameters['Arrow_background'] = False
|
||||||
|
self.template_parameters['Arrow_path'] = "NorthArrow_03.svg"
|
||||||
|
self.template_parameters['Echelle_size'] = QgsLayoutSize(50, 8, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(247, 43, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_size'] = QgsLayoutSize(40.0, 30, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_locals'] = QgsLayoutPoint(209, 174.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_rotate'] = 0
|
||||||
|
self.template_parameters['Titre_size'] = QgsLayoutSize(289.0, 11, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_locals'] = QgsLayoutPoint(3, 1.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_rotate'] = 0
|
||||||
|
self.template_parameters['Credit_size'] = QgsLayoutSize(191, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_locals'] = QgsLayoutPoint(8, 201, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_rotate'] = 0
|
||||||
|
self.template_parameters['Credit_alignment'] = 0x0001
|
||||||
|
self.template_parameters['Source_size'] = QgsLayoutSize(191, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_locals'] = QgsLayoutPoint(8, 195, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_rotate'] = 0
|
||||||
|
self.template_parameters['Source_alignment'] = 0x0001
|
||||||
|
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(289.0, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(3, 12.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_rotate'] = 0
|
||||||
|
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(50, 13, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(249, 30, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_2_size'] = QgsLayoutSize(40.0, 30, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(252, 174, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_rotate'] = 0
|
||||||
|
if values_page == 'A3':
|
||||||
|
self.template_parameters['Carte_size'] = QgsLayoutSize(305.0, 273, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_locals'] = QgsLayoutPoint(9, 18.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_rotate'] = 0
|
||||||
|
self.template_parameters['Carte_frame'] = True
|
||||||
|
self.template_parameters['Carte_2_size'] = QgsLayoutSize(50.0, 40, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(311, 20.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_rotate'] = 0
|
||||||
|
self.template_parameters['Carte_2_frame'] = True
|
||||||
|
self.template_parameters['Legande_size'] = QgsLayoutSize(203.0, 62, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_locals'] = QgsLayoutPoint(317, 63.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_rotate'] = 0
|
||||||
|
self.template_parameters['Legande_frame'] = True
|
||||||
|
self.template_parameters['Arrow_size'] = QgsLayoutSize(14.0, 14, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(296, 20.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_rotate'] = 0
|
||||||
|
self.template_parameters['Arrow_background'] = False
|
||||||
|
self.template_parameters['Arrow_path'] = "NorthArrow_03.svg"
|
||||||
|
self.template_parameters['Echelle_size'] = QgsLayoutSize(50, 8, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(364, 43, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_size'] = QgsLayoutSize(40.0, 30, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_locals'] = QgsLayoutPoint(320, 264.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_rotate'] = 0
|
||||||
|
self.template_parameters['Titre_size'] = QgsLayoutSize(413.0, 11, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_locals'] = QgsLayoutPoint(3, 1.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_rotate'] = 0
|
||||||
|
self.template_parameters['Credit_size'] = QgsLayoutSize(306, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_locals'] = QgsLayoutPoint(8, 285, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_rotate'] = 0
|
||||||
|
self.template_parameters['Credit_alignment'] = 0x0001
|
||||||
|
self.template_parameters['Source_size'] = QgsLayoutSize(306, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_locals'] = QgsLayoutPoint(8, 279, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_rotate'] = 0
|
||||||
|
self.template_parameters['Source_alignment'] = 0x0001
|
||||||
|
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(413.0, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(3, 12.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_rotate'] = 0
|
||||||
|
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(50, 13, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(366, 30, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_2_size'] = QgsLayoutSize(40.0, 30, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(369, 264, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_rotate'] = 0
|
||||||
|
return self.template_parameters
|
||||||
@@ -0,0 +1,197 @@
|
|||||||
|
|
||||||
|
from qgis.core import (
|
||||||
|
QgsLayoutSize,
|
||||||
|
QgsUnitTypes,
|
||||||
|
QgsLayoutPoint,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def fletch_canvas(self):
|
||||||
|
if self.radioButton_6.isChecked():
|
||||||
|
values_page = 'A4'
|
||||||
|
else:
|
||||||
|
values_page = 'A3'
|
||||||
|
if self.radioButton_7.isChecked():
|
||||||
|
page_rotate = 'Portrait'
|
||||||
|
else:
|
||||||
|
page_rotate = 'Landscape'
|
||||||
|
|
||||||
|
if page_rotate == 'Portrait':
|
||||||
|
if values_page == 'A4':
|
||||||
|
self.template_parameters['Carte_size'] = QgsLayoutSize(145.0, 135, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_locals'] = QgsLayoutPoint(4, 18, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_rotate'] = 0
|
||||||
|
self.template_parameters['Carte_frame'] = True
|
||||||
|
self.template_parameters['Carte_2_size'] = QgsLayoutSize(50, 40, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(146, 21, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_rotate'] = 0
|
||||||
|
self.template_parameters['Carte_2_frame'] = True
|
||||||
|
self.template_parameters['Legande_size'] = QgsLayoutSize(198.85714285714286, 36, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_locals'] = QgsLayoutPoint(153, 64, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_rotate'] = 0
|
||||||
|
self.template_parameters['Legande_frame'] = True
|
||||||
|
self.template_parameters['Arrow_size'] = QgsLayoutSize(14.0, 14, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(6, 20, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_rotate'] = 0
|
||||||
|
self.template_parameters['Arrow_background'] = False
|
||||||
|
self.template_parameters['Arrow_path'] = "NorthArrow_03.svg"
|
||||||
|
self.template_parameters['Echelle_size'] = QgsLayoutSize(50.0, 10, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(154, 220, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_size'] = QgsLayoutSize(40.0, 20, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_locals'] = QgsLayoutPoint(160, 264, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_rotate'] = 0
|
||||||
|
self.template_parameters['Titre_size'] = QgsLayoutSize(205.0, 10, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_locals'] = QgsLayoutPoint(2, 1, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_rotate'] = 0
|
||||||
|
self.template_parameters['Credit_size'] = QgsLayoutSize(145.0, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_locals'] = QgsLayoutPoint(4, 147.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_rotate'] = 0
|
||||||
|
self.template_parameters['Credit_alignment'] = 0x0001
|
||||||
|
self.template_parameters['Source_size'] = QgsLayoutSize(145.0, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_locals'] = QgsLayoutPoint(4, 141.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_rotate'] = 0
|
||||||
|
self.template_parameters['Source_alignment'] = 0x0001
|
||||||
|
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(205, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(2, 11, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_rotate'] = 0
|
||||||
|
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(50.0, 13, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(162, 208, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_2_size'] = QgsLayoutSize(40.0, 20, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(160, 234, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_rotate'] = 0
|
||||||
|
if values_page == 'A3':
|
||||||
|
self.template_parameters['Carte_size'] = QgsLayoutSize(233.0, 192, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_locals'] = QgsLayoutPoint(4, 18, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_rotate'] = 0
|
||||||
|
self.template_parameters['Carte_frame'] = True
|
||||||
|
self.template_parameters['Carte_2_size'] = QgsLayoutSize(50, 40, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(234, 21, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_rotate'] = 0
|
||||||
|
self.template_parameters['Carte_2_frame'] = True
|
||||||
|
self.template_parameters['Legande_size'] = QgsLayoutSize(190, 36, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_locals'] = QgsLayoutPoint(242, 64, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_rotate'] = 0
|
||||||
|
self.template_parameters['Legande_frame'] = True
|
||||||
|
self.template_parameters['Arrow_size'] = QgsLayoutSize(14.0, 14, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(6, 20, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_rotate'] = 0
|
||||||
|
self.template_parameters['Arrow_background'] = False
|
||||||
|
self.template_parameters['Arrow_path'] = "NorthArrow_03.svg"
|
||||||
|
self.template_parameters['Echelle_size'] = QgsLayoutSize(50.0, 10, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(154, 220, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_size'] = QgsLayoutSize(40.0, 20, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_locals'] = QgsLayoutPoint(248, 386, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_rotate'] = 0
|
||||||
|
self.template_parameters['Titre_size'] = QgsLayoutSize(293.0, 10, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_locals'] = QgsLayoutPoint(2, 1, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_rotate'] = 0
|
||||||
|
self.template_parameters['Credit_size'] = QgsLayoutSize(233.0, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_locals'] = QgsLayoutPoint(4, 204.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_rotate'] = 0
|
||||||
|
self.template_parameters['Credit_alignment'] = 0x0001
|
||||||
|
self.template_parameters['Source_size'] = QgsLayoutSize(233.0, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_locals'] = QgsLayoutPoint(4, 198.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_rotate'] = 0
|
||||||
|
self.template_parameters['Source_alignment'] = 0x0001
|
||||||
|
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(293, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(2, 11, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_rotate'] = 0
|
||||||
|
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(50.0, 13, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(252, 330, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_2_size'] = QgsLayoutSize(40.0, 20, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(160, 234, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_rotate'] = 0
|
||||||
|
if page_rotate == 'Landscape':
|
||||||
|
if values_page == 'A4':
|
||||||
|
self.template_parameters['Carte_size'] = QgsLayoutSize(145.0, 140, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_locals'] = QgsLayoutPoint(150, 27.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_rotate'] = 0
|
||||||
|
self.template_parameters['Carte_frame'] = True
|
||||||
|
self.template_parameters['Carte_2_size'] = QgsLayoutSize(40.0, 30, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(253, 144.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_rotate'] = 0
|
||||||
|
self.template_parameters['Carte_2_frame'] = True
|
||||||
|
self.template_parameters['Legande_size'] = QgsLayoutSize(110.0, 30, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_locals'] = QgsLayoutPoint(183, 175.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_rotate'] = 0
|
||||||
|
self.template_parameters['Legande_frame'] = True
|
||||||
|
self.template_parameters['Arrow_size'] = QgsLayoutSize(14.0, 14, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(278, 29.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_rotate'] = 0
|
||||||
|
self.template_parameters['Arrow_background'] = False
|
||||||
|
self.template_parameters['Arrow_path'] = "NorthArrow_03.svg"
|
||||||
|
self.template_parameters['Echelle_size'] = QgsLayoutSize(50, 8, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(110, 191, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_size'] = QgsLayoutSize(40.0, 30, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_locals'] = QgsLayoutPoint(7, 175.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_rotate'] = 0
|
||||||
|
self.template_parameters['Titre_size'] = QgsLayoutSize(288.0, 11, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_locals'] = QgsLayoutPoint(3, 1.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_rotate'] = 0
|
||||||
|
self.template_parameters['Credit_size'] = QgsLayoutSize(140, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_locals'] = QgsLayoutPoint(150, 167, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_rotate'] = 270
|
||||||
|
self.template_parameters['Credit_alignment'] = 0x0001
|
||||||
|
self.template_parameters['Source_size'] = QgsLayoutSize(140, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_locals'] = QgsLayoutPoint(156, 167, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_rotate'] = 270
|
||||||
|
self.template_parameters['Source_alignment'] = 0x0001
|
||||||
|
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(288.0, 11, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(3, 11.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_rotate'] = 0
|
||||||
|
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(50, 13, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(110, 180, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_2_size'] = QgsLayoutSize(40.0, 30, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(52, 175, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_rotate'] = 0
|
||||||
|
if values_page == 'A3':
|
||||||
|
self.template_parameters['Carte_size'] = QgsLayoutSize(200.0, 230, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_locals'] = QgsLayoutPoint(216, 27.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_rotate'] = 0
|
||||||
|
self.template_parameters['Carte_frame'] = True
|
||||||
|
self.template_parameters['Carte_2_size'] = QgsLayoutSize(40.0, 30, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(373, 234.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_rotate'] = 0
|
||||||
|
self.template_parameters['Carte_2_frame'] = True
|
||||||
|
self.template_parameters['Legande_size'] = QgsLayoutSize(110.0, 30, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_locals'] = QgsLayoutPoint(253, 264.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_rotate'] = 0
|
||||||
|
self.template_parameters['Legande_frame'] = True
|
||||||
|
self.template_parameters['Arrow_size'] = QgsLayoutSize(14.0, 14, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(401, 29.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_rotate'] = 0
|
||||||
|
self.template_parameters['Arrow_background'] = False
|
||||||
|
self.template_parameters['Arrow_path'] = "NorthArrow_03.svg"
|
||||||
|
self.template_parameters['Echelle_size'] = QgsLayoutSize(50, 8, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(150, 281, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_size'] = QgsLayoutSize(40.0, 30, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_locals'] = QgsLayoutPoint(7, 265.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_rotate'] = 0
|
||||||
|
self.template_parameters['Titre_size'] = QgsLayoutSize(413.0, 11, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_locals'] = QgsLayoutPoint(3, 1.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_rotate'] = 0
|
||||||
|
self.template_parameters['Credit_size'] = QgsLayoutSize(230, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_locals'] = QgsLayoutPoint(216, 257, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_rotate'] = 270
|
||||||
|
self.template_parameters['Credit_alignment'] = 0x0001
|
||||||
|
self.template_parameters['Source_size'] = QgsLayoutSize(230, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_locals'] = QgsLayoutPoint(222, 257, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_rotate'] = 270
|
||||||
|
self.template_parameters['Source_alignment'] = 0x0001
|
||||||
|
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(413.0, 11, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(3, 11.0, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_rotate'] = 0
|
||||||
|
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(50, 13, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(150, 270, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_2_size'] = QgsLayoutSize(40.0, 30, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(72, 265, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_rotate'] = 0
|
||||||
|
return self.template_parameters
|
||||||
@@ -4,7 +4,7 @@ import configparser
|
|||||||
import shutil
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
import base64
|
import base64
|
||||||
import socket
|
import os
|
||||||
import psycopg2
|
import psycopg2
|
||||||
import psycopg2.extras
|
import psycopg2.extras
|
||||||
from os.path import abspath, join, pardir, dirname
|
from os.path import abspath, join, pardir, dirname
|
||||||
@@ -109,14 +109,9 @@ def load_ui(*args):
|
|||||||
return ui_class
|
return ui_class
|
||||||
|
|
||||||
def pyperclip():
|
def pyperclip():
|
||||||
IPAddr=socket.gethostbyname(socket.gethostname())
|
dst = dirname(dirname(__file__))+"\\tools\\"
|
||||||
dst = abspath(abspath(join(plugin_path(), "CenRa_AUTOMAP\\tools\\")))
|
if os.access('N:/',os.R_OK):
|
||||||
if IPAddr[0:11] == "100.100.100": #4269
|
src = 'N:/SI_Systeme d information/Z_QGIS/PLUGIN/StyleLayer.py'
|
||||||
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\StyleLayer.py'
|
|
||||||
if IPAddr[0:9] == "192.168.0": #01
|
|
||||||
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\StyleLayer.py'
|
|
||||||
if IPAddr[0:9] == "192.168.1": #0726
|
|
||||||
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\StyleLayer.py'
|
|
||||||
try:
|
try:
|
||||||
shutil.copy(src, dst)
|
shutil.copy(src, dst)
|
||||||
except:
|
except:
|
||||||
@@ -154,7 +149,7 @@ def maj_verif(NAME):
|
|||||||
|
|
||||||
url = qgis.utils.pluginMetadata(NAME,'repository')
|
url = qgis.utils.pluginMetadata(NAME,'repository')
|
||||||
#URL = url+'/raw/branch/main/plugins.xml'
|
#URL = url+'/raw/branch/main/plugins.xml'
|
||||||
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/releases/plugins.xml'
|
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/plugins.xml'
|
||||||
# print(URL)
|
# print(URL)
|
||||||
version = qgis.utils.pluginMetadata(NAME,'version')
|
version = qgis.utils.pluginMetadata(NAME,'version')
|
||||||
len_version = len(version)
|
len_version = len(version)
|
||||||
|
|||||||
@@ -29,9 +29,6 @@
|
|||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::NoFrame</enum>
|
<enum>QFrame::NoFrame</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Plain</enum>
|
|
||||||
</property>
|
|
||||||
<property name="widgetResizable">
|
<property name="widgetResizable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@@ -41,7 +38,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>453</width>
|
<width>453</width>
|
||||||
<height>547</height>
|
<height>570</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
@@ -56,7 +53,7 @@
|
|||||||
<property name="title">
|
<property name="title">
|
||||||
<string>DevLog</string>
|
<string>DevLog</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWebView" name="viewer" native="true">
|
<widget class="QTextBrowser" name="viewer">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
@@ -65,11 +62,6 @@
|
|||||||
<height>511</height>
|
<height>511</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="url" stdset="0">
|
|
||||||
<url>
|
|
||||||
<string>about:blank</string>
|
|
||||||
</url>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -78,19 +70,12 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="standardButtons">
|
<property name="standardButtons">
|
||||||
<set>QDialogButtonBox::Ok</set>
|
<set>QDialogButtonBox::NoButton</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
|
||||||
<customwidget>
|
|
||||||
<class>QWebView</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header location="global">QtWebKitWidgets/QWebView</header>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
@@ -4,27 +4,29 @@ __email__ = "info@3liz.org"
|
|||||||
|
|
||||||
|
|
||||||
from qgis.core import QgsApplication
|
from qgis.core import QgsApplication
|
||||||
from qgis.PyQt.QtCore import QCoreApplication, Qt, QTranslator, QUrl
|
from qgis.PyQt.QtCore import QSettings, QUrl
|
||||||
from qgis.PyQt.QtGui import QDesktopServices, QIcon
|
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
|
from qgis.utils import iface
|
||||||
import qgis
|
import qgis
|
||||||
|
|
||||||
|
|
||||||
# include <QSettings>
|
# include <QSettings>
|
||||||
import socket
|
|
||||||
import os
|
import os
|
||||||
|
from .about_form import AboutDialog
|
||||||
from .tools.resources import (
|
from .tools.resources import (
|
||||||
plugin_path,
|
# plugin_path,
|
||||||
pyperclip,
|
pyperclip,
|
||||||
resources_path,
|
resources_path,
|
||||||
maj_verif,
|
maj_verif,
|
||||||
)
|
)
|
||||||
pyperclip()
|
pyperclip()
|
||||||
from .copie_editor import Copie_Editor
|
|
||||||
from .about_form import AboutDialog
|
|
||||||
|
|
||||||
from PyQt5.QtCore import *
|
try:
|
||||||
|
from .copie_editor import Copie_Editor
|
||||||
|
except NameError:
|
||||||
|
print('404')
|
||||||
|
|
||||||
|
|
||||||
class PgCopie:
|
class PgCopie:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@@ -69,12 +71,8 @@ class PgCopie:
|
|||||||
self.toolBar.addAction(self.copie_editor)
|
self.toolBar.addAction(self.copie_editor)
|
||||||
self.copie_editor.triggered.connect(self.open_editor)
|
self.copie_editor.triggered.connect(self.open_editor)
|
||||||
self.copie_editor.setEnabled(False)
|
self.copie_editor.setEnabled(False)
|
||||||
IPAddr=socket.gethostbyname(socket.gethostname())
|
# IPAddr = socket.gethostbyname(socket.gethostname())
|
||||||
if IPAddr[0:11] == "100.100.100":
|
if os.access('N:/', os.R_OK):
|
||||||
self.copie_editor.setEnabled(True)
|
|
||||||
elif IPAddr[0:9] == "192.168.0":
|
|
||||||
self.copie_editor.setEnabled(True)
|
|
||||||
elif IPAddr[0:9] == "192.168.1":
|
|
||||||
self.copie_editor.setEnabled(True)
|
self.copie_editor.setEnabled(True)
|
||||||
|
|
||||||
def open_about_dialog(self):
|
def open_about_dialog(self):
|
||||||
@@ -82,7 +80,8 @@ class PgCopie:
|
|||||||
About dialog
|
About dialog
|
||||||
"""
|
"""
|
||||||
dialog = AboutDialog(iface)
|
dialog = AboutDialog(iface)
|
||||||
dialog.exec_()
|
dialog.exec()
|
||||||
|
|
||||||
def open_help():
|
def open_help():
|
||||||
""" Open the online help. """
|
""" Open the online help. """
|
||||||
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
|
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
|
||||||
@@ -96,7 +95,6 @@ class PgCopie:
|
|||||||
if self.action_editor:
|
if self.action_editor:
|
||||||
iface.removePluginMenu('CenRa_Copie', self.copie_editor)
|
iface.removePluginMenu('CenRa_Copie', self.copie_editor)
|
||||||
|
|
||||||
|
|
||||||
if self.provider:
|
if self.provider:
|
||||||
QgsApplication.processingRegistry().removeProvider(self.provider)
|
QgsApplication.processingRegistry().removeProvider(self.provider)
|
||||||
del self.provider
|
del self.provider
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import os.path
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from qgis.PyQt import uic
|
from qgis.PyQt import uic
|
||||||
from qgis.PyQt.QtGui import QPixmap
|
# from qgis.PyQt.QtGui import QPixmap
|
||||||
from qgis.PyQt.QtWidgets import QDialog
|
from qgis.PyQt.QtWidgets import QDialog
|
||||||
|
|
||||||
from .tools.resources import devlog
|
from .tools.resources import devlog
|
||||||
|
|||||||
@@ -4,37 +4,37 @@ from __future__ import absolute_import
|
|||||||
# Import the PyQt and QGIS libraries
|
# Import the PyQt and QGIS libraries
|
||||||
from builtins import next
|
from builtins import next
|
||||||
from builtins import str
|
from builtins import str
|
||||||
from builtins import object
|
# from builtins import object
|
||||||
import qgis
|
# import qgis
|
||||||
from qgis.PyQt.QtCore import QSettings
|
from qgis.PyQt.QtCore import QSettings
|
||||||
from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog
|
from qgis.PyQt.QtWidgets import QDialog, QMessageBox
|
||||||
from qgis.PyQt.QtGui import QIcon
|
from qgis.PyQt import QtGui
|
||||||
from PyQt5.QtCore import *
|
from qgis.core import QgsDataSourceUri, QgsSettings, QgsWkbTypes, Qgis
|
||||||
from PyQt5.QtGui import *
|
|
||||||
from PyQt5 import QtGui
|
|
||||||
from qgis.core import *
|
|
||||||
from qgis.core import QgsDataSourceUri
|
|
||||||
|
|
||||||
|
try:
|
||||||
from .tools.PythonSQL import login_base
|
from .tools.PythonSQL import login_base
|
||||||
from .tools.SQLRequet import *
|
except ValueError:
|
||||||
|
print('Pas de fichier PythonSQL')
|
||||||
|
|
||||||
from .tools.resources import (
|
from .tools.resources import (
|
||||||
load_ui,
|
load_ui,
|
||||||
resources_path,
|
resources_path,
|
||||||
send_issues,
|
# send_issues,
|
||||||
)
|
)
|
||||||
from .issues import CenRa_Issues
|
# from .issues import CenRa_Issues
|
||||||
|
|
||||||
from qgis.utils import iface
|
from qgis.utils import iface
|
||||||
import os.path
|
# import os
|
||||||
import webbrowser, os
|
# import os.path
|
||||||
import psycopg2
|
# import webbrowser
|
||||||
import psycopg2.extras
|
# import psycopg2
|
||||||
import base64
|
# import psycopg2.extras
|
||||||
|
# import base64
|
||||||
|
|
||||||
EDITOR_CLASS = load_ui('CenRa_Copie_base.ui')
|
EDITOR_CLASS = load_ui('CenRa_Copie_base.ui')
|
||||||
|
|
||||||
class Copie_Editor(QDialog, EDITOR_CLASS):
|
|
||||||
|
|
||||||
|
class Copie_Editor(QDialog, EDITOR_CLASS):
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
_ = parent
|
_ = parent
|
||||||
super().__init__()
|
super().__init__()
|
||||||
@@ -48,7 +48,7 @@ class Copie_Editor(QDialog, EDITOR_CLASS):
|
|||||||
"""Run method that performs all the real work"""
|
"""Run method that performs all the real work"""
|
||||||
layer = self.iface.activeLayer()
|
layer = self.iface.activeLayer()
|
||||||
|
|
||||||
if layer == None :
|
if layer is None:
|
||||||
# self.iface.messageBar().pushMessage(u"Vous devez sélectionner une table !", level=QgsMessageBar.WARNING, duration=5)
|
# self.iface.messageBar().pushMessage(u"Vous devez sélectionner une table !", level=QgsMessageBar.WARNING, duration=5)
|
||||||
self.iface.messageBar().pushMessage("Ooops", u"Vous devez sélectionner une table !", level=Qgis.Warning, duration=5)
|
self.iface.messageBar().pushMessage("Ooops", u"Vous devez sélectionner une table !", level=Qgis.Warning, duration=5)
|
||||||
|
|
||||||
@@ -62,11 +62,9 @@ class Copie_Editor(QDialog, EDITOR_CLASS):
|
|||||||
# tablename
|
# tablename
|
||||||
source_tablename = [s for s in list_sources if "table" in s][0].split('"')[3]
|
source_tablename = [s for s in list_sources if "table" in s][0].split('"')[3]
|
||||||
|
|
||||||
|
|
||||||
account = login_base("account")
|
account = login_base("account")
|
||||||
sigdb = account[5]
|
sigdb = account[5]
|
||||||
|
|
||||||
|
|
||||||
if source_db != sigdb:
|
if source_db != sigdb:
|
||||||
# self.iface.messageBar().pushMessage(u"Un référentiel ne peut être copié, utilisez les filtres !", level=QgsMessageBar.CRITICAL, duration=10)
|
# self.iface.messageBar().pushMessage(u"Un référentiel ne peut être copié, utilisez les filtres !", level=QgsMessageBar.CRITICAL, duration=10)
|
||||||
self.iface.messageBar().pushMessage("Ooops", u"Vous ne pouvez copier des couches que dans sigXX", level=Qgis.Critical, duration=5)
|
self.iface.messageBar().pushMessage("Ooops", u"Vous ne pouvez copier des couches que dans sigXX", level=Qgis.Critical, duration=5)
|
||||||
@@ -103,19 +101,18 @@ class Copie_Editor(QDialog, EDITOR_CLASS):
|
|||||||
|
|
||||||
self.schema.clear()
|
self.schema.clear()
|
||||||
self.schema.addItems(listItems)
|
self.schema.addItems(listItems)
|
||||||
self.schema.setCurrentIndex(-1) # Pour ne pas commencer la liste au premier schema
|
# Pour ne pas commencer la liste au premier schema
|
||||||
|
self.schema.setCurrentIndex(-1)
|
||||||
|
|
||||||
|
# Affiche le nom de la table source
|
||||||
self.table_source.setText(source_schema + "." + source_tablename) # Affiche le nom de la table source
|
self.table_source.setText(source_schema + "." + source_tablename)
|
||||||
# show the dialog
|
# show the dialog
|
||||||
self.show()
|
self.show()
|
||||||
# Run the dialog event loop
|
# Run the dialog event loop
|
||||||
result = self.exec_()
|
result = self.exec()
|
||||||
# See if OK was pressed
|
# See if OK was pressed
|
||||||
if result:
|
if result:
|
||||||
# ******************************debut script*********************************
|
# ******************************debut script*********************************
|
||||||
|
|
||||||
|
|
||||||
account = login_base("account")
|
account = login_base("account")
|
||||||
user = account[0]
|
user = account[0]
|
||||||
mdp = account[1]
|
mdp = account[1]
|
||||||
@@ -159,7 +156,6 @@ class Copie_Editor(QDialog, EDITOR_CLASS):
|
|||||||
else:
|
else:
|
||||||
SQL_table = "CREATE TABLE " + schema + "." + tablename + " AS SELECT * FROM " + source_schema + "." + source_tablename
|
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_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_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);"
|
SQL_sequence_02 = "ALTER TABLE " + schema + "." + tablename + " ALTER COLUMN gid SET DEFAULT nextval(\'" + schema + "." + tablename + "_gid_seq\'::regclass);"
|
||||||
@@ -179,6 +175,13 @@ class Copie_Editor(QDialog, EDITOR_CLASS):
|
|||||||
cur.execute(SQL_sequence_03)
|
cur.execute(SQL_sequence_03)
|
||||||
cur.execute(SQL_sequence_04)
|
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:
|
if layer.wkbType() == QgsWkbTypes.PointGeometry:
|
||||||
cur.execute(SQL_trigger_coordonnees)
|
cur.execute(SQL_trigger_coordonnees)
|
||||||
|
|
||||||
@@ -192,12 +195,12 @@ class Copie_Editor(QDialog, EDITOR_CLASS):
|
|||||||
|
|
||||||
con.commit()
|
con.commit()
|
||||||
|
|
||||||
### Affichage de la table
|
# Affichage de la table
|
||||||
uri = QgsDataSourceUri()
|
uri = QgsDataSourceUri()
|
||||||
# set host name, port, database name, username and password
|
# set host name, port, database name, username and password
|
||||||
uri.setConnection(host, port, dbname, user, mdp)
|
uri.setConnection(host, port, dbname, user, mdp)
|
||||||
# set database schema, table name, geometry column and optionaly subset (WHERE clause)
|
# set database schema, table name, geometry column and optionaly subset (WHERE clause)
|
||||||
uri.setDataSource(schema, tablename, geom)
|
uri.setDataSource(schema, tablename, "geom")
|
||||||
|
|
||||||
layer = self.iface.addVectorLayer(uri.uri(), tablename_qgis, "postgres")
|
layer = self.iface.addVectorLayer(uri.uri(), tablename_qgis, "postgres")
|
||||||
|
|
||||||
@@ -205,5 +208,5 @@ class Copie_Editor(QDialog, EDITOR_CLASS):
|
|||||||
con.close()
|
con.close()
|
||||||
|
|
||||||
# self.iface.messageBar().pushMessage("Table \"" + source_schema + "." + source_tablename + u"\" copiée dans \"" + schema + "." + tablename + "\"." , level=QgsMessageBar.INFO, duration=10)
|
# self.iface.messageBar().pushMessage("Table \"" + source_schema + "." + source_tablename + u"\" copiée dans \"" + schema + "." + tablename + "\"." , level=QgsMessageBar.INFO, duration=10)
|
||||||
self.iface.messageBar().pushMessage("Bravo!", "Table \"" + source_schema + "." + source_tablename + u"\" copiée dans \"" + schema + "." + tablename + "\".", level=Qgis.Success, duration=5)
|
self.iface.messageBar().pushMessage("Bravo!", "Table \"" + source_schema + "." + source_tablename + u"\" copiée dans \"" + schema + "." + tablename + "\".", level=Qgis.Info, duration=5)
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -9,8 +9,10 @@
|
|||||||
[general]
|
[general]
|
||||||
name=CenRA_COPIE
|
name=CenRA_COPIE
|
||||||
qgisMinimumVersion=3.0
|
qgisMinimumVersion=3.0
|
||||||
|
qgisMaximumVersion=4.99
|
||||||
|
supportsQt6=True
|
||||||
description=Permet la copie d'une table dans une base PostGis
|
description=Permet la copie d'une table dans une base PostGis
|
||||||
version=2.2
|
version=3.2
|
||||||
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
|
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
|
||||||
email=si_besoin@cen-rhonealpes.fr
|
email=si_besoin@cen-rhonealpes.fr
|
||||||
|
|
||||||
@@ -19,7 +21,7 @@ email=si_besoin@cen-rhonealpes.fr
|
|||||||
# Recommended items:
|
# Recommended items:
|
||||||
|
|
||||||
# Uncomment the following line and add your changelog:
|
# 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>12/03/2026 - Version 3.2: </h3> - qgisMaximumVersion est 4.0.</p></br><p><h3>30/07/2025 - Version 3.1: </h3> - Correctife de bug.</p></br><p><h3>19/05/2025 - Version 3.0: </h3> - Compatible PyQt5 et PyQt6</p></br><p><h3>11/04/2025 - Version 2.5: </h3> - Correctif de bug.</p></br><p><h3>09/04/2025 - Version 2.4: </h3> - Correctif bug en TT.</p></br><p><h3>09/04/2025 - Version 2.3: </h3> - Optimisation pour le TT.</p></br><p><h3>03/04/2025 - Version 2.2: </h3> - Mise a jour de securite.</p></br><p><h3>07/01/2025 - Version 2.1: </h3> - ByPass du certif ssl ci erreur.</br></p><p><h3>22/10/2024 - Version 2:</h3>- Refonte du code.</p></br><p><h3>13/09/2024 - Version 1.5:</h3>- Ajoute d'un changelog et vérification de mise à jour.</p>
|
||||||
|
|
||||||
# Tags are comma separated with spaces allowed
|
# Tags are comma separated with spaces allowed
|
||||||
tags=cenra, database, table
|
tags=cenra, database, table
|
||||||
|
|||||||
@@ -1,141 +0,0 @@
|
|||||||
|
|
||||||
geom = "geom"
|
|
||||||
champ_travaux_prevus_multipolygon="""(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, surface_m2 double precision, surface_ha double precision, date_creation date, date_maj date, geom geometry(MultiPolygon,2154))"""
|
|
||||||
champ_travaux_prevus_multilinestring="""(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, longueur_m double precision, longueur_km double precision, date_creation date, date_maj date, geom geometry(MultiLineString,2154))"""
|
|
||||||
champ_travaux_prevus_point = """(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, x_wgs84 double precision, y_wgs84 double precision, date_creation date, date_maj date, geom geometry(Point,2154))"""
|
|
||||||
|
|
||||||
champ_viergePolygone = """(gid serial NOT NULL, commentaire text, surface_m2 double precision, surface_ha double precision, geom geometry(MultiPolygon,2154))"""
|
|
||||||
champ_viergeLigne = """(gid serial NOT NULL, commentaire text, longueur_m double precision, longueur_km double precision, geom geometry(MultiLineString,2154))"""
|
|
||||||
champ_viergePoint = """(gid serial NOT NULL, commentaire text, x_wgs84 double precision, y_wgs84 double precision, geom geometry(Point,2154))"""
|
|
||||||
|
|
||||||
champ_habitat = """(gid serial NOT NULL, cd_cb_01 text, lb_cb97_fr_01 text, occupation_01 integer, cd_cb_02 text, lb_cb97_fr_02 text, occupation_02 integer, cd_cb_03 text, lb_cb97_fr_03 text, occupation_03 integer, milieu_code text, milieu_libelle text, surface_m2 double precision, surface_ha double precision, commentaire text, date_creation date, date_maj date, geom geometry(MultiPolygon,2154))"""
|
|
||||||
|
|
||||||
champ_contour="""(gid serial NOT NULL, date_creation date, date_maj date, utilisateur character varying, dept character(2), nom character varying, surface_m2 double precision, surface_ha double precision, type_site character varying, type_milieu character varying, date_premier_pg integer, date_debut_pg integer, date_fin_pg integer, referent character varying, gestion_deleguee character varying, terrain_militaire character(3), ens character(3), zh character(3), adapt_pmr character(3), inform character(3), guide character(3), ouverture_public character(3), obs character(3), anim character(3), n2000_anim character(3), contrat_n2000_conseil character(3), n2000_op character(3), contrat_n2000_benef character(3), contrat_agri character(3), bc_habitat integer, bc_amphibien integer, bc_coleoptere integer, bc_crustace integer, bc_mammifere integer, bc_chiroptere integer, bc_mollusque integer, bc_odonate integer, bc_oiseau integer, bc_orthoptere integer, bc_poisson integer, bc_reptile integer, bc_rhopalocere integer, bc_heterocere integer, bc_autre_invertebre integer, bc_flore integer, bc_bryophyte integer, bc_champignon integer, suiv_analyse_sol character(3), suiv_piezo character(3), suiv_climat character(3), suiv_topo character(3), suiv_habitat character(3), suiv_amphibien character(3), suiv_coleoptere character(3), suiv_crustace character(3), suiv_mammifere character(3), suiv_chiroptere character(3), suiv_mollusque character(3), suiv_odonate character(3), suiv_oiseau character(3), suiv_orthoptere character(3), suiv_poisson character(3), suiv_reptile character(3), suiv_rhopalocere character(3), suiv_heterocere character(3), suiv_autre_invertebre character(3), suiv_flore character(3), suiv_bryophyte character(3), suiv_champignon character(3), suiv_analyse_eau character(3), suiv_phenologie character(3), suiv_frequentation character(3), suiv_paysager character(3), suiv_autre character(3), commentaire text, geom geometry(MultiPolygon,2154))
|
|
||||||
"""
|
|
||||||
|
|
||||||
champ_vegethab_point = """(
|
|
||||||
gid serial NOT NULL ,
|
|
||||||
cd_eu_01 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lb_eu_01 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
occupati_1 bigint,
|
|
||||||
cd_eu_02 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lb_eu_02 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
occupati_2 bigint,
|
|
||||||
cd_eu_03 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lb_eu_03 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
occupati_3 bigint,
|
|
||||||
milieu_cod character varying(254) COLLATE pg_catalog."default",
|
|
||||||
milieu_lib character varying(254) COLLATE pg_catalog."default",
|
|
||||||
surface_m2 numeric,
|
|
||||||
surface_ha numeric,
|
|
||||||
commentair character varying(254) COLLATE pg_catalog."default",
|
|
||||||
date_creat date,
|
|
||||||
date_maj date,
|
|
||||||
num_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
type_unite character varying(254) COLLATE pg_catalog."default",
|
|
||||||
dynamique character varying(254) COLLATE pg_catalog."default",
|
|
||||||
gestio_obs character varying(254) COLLATE pg_catalog."default",
|
|
||||||
degrad_obs character varying(254) COLLATE pg_catalog."default",
|
|
||||||
eta_conser character varying(254) COLLATE pg_catalog."default",
|
|
||||||
clas_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
alli_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
syntaxon character varying(254) COLLATE pg_catalog."default",
|
|
||||||
n2000 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lrr_aura character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lrr_cbna character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lrr_cbnmc character varying(254) COLLATE pg_catalog."default",
|
|
||||||
vege_enjeu character varying(254) COLLATE pg_catalog."default",
|
|
||||||
num_photo character varying(254) COLLATE pg_catalog."default",
|
|
||||||
nature_obs character varying(254) COLLATE pg_catalog."default",
|
|
||||||
date_sais date,
|
|
||||||
s_al_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
alli_name character varying(254) COLLATE pg_catalog."default",
|
|
||||||
salli_name character varying(254) COLLATE pg_catalog."default",
|
|
||||||
class_name character varying(254) COLLATE pg_catalog."default",
|
|
||||||
geom geometry(Point,2154)
|
|
||||||
)
|
|
||||||
"""
|
|
||||||
champ_vegethab_multilinestring = """(
|
|
||||||
gid serial NOT NULL ,
|
|
||||||
cd_eu_01 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lb_eu_01 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
occupati_1 bigint,
|
|
||||||
cd_eu_02 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lb_eu_02 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
occupati_2 bigint,
|
|
||||||
cd_eu_03 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lb_eu_03 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
occupati_3 bigint,
|
|
||||||
milieu_cod character varying(254) COLLATE pg_catalog."default",
|
|
||||||
milieu_lib character varying(254) COLLATE pg_catalog."default",
|
|
||||||
surface_m2 numeric,
|
|
||||||
surface_ha numeric,
|
|
||||||
commentair character varying(254) COLLATE pg_catalog."default",
|
|
||||||
date_creat date,
|
|
||||||
date_maj date,
|
|
||||||
num_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
type_unite character varying(254) COLLATE pg_catalog."default",
|
|
||||||
dynamique character varying(254) COLLATE pg_catalog."default",
|
|
||||||
gestio_obs character varying(254) COLLATE pg_catalog."default",
|
|
||||||
degrad_obs character varying(254) COLLATE pg_catalog."default",
|
|
||||||
eta_conser character varying(254) COLLATE pg_catalog."default",
|
|
||||||
clas_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
alli_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
syntaxon character varying(254) COLLATE pg_catalog."default",
|
|
||||||
n2000 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lrr_aura character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lrr_cbna character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lrr_cbnmc character varying(254) COLLATE pg_catalog."default",
|
|
||||||
vege_enjeu character varying(254) COLLATE pg_catalog."default",
|
|
||||||
num_photo character varying(254) COLLATE pg_catalog."default",
|
|
||||||
nature_obs character varying(254) COLLATE pg_catalog."default",
|
|
||||||
date_sais date,
|
|
||||||
s_al_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
alli_name character varying(254) COLLATE pg_catalog."default",
|
|
||||||
salli_name character varying(254) COLLATE pg_catalog."default",
|
|
||||||
class_name character varying(254) COLLATE pg_catalog."default",
|
|
||||||
geom geometry(MultiLineString,2154)
|
|
||||||
)
|
|
||||||
"""
|
|
||||||
champ_vegethab_multipolygon = """(
|
|
||||||
gid serial NOT NULL ,
|
|
||||||
cd_eu_01 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lb_eu_01 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
occupati_1 bigint,
|
|
||||||
cd_eu_02 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lb_eu_02 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
occupati_2 bigint,
|
|
||||||
cd_eu_03 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lb_eu_03 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
occupati_3 bigint,
|
|
||||||
milieu_cod character varying(254) COLLATE pg_catalog."default",
|
|
||||||
milieu_lib character varying(254) COLLATE pg_catalog."default",
|
|
||||||
surface_m2 numeric,
|
|
||||||
surface_ha numeric,
|
|
||||||
commentair character varying(254) COLLATE pg_catalog."default",
|
|
||||||
date_creat date,
|
|
||||||
date_maj date,
|
|
||||||
num_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
type_unite character varying(254) COLLATE pg_catalog."default",
|
|
||||||
dynamique character varying(254) COLLATE pg_catalog."default",
|
|
||||||
gestio_obs character varying(254) COLLATE pg_catalog."default",
|
|
||||||
degrad_obs character varying(254) COLLATE pg_catalog."default",
|
|
||||||
eta_conser character varying(254) COLLATE pg_catalog."default",
|
|
||||||
clas_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
alli_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
syntaxon character varying(254) COLLATE pg_catalog."default",
|
|
||||||
n2000 character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lrr_aura character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lrr_cbna character varying(254) COLLATE pg_catalog."default",
|
|
||||||
lrr_cbnmc character varying(254) COLLATE pg_catalog."default",
|
|
||||||
vege_enjeu character varying(254) COLLATE pg_catalog."default",
|
|
||||||
num_photo character varying(254) COLLATE pg_catalog."default",
|
|
||||||
nature_obs character varying(254) COLLATE pg_catalog."default",
|
|
||||||
date_sais date,
|
|
||||||
s_al_phyto character varying(254) COLLATE pg_catalog."default",
|
|
||||||
alli_name character varying(254) COLLATE pg_catalog."default",
|
|
||||||
salli_name character varying(254) COLLATE pg_catalog."default",
|
|
||||||
class_name character varying(254) COLLATE pg_catalog."default",
|
|
||||||
geom geometry(MultiPolygon,2154)
|
|
||||||
)
|
|
||||||
"""
|
|
||||||
@@ -3,10 +3,10 @@
|
|||||||
import configparser
|
import configparser
|
||||||
import shutil
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
import base64
|
# import base64
|
||||||
import psycopg2
|
# import psycopg2
|
||||||
import psycopg2.extras
|
# import psycopg2.extras
|
||||||
import socket
|
import os
|
||||||
from os.path import abspath, join, pardir, dirname
|
from os.path import abspath, join, pardir, dirname
|
||||||
|
|
||||||
from qgis.PyQt import uic
|
from qgis.PyQt import uic
|
||||||
@@ -90,7 +90,7 @@ def resources_path(*args):
|
|||||||
:return: Absolute path to the resources folder.
|
:return: Absolute path to the resources folder.
|
||||||
:rtype: str
|
:rtype: str
|
||||||
"""
|
"""
|
||||||
path = abspath(abspath(join(plugin_path(), "CenRa_Copie\\tools")))
|
path = abspath(abspath(join(plugin_path(), "CenRa_COPIE\\tools")))
|
||||||
for item in args:
|
for item in args:
|
||||||
path = abspath(join(path, item))
|
path = abspath(join(path, item))
|
||||||
return path
|
return path
|
||||||
@@ -108,60 +108,60 @@ def load_ui(*args):
|
|||||||
|
|
||||||
return ui_class
|
return ui_class
|
||||||
|
|
||||||
|
|
||||||
def pyperclip():
|
def pyperclip():
|
||||||
IPAddr=socket.gethostbyname(socket.gethostname())
|
dst = dirname(dirname(__file__)) + "\\tools\\"
|
||||||
dst = abspath(abspath(join(plugin_path(), "CenRa_Copie\\tools\\")))
|
if os.access('N:/', os.R_OK):
|
||||||
if IPAddr[0:11] == "100.100.100": #4269
|
src = 'N:/SI_Systeme d information/Z_QGIS/PLUGIN/PythonSQL.py'
|
||||||
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
|
|
||||||
if IPAddr[0:9] == "192.168.0": #01
|
|
||||||
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
|
|
||||||
if IPAddr[0:9] == "192.168.1": #0726
|
|
||||||
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
|
|
||||||
try:
|
try:
|
||||||
shutil.copy(src, dst)
|
shutil.copy(src, dst)
|
||||||
except:
|
except FileNotFoundError:
|
||||||
print('404')
|
print('404')
|
||||||
|
except UnboundLocalError:
|
||||||
|
print('404')
|
||||||
|
|
||||||
|
|
||||||
def send_issues(url, titre, body, labels):
|
def send_issues(url, titre, body, labels):
|
||||||
import requests
|
import requests
|
||||||
|
import urllib.request
|
||||||
import json
|
import json
|
||||||
import os
|
# import os
|
||||||
import qgis
|
# import qgis
|
||||||
|
|
||||||
usr = os.environ['USERNAME']
|
# usr = os.environ['USERNAME']
|
||||||
token = '9d0a4e0bea561710e0728f161f7edf4e5201e112'
|
token = '9d0a4e0bea561710e0728f161f7edf4e5201e112'
|
||||||
url = url + '?token=' + token
|
url = url + '?token=' + token
|
||||||
|
|
||||||
headers = {'Authorization': 'token ' + token, 'accept': 'application/json', 'Content-Type': 'application/json'}
|
headers = {'Authorization': 'token ' + token, 'accept': 'application/json', 'Content-Type': 'application/json'}
|
||||||
|
|
||||||
|
|
||||||
payload = {'title': titre, 'body': body, 'labels': labels}
|
payload = {'title': titre, 'body': body, 'labels': labels}
|
||||||
try:
|
try:
|
||||||
urllib.request.urlopen('https://google.com')
|
urllib.request.urlopen('https://google.com')
|
||||||
binar = True
|
binar = True
|
||||||
except:
|
except ValueError:
|
||||||
binar = False
|
binar = False
|
||||||
r = ''
|
r = ''
|
||||||
if binar:
|
if binar:
|
||||||
r = requests.post(url, data=json.dumps(payload), headers=headers)
|
r = requests.post(url, data=json.dumps(payload), headers=headers)
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
|
||||||
def maj_verif(NAME):
|
def maj_verif(NAME):
|
||||||
import qgis
|
import qgis
|
||||||
import urllib.request
|
import urllib.request
|
||||||
iface = qgis.utils.iface
|
iface = qgis.utils.iface
|
||||||
from qgis.core import Qgis
|
from qgis.core import Qgis
|
||||||
|
|
||||||
url = qgis.utils.pluginMetadata(NAME,'repository')
|
# url = qgis.utils.pluginMetadata(NAME, 'repository')
|
||||||
# URL = url+'/raw/branch/main/plugins.xml'
|
# URL = url+'/raw/branch/main/plugins.xml'
|
||||||
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/releases/plugins.xml'
|
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/plugins.xml'
|
||||||
# print(URL)
|
# print(URL)
|
||||||
version = qgis.utils.pluginMetadata(NAME, 'version')
|
version = qgis.utils.pluginMetadata(NAME, 'version')
|
||||||
len_version = len(version)
|
len_version = len(version)
|
||||||
try:
|
try:
|
||||||
urllib.request.urlopen('https://google.com')
|
urllib.request.urlopen('https://google.com')
|
||||||
binar = True
|
binar = True
|
||||||
except:
|
except urllib.error.URLError:
|
||||||
binar = False
|
binar = False
|
||||||
if binar:
|
if binar:
|
||||||
try:
|
try:
|
||||||
@@ -171,11 +171,12 @@ def maj_verif(NAME):
|
|||||||
version_plugin = version_web[valeur_version_web:valeur_version_web + len_version]
|
version_plugin = version_web[valeur_version_web:valeur_version_web + len_version]
|
||||||
if version_plugin != version:
|
if version_plugin != version:
|
||||||
iface.messageBar().pushMessage("MAJ :", "Des mise à jour de plugin sont disponibles.", level=Qgis.Info, duration=30)
|
iface.messageBar().pushMessage("MAJ :", "Des mise à jour de plugin sont disponibles.", level=Qgis.Info, duration=30)
|
||||||
except:
|
except urllib.error.URLError:
|
||||||
print("error gitea version ssl")
|
print("error gitea version ssl")
|
||||||
else:
|
else:
|
||||||
iface.messageBar().pushMessage("WiFi :", "Pas de connection à internet.", level=Qgis.Warning, duration=30)
|
iface.messageBar().pushMessage("WiFi :", "Pas de connection à internet.", level=Qgis.Warning, duration=30)
|
||||||
|
|
||||||
|
|
||||||
def devlog(NAME):
|
def devlog(NAME):
|
||||||
import qgis
|
import qgis
|
||||||
devmaj = '<head><style>* {margin:0; padding:0; }</style></head>'
|
devmaj = '<head><style>* {margin:0; padding:0; }</style></head>'
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>CenRa_Metabase_editorwidget_base</class>
|
<class>CenRa_Metabase_editorwidget_base</class>
|
||||||
<widget class="QDialog" name="CenRa_Metabase_editorwidget_base">
|
<widget class="QDialog" name="CenRa_about_base">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
@@ -13,10 +13,6 @@
|
|||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Journal des modifications</string>
|
<string>Journal des modifications</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
|
||||||
<iconset>
|
|
||||||
<normaloff>../../CenRa_Metabase/tools/ui/icon.svg</normaloff>../../CenRa_Metabase/tools/ui/icon.svg</iconset>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QScrollArea" name="scrollArea">
|
<widget class="QScrollArea" name="scrollArea">
|
||||||
@@ -29,9 +25,6 @@
|
|||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::NoFrame</enum>
|
<enum>QFrame::NoFrame</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Plain</enum>
|
|
||||||
</property>
|
|
||||||
<property name="widgetResizable">
|
<property name="widgetResizable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@@ -56,7 +49,7 @@
|
|||||||
<property name="title">
|
<property name="title">
|
||||||
<string>DevLog</string>
|
<string>DevLog</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWebView" name="viewer" native="true">
|
<widget class="QTextBrowser" name="viewer">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
@@ -65,11 +58,6 @@
|
|||||||
<height>511</height>
|
<height>511</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="url" stdset="0">
|
|
||||||
<url>
|
|
||||||
<string>about:blank</string>
|
|
||||||
</url>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -78,19 +66,12 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="standardButtons">
|
<property name="standardButtons">
|
||||||
<set>QDialogButtonBox::Ok</set>
|
<set>QDialogButtonBox::Close|QDialogButtonBox::Ok</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
|
||||||
<customwidget>
|
|
||||||
<class>QWebView</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header location="global">QtWebKitWidgets/QWebView</header>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
@@ -4,27 +4,27 @@ __email__ = "info@3liz.org"
|
|||||||
|
|
||||||
|
|
||||||
from qgis.core import QgsApplication
|
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.QtGui import QDesktopServices, QIcon
|
||||||
from qgis.PyQt.QtWidgets import QAction, QMessageBox
|
from qgis.PyQt.QtWidgets import QAction
|
||||||
from qgis.utils import iface
|
from qgis.utils import iface
|
||||||
import qgis
|
import qgis
|
||||||
|
|
||||||
|
|
||||||
# include <QSettings>
|
# include <QSettings>
|
||||||
import socket
|
from .about_form import AboutDialog
|
||||||
import os
|
import os
|
||||||
from .tools.resources import (
|
from .tools.resources import (
|
||||||
plugin_path,
|
|
||||||
pyperclip,
|
pyperclip,
|
||||||
resources_path,
|
resources_path,
|
||||||
maj_verif,
|
maj_verif,
|
||||||
)
|
)
|
||||||
pyperclip()
|
pyperclip()
|
||||||
from .flux_editor import Flux_Editor
|
|
||||||
from .about_form import AboutDialog
|
|
||||||
|
|
||||||
from PyQt5.QtCore import *
|
try:
|
||||||
|
from .flux_editor import Flux_Editor
|
||||||
|
except NameError:
|
||||||
|
print('404')
|
||||||
|
|
||||||
|
|
||||||
class PgFlux:
|
class PgFlux:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@@ -64,18 +64,11 @@ class PgFlux:
|
|||||||
self.help_action.triggered.connect(self.open_help)
|
self.help_action.triggered.connect(self.open_help)
|
||||||
if not self.action_editor:
|
if not self.action_editor:
|
||||||
self.action_editor = Flux_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.toolBar.addAction(self.flux_editor)
|
||||||
self.flux_editor.triggered.connect(self.open_editor)
|
self.flux_editor.triggered.connect(self.open_editor)
|
||||||
self.flux_editor.setEnabled(False)
|
self.flux_editor.setEnabled(False)
|
||||||
IPAddr=socket.gethostbyname(socket.gethostname())
|
if os.access('N:/', os.R_OK):
|
||||||
if IPAddr[0:11] == "100.100.100":
|
|
||||||
self.flux_editor.setEnabled(True)
|
|
||||||
elif IPAddr[0:9] == "192.168.0":
|
|
||||||
self.flux_editor.setEnabled(True)
|
|
||||||
elif IPAddr[0:9] == "192.168.1":
|
|
||||||
self.flux_editor.setEnabled(True)
|
self.flux_editor.setEnabled(True)
|
||||||
|
|
||||||
def open_about_dialog(self):
|
def open_about_dialog(self):
|
||||||
@@ -83,7 +76,8 @@ class PgFlux:
|
|||||||
About dialog
|
About dialog
|
||||||
"""
|
"""
|
||||||
dialog = AboutDialog(iface)
|
dialog = AboutDialog(iface)
|
||||||
dialog.exec_()
|
dialog.exec()
|
||||||
|
|
||||||
def open_help():
|
def open_help():
|
||||||
""" Open the online help. """
|
""" Open the online help. """
|
||||||
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
|
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
|
||||||
@@ -97,7 +91,6 @@ class PgFlux:
|
|||||||
if self.action_editor:
|
if self.action_editor:
|
||||||
iface.removePluginMenu('CenRa_Flux', self.flux_editor)
|
iface.removePluginMenu('CenRa_Flux', self.flux_editor)
|
||||||
|
|
||||||
|
|
||||||
if self.provider:
|
if self.provider:
|
||||||
QgsApplication.processingRegistry().removeProvider(self.provider)
|
QgsApplication.processingRegistry().removeProvider(self.provider)
|
||||||
del self.provider
|
del self.provider
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import os.path
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from qgis.PyQt import uic
|
from qgis.PyQt import uic
|
||||||
from qgis.PyQt.QtGui import QPixmap
|
# from qgis.PyQt.QtGui import QPixmap
|
||||||
from qgis.PyQt.QtWidgets import QDialog
|
from qgis.PyQt.QtWidgets import QDialog
|
||||||
|
|
||||||
from .tools.resources import devlog
|
from .tools.resources import devlog
|
||||||
|
|||||||
@@ -1,47 +1,24 @@
|
|||||||
import os
|
import os
|
||||||
plugin_dir = os.path.dirname(__file__)
|
# from qgis.gui import *
|
||||||
end_find = plugin_dir.rfind('\\')+1
|
|
||||||
|
|
||||||
NAME = plugin_dir[end_find:]
|
from qgis.core import QgsSettings
|
||||||
|
from qgis.PyQt.QtWidgets import QDialog
|
||||||
from qgis.gui import *
|
|
||||||
|
|
||||||
from qgis.core import (
|
|
||||||
NULL,
|
|
||||||
QgsApplication,
|
|
||||||
QgsDataSourceUri,
|
|
||||||
QgsProject,
|
|
||||||
QgsProviderConnectionException,
|
|
||||||
QgsProviderRegistry,
|
|
||||||
QgsRasterLayer,
|
|
||||||
QgsSettings,
|
|
||||||
QgsVectorLayer,
|
|
||||||
QgsGeometry,
|
|
||||||
)
|
|
||||||
from qgis.PyQt.QtWidgets import (
|
|
||||||
QDialog,
|
|
||||||
QAction,
|
|
||||||
QDockWidget,
|
|
||||||
QFileDialog,
|
|
||||||
QInputDialog,
|
|
||||||
QMenu,
|
|
||||||
QToolButton,
|
|
||||||
QTableWidget,
|
|
||||||
QTableWidgetItem,
|
|
||||||
)
|
|
||||||
from qgis.utils import iface
|
from qgis.utils import iface
|
||||||
|
|
||||||
|
|
||||||
from .tools.resources import (
|
from .tools.resources import (
|
||||||
load_ui,
|
load_ui,
|
||||||
resources_path,
|
|
||||||
send_issues,
|
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')
|
EDITOR_CLASS = load_ui('CenRa_IssuesSend.ui')
|
||||||
|
|
||||||
class CenRa_Issues(QDialog, EDITOR_CLASS):
|
|
||||||
|
|
||||||
|
class CenRa_Issues(QDialog, EDITOR_CLASS):
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
_ = parent
|
_ = parent
|
||||||
super().__init__()
|
super().__init__()
|
||||||
@@ -62,11 +39,16 @@ class CenRa_Issues(QDialog, EDITOR_CLASS):
|
|||||||
statu_autre = self.check_autre.isChecked()
|
statu_autre = self.check_autre.isChecked()
|
||||||
|
|
||||||
statu = []
|
statu = []
|
||||||
if statu_bug == True : statu = statu + [1]
|
if statu_bug is True:
|
||||||
if statu_aide == True : statu = statu + [3]
|
statu = statu + [1]
|
||||||
if statu_question == True : statu = statu + [5]
|
if statu_aide is True:
|
||||||
if statu_amelioration == True : statu = statu + [2]
|
statu = statu + [3]
|
||||||
if statu_autre == True : statu = statu + [6]
|
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:
|
if len(statu) >= 1:
|
||||||
import qgis
|
import qgis
|
||||||
@@ -78,11 +60,11 @@ class CenRa_Issues(QDialog, EDITOR_CLASS):
|
|||||||
else:
|
else:
|
||||||
code = 423
|
code = 423
|
||||||
if code == 201:
|
if code == 201:
|
||||||
iface.messageBar().pushMessage("Envoyer :", "Votre messages à bien été envoyer.", level=Qgis.Success, duration=20)
|
iface.messageBar().pushMessage("Envoyer :", "Votre messages à bien été envoyer.", level=0, duration=20)
|
||||||
self.close()
|
self.close()
|
||||||
elif code == 422:
|
elif code == 422:
|
||||||
iface.messageBar().pushMessage("Erreur :", "Erreur dans le contenu du messages.", level=Qgis.Critical, duration=20)
|
iface.messageBar().pushMessage("Erreur :", "Erreur dans le contenu du messages.", level=2, duration=20)
|
||||||
elif code == 423:
|
elif code == 423:
|
||||||
iface.messageBar().pushMessage("Erreur :", "Pas de sujet sélectionné.", level=Qgis.Critical, duration=20)
|
iface.messageBar().pushMessage("Erreur :", "Pas de sujet sélectionné.", level=2, duration=20)
|
||||||
elif code == 404:
|
elif code == 404:
|
||||||
iface.messageBar().pushMessage("Missing :", "Le serveur de messagerie est injoignable.", level=Qgis.Warning, duration=20)
|
iface.messageBar().pushMessage("Missing :", "Le serveur de messagerie est injoignable.", level=1, duration=20)
|
||||||
|
|||||||
@@ -5,8 +5,10 @@
|
|||||||
[general]
|
[general]
|
||||||
name=CenRa_FLUX
|
name=CenRa_FLUX
|
||||||
qgisMinimumVersion=3.0
|
qgisMinimumVersion=3.0
|
||||||
|
qgisMaximumVersion=4.99
|
||||||
|
supportsQt6=True
|
||||||
description=Permet d'ouvrire une table dans la base PostGis
|
description=Permet d'ouvrire une table dans la base PostGis
|
||||||
version=2.6
|
version=3.23
|
||||||
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
|
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
|
||||||
email=si_besoin@cen-rhonealpes.fr
|
email=si_besoin@cen-rhonealpes.fr
|
||||||
|
|
||||||
@@ -18,7 +20,6 @@ email=si_besoin@cen-rhonealpes.fr
|
|||||||
|
|
||||||
hasProcessingProvider=no
|
hasProcessingProvider=no
|
||||||
# Uncomment the following line and add your changelog:
|
# 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 are comma separated with spaces allowed
|
||||||
tags=cenra, postgis, database
|
tags=cenra, postgis, database
|
||||||
@@ -32,7 +33,7 @@ icon=icon.png
|
|||||||
# experimental flag
|
# experimental flag
|
||||||
experimental=False
|
experimental=False
|
||||||
|
|
||||||
changelog=<h2>CenRa_FLUX:</h2></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>21/05/2026 - Version 3.23: </h3> - Optimisation des performances hors connexion.</p></br><p><h3>23/03/2026 - Version 3.22: </h3> - Pache mineur.</p></br><p><h3>12/03/2026 - Version 3.21: </h3> - qgisMaximumVersion est 4.0.</p></br><p><h3>05/03/2026 - Version 3.20: </h3> - Visualisation des metadonnees avec un tooltip au survol de la couche.</p></br><p><h3>26/02/2026 - Version 3.19: </h3> - Visualisation des droits pour les vues materialisees.</p></br><p><h3>25/02/2026 - Version 3.18: </h3> - Filtre par secteur geographique compatible avec les favoris.</p></br><p><h3>12/02/2026 - Version 3.17: </h3> - Favorit dans la BD Ref.</p></br><p><h3>11/02/2026 - Version 3.16: </h3> - Creation de favori et visualisation.</p></br><p><h3>10/02/2026 - Version 3.15: </h3> - Sauvegarde la recherche.</p></br><p><h3>08/12/2025 - Version 3.14: </h3> - message d'erreur pour les drois de couche sur la DB.</p></br><p><h3>08/12/2025 - Version 3.13: </h3> - Detection des droit utilisateur.</p></br><p><h3>25/09/2025 - Version 3.12: </h3> - version +1.</p></br><p><h3>25/09/2025 - Version 3.11: </h3> - Correctife sur les code 00.</p></br><p><h3>24/09/2025 - Version 3.10: </h3> - Erreur sur l ouverture des couche raster. </p></br><p><h3>24/09/2025 - Version 3.9: </h3> - bugfix lier aux extention pgsql.</p></br><p><h3>09/09/2025 - Version 3.8: </h3> - Bug REF fix.</p></br><p><h3>05/09/2025 - Version 3.7: </h3> - Ouverture de projet QGIS contenue dans la base de donnees.</p></br><p><h3>30/07/2025 - Version 3.6: </h3> - Correctife de bug.</p></br><p><h3>29/07/2025 - Version 3.5: </h3> - Bug fix sur les donnee raster.</p></br><p><h3>23/07/2025 - Version 3.4: </h3> - Ouverture raster dans la base SIG.</p></br><p><h3>23/07/2025 - Version 3.3: </h3> - Optimisation des chargement.</p></br><p><h3>22/07/2025 - Version 3.2: </h3> - Visualisation des format raster et vecteur dans REF.</p></br><p><h3>21/07/2025 - Version 3.1: </h3> - Bug fix pour l'ouverture de plus de 5 couches.</p></br><p><h3>19/05/2025 - Version 3.0: </h3> - Compatible PyQt5 et PyQt6.</p></br><p><h3>09/04/2025 - Version 2.9: </h3> - Correctif bug en TT.</p></br><p><h3>09/04/2025 - Version 2.8: </h3> - Optimisation pour le TT.</p></br><p><h3>07/04/2025 - Version 2.7: </h3> - mode debug.</p></br><p><h3>03/04/2025 - Version 2.6: </h3> - Mise a jour de securite.</p></br><p><h3>20/03/2025 - Version 2.5: </h3> - Visualisation distincte des couches ne se trouvant pas dans l'antenne.</p></br><p><h3>13/02/2025 - Version 2.4: </h3> - Ajoute redimensionnement et déplacement mollette.</p></br><p><h3>05/02/2025 - Version 2.3: </h3> - Bouton de visualisation des couches se trouvent uniquement dans le canva de la carte.</p></br><p><h3>07/01/2025 - Version 2.2: </h3> - ByPass du certif ssl ci erreur.</p></br><p><h3>22/10/2024 - Version 2.1:</h3> - Correctif de bug.</br> - Evolution de la limit de 3 à 5. </br></p></br><p><h3>22/10/2024 - Version 2.0:</h3> - Reformatage du code.</br></p></br><p><h3>03/10/2024 - Version 1.14:</h3> - Remonte la fênetre dans la pille.</br></p><p><h3>13/09/2024 - Version 1.13:</h3>- MAJ sur le lien du changelog</br>- Bug-fix: Ouvre MultiPolygone et Polygon séparément.</p></br><p><h3>10/09/2024 - Version 1.11:</h3>- Ouverture de table contenant plusieurs géométries.</p></br><p><h3>26/08/2024 - Version 1.10:</h3>- Ajoute d'un changelog et vérification de mise à jour.</p>
|
||||||
|
|
||||||
# deprecated flag (applies to the whole plugin, not just a single version)
|
# deprecated flag (applies to the whole plugin, not just a single version)
|
||||||
deprecated=False
|
deprecated=False
|
||||||
@@ -45,4 +46,3 @@ deprecated=False
|
|||||||
|
|
||||||
# If the plugin can run on QGIS Server.
|
# If the plugin can run on QGIS Server.
|
||||||
server=False
|
server=False
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
from qgis.core import QgsApplication
|
from qgis.core import QgsApplication
|
||||||
|
|
||||||
|
|
||||||
def gitea():
|
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'
|
recherche_1 = 'plugin_repositories\\github\\url=https://github.com/CEN-Rhone-Alpes/Plugin_QGIS/releases/latest/download/plugins.xml'
|
||||||
|
|||||||
@@ -2,13 +2,57 @@
|
|||||||
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'
|
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;"""
|
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'
|
schemaname_list_ref = """
|
||||||
order by schemaname,tablename;"""
|
WITH TableList AS (SELECT
|
||||||
schemaname_list="""(SELECT schemaname,tablename from pg_catalog.pg_tables
|
schemaname,
|
||||||
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)
|
tablename
|
||||||
UNION
|
FROM pg_catalog.pg_tables
|
||||||
(SELECT schemaname,matviewname AS tablename FROM pg_catalog.pg_matviews order by schemaname,tablename) order by schemaname,tablename;"""
|
WHERE
|
||||||
|
schemaname NOT LIKE '_archives' AND schemaname NOT LIKE 'topology' AND schemaname NOT LIKE 'information_schema' AND schemaname NOT LIKE 'pg_catalog' and schemaname NOT LIKE 'public' AND schemaname NOT LIKE '_trier'
|
||||||
|
ORDER BY schemaname,tablename),
|
||||||
|
TableDescription AS (SELECT
|
||||||
|
schemaname,
|
||||||
|
tablename,
|
||||||
|
description
|
||||||
|
FROM TableList
|
||||||
|
LEFT JOIN pg_description ON objoid = (quote_ident(schemaname)||'.'||quote_ident(tablename))::regclass
|
||||||
|
ORDER BY schemaname, tablename)
|
||||||
|
SELECT * FROM TableDescription;
|
||||||
|
"""
|
||||||
|
|
||||||
|
schemaname_list = """
|
||||||
|
WITH
|
||||||
|
TableList as (SELECT
|
||||||
|
schemaname,
|
||||||
|
tablename
|
||||||
|
FROM pg_catalog.pg_tables
|
||||||
|
WHERE schemaname LIKE 'trav%' OR schemaname LIKE '_ag%' OR schemaname LIKE '_00%' OR schemaname LIKE '_01%' OR schemaname LIKE '_07%' OR schemaname LIKE '_26%' OR schemaname LIKE '_form%' OR schemaname LIKE '_42%' OR schemaname LIKE '_69%'
|
||||||
|
ORDER BY schemaname,tablename),
|
||||||
|
|
||||||
|
ViewList as (SELECT
|
||||||
|
schemaname,
|
||||||
|
matviewname AS tablename
|
||||||
|
FROM pg_catalog.pg_matviews
|
||||||
|
ORDER BY schemaname,tablename),
|
||||||
|
|
||||||
|
TableAndView as (SELECT
|
||||||
|
schemaname,
|
||||||
|
tablename
|
||||||
|
FROM TableList
|
||||||
|
UNION SELECT schemaname,tablename FROM ViewList),
|
||||||
|
|
||||||
|
TableViewDescription as (SELECT
|
||||||
|
schemaname,
|
||||||
|
tablename,
|
||||||
|
description
|
||||||
|
FROM TableAndView
|
||||||
|
LEFT JOIN pg_description ON objoid = (quote_ident(schemaname)||'.'||quote_ident(tablename))::regclass
|
||||||
|
ORDER BY schemaname,tablename)
|
||||||
|
|
||||||
|
SELECT * FROM TableViewDescription;
|
||||||
|
"""
|
||||||
|
|
||||||
geom = "geom"
|
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_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_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))"""
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||||
|
width="128px" height="128px" viewBox="0 0 128 128" enable-background="new 0 0 128 128" xml:space="preserve">
|
||||||
|
<polygon fill="#EE7913" points="68.613,69.625 86.891,69.625 71.697,54.625 52.613,54.625 52.613,72.746 68.613,88.548 "/>
|
||||||
|
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="402.5244" y1="-220.8706" x2="400.6479" y2="-97.5023" gradientTransform="matrix(1 0 0 -1 -300.5195 -92.5547)">
|
||||||
|
<stop offset="0" style="stop-color:#589632"/>
|
||||||
|
<stop offset="1" style="stop-color:#93B023"/>
|
||||||
|
</linearGradient>
|
||||||
|
<polygon fill="url(#SVGID_1_)" points="126.613,109.057 94.488,77.625 76.613,77.625 76.613,96.033 107.143,126.625
|
||||||
|
126.613,126.625 "/>
|
||||||
|
<polygon fill="#F0E64A" points="76.613,77.625 94.488,77.625 86.891,69.625 68.613,69.625 68.613,88.548 76.613,96.033 "/>
|
||||||
|
<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="365.4619" y1="-221.1455" x2="363.5923" y2="-98.227" gradientTransform="matrix(1 0 0 -1 -300.5195 -92.5547)">
|
||||||
|
<stop offset="0" style="stop-color:#589632"/>
|
||||||
|
<stop offset="1" style="stop-color:#93B023"/>
|
||||||
|
</linearGradient>
|
||||||
|
<path fill="url(#SVGID_2_)" d="M68.923,101.552c-1.165,0.242-1.769,0.157-4.685,0.157c-20.866,0-38.612-17.158-38.612-39.406
|
||||||
|
c0-22.248,17.551-39.027,38.612-39.027s37.833,16.78,37.833,39.027c0,3.619-0.451,7.099-1.284,10.398L120.1,92.012
|
||||||
|
c4.979-8.726,7.765-18.869,7.765-29.857c0-34.289-27.363-59.963-64.016-59.963C27.363,2.191,0,27.696,0,62.154
|
||||||
|
c0,34.625,27.363,60.638,63.848,60.638c9.417,0,16.069-1.469,23.042-3.761L68.923,101.552z"/>
|
||||||
|
<polygon opacity="0.15" fill="#FFFFFF" enable-background="new " points="53.083,54.625 71.697,54.625 126.613,109.057
|
||||||
|
126.613,126.625 "/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.0 KiB |
@@ -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 |
@@ -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 |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 11 KiB |
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import configparser
|
import configparser
|
||||||
import shutil
|
import shutil
|
||||||
import socket
|
import os
|
||||||
import tempfile
|
import tempfile
|
||||||
from os.path import abspath, join, pardir, dirname
|
from os.path import abspath, join, pardir, dirname
|
||||||
|
|
||||||
@@ -77,20 +77,17 @@ def plugin_test_data_path(*args, copy=False):
|
|||||||
else:
|
else:
|
||||||
return path
|
return path
|
||||||
|
|
||||||
|
|
||||||
def pyperclip():
|
def pyperclip():
|
||||||
IPAddr=socket.gethostbyname(socket.gethostname())
|
dst = dirname(dirname(__file__)) + "\\tools\\"
|
||||||
dst = abspath(abspath(join(plugin_path(), "CenRa_FLUX\\tools\\")))
|
if os.access('N:/', os.R_OK):
|
||||||
if IPAddr[0:11] == "100.100.100": #4269
|
src = 'N:/SI_Systeme d information/Z_QGIS/PLUGIN/PythonSQL.py'
|
||||||
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
|
|
||||||
if IPAddr[0:9] == "192.168.0": #01
|
|
||||||
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
|
|
||||||
if IPAddr[0:9] == "192.168.1": #0726
|
|
||||||
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
|
|
||||||
try:
|
try:
|
||||||
shutil.copy(src, dst)
|
shutil.copy(src, dst)
|
||||||
except:
|
except NameError:
|
||||||
print('404')
|
print('404')
|
||||||
|
|
||||||
|
|
||||||
def resources_path(*args):
|
def resources_path(*args):
|
||||||
"""Get the path to our resources folder.
|
"""Get the path to our resources folder.
|
||||||
|
|
||||||
@@ -117,46 +114,48 @@ def load_ui(*args):
|
|||||||
ui_class, _ = uic.loadUiType(resources_path("ui", *args))
|
ui_class, _ = uic.loadUiType(resources_path("ui", *args))
|
||||||
|
|
||||||
return ui_class
|
return ui_class
|
||||||
|
|
||||||
|
|
||||||
def send_issues(url, titre, body, labels):
|
def send_issues(url, titre, body, labels):
|
||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
import os
|
# import os
|
||||||
import qgis
|
# import qgis
|
||||||
|
|
||||||
usr = os.environ['USERNAME']
|
# usr = os.environ['USERNAME']
|
||||||
token = '9d0a4e0bea561710e0728f161f7edf4e5201e112'
|
token = '9d0a4e0bea561710e0728f161f7edf4e5201e112'
|
||||||
url = url + '?token=' + token
|
url = url + '?token=' + token
|
||||||
|
|
||||||
headers = {'Authorization': 'token ' + token, 'accept': 'application/json', 'Content-Type': 'application/json'}
|
headers = {'Authorization': 'token ' + token, 'accept': 'application/json', 'Content-Type': 'application/json'}
|
||||||
|
|
||||||
|
|
||||||
payload = {'title': titre, 'body': body, 'labels': labels}
|
payload = {'title': titre, 'body': body, 'labels': labels}
|
||||||
try:
|
try:
|
||||||
urllib.request.urlopen('https://google.com')
|
urllib.request.urlopen('https://google.com')
|
||||||
binar = True
|
binar = True
|
||||||
except:
|
except NameError:
|
||||||
binar = False
|
binar = False
|
||||||
r = ''
|
r = ''
|
||||||
if binar:
|
if binar:
|
||||||
r = requests.post(url, data=json.dumps(payload), headers=headers)
|
r = requests.post(url, data=json.dumps(payload), headers=headers)
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
|
||||||
def maj_verif(NAME):
|
def maj_verif(NAME):
|
||||||
import qgis
|
import qgis
|
||||||
import urllib.request
|
import urllib.request
|
||||||
iface = qgis.utils.iface
|
iface = qgis.utils.iface
|
||||||
from qgis.core import Qgis
|
from qgis.core import Qgis
|
||||||
|
|
||||||
url = qgis.utils.pluginMetadata(NAME,'repository')
|
# url = qgis.utils.pluginMetadata(NAME, 'repository')
|
||||||
# URL = url+'/raw/branch/main/plugins.xml'
|
# URL = url+'/raw/branch/main/plugins.xml'
|
||||||
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/releases/plugins.xml'
|
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/plugins.xml'
|
||||||
# print(URL)
|
# print(URL)
|
||||||
version = qgis.utils.pluginMetadata(NAME, 'version')
|
version = qgis.utils.pluginMetadata(NAME, 'version')
|
||||||
len_version = len(version)
|
len_version = len(version)
|
||||||
try:
|
try:
|
||||||
urllib.request.urlopen('https://google.com')
|
urllib.request.urlopen('https://google.com')
|
||||||
binar = True
|
binar = True
|
||||||
except:
|
except urllib.error.URLError:
|
||||||
binar = False
|
binar = False
|
||||||
if binar:
|
if binar:
|
||||||
try:
|
try:
|
||||||
@@ -166,11 +165,12 @@ def maj_verif(NAME):
|
|||||||
version_plugin = version_web[valeur_version_web: valeur_version_web + len_version]
|
version_plugin = version_web[valeur_version_web: valeur_version_web + len_version]
|
||||||
if version_plugin != version:
|
if version_plugin != version:
|
||||||
iface.messageBar().pushMessage("MAJ :", "Des mise à jour de plugin sont disponibles.", level=Qgis.Info, duration=30)
|
iface.messageBar().pushMessage("MAJ :", "Des mise à jour de plugin sont disponibles.", level=Qgis.Info, duration=30)
|
||||||
except:
|
except NameError:
|
||||||
print("error gitea version ssl")
|
print("error gitea version ssl")
|
||||||
else:
|
else:
|
||||||
iface.messageBar().pushMessage("WiFi :", "Pas de connection à internet.", level=Qgis.Warning, duration=30)
|
iface.messageBar().pushMessage("WiFi :", "Pas de connection à internet.", level=Qgis.Warning, duration=30)
|
||||||
|
|
||||||
|
|
||||||
def devlog(NAME):
|
def devlog(NAME):
|
||||||
import qgis
|
import qgis
|
||||||
devmaj = '<head><style>* {margin:0; padding:0; }</style></head>'
|
devmaj = '<head><style>* {margin:0; padding:0; }</style></head>'
|
||||||
|
|||||||
@@ -1,252 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>Dialog</class>
|
|
||||||
<widget class="QDialog" name="Dialog">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>910</width>
|
|
||||||
<height>800</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>910</width>
|
|
||||||
<height>800</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>910</width>
|
|
||||||
<height>800</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>SIG CEN-RA</string>
|
|
||||||
</property>
|
|
||||||
<widget class="QComboBox" name="comboBox">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>260</x>
|
|
||||||
<y>130</y>
|
|
||||||
<width>171</width>
|
|
||||||
<height>22</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="editable">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="currentText">
|
|
||||||
<string notr="true"/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QComboBox" name="comboBox_2">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>370</x>
|
|
||||||
<y>80</y>
|
|
||||||
<width>171</width>
|
|
||||||
<height>22</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="editable">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="currentText">
|
|
||||||
<string notr="true"/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLabel" name="label_3">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>345</x>
|
|
||||||
<y>10</y>
|
|
||||||
<width>221</width>
|
|
||||||
<height>71</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="pixmap">
|
|
||||||
<pixmap>:/plugins/CenRa_FLUX/logo.jpg</pixmap>
|
|
||||||
</property>
|
|
||||||
<property name="scaledContents">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QPushButton" name="pushButton_2">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>370</x>
|
|
||||||
<y>750</y>
|
|
||||||
<width>171</width>
|
|
||||||
<height>23</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Charger les couches</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QTableWidget" name="tableWidget">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>30</x>
|
|
||||||
<y>170</y>
|
|
||||||
<width>850</width>
|
|
||||||
<height>281</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="selectionMode">
|
|
||||||
<enum>QAbstractItemView::SingleSelection</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sortingEnabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QTableWidget" name="tableWidget_2">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>30</x>
|
|
||||||
<y>550</y>
|
|
||||||
<width>850</width>
|
|
||||||
<height>181</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="selectionMode">
|
|
||||||
<enum>QAbstractItemView::SingleSelection</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QCommandLinkButton" name="commandLinkButton">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>400</x>
|
|
||||||
<y>470</y>
|
|
||||||
<width>61</width>
|
|
||||||
<height>61</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset>
|
|
||||||
<normaloff>:/plugins/CenRa_FLUX/arrow-bottom.png</normaloff>:/plugins/CenRa_FLUX/arrow-bottom.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>50</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QCommandLinkButton" name="commandLinkButton_2">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>460</x>
|
|
||||||
<y>470</y>
|
|
||||||
<width>61</width>
|
|
||||||
<height>61</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset>
|
|
||||||
<normaloff>:/plugins/CenRa_FLUX/arrow-up.png</normaloff>:/plugins/CenRa_FLUX/arrow-up.png</iconset>
|
|
||||||
</property>
|
|
||||||
<property name="iconSize">
|
|
||||||
<size>
|
|
||||||
<width>50</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLineEdit" name="lineEdit">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>480</x>
|
|
||||||
<y>130</y>
|
|
||||||
<width>171</width>
|
|
||||||
<height>21</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Recherche par mots-clés</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
<property name="readOnly">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="clearButtonEnabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>40</x>
|
|
||||||
<y>150</y>
|
|
||||||
<width>161</width>
|
|
||||||
<height>16</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<family>Calibri</family>
|
|
||||||
<pointsize>10</pointsize>
|
|
||||||
<italic>false</italic>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Liste des flux disponibles :</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLabel" name="label_2">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>30</x>
|
|
||||||
<y>530</y>
|
|
||||||
<width>171</width>
|
|
||||||
<height>16</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<family>Calibri</family>
|
|
||||||
<pointsize>10</pointsize>
|
|
||||||
<italic>false</italic>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Flux sélectionné(s) à charger :</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<zorder>label_3</zorder>
|
|
||||||
<zorder>comboBox</zorder>
|
|
||||||
<zorder>comboBox_2</zorder>
|
|
||||||
<zorder>pushButton_2</zorder>
|
|
||||||
<zorder>tableWidget</zorder>
|
|
||||||
<zorder>tableWidget_2</zorder>
|
|
||||||
<zorder>commandLinkButton</zorder>
|
|
||||||
<zorder>commandLinkButton_2</zorder>
|
|
||||||
<zorder>lineEdit</zorder>
|
|
||||||
<zorder>label</zorder>
|
|
||||||
<zorder>label_2</zorder>
|
|
||||||
</widget>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="inputMethodHints">
|
<property name="inputMethodHints">
|
||||||
<set>Qt::ImhNoEditMenu</set>
|
<set>Qt::ImhNoEditMenu|Qt::ImhNoTextHandles</set>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::NoFrame</enum>
|
<enum>QFrame::NoFrame</enum>
|
||||||
@@ -159,9 +159,15 @@
|
|||||||
<height>181</height>
|
<height>181</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="inputMethodHints">
|
||||||
|
<set>Qt::ImhNoEditMenu|Qt::ImhNoTextHandles</set>
|
||||||
|
</property>
|
||||||
<property name="selectionMode">
|
<property name="selectionMode">
|
||||||
<enum>QAbstractItemView::SingleSelection</enum>
|
<enum>QAbstractItemView::SingleSelection</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="selectionBehavior">
|
||||||
|
<enum>QAbstractItemView::SelectRows</enum>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QComboBox" name="comboBox">
|
<widget class="QComboBox" name="comboBox">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
@@ -235,9 +241,15 @@
|
|||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="editTriggers">
|
||||||
|
<set>QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked</set>
|
||||||
|
</property>
|
||||||
<property name="selectionMode">
|
<property name="selectionMode">
|
||||||
<enum>QAbstractItemView::SingleSelection</enum>
|
<enum>QAbstractItemView::SingleSelection</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="selectionBehavior">
|
||||||
|
<enum>QAbstractItemView::SelectRows</enum>
|
||||||
|
</property>
|
||||||
<property name="sortingEnabled">
|
<property name="sortingEnabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@@ -326,24 +338,6 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</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">
|
<widget class="QCheckBox" name="checkBox">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
@@ -357,18 +351,75 @@
|
|||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QComboBox" name="DeBUG">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>20</y>
|
||||||
|
<width>71</width>
|
||||||
|
<height>22</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Ignored" vsizetype="Ignored">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="editable">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="currentText">
|
||||||
|
<string notr="true"/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<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 class="QToolButton" name="toolButton_2">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>700</x>
|
||||||
|
<y>130</y>
|
||||||
|
<width>21</width>
|
||||||
|
<height>21</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>0</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<zorder>commandLinkButton_2</zorder>
|
||||||
|
<zorder>pushButton_2</zorder>
|
||||||
|
<zorder>label</zorder>
|
||||||
|
<zorder>tableWidget_2</zorder>
|
||||||
|
<zorder>comboBox</zorder>
|
||||||
|
<zorder>lineEdit</zorder>
|
||||||
|
<zorder>toolButton</zorder>
|
||||||
|
<zorder>tableWidget</zorder>
|
||||||
|
<zorder>label_2</zorder>
|
||||||
|
<zorder>label_3</zorder>
|
||||||
|
<zorder>comboBox_2</zorder>
|
||||||
|
<zorder>commandLinkButton</zorder>
|
||||||
|
<zorder>checkBox</zorder>
|
||||||
|
<zorder>DeBUG</zorder>
|
||||||
|
<zorder>toolButton_2</zorder>
|
||||||
|
<zorder>viewer</zorder>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
|
||||||
<customwidget>
|
|
||||||
<class>QWebView</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header location="global">QtWebKitWidgets/QWebView</header>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>CenRa_Metabase_editorwidget_base</class>
|
<class>CenRa_Metabase_editorwidget_base</class>
|
||||||
<widget class="QDialog" name="CenRa_Metabase_editorwidget_base">
|
<widget class="QDialog" name="CenRa_about_base">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
@@ -13,10 +13,6 @@
|
|||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Journal des modifications</string>
|
<string>Journal des modifications</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
|
||||||
<iconset>
|
|
||||||
<normaloff>../../CenRa_Metabase/tools/ui/icon.svg</normaloff>../../CenRa_Metabase/tools/ui/icon.svg</iconset>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QScrollArea" name="scrollArea">
|
<widget class="QScrollArea" name="scrollArea">
|
||||||
@@ -29,9 +25,6 @@
|
|||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::NoFrame</enum>
|
<enum>QFrame::NoFrame</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Plain</enum>
|
|
||||||
</property>
|
|
||||||
<property name="widgetResizable">
|
<property name="widgetResizable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@@ -56,7 +49,7 @@
|
|||||||
<property name="title">
|
<property name="title">
|
||||||
<string>DevLog</string>
|
<string>DevLog</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWebView" name="viewer" native="true">
|
<widget class="QTextBrowser" name="viewer">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
@@ -65,11 +58,6 @@
|
|||||||
<height>511</height>
|
<height>511</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="url" stdset="0">
|
|
||||||
<url>
|
|
||||||
<string>about:blank</string>
|
|
||||||
</url>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -78,19 +66,12 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="standardButtons">
|
<property name="standardButtons">
|
||||||
<set>QDialogButtonBox::Ok</set>
|
<set>QDialogButtonBox::Close|QDialogButtonBox::Ok</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
|
||||||
<customwidget>
|
|
||||||
<class>QWebView</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header location="global">QtWebKitWidgets/QWebView</header>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
|
After Width: | Height: | Size: 18 KiB |
@@ -4,13 +4,12 @@ __email__ = "info@3liz.org"
|
|||||||
|
|
||||||
|
|
||||||
from qgis.core import QgsApplication
|
from qgis.core import QgsApplication
|
||||||
from qgis.PyQt.QtCore import QCoreApplication, Qt, QTranslator, QUrl
|
from qgis.PyQt.QtCore import Qt, QUrl, QSettings
|
||||||
from qgis.PyQt.QtGui import QDesktopServices, QIcon
|
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
|
from qgis.utils import iface
|
||||||
import qgis
|
import qgis
|
||||||
|
|
||||||
|
|
||||||
# include <QSettings>
|
# include <QSettings>
|
||||||
'''
|
'''
|
||||||
from pg_metadata.connection_manager import (
|
from pg_metadata.connection_manager import (
|
||||||
@@ -24,19 +23,23 @@ from pg_metadata.processing.provider import PgMetadataProvider
|
|||||||
from pg_metadata.qgis_plugin_tools.tools.custom_logging import setup_logger
|
from pg_metadata.qgis_plugin_tools.tools.custom_logging import setup_logger
|
||||||
'''
|
'''
|
||||||
import os
|
import os
|
||||||
|
from .about_form import MetabaseAboutDialog
|
||||||
from .tools.resources import (
|
from .tools.resources import (
|
||||||
plugin_path,
|
# plugin_path,
|
||||||
pyperclip,
|
pyperclip,
|
||||||
resources_path,
|
resources_path,
|
||||||
maj_verif,
|
maj_verif,
|
||||||
)
|
)
|
||||||
pyperclip()
|
pyperclip()
|
||||||
|
|
||||||
|
try:
|
||||||
from .dock import CenRa_Metabase
|
from .dock import CenRa_Metabase
|
||||||
from .editor import Metabase_Editor
|
from .editor import Metabase_Editor
|
||||||
from .about_form import MetabaseAboutDialog
|
except NameError:
|
||||||
|
print('404')
|
||||||
|
|
||||||
# from CenRa_Metabase.issues import CenRa_Issues
|
# from CenRa_Metabase.issues import CenRa_Issues
|
||||||
|
|
||||||
from PyQt5.QtCore import *
|
|
||||||
|
|
||||||
class PgMetadata:
|
class PgMetadata:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@@ -99,14 +102,13 @@ class PgMetadata:
|
|||||||
if not self.editor:
|
if not self.editor:
|
||||||
self.editor = Metabase_Editor()
|
self.editor = Metabase_Editor()
|
||||||
|
|
||||||
|
|
||||||
self.editor_action = QAction(icon2, 'CenRa_Metabase', None)
|
self.editor_action = QAction(icon2, 'CenRa_Metabase', None)
|
||||||
self.toolBar.addAction(self.editor_action)
|
self.toolBar.addAction(self.editor_action)
|
||||||
self.editor_action.triggered.connect(self.open_editor)
|
self.editor_action.triggered.connect(self.open_editor)
|
||||||
|
|
||||||
if not self.dock:
|
if not self.dock:
|
||||||
self.dock = CenRa_Metabase()
|
self.dock = CenRa_Metabase()
|
||||||
iface.addDockWidget(Qt.RightDockWidgetArea, self.dock)
|
iface.addDockWidget(Qt.DockWidgetArea(0x2), self.dock)
|
||||||
|
|
||||||
# Open/close the dock from plugin menu
|
# Open/close the dock from plugin menu
|
||||||
self.dock_action = QAction(icon, 'CenRa_Metabase', iface.mainWindow())
|
self.dock_action = QAction(icon, 'CenRa_Metabase', iface.mainWindow())
|
||||||
@@ -157,7 +159,8 @@ class PgMetadata:
|
|||||||
About dialog
|
About dialog
|
||||||
"""
|
"""
|
||||||
dialog = MetabaseAboutDialog(iface)
|
dialog = MetabaseAboutDialog(iface)
|
||||||
dialog.exec_()
|
dialog.exec()
|
||||||
|
|
||||||
def open_help():
|
def open_help():
|
||||||
""" Open the online help. """
|
""" Open the online help. """
|
||||||
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
|
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
|
||||||
@@ -201,7 +204,6 @@ class PgMetadata:
|
|||||||
iface.pluginMenu().removeAction(self.dock_action)
|
iface.pluginMenu().removeAction(self.dock_action)
|
||||||
del self.dock_action
|
del self.dock_action
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def run_tests(pattern='test_*.py', package=None):
|
def run_tests(pattern='test_*.py', package=None):
|
||||||
"""Run the test inside QGIS."""
|
"""Run the test inside QGIS."""
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import os.path
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from qgis.PyQt import uic
|
from qgis.PyQt import uic
|
||||||
from qgis.PyQt.QtGui import QPixmap
|
# from qgis.PyQt.QtGui import QPixmap
|
||||||
from qgis.PyQt.QtWidgets import QDialog
|
from qgis.PyQt.QtWidgets import QDialog
|
||||||
|
|
||||||
from .tools.resources import devlog
|
from .tools.resources import devlog
|
||||||
@@ -12,10 +12,11 @@ ABOUT_FORM_CLASS, _ = uic.loadUiType(
|
|||||||
os.path.join(
|
os.path.join(
|
||||||
str(Path(__file__).resolve().parent),
|
str(Path(__file__).resolve().parent),
|
||||||
'tools/ui',
|
'tools/ui',
|
||||||
'CenRa_Metabase_about_form.ui'
|
'CenRa_about_form.ui'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class MetabaseAboutDialog(QDialog, ABOUT_FORM_CLASS):
|
class MetabaseAboutDialog(QDialog, ABOUT_FORM_CLASS):
|
||||||
|
|
||||||
""" About - Let the user display the about dialog. """
|
""" About - Let the user display the about dialog. """
|
||||||
|
|||||||
@@ -14,44 +14,31 @@ from pathlib import Path
|
|||||||
from xml.dom.minidom import parseString
|
from xml.dom.minidom import parseString
|
||||||
|
|
||||||
from qgis.core import (
|
from qgis.core import (
|
||||||
NULL,
|
|
||||||
QgsApplication,
|
QgsApplication,
|
||||||
QgsDataSourceUri,
|
|
||||||
QgsProject,
|
|
||||||
QgsProviderConnectionException,
|
|
||||||
QgsProviderRegistry,
|
QgsProviderRegistry,
|
||||||
QgsRasterLayer,
|
|
||||||
QgsSettings,
|
QgsSettings,
|
||||||
QgsVectorLayer,
|
|
||||||
)
|
)
|
||||||
from qgis.PyQt.QtCore import QLocale, QUrl
|
from qgis.PyQt.QtCore import QLocale, QUrl
|
||||||
from qgis.PyQt.QtGui import QDesktopServices, QIcon
|
from qgis.PyQt.QtGui import QDesktopServices, QIcon
|
||||||
from qgis.PyQt.QtPrintSupport import QPrinter
|
from qgis.PyQt.QtPrintSupport import QPrinter
|
||||||
from qgis.PyQt.QtWebKitWidgets import QWebPage
|
# from qgis.PyQt.QtWebKitWidgets import QWebPage
|
||||||
from qgis.PyQt.QtWidgets import (
|
from qgis.PyQt.QtWidgets import (
|
||||||
QDialog,
|
|
||||||
QAction,
|
QAction,
|
||||||
QDockWidget,
|
QDockWidget,
|
||||||
QFileDialog,
|
QFileDialog,
|
||||||
QInputDialog,
|
|
||||||
QMenu,
|
QMenu,
|
||||||
QToolButton,
|
QToolButton,
|
||||||
)
|
)
|
||||||
from qgis.gui import *
|
|
||||||
from qgis.utils import iface
|
from qgis.utils import iface
|
||||||
import qgis
|
import qgis
|
||||||
'''
|
|
||||||
from pg_metadata.connection_manager import (
|
|
||||||
check_pgmetadata_is_installed,
|
|
||||||
connections_list,
|
|
||||||
settings_connections_names,
|
|
||||||
)
|
|
||||||
'''
|
|
||||||
from .tools.PythonSQL import login_base
|
|
||||||
from .tools.resources import (
|
from .tools.resources import (
|
||||||
load_ui,
|
load_ui,
|
||||||
resources_path,
|
resources_path,
|
||||||
)
|
)
|
||||||
|
try:
|
||||||
|
from .tools.PythonSQL import login_base
|
||||||
|
except ValueError:
|
||||||
|
print('Pas de fichier PythonSQL')
|
||||||
|
|
||||||
DOCK_CLASS = load_ui('CenRa_Metabase_dockwidget_base.ui')
|
DOCK_CLASS = load_ui('CenRa_Metabase_dockwidget_base.ui')
|
||||||
LOGGER = logging.getLogger('CenRa_Metabase')
|
LOGGER = logging.getLogger('CenRa_Metabase')
|
||||||
@@ -80,8 +67,8 @@ class CenRa_Metabase(QDockWidget, DOCK_CLASS):
|
|||||||
self.current_datasource_uri = None
|
self.current_datasource_uri = None
|
||||||
self.current_connection = None
|
self.current_connection = None
|
||||||
|
|
||||||
self.viewer.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks)
|
# self.viewer.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks)
|
||||||
self.viewer.page().linkClicked.connect(self.open_link)
|
# self.viewer.page().linkClicked.connect(self.open_link)
|
||||||
|
|
||||||
# Help button
|
# Help button
|
||||||
self.external_help.setText('')
|
self.external_help.setText('')
|
||||||
@@ -97,7 +84,7 @@ class CenRa_Metabase(QDockWidget, DOCK_CLASS):
|
|||||||
# Settings menu
|
# Settings menu
|
||||||
self.config.setAutoRaise(True)
|
self.config.setAutoRaise(True)
|
||||||
# self.config.setToolTip(tr("Settings"))
|
# self.config.setToolTip(tr("Settings"))
|
||||||
self.config.setPopupMode(QToolButton.InstantPopup)
|
self.config.setPopupMode(QToolButton.ToolButtonPopupMode(2))
|
||||||
self.config.setIcon(QgsApplication.getThemeIcon("/mActionOptions.svg"))
|
self.config.setIcon(QgsApplication.getThemeIcon("/mActionOptions.svg"))
|
||||||
|
|
||||||
self.auto_open_dock_action = QAction(
|
self.auto_open_dock_action = QAction(
|
||||||
@@ -115,7 +102,7 @@ class CenRa_Metabase(QDockWidget, DOCK_CLASS):
|
|||||||
# Setting PDF/HTML menu
|
# Setting PDF/HTML menu
|
||||||
self.save_button.setAutoRaise(True)
|
self.save_button.setAutoRaise(True)
|
||||||
# self.save_button.setToolTip(tr("Save metadata"))
|
# 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_button.setIcon(QIcon(QgsApplication.iconPath('mActionFileSave.svg')))
|
||||||
|
|
||||||
self.save_as_pdf = QAction(
|
self.save_as_pdf = QAction(
|
||||||
@@ -146,11 +133,11 @@ class CenRa_Metabase(QDockWidget, DOCK_CLASS):
|
|||||||
# self.default_html_content_not_installed()
|
# self.default_html_content_not_installed()
|
||||||
# else:
|
# else:
|
||||||
self.default_html_content_not_pg_layer()
|
self.default_html_content_not_pg_layer()
|
||||||
|
iface.layerTreeView().currentLayerChanged.connect(self.layer_changed)
|
||||||
try:
|
try:
|
||||||
login_base()
|
login_base()
|
||||||
iface.layerTreeView().currentLayerChanged.connect(self.layer_changed)
|
iface.layerTreeView().currentLayerChanged.connect(self.layer_changed)
|
||||||
except:
|
except ValueError:
|
||||||
# qgis.utils.plugins['CenRa_METABASE'].initGui()
|
# qgis.utils.plugins['CenRa_METABASE'].initGui()
|
||||||
qgis.utils.plugins['CenRa_METABASE'].unload()
|
qgis.utils.plugins['CenRa_METABASE'].unload()
|
||||||
# self.default_html_content_not_pg_layer()
|
# self.default_html_content_not_pg_layer()
|
||||||
@@ -187,8 +174,8 @@ class CenRa_Metabase(QDockWidget, DOCK_CLASS):
|
|||||||
|
|
||||||
if output_format == OutputFormats.PDF:
|
if output_format == OutputFormats.PDF:
|
||||||
printer = QPrinter()
|
printer = QPrinter()
|
||||||
printer.setOutputFormat(QPrinter.PdfFormat)
|
printer.setOutputFormat(QPrinter.OutputFormat(1))
|
||||||
printer.setPageMargins(20, 20, 20, 20, QPrinter.Millimeter)
|
# printer.setPageMargins(20,20,20,20,QPrinter.Unit(0))
|
||||||
printer.setOutputFileName(output_file_path)
|
printer.setOutputFileName(output_file_path)
|
||||||
self.viewer.print(printer)
|
self.viewer.print(printer)
|
||||||
iface.messageBar().pushSuccess(
|
iface.messageBar().pushSuccess(
|
||||||
@@ -227,43 +214,15 @@ class CenRa_Metabase(QDockWidget, DOCK_CLASS):
|
|||||||
def save_auto_open_dock(self):
|
def save_auto_open_dock(self):
|
||||||
""" Save settings about the dock. """
|
""" Save settings about the dock. """
|
||||||
self.settings.setValue("pgmetadata/auto_open_dock", self.auto_open_dock_action.isChecked())
|
self.settings.setValue("pgmetadata/auto_open_dock", self.auto_open_dock_action.isChecked())
|
||||||
|
|
||||||
def sql_to_xml(self, dataall):
|
def sql_to_xml(self, dataall):
|
||||||
distribution = ''
|
distribution = ''
|
||||||
for y in dataall[1]:
|
for y in dataall[1]:
|
||||||
distribution = distribution + (
|
distribution = distribution + ('<dcat:distribution>' + '<dcat:Distribution>' + '<dct:title>{data}</dct:title>'.format(data=y[0]) + '<dcat:downloadURL>{data}</dcat:downloadURL>'.format(data=y[1]) + '<dcat:mediaType>{data}</dcat:mediaType>'.format(data=y[2]) + '<dct:format>{data}</dct:format>'.format(data=y[3]) + '<dct:bytesize>{data}</dct:bytesize>'.format(data=y[4]) + '</dcat:Distribution>' + '</dcat:distribution>')
|
||||||
'<dcat:distribution>'+
|
|
||||||
'<dcat:Distribution>'+
|
|
||||||
'<dct:title>{data}</dct:title>'.format(data=y[0])+
|
|
||||||
'<dcat:downloadURL>{data}</dcat:downloadURL>'.format(data=y[1])+
|
|
||||||
'<dcat:mediaType>{data}</dcat:mediaType>'.format(data=y[2])+
|
|
||||||
'<dct:format>{data}</dct:format>'.format(data=y[3])+
|
|
||||||
'<dct:bytesize>{data}</dct:bytesize>'.format(data=y[4])+
|
|
||||||
'</dcat:Distribution>'+
|
|
||||||
'</dcat:distribution>')
|
|
||||||
publisher = ''
|
publisher = ''
|
||||||
for z in dataall[2]:
|
for z in dataall[2]:
|
||||||
publisher = publisher + (
|
publisher = publisher + ('<dct:publisher>' + '<foaf:Organization>' + '<foaf:name>{data}</foaf:name>'.format(data=z[1]) + '<foaf:mbox>{data}</foaf:mbox>'.format(data=z[3]) + '</foaf:Organization>' + '</dct:publisher>')
|
||||||
'<dct:publisher>'+
|
data_str = [[dataall[0][26], '<dct:identifier>{data}</dct:identifier>'.format(data=dataall[0][1]) + '<dct:title>{data}</dct:title>'.format(data=dataall[0][4]) + '<dct:description>{data}</dct:description>'.format(data=dataall[0][5]) + '<dct:language>{data}</dct:language>'.format(data=dataall[0][26]) + '<dct:spatial>{data}</dct:spatial>'.format(data=dataall[0][28]) + '<dct:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">{data}</dct:created>'.format(data=dataall[0][20]) + '<dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">{data}</dct:issued>'.format(data=dataall[0][11]) + '<dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">{data}</dct:modified>'.format(data=dataall[0][21]) + '<dct:license>{data}</dct:license>'.format(data=dataall[0][13]) + distribution + publisher + '<dcat:theme>{data}</dcat:theme>'.format(data=", ".join(str(x) for x in dataall[0][24])) + '<dcat:keyword>{data}</dcat:keyword>'.format(data=", ".join(str(x) for x in dataall[0][6])) + '<dct:accrualPeriodicity>{data}</dct:accrualPeriodicity>'.format(data=dataall[0][12])]]
|
||||||
'<foaf:Organization>'+
|
|
||||||
'<foaf:name>{data}</foaf:name>'.format(data=z[1])+
|
|
||||||
'<foaf:mbox>{data}</foaf:mbox>'.format(data=z[3])+
|
|
||||||
'</foaf:Organization>'+
|
|
||||||
'</dct:publisher>')
|
|
||||||
data_str = [[dataall[0][26],
|
|
||||||
'<dct:identifier>{data}</dct:identifier>'.format(data=dataall[0][1])+
|
|
||||||
'<dct:title>{data}</dct:title>'.format(data=dataall[0][4])+
|
|
||||||
'<dct:description>{data}</dct:description>'.format(data=dataall[0][5])+
|
|
||||||
'<dct:language>{data}</dct:language>'.format(data=dataall[0][26])+
|
|
||||||
'<dct:spatial>{data}</dct:spatial>'.format(data=dataall[0][28])+
|
|
||||||
'<dct:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">{data}</dct:created>'.format(data=dataall[0][20])+
|
|
||||||
'<dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">{data}</dct:issued>'.format(data=dataall[0][11])+
|
|
||||||
'<dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">{data}</dct:modified>'.format(data=dataall[0][21])+
|
|
||||||
'<dct:license>{data}</dct:license>'.format(data=dataall[0][13])+
|
|
||||||
distribution+
|
|
||||||
publisher+
|
|
||||||
'<dcat:theme>{data}</dcat:theme>'.format(data=", ".join(str(x) for x in dataall[0][24]))+
|
|
||||||
'<dcat:keyword>{data}</dcat:keyword>'.format(data=", ".join(str(x) for x in dataall[0][6]))+
|
|
||||||
'<dct:accrualPeriodicity>{data}</dct:accrualPeriodicity>'.format(data=dataall[0][12])]]
|
|
||||||
|
|
||||||
return data_str
|
return data_str
|
||||||
|
|
||||||
@@ -288,7 +247,6 @@ publisher+
|
|||||||
self.current_connection = None
|
self.current_connection = None
|
||||||
self.ce_trouve_dans_psql(layer)
|
self.ce_trouve_dans_psql(layer)
|
||||||
|
|
||||||
|
|
||||||
def add_flatten_dataset_table(self):
|
def add_flatten_dataset_table(self):
|
||||||
""" Add a flatten dataset table with all links and contacts. """
|
""" Add a flatten dataset table with all links and contacts. """
|
||||||
'''
|
'''
|
||||||
@@ -333,7 +291,7 @@ publisher+
|
|||||||
|
|
||||||
def set_html_content(self, title=None, body=None):
|
def set_html_content(self, title=None, body=None):
|
||||||
""" Set the content in the dock. """
|
""" Set the content in the dock. """
|
||||||
#link_logo=resources_path('icons', 'CEN_RA.png')
|
# ink_logo=resources_path('icons', 'CEN_RA.png')
|
||||||
css_file = resources_path('css', 'dock.css')
|
css_file = resources_path('css', 'dock.css')
|
||||||
with open(css_file, 'r', encoding='utf8') as f:
|
with open(css_file, 'r', encoding='utf8') as f:
|
||||||
css = f.read()
|
css = f.read()
|
||||||
@@ -352,13 +310,13 @@ publisher+
|
|||||||
html += '</body></html>'
|
html += '</body></html>'
|
||||||
|
|
||||||
# It must be a file, even if it does not exist on the file system.
|
# 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'))
|
# base_url = QUrl.fromLocalFile(resources_path('images', 'must_be_a_file.png'))
|
||||||
self.viewer.setHtml(html, base_url)
|
self.viewer.setHtml(html)
|
||||||
|
|
||||||
def ce_trouve_dans_psql(self, layer):
|
def ce_trouve_dans_psql(self, layer):
|
||||||
try:
|
try:
|
||||||
uri = layer.dataProvider().uri()
|
uri = layer.dataProvider().uri()
|
||||||
except:
|
except AttributeError:
|
||||||
self.default_html_content_not_pg_layer()
|
self.default_html_content_not_pg_layer()
|
||||||
self.save_button.setEnabled(False)
|
self.save_button.setEnabled(False)
|
||||||
uri = ''
|
uri = ''
|
||||||
@@ -388,7 +346,7 @@ publisher+
|
|||||||
data_url = dataall[1]
|
data_url = dataall[1]
|
||||||
data_contact = dataall[2]
|
data_contact = dataall[2]
|
||||||
# print(len(data_url))
|
# print(len(data_url))
|
||||||
data_collonne=[field.name() for field in layer.dataProvider().fields()]
|
# data_collonne = [field.name() for field in layer.dataProvider().fields()]
|
||||||
|
|
||||||
body += '<div><h3>Identification</h3><table class="table table-condensed">'
|
body += '<div><h3>Identification</h3><table class="table table-condensed">'
|
||||||
body += '<tr><th>Titre</th><td>{data[4]}</td></tr>'.format(data=data)
|
body += '<tr><th>Titre</th><td>{data[4]}</td></tr>'.format(data=data)
|
||||||
@@ -453,10 +411,12 @@ publisher+
|
|||||||
def set_html_to_wms(self, layer):
|
def set_html_to_wms(self, layer):
|
||||||
self.set_html_content(
|
self.set_html_content(
|
||||||
'CenRa Metadata', (layer.htmlMetadata()))
|
'CenRa Metadata', (layer.htmlMetadata()))
|
||||||
|
|
||||||
def default_html_content_not_pg_layer(self):
|
def default_html_content_not_pg_layer(self):
|
||||||
""" When it's not a PostgreSQL layer. """
|
""" When it's not a PostgreSQL layer. """
|
||||||
self.set_html_content(
|
self.set_html_content(
|
||||||
'CenRa Metadata', ('Vous devez cliquer sur une couche dans la légende qui est stockée dans PostgreSQL.'))
|
'CenRa Metadata', ('Vous devez cliquer sur une couche dans la légende qui est stockée dans PostgreSQL.'))
|
||||||
|
|
||||||
def default_html_content_not_metadata(self):
|
def default_html_content_not_metadata(self):
|
||||||
self.set_html_content(
|
self.set_html_content(
|
||||||
'CenRa Metadata', ('La couche ne contien pas de métadonnée.'))
|
'CenRa Metadata', ('La couche ne contien pas de métadonnée.'))
|
||||||
@@ -491,4 +451,3 @@ publisher+
|
|||||||
data_contact = cur.fetchall()
|
data_contact = cur.fetchall()
|
||||||
cur.close()
|
cur.close()
|
||||||
return data_general[0], data_url, data_contact
|
return data_general[0], data_url, data_contact
|
||||||
|
|
||||||
|
|||||||
@@ -1,56 +1,48 @@
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from collections import namedtuple
|
# from collections import namedtuple
|
||||||
from enum import Enum
|
# from enum import Enum
|
||||||
from functools import partial
|
# from functools import partial
|
||||||
from pathlib import Path
|
# from pathlib import Path
|
||||||
from xml.dom.minidom import parseString
|
# from xml.dom.minidom import parseString
|
||||||
from qgis.gui import *
|
# from qgis.gui import *
|
||||||
from qgis.core import (
|
from qgis.core import (
|
||||||
NULL,
|
|
||||||
QgsApplication,
|
QgsApplication,
|
||||||
QgsDataSourceUri,
|
|
||||||
QgsProject,
|
|
||||||
QgsProviderConnectionException,
|
|
||||||
QgsProviderRegistry,
|
|
||||||
QgsRasterLayer,
|
|
||||||
QgsSettings,
|
QgsSettings,
|
||||||
QgsVectorLayer,
|
|
||||||
QgsGeometry,
|
QgsGeometry,
|
||||||
QgsWkbTypes,
|
QgsWkbTypes,
|
||||||
|
Qgis,
|
||||||
)
|
)
|
||||||
from PyQt5 import QtGui
|
from qgis.PyQt import QtGui, QtCore
|
||||||
from qgis.PyQt.QtCore import QLocale, QUrl, QDateTime
|
from qgis.PyQt.QtGui import QIcon
|
||||||
from qgis.PyQt.QtGui import QDesktopServices, QIcon
|
# from qgis.PyQt.QtPrintSupport import QPrinter
|
||||||
from qgis.PyQt.QtPrintSupport import QPrinter
|
# from qgis.PyQt.QtWebKitWidgets import QWebPage
|
||||||
from qgis.PyQt.QtWebKitWidgets import QWebPage
|
import psycopg2
|
||||||
from qgis.PyQt.QtWidgets import (
|
from qgis.PyQt.QtWidgets import (
|
||||||
QDialog,
|
QDialog,
|
||||||
QAction,
|
|
||||||
QDockWidget,
|
|
||||||
QFileDialog,
|
QFileDialog,
|
||||||
QInputDialog,
|
|
||||||
QMenu,
|
|
||||||
QToolButton,
|
|
||||||
QTableWidget,
|
|
||||||
QTableWidgetItem,
|
QTableWidgetItem,
|
||||||
)
|
)
|
||||||
from qgis.utils import iface
|
from qgis.utils import iface
|
||||||
|
|
||||||
|
try:
|
||||||
from .tools.PythonSQL import login_base
|
from .tools.PythonSQL import login_base
|
||||||
|
except ValueError:
|
||||||
|
print('Pas de fichier PythonSQL')
|
||||||
|
|
||||||
from .tools.resources import (
|
from .tools.resources import (
|
||||||
load_ui,
|
load_ui,
|
||||||
resources_path,
|
resources_path,
|
||||||
send_issues,
|
# send_issues,
|
||||||
)
|
)
|
||||||
from .issues import CenRa_Issues
|
# from .issues import CenRa_Issues
|
||||||
|
|
||||||
EDITOR_CLASS = load_ui('CenRa_Metabase_editorwidget_base.ui')
|
EDITOR_CLASS = load_ui('CenRa_Metabase_editorwidget_base.ui')
|
||||||
LOGGER = logging.getLogger('CenRa_Metabase')
|
LOGGEr = logging.getLogger('CenRa_Metabase')
|
||||||
|
|
||||||
|
|
||||||
class Metabase_Editor(QDialog, EDITOR_CLASS):
|
class Metabase_Editor(QDialog, EDITOR_CLASS):
|
||||||
|
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
_ = parent
|
_ = parent
|
||||||
super().__init__()
|
super().__init__()
|
||||||
@@ -70,7 +62,7 @@ class Metabase_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.auto_adding.show()
|
self.auto_adding.show()
|
||||||
|
|
||||||
self.auto_adding.clicked.connect(self.auto_run)
|
self.auto_adding.clicked.connect(self.auto_run)
|
||||||
self.issues_app.clicked.connect(self.issues_open)
|
# self.issues_app.clicked.connect(self.issues_open)
|
||||||
self.categories_select_view.itemDoubleClicked.connect(self.add_categories_view)
|
self.categories_select_view.itemDoubleClicked.connect(self.add_categories_view)
|
||||||
self.categories_view.itemDoubleClicked.connect(self.deleter_categories_view)
|
self.categories_view.itemDoubleClicked.connect(self.deleter_categories_view)
|
||||||
self.themes_select_view.itemDoubleClicked.connect(self.add_themes_view)
|
self.themes_select_view.itemDoubleClicked.connect(self.add_themes_view)
|
||||||
@@ -98,6 +90,7 @@ class Metabase_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.format_box.setCurrentIndex(0)
|
self.format_box.setCurrentIndex(0)
|
||||||
self.taille_line.setText('45')
|
self.taille_line.setText('45')
|
||||||
self.add_lien()
|
self.add_lien()
|
||||||
|
|
||||||
def add_metadata(self):
|
def add_metadata(self):
|
||||||
table_name = layer.dataProvider().uri().table()
|
table_name = layer.dataProvider().uri().table()
|
||||||
schema_name = layer.dataProvider().uri().schema()
|
schema_name = layer.dataProvider().uri().schema()
|
||||||
@@ -251,7 +244,7 @@ class Metabase_Editor(QDialog, EDITOR_CLASS):
|
|||||||
def is_in_psql(self, layer):
|
def is_in_psql(self, layer):
|
||||||
try:
|
try:
|
||||||
uri = layer.dataProvider().uri()
|
uri = layer.dataProvider().uri()
|
||||||
except:
|
except AttributeError:
|
||||||
uri = ''
|
uri = ''
|
||||||
return False
|
return False
|
||||||
if uri != '':
|
if uri != '':
|
||||||
@@ -320,7 +313,6 @@ class Metabase_Editor(QDialog, EDITOR_CLASS):
|
|||||||
role_list = all_list[10]
|
role_list = all_list[10]
|
||||||
organisation_list = all_list[11]
|
organisation_list = all_list[11]
|
||||||
|
|
||||||
|
|
||||||
# langue_box
|
# langue_box
|
||||||
self.langue_box.clear()
|
self.langue_box.clear()
|
||||||
self.langue_box.addItem('')
|
self.langue_box.addItem('')
|
||||||
@@ -388,7 +380,6 @@ class Metabase_Editor(QDialog, EDITOR_CLASS):
|
|||||||
crs_code = str(layer.crs().authid())
|
crs_code = str(layer.crs().authid())
|
||||||
self.crscode_plaintext.setPlainText(crs_code)
|
self.crscode_plaintext.setPlainText(crs_code)
|
||||||
|
|
||||||
|
|
||||||
self.frequence_box.addItem('')
|
self.frequence_box.addItem('')
|
||||||
self.restriction_box.addItem('')
|
self.restriction_box.addItem('')
|
||||||
self.licence_box.addItem('')
|
self.licence_box.addItem('')
|
||||||
@@ -457,7 +448,7 @@ class Metabase_Editor(QDialog, EDITOR_CLASS):
|
|||||||
try:
|
try:
|
||||||
in_index = sql_dataload[6].index(categorie_select_data[0])
|
in_index = sql_dataload[6].index(categorie_select_data[0])
|
||||||
in_index = False
|
in_index = False
|
||||||
except:
|
except ValueError:
|
||||||
in_index = True
|
in_index = True
|
||||||
if in_index:
|
if in_index:
|
||||||
self.categories_select_view.setItem(i, 0, QTableWidgetItem(categorie_select_data[0]))
|
self.categories_select_view.setItem(i, 0, QTableWidgetItem(categorie_select_data[0]))
|
||||||
@@ -467,7 +458,7 @@ class Metabase_Editor(QDialog, EDITOR_CLASS):
|
|||||||
try:
|
try:
|
||||||
in_index = sql_dataload[24].index(themes_select_data[0])
|
in_index = sql_dataload[24].index(themes_select_data[0])
|
||||||
in_index = False
|
in_index = False
|
||||||
except:
|
except ValueError:
|
||||||
in_index = True
|
in_index = True
|
||||||
if in_index:
|
if in_index:
|
||||||
self.themes_select_view.setItem(i, 0, QTableWidgetItem(themes_select_data[0]))
|
self.themes_select_view.setItem(i, 0, QTableWidgetItem(themes_select_data[0]))
|
||||||
@@ -582,6 +573,7 @@ class Metabase_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.categories_select_view.removeRow(self.categories_select_view.currentRow())
|
self.categories_select_view.removeRow(self.categories_select_view.currentRow())
|
||||||
self.categories_view.insertRow(0)
|
self.categories_view.insertRow(0)
|
||||||
self.categories_view.setItem(0, 0, QTableWidgetItem(values_add_categories))
|
self.categories_view.setItem(0, 0, QTableWidgetItem(values_add_categories))
|
||||||
|
|
||||||
def deleter_categories_view(self):
|
def deleter_categories_view(self):
|
||||||
values_deleter_categories = self.categories_view.selectedItems()[0].text()
|
values_deleter_categories = self.categories_view.selectedItems()[0].text()
|
||||||
self.categories_view.removeRow(self.categories_view.currentRow())
|
self.categories_view.removeRow(self.categories_view.currentRow())
|
||||||
@@ -593,6 +585,7 @@ class Metabase_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.themes_select_view.removeRow(self.themes_select_view.currentRow())
|
self.themes_select_view.removeRow(self.themes_select_view.currentRow())
|
||||||
self.themes_view.insertRow(0)
|
self.themes_view.insertRow(0)
|
||||||
self.themes_view.setItem(0, 0, QTableWidgetItem(values_add_themes))
|
self.themes_view.setItem(0, 0, QTableWidgetItem(values_add_themes))
|
||||||
|
|
||||||
def deleter_themes_view(self):
|
def deleter_themes_view(self):
|
||||||
values_deleter_themes = self.themes_view.selectedItems()[0].text()
|
values_deleter_themes = self.themes_view.selectedItems()[0].text()
|
||||||
self.themes_view.removeRow(self.themes_view.currentRow())
|
self.themes_view.removeRow(self.themes_view.currentRow())
|
||||||
@@ -613,10 +606,10 @@ class Metabase_Editor(QDialog, EDITOR_CLASS):
|
|||||||
cur.execute(sql_sizefile)
|
cur.execute(sql_sizefile)
|
||||||
boolean = True
|
boolean = True
|
||||||
|
|
||||||
except:
|
except psycopg2.errors.UndefinedTable:
|
||||||
boolean = False
|
boolean = False
|
||||||
|
|
||||||
if boolean == True:
|
if boolean is True:
|
||||||
size_file = (cur.fetchall())[0][0]
|
size_file = (cur.fetchall())[0][0]
|
||||||
else:
|
else:
|
||||||
size_file = ''
|
size_file = ''
|
||||||
@@ -654,9 +647,12 @@ class Metabase_Editor(QDialog, EDITOR_CLASS):
|
|||||||
array_contact += "('" + table + "', '" + schema + "', '" + self.role_box.currentText() + "', '" + self.nom_line.text() + "', '" + self.organisation_box.currentText() + "', '" + self.email_line.text() + "', '" + self.telephone_line.text() + "'),"
|
array_contact += "('" + table + "', '" + schema + "', '" + self.role_box.currentText() + "', '" + self.nom_line.text() + "', '" + self.organisation_box.currentText() + "', '" + self.email_line.text() + "', '" + self.telephone_line.text() + "'),"
|
||||||
|
|
||||||
def delete_lien(self):
|
def delete_lien(self):
|
||||||
|
fin = ''
|
||||||
global uid_delete_list_link, array_link
|
global uid_delete_list_link, array_link
|
||||||
|
try:
|
||||||
lien_uid = self.table_lien.item(self.table_lien.currentRow(), 0).text()
|
lien_uid = self.table_lien.item(self.table_lien.currentRow(), 0).text()
|
||||||
|
except AttributeError:
|
||||||
|
lien_uid = True
|
||||||
self.table_lien.removeRow(self.table_lien.currentRow())
|
self.table_lien.removeRow(self.table_lien.currentRow())
|
||||||
if lien_uid == 'new_value':
|
if lien_uid == 'new_value':
|
||||||
position = self.table_lien.currentRow()
|
position = self.table_lien.currentRow()
|
||||||
@@ -680,12 +676,18 @@ class Metabase_Editor(QDialog, EDITOR_CLASS):
|
|||||||
fin += 1
|
fin += 1
|
||||||
array_link = array_link[:debut - 1] + array_link[fin + 1:]
|
array_link = array_link[:debut - 1] + array_link[fin + 1:]
|
||||||
# print('a:', array_link)
|
# print('a:', array_link)
|
||||||
|
elif lien_uid is True:
|
||||||
|
print('Pas de ligne "Lien"')
|
||||||
else:
|
else:
|
||||||
uid_delete_list_link += "'" + lien_uid + "',"
|
uid_delete_list_link += "'" + lien_uid + "',"
|
||||||
|
|
||||||
def delete_contact(self):
|
def delete_contact(self):
|
||||||
|
fin = ''
|
||||||
global uid_delete_list_contact, array_contact
|
global uid_delete_list_contact, array_contact
|
||||||
|
try:
|
||||||
contact_uid = self.table_contact.item(self.table_contact.currentRow(), 0).text()
|
contact_uid = self.table_contact.item(self.table_contact.currentRow(), 0).text()
|
||||||
|
except AttributeError:
|
||||||
|
contact_uid = True
|
||||||
self.table_contact.removeRow(self.table_contact.currentRow())
|
self.table_contact.removeRow(self.table_contact.currentRow())
|
||||||
if contact_uid == 'new_value':
|
if contact_uid == 'new_value':
|
||||||
position = self.table_contact.currentRow()
|
position = self.table_contact.currentRow()
|
||||||
@@ -709,10 +711,11 @@ class Metabase_Editor(QDialog, EDITOR_CLASS):
|
|||||||
fin += 1
|
fin += 1
|
||||||
array_contact = array_contact[:debut - 1] + array_contact[fin + 1:]
|
array_contact = array_contact[:debut - 1] + array_contact[fin + 1:]
|
||||||
# print('a:', array_contact)
|
# print('a:', array_contact)
|
||||||
|
elif contact_uid is True:
|
||||||
|
print('Pas de ligne "Contact"')
|
||||||
else:
|
else:
|
||||||
uid_delete_list_contact += "'" + contact_uid + "',"
|
uid_delete_list_contact += "'" + contact_uid + "',"
|
||||||
|
|
||||||
|
|
||||||
def fletch_ref(self):
|
def fletch_ref(self):
|
||||||
cur = login_base()
|
cur = login_base()
|
||||||
|
|
||||||
@@ -766,6 +769,7 @@ class Metabase_Editor(QDialog, EDITOR_CLASS):
|
|||||||
folder = folder[0]
|
folder = folder[0]
|
||||||
if folder[len(folder) - 4:] == '.xml':
|
if folder[len(folder) - 4:] == '.xml':
|
||||||
print('is .xml')
|
print('is .xml')
|
||||||
def issues_open(self):
|
|
||||||
self.issues = CenRa_Issues()
|
# def issues_open(self):
|
||||||
self.issues.show()
|
# self.issues = CenRa_Issues()
|
||||||
|
# self.issues.show()
|
||||||
|
|||||||
@@ -5,8 +5,10 @@
|
|||||||
[general]
|
[general]
|
||||||
name=CenRa_Metabase
|
name=CenRa_Metabase
|
||||||
qgisMinimumVersion=3.0
|
qgisMinimumVersion=3.0
|
||||||
|
qgisMaximumVersion=4.99
|
||||||
|
supportsQt6=True
|
||||||
description=CenRa_METABASE
|
description=CenRa_METABASE
|
||||||
version=0.2.1
|
version=0.3.2
|
||||||
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
|
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
|
||||||
email=si_besoin@cen-rhonealpes.fr
|
email=si_besoin@cen-rhonealpes.fr
|
||||||
|
|
||||||
@@ -21,7 +23,7 @@ tracker=https://gitea.cenra-outils.org/api/v1/repos/CEN-RA/Plugin_QGIS/issues
|
|||||||
|
|
||||||
hasProcessingProvider=no
|
hasProcessingProvider=no
|
||||||
# Uncomment the following line and add your changelog:
|
# 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>12/03/2026 - Version 0.3.2: </h3> - qgisMaximumVersion est 4.0.</p></br><p><h3>30/07/2025 - Version 0.3.1: </h3> - Correctife de bug.</p></br><p><h3>19/05/2025 - Version 0.3.0: </h3> - Compatible PyQt5 et PyQt6</p></br><p><h3>09/04/2025 - Version 0.2.3: </h3> - Correctif bug en TT.</p></br><p><h3>09/04/2025 - Version 0.2.2: </h3> - Optimisation pour le TT.</p></br><p><h3>03/04/2025 - Version 0.2.1: </h3> - Mise a jour de securite.</p></br><p><h3>07/01/2025 - Version 0.2.0: </h3> - Deployment sur serveur SIG.</p></br><p><h3>07/01/2025 - Version 0.1.6: </h3> - ByPass du certif ssl ci erreur</p></br><p><h3>19/12/2024 - Version 0.1.5: </h3> - Fix les problem de lenteur qu'en la base est down.</p></br><p><h3>12/12/2024 - Version 0.1.4: </h3> - Crash Fix .</p></br><p><h3>08/10/2024 - Version 0.1.3: </h3> - Lecture de métadonnée des flux WMS/WFS.</p></br><p><h3>07/10/2024 - Version 0.1.2: </h3> - Correctif de bug.</p></br><p><h3>03/10/2024 - Version 0.1.1: </h3> - Remonte la fênetre dans la pille.</p></br><p><h3>26/08/2024 - Version 0.1.0: </h3> - Lancement du plugin CenRa_Metabase </p>
|
||||||
|
|
||||||
# Tags are comma separated with spaces allowed
|
# Tags are comma separated with spaces allowed
|
||||||
tags=python
|
tags=python
|
||||||
|
|||||||
@@ -3,9 +3,12 @@
|
|||||||
import configparser
|
import configparser
|
||||||
import shutil
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
import socket
|
# import base64
|
||||||
|
# import psycopg2
|
||||||
|
# import psycopg2.extras
|
||||||
|
import os
|
||||||
from os.path import abspath, join, pardir, dirname
|
from os.path import abspath, join, pardir, dirname
|
||||||
from qgis.PyQt.QtWidgets import QApplication
|
|
||||||
from qgis.PyQt import uic
|
from qgis.PyQt import uic
|
||||||
|
|
||||||
__copyright__ = "Copyright 2019, 3Liz"
|
__copyright__ = "Copyright 2019, 3Liz"
|
||||||
@@ -92,19 +95,6 @@ def resources_path(*args):
|
|||||||
path = abspath(join(path, item))
|
path = abspath(join(path, item))
|
||||||
return path
|
return path
|
||||||
|
|
||||||
def pyperclip():
|
|
||||||
IPAddr=socket.gethostbyname(socket.gethostname())
|
|
||||||
dst = abspath(abspath(join(plugin_path(), "CenRa_METABASE\\tools\\")))
|
|
||||||
if IPAddr[0:11] == "100.100.100": #4269
|
|
||||||
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
|
|
||||||
if IPAddr[0:9] == "192.168.0": #01
|
|
||||||
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
|
|
||||||
if IPAddr[0:9] == "192.168.1": #0726
|
|
||||||
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
|
|
||||||
try:
|
|
||||||
shutil.copy(src, dst)
|
|
||||||
except:
|
|
||||||
print('404')
|
|
||||||
|
|
||||||
def load_ui(*args):
|
def load_ui(*args):
|
||||||
"""Get compile UI file.
|
"""Get compile UI file.
|
||||||
@@ -118,46 +108,60 @@ def load_ui(*args):
|
|||||||
|
|
||||||
return ui_class
|
return ui_class
|
||||||
|
|
||||||
|
|
||||||
|
def pyperclip():
|
||||||
|
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 FileNotFoundError:
|
||||||
|
print('404')
|
||||||
|
except UnboundLocalError:
|
||||||
|
print('404')
|
||||||
|
|
||||||
|
|
||||||
def send_issues(url, titre, body, labels):
|
def send_issues(url, titre, body, labels):
|
||||||
import requests
|
import requests
|
||||||
|
import urllib.request
|
||||||
import json
|
import json
|
||||||
import os
|
# import os
|
||||||
import qgis
|
# import qgis
|
||||||
|
|
||||||
usr = os.environ['USERNAME']
|
# usr = os.environ['USERNAME']
|
||||||
token = '9d0a4e0bea561710e0728f161f7edf4e5201e112'
|
token = '9d0a4e0bea561710e0728f161f7edf4e5201e112'
|
||||||
url = url + '?token=' + token
|
url = url + '?token=' + token
|
||||||
|
|
||||||
headers = {'Authorization': 'token ' + token, 'accept': 'application/json', 'Content-Type': 'application/json'}
|
headers = {'Authorization': 'token ' + token, 'accept': 'application/json', 'Content-Type': 'application/json'}
|
||||||
|
|
||||||
|
|
||||||
payload = {'title': titre, 'body': body, 'labels': labels}
|
payload = {'title': titre, 'body': body, 'labels': labels}
|
||||||
try:
|
try:
|
||||||
urllib.request.urlopen('https://google.com')
|
urllib.request.urlopen('https://google.com')
|
||||||
binar = True
|
binar = True
|
||||||
except:
|
except ValueError:
|
||||||
binar = False
|
binar = False
|
||||||
r = ''
|
r = ''
|
||||||
if binar:
|
if binar:
|
||||||
r = requests.post(url, data=json.dumps(payload), headers=headers)
|
r = requests.post(url, data=json.dumps(payload), headers=headers)
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
|
||||||
def maj_verif(NAME):
|
def maj_verif(NAME):
|
||||||
import qgis
|
import qgis
|
||||||
import urllib.request
|
import urllib.request
|
||||||
iface = qgis.utils.iface
|
iface = qgis.utils.iface
|
||||||
from qgis.core import Qgis
|
from qgis.core import Qgis
|
||||||
|
|
||||||
url = qgis.utils.pluginMetadata(NAME,'repository')
|
# url = qgis.utils.pluginMetadata(NAME, 'repository')
|
||||||
# URL = url+'/raw/branch/main/plugins.xml'
|
# URL = url+'/raw/branch/main/plugins.xml'
|
||||||
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/releases/plugins.xml'
|
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/plugins.xml'
|
||||||
# print(URL)
|
# print(URL)
|
||||||
version = qgis.utils.pluginMetadata(NAME, 'version')
|
version = qgis.utils.pluginMetadata(NAME, 'version')
|
||||||
len_version = len(version)
|
len_version = len(version)
|
||||||
try:
|
try:
|
||||||
urllib.request.urlopen('https://google.com')
|
urllib.request.urlopen('https://google.com')
|
||||||
binar = True
|
binar = True
|
||||||
except:
|
except urllib.error.URLError:
|
||||||
binar = False
|
binar = False
|
||||||
if binar:
|
if binar:
|
||||||
try:
|
try:
|
||||||
@@ -167,13 +171,11 @@ def maj_verif(NAME):
|
|||||||
version_plugin = version_web[valeur_version_web:valeur_version_web + len_version]
|
version_plugin = version_web[valeur_version_web:valeur_version_web + len_version]
|
||||||
if version_plugin != version:
|
if version_plugin != version:
|
||||||
iface.messageBar().pushMessage("MAJ :", "Des mise à jour de plugin sont disponibles.", level=Qgis.Info, duration=30)
|
iface.messageBar().pushMessage("MAJ :", "Des mise à jour de plugin sont disponibles.", level=Qgis.Info, duration=30)
|
||||||
except:
|
except urllib.error.URLError:
|
||||||
print("error gitea version ssl")
|
print("error gitea version ssl")
|
||||||
else:
|
else:
|
||||||
iface.messageBar().pushMessage("WiFi :", "Pas de connection à internet.", level=Qgis.Warning, duration=30)
|
iface.messageBar().pushMessage("WiFi :", "Pas de connection à internet.", level=Qgis.Warning, duration=30)
|
||||||
|
|
||||||
def tr(text, context="@default"):
|
|
||||||
return QApplication.translate(context, text)
|
|
||||||
|
|
||||||
def devlog(NAME):
|
def devlog(NAME):
|
||||||
import qgis
|
import qgis
|
||||||
|
|||||||
@@ -64,24 +64,11 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QWebView" name="viewer" native="true">
|
<widget class="QTextBrowser" name="viewer"/>
|
||||||
<property name="url" stdset="0">
|
|
||||||
<url>
|
|
||||||
<string>about:blank</string>
|
|
||||||
</url>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
|
||||||
<customwidget>
|
|
||||||
<class>QWebView</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header location="global">QtWebKitWidgets/QWebView</header>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>CenRa_Metabase_editorwidget_base</class>
|
<class>CenRa_Metabase_editorwidget_base</class>
|
||||||
<widget class="QDialog" name="CenRa_Metabase_editorwidget_base">
|
<widget class="QDialog" name="CenRa_about_base">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
@@ -11,11 +11,7 @@
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Metabase</string>
|
<string>Journal des modifications</string>
|
||||||
</property>
|
|
||||||
<property name="windowIcon">
|
|
||||||
<iconset>
|
|
||||||
<normaloff>../../CenRa_Metabase/tools/ui/icon.svg</normaloff>../../CenRa_Metabase/tools/ui/icon.svg</iconset>
|
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
@@ -29,9 +25,6 @@
|
|||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::NoFrame</enum>
|
<enum>QFrame::NoFrame</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Plain</enum>
|
|
||||||
</property>
|
|
||||||
<property name="widgetResizable">
|
<property name="widgetResizable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@@ -56,7 +49,7 @@
|
|||||||
<property name="title">
|
<property name="title">
|
||||||
<string>DevLog</string>
|
<string>DevLog</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWebView" name="viewer" native="true">
|
<widget class="QTextBrowser" name="viewer">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
@@ -65,11 +58,6 @@
|
|||||||
<height>511</height>
|
<height>511</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="url" stdset="0">
|
|
||||||
<url>
|
|
||||||
<string>about:blank</string>
|
|
||||||
</url>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -78,19 +66,12 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="standardButtons">
|
<property name="standardButtons">
|
||||||
<set>QDialogButtonBox::Ok</set>
|
<set>QDialogButtonBox::Close|QDialogButtonBox::Ok</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
|
||||||
<customwidget>
|
|
||||||
<class>QWebView</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header location="global">QtWebKitWidgets/QWebView</header>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
@@ -4,9 +4,9 @@ __email__ = "info@3liz.org"
|
|||||||
|
|
||||||
|
|
||||||
from qgis.core import QgsApplication
|
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.QtGui import QDesktopServices, QIcon
|
||||||
from qgis.PyQt.QtWidgets import QAction, QMessageBox
|
from qgis.PyQt.QtWidgets import QAction
|
||||||
from qgis.utils import iface
|
from qgis.utils import iface
|
||||||
import qgis
|
import qgis
|
||||||
|
|
||||||
@@ -25,14 +25,13 @@ from pg_metadata.qgis_plugin_tools.tools.custom_logging import setup_logger
|
|||||||
'''
|
'''
|
||||||
import os
|
import os
|
||||||
from .tools.resources import (
|
from .tools.resources import (
|
||||||
plugin_path,
|
# plugin_path,
|
||||||
resources_path,
|
resources_path,
|
||||||
maj_verif,
|
maj_verif,
|
||||||
)
|
)
|
||||||
from .canvas_editor import PageRender_Editor
|
from .canvas_editor import PageRender_Editor
|
||||||
from .about_form import AboutDialog
|
from .about_form import AboutDialog
|
||||||
|
|
||||||
from PyQt5.QtCore import *
|
|
||||||
|
|
||||||
class PgPageRender:
|
class PgPageRender:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@@ -73,7 +72,6 @@ class PgPageRender:
|
|||||||
if not self.canvas_editor:
|
if not self.canvas_editor:
|
||||||
self.canvas_editor = PageRender_Editor()
|
self.canvas_editor = PageRender_Editor()
|
||||||
|
|
||||||
|
|
||||||
self.pagerender_action = QAction(icon, 'CenRa_PAGERENDER', None)
|
self.pagerender_action = QAction(icon, 'CenRa_PAGERENDER', None)
|
||||||
self.toolBar.addAction(self.pagerender_action)
|
self.toolBar.addAction(self.pagerender_action)
|
||||||
self.pagerender_action.triggered.connect(self.open_editor)
|
self.pagerender_action.triggered.connect(self.open_editor)
|
||||||
@@ -115,7 +113,8 @@ class PgPageRender:
|
|||||||
About dialog
|
About dialog
|
||||||
"""
|
"""
|
||||||
dialog = AboutDialog(iface)
|
dialog = AboutDialog(iface)
|
||||||
dialog.exec_()
|
dialog.exec()
|
||||||
|
|
||||||
def open_help():
|
def open_help():
|
||||||
""" Open the online help. """
|
""" Open the online help. """
|
||||||
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
|
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import os.path
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from qgis.PyQt import uic
|
from qgis.PyQt import uic
|
||||||
from qgis.PyQt.QtGui import QPixmap
|
# from qgis.PyQt.QtGui import QPixmap
|
||||||
from qgis.PyQt.QtWidgets import QDialog
|
from qgis.PyQt.QtWidgets import QDialog
|
||||||
|
|
||||||
from .tools.resources import devlog
|
from .tools.resources import devlog
|
||||||
|
|||||||
@@ -1,74 +1,37 @@
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
from PyQt5.QtCore import QSettings,QPointF
|
# from collections import namedtuple
|
||||||
from collections import namedtuple
|
# from enum import Enum
|
||||||
from enum import Enum
|
# from functools import partial
|
||||||
from functools import partial
|
# from pathlib import Path
|
||||||
from pathlib import Path
|
# from xml.dom.minidom import parseString
|
||||||
from xml.dom.minidom import parseString
|
# from qgis.gui import *
|
||||||
from qgis.gui import *
|
# import qgis
|
||||||
import qgis
|
from qgis.core import QgsSettings
|
||||||
from qgis.core import (
|
from qgis.PyQt.QtCore import Qt
|
||||||
NULL,
|
# from qgis.PyQt.QtPrintSupport import QPrinter
|
||||||
QgsApplication,
|
# from qgis.PyQt.QtWebKitWidgets import QWebPage
|
||||||
QgsScaleBarSettings,
|
|
||||||
QgsDataSourceUri,
|
|
||||||
QgsProject,
|
|
||||||
QgsProviderConnectionException,
|
|
||||||
QgsProviderRegistry,
|
|
||||||
QgsRasterLayer,
|
|
||||||
QgsSettings,
|
|
||||||
QgsVectorLayer,
|
|
||||||
QgsGeometry,
|
|
||||||
QgsPrintLayout,
|
|
||||||
QgsReadWriteContext,
|
|
||||||
QgsLayoutItemMap,
|
|
||||||
QgsLayoutItemPage,
|
|
||||||
QgsLayoutSize,
|
|
||||||
QgsUnitTypes,
|
|
||||||
QgsLayoutPoint,
|
|
||||||
QgsLayoutItemLabel,
|
|
||||||
QgsLayoutItemPicture,
|
|
||||||
QgsLayoutItemLegend,
|
|
||||||
QgsLegendStyle,
|
|
||||||
QgsLayoutItemScaleBar,
|
|
||||||
QgsLayerTreeGroup,
|
|
||||||
QgsCoordinateReferenceSystem,
|
|
||||||
QgsCoordinateTransform,
|
|
||||||
QgsLayerTree,
|
|
||||||
QgsLayoutTableColumn,
|
|
||||||
QgsRectangle,
|
|
||||||
QgsLayoutItemMapOverviewStack,
|
|
||||||
QgsLayoutItemHtml,
|
|
||||||
)
|
|
||||||
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 (
|
from qgis.PyQt.QtWidgets import (
|
||||||
QDialog,
|
QDialog,
|
||||||
QAction,
|
|
||||||
QDockWidget,
|
|
||||||
QFileDialog,
|
QFileDialog,
|
||||||
QInputDialog,
|
|
||||||
QMenu,
|
|
||||||
QToolButton,
|
|
||||||
QTableWidget,
|
|
||||||
QTableWidgetItem,
|
QTableWidgetItem,
|
||||||
QVBoxLayout,
|
|
||||||
)
|
)
|
||||||
from PyQt5 import QtGui
|
|
||||||
from PyQt5.QtWidgets import QApplication
|
from qgis.PyQt import QtGui
|
||||||
from qgis.PyQt.QtXml import QDomDocument
|
from qgis.PyQt.QtWidgets import QApplication
|
||||||
from qgis.utils import iface
|
from qgis.PyQt.QtCore import QSettings
|
||||||
import glob
|
|
||||||
|
# from qgis.PyQt.QtXml import QDomDocument
|
||||||
|
# from qgis.utils import iface
|
||||||
|
# import glob
|
||||||
from .tools.resources import (
|
from .tools.resources import (
|
||||||
load_ui,
|
load_ui,
|
||||||
resources_path,
|
resources_path,
|
||||||
send_issues,
|
# send_issues,
|
||||||
)
|
)
|
||||||
from .issues import CenRa_Issues
|
# from .issues import CenRa_Issues
|
||||||
from datetime import date
|
# from datetime import date
|
||||||
|
|
||||||
last_select = None
|
last_select = None
|
||||||
maxV = 210
|
maxV = 210
|
||||||
maxH = 296
|
maxH = 296
|
||||||
@@ -78,31 +41,10 @@ url_osm = 'https://osm.datagrandest.fr/mapcache/?crs=EPSG:2154&featureCount=10&f
|
|||||||
url_ortho = 'http://tiles.craig.fr/ortho/service/?crs=EPSG:2154&featureCount=10&format=image/jpeg&layers=ortho&maxHeight=256&maxWidth=256&styles=&url=http://tiles.craig.fr/ortho/service'
|
url_ortho = 'http://tiles.craig.fr/ortho/service/?crs=EPSG:2154&featureCount=10&format=image/jpeg&layers=ortho&maxHeight=256&maxWidth=256&styles=&url=http://tiles.craig.fr/ortho/service'
|
||||||
url_mnt = 'http://tiles.craig.fr/mnt/crs=EPSG:2154&featureCount=10&format=image/png&layers=relief&maxHeight=256&maxWidth=256&styles=&url=http://tiles.craig.fr/mnt'
|
url_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'
|
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 = [
|
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',
|
|
||||||
]
|
|
||||||
class PageRender_Editor(QDialog, EDITOR_CLASS):
|
|
||||||
|
|
||||||
|
|
||||||
|
class PageRender_Editor(QDialog, EDITOR_CLASS):
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
_ = parent
|
_ = parent
|
||||||
super().__init__()
|
super().__init__()
|
||||||
@@ -125,7 +67,8 @@ class PageRender_Editor(QDialog, EDITOR_CLASS):
|
|||||||
'Credit': 0,
|
'Credit': 0,
|
||||||
'Source': 0,
|
'Source': 0,
|
||||||
'Echelle_2': 0,
|
'Echelle_2': 0,
|
||||||
'Logo_2':0,}
|
'Logo_2': 0}
|
||||||
|
self.varObject = {}
|
||||||
|
|
||||||
path = ''
|
path = ''
|
||||||
ix = 0
|
ix = 0
|
||||||
@@ -141,6 +84,7 @@ class PageRender_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.horizontalSlider.valueChanged.connect(self.horizontal)
|
self.horizontalSlider.valueChanged.connect(self.horizontal)
|
||||||
self.verticalSlider.valueChanged.connect(self.vertical)
|
self.verticalSlider.valueChanged.connect(self.vertical)
|
||||||
self.tableWidget.itemSelectionChanged.connect(self.setSlider)
|
self.tableWidget.itemSelectionChanged.connect(self.setSlider)
|
||||||
|
self.tableWidget_2.cellChanged.connect(self.setObject)
|
||||||
self.radioButton.toggled.connect(self.setSlider)
|
self.radioButton.toggled.connect(self.setSlider)
|
||||||
self.pushButton.clicked.connect(self.export)
|
self.pushButton.clicked.connect(self.export)
|
||||||
self.spinBox.editingFinished.connect(self.valueSlider)
|
self.spinBox.editingFinished.connect(self.valueSlider)
|
||||||
@@ -156,9 +100,10 @@ class PageRender_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.activateWindow()
|
self.activateWindow()
|
||||||
self.setNavigator()
|
self.setNavigator()
|
||||||
self.verticalScrollBar.setValue(self.frame.y())
|
self.verticalScrollBar.setValue(self.frame.y())
|
||||||
|
|
||||||
def mousePressEvent(self, event):
|
def mousePressEvent(self, event):
|
||||||
if self.tableWidget.currentItem() != None:
|
if self.tableWidget.currentItem() is not None:
|
||||||
QApplication.setOverrideCursor(Qt.OpenHandCursor)
|
QApplication.setOverrideCursor(Qt.CursorShape(18))
|
||||||
global lastPos
|
global lastPos
|
||||||
lastPos = {'x': event.pos().x(), 'y': event.pos().y()}
|
lastPos = {'x': event.pos().x(), 'y': event.pos().y()}
|
||||||
|
|
||||||
@@ -167,16 +112,15 @@ class PageRender_Editor(QDialog, EDITOR_CLASS):
|
|||||||
|
|
||||||
def keyPressEvent(self, event):
|
def keyPressEvent(self, event):
|
||||||
# if event.modifiers() & Qt.ControlModifier:
|
# 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)
|
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)
|
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)
|
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)
|
self.horizontalSlider.setValue(self.spinBox.value() - 1)
|
||||||
|
|
||||||
|
|
||||||
def wheelEvent(self, event):
|
def wheelEvent(self, event):
|
||||||
if (event.angleDelta().y() >= 1):
|
if (event.angleDelta().y() >= 1):
|
||||||
vsb = self.verticalScrollBar.value() + 50
|
vsb = self.verticalScrollBar.value() + 50
|
||||||
@@ -186,7 +130,7 @@ class PageRender_Editor(QDialog, EDITOR_CLASS):
|
|||||||
|
|
||||||
def mouseMoveEvent(self, event):
|
def mouseMoveEvent(self, event):
|
||||||
updated_cursor_position = event.pos()
|
updated_cursor_position = event.pos()
|
||||||
if self.tableWidget.currentItem() != None:
|
if self.tableWidget.currentItem() is not None:
|
||||||
selection_name = (self.tableWidget.currentItem()).text()
|
selection_name = (self.tableWidget.currentItem()).text()
|
||||||
all_children = self.frame.children()
|
all_children = self.frame.children()
|
||||||
selection = 0
|
selection = 0
|
||||||
@@ -202,14 +146,14 @@ class PageRender_Editor(QDialog, EDITOR_CLASS):
|
|||||||
|
|
||||||
orig_position_w = selection.width()
|
orig_position_w = selection.width()
|
||||||
orig_position_h = selection.height()
|
orig_position_h = selection.height()
|
||||||
if (frame_x <= round(updated_cursor_position.x()) <= frame_w and self.radioButton.isChecked() == True):
|
if (frame_x <= round(updated_cursor_position.x()) <= frame_w and self.radioButton.isChecked() is True):
|
||||||
updated_cursor_position_x = orig_position_w + (round(updated_cursor_position.x() - lastPos['x']))
|
updated_cursor_position_x = orig_position_w + (round(updated_cursor_position.x() - lastPos['x']))
|
||||||
lastPos['x'] = event.pos().x()
|
lastPos['x'] = event.pos().x()
|
||||||
selection.resize(updated_cursor_position_x, orig_position_h)
|
selection.resize(updated_cursor_position_x, orig_position_h)
|
||||||
self.horizontalSlider.setValue(round(updated_cursor_position_x / 3.5))
|
self.horizontalSlider.setValue(round(updated_cursor_position_x / 3.5))
|
||||||
orig_position_w = selection.width()
|
orig_position_w = selection.width()
|
||||||
orig_position_h = selection.height()
|
orig_position_h = selection.height()
|
||||||
if (frame_y <= round(updated_cursor_position.y()) <= frame_h and self.radioButton.isChecked() == True):
|
if (frame_y <= round(updated_cursor_position.y()) <= frame_h and self.radioButton.isChecked() is True):
|
||||||
updated_cursor_position_y = orig_position_h + (round(updated_cursor_position.y() - lastPos['y']))
|
updated_cursor_position_y = orig_position_h + (round(updated_cursor_position.y() - lastPos['y']))
|
||||||
lastPos['y'] = event.pos().y()
|
lastPos['y'] = event.pos().y()
|
||||||
selection.resize(orig_position_w, updated_cursor_position_y)
|
selection.resize(orig_position_w, updated_cursor_position_y)
|
||||||
@@ -217,7 +161,7 @@ class PageRender_Editor(QDialog, EDITOR_CLASS):
|
|||||||
|
|
||||||
orig_position_x = selection.pos().x()
|
orig_position_x = selection.pos().x()
|
||||||
orig_position_y = selection.pos().y()
|
orig_position_y = selection.pos().y()
|
||||||
if (frame_x <= round(updated_cursor_position.x()) <= frame_w and self.radioButton.isChecked() == False):
|
if (frame_x <= round(updated_cursor_position.x()) <= frame_w and self.radioButton.isChecked() is False):
|
||||||
updated_cursor_position_x = orig_position_x + (round(updated_cursor_position.x() - lastPos['x']))
|
updated_cursor_position_x = orig_position_x + (round(updated_cursor_position.x() - lastPos['x']))
|
||||||
lastPos['x'] = event.pos().x()
|
lastPos['x'] = event.pos().x()
|
||||||
# print(updated_cursor_position_x)
|
# print(updated_cursor_position_x)
|
||||||
@@ -226,7 +170,7 @@ class PageRender_Editor(QDialog, EDITOR_CLASS):
|
|||||||
|
|
||||||
orig_position_x = selection.pos().x()
|
orig_position_x = selection.pos().x()
|
||||||
orig_position_y = selection.pos().y()
|
orig_position_y = selection.pos().y()
|
||||||
if (frame_y <= round(updated_cursor_position.y()) <= frame_h and self.radioButton.isChecked() == False):
|
if (frame_y <= round(updated_cursor_position.y()) <= frame_h and self.radioButton.isChecked() is False):
|
||||||
updated_cursor_position_y = orig_position_y + (round(updated_cursor_position.y() - lastPos['y']))
|
updated_cursor_position_y = orig_position_y + (round(updated_cursor_position.y() - lastPos['y']))
|
||||||
lastPos['y'] = event.pos().y()
|
lastPos['y'] = event.pos().y()
|
||||||
# print(updated_cursor_position_y)
|
# print(updated_cursor_position_y)
|
||||||
@@ -235,17 +179,18 @@ class PageRender_Editor(QDialog, EDITOR_CLASS):
|
|||||||
|
|
||||||
def mouseReleaseEvent(self, event):
|
def mouseReleaseEvent(self, event):
|
||||||
# print('x: {0}, y: {1}'.format(event.pos().x(), event.pos().y()))
|
# print('x: {0}, y: {1}'.format(event.pos().x(), event.pos().y()))
|
||||||
if self.tableWidget.currentItem() != None:
|
if self.tableWidget.currentItem() is not None:
|
||||||
QApplication.restoreOverrideCursor()
|
QApplication.restoreOverrideCursor()
|
||||||
|
|
||||||
def select_file(self):
|
def select_file(self):
|
||||||
options = QFileDialog.Options()
|
# options = QFileDialog.Options()
|
||||||
options |= QFileDialog.ShowDirsOnly
|
# options |= QFileDialog.getExistingDirectory()
|
||||||
folder = QFileDialog.getOpenFileName(self, "Sélection du fichier ", '', 'Python(*.py)')
|
folder = QFileDialog.getOpenFileName(self, "Sélection du fichier ", '', 'Python(*.py)')
|
||||||
if folder[0] != '':
|
if folder[0] != '':
|
||||||
return folder[0]
|
return folder[0]
|
||||||
else:
|
else:
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
folder = self.select_file()
|
folder = self.select_file()
|
||||||
logopath = folder
|
logopath = folder
|
||||||
@@ -254,7 +199,7 @@ class PageRender_Editor(QDialog, EDITOR_CLASS):
|
|||||||
sourcefile = open(logopath, 'r')
|
sourcefile = open(logopath, 'r')
|
||||||
splitsource = sourcefile.read().splitlines()
|
splitsource = sourcefile.read().splitlines()
|
||||||
all_children = self.frame.children()
|
all_children = self.frame.children()
|
||||||
all_element = ['_locals','_size','_rotate']
|
all_element = ['_locals', '_size', '_rotate', '_frame', '_background', '_path']
|
||||||
for children in all_children:
|
for children in all_children:
|
||||||
flen = 0
|
flen = 0
|
||||||
for element in all_element:
|
for element in all_element:
|
||||||
@@ -264,7 +209,17 @@ class PageRender_Editor(QDialog, EDITOR_CLASS):
|
|||||||
if find_it.find(recherche_element) != -1:
|
if find_it.find(recherche_element) != -1:
|
||||||
flen = flen + 1
|
flen = flen + 1
|
||||||
if flen == 1:
|
if flen == 1:
|
||||||
if element != '_rotate':
|
if element == '_frame' or element == '_background' or element == '_path':
|
||||||
|
value_find = (find_it.split('=')[1]).replace('"', '')
|
||||||
|
if children.objectName() in self.varObject:
|
||||||
|
if element[1:] in self.varObject[children.objectName()]:
|
||||||
|
self.varObject[children.objectName()][element[1:]] = value_find
|
||||||
|
else:
|
||||||
|
self.varObject[children.objectName()].update({element[1:]: value_find})
|
||||||
|
else:
|
||||||
|
self.varObject.update({children.objectName(): {element[1:]: value_find}})
|
||||||
|
# print(self.varObject)
|
||||||
|
elif element != '_rotate':
|
||||||
value_find = (find_it[find_it[:].find('(') + 1:-33]).split(',')
|
value_find = (find_it[find_it[:].find('(') + 1:-33]).split(',')
|
||||||
if element == '_size':
|
if element == '_size':
|
||||||
Psize_h = float(value_find[0]) * 3.5
|
Psize_h = float(value_find[0]) * 3.5
|
||||||
@@ -315,12 +270,13 @@ class PageRender_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.tableWidget.removeRow(0)
|
self.tableWidget.removeRow(0)
|
||||||
xR = xR + 1
|
xR = xR + 1
|
||||||
self.tableWidget.clear()
|
self.tableWidget.clear()
|
||||||
id=0
|
# id = 0
|
||||||
for children in all_children:
|
for children in all_children:
|
||||||
position = self.tableWidget.rowCount()
|
position = self.tableWidget.rowCount()
|
||||||
self.tableWidget.insertRow(position)
|
self.tableWidget.insertRow(position)
|
||||||
self.tableWidget.setItem(position, 0, QTableWidgetItem(children.objectName()))
|
self.tableWidget.setItem(position, 0, QTableWidgetItem(children.objectName()))
|
||||||
# print(children.objectName())
|
# print(children.objectName())
|
||||||
|
|
||||||
def export(self):
|
def export(self):
|
||||||
self.type_page()
|
self.type_page()
|
||||||
self.type_page()
|
self.type_page()
|
||||||
@@ -332,6 +288,8 @@ from qgis.core import (
|
|||||||
QgsUnitTypes,
|
QgsUnitTypes,
|
||||||
QgsLayoutPoint,
|
QgsLayoutPoint,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def fletch_canvas(self):
|
def fletch_canvas(self):
|
||||||
if self.radioButton_6.isChecked():
|
if self.radioButton_6.isChecked():
|
||||||
values_page = 'A4'
|
values_page = 'A4'
|
||||||
@@ -353,6 +311,16 @@ def fletch_canvas(self):
|
|||||||
if values_page == '""" + page_size + """':"""
|
if values_page == '""" + page_size + """':"""
|
||||||
for children in all_children:
|
for children in all_children:
|
||||||
selection = children
|
selection = children
|
||||||
|
if selection.objectName() in self.varObject:
|
||||||
|
for parametre_object in self.varObject[selection.objectName()]:
|
||||||
|
if str(selection.objectName()) != "Arrow" and str(parametre_object) != "path":
|
||||||
|
export_str = export_str + """
|
||||||
|
self.template_parameters['""" + str(selection.objectName()) + '_' + str(parametre_object) + """'] = """ + str(self.varObject[selection.objectName()][parametre_object])
|
||||||
|
elif str(selection.objectName()) == "Arrow" and str(parametre_object) == "path":
|
||||||
|
if str(self.varObject[selection.objectName()][parametre_object]) == "":
|
||||||
|
self.varObject[selection.objectName()][parametre_object] = "NorthArrow_02.svg"
|
||||||
|
export_str = export_str + """
|
||||||
|
self.template_parameters['""" + str(selection.objectName()) + '_' + str(parametre_object) + """'] = '""" + str(self.varObject[selection.objectName()][parametre_object]) + "'"
|
||||||
if page_type == 'Portrait':
|
if page_type == 'Portrait':
|
||||||
item_rotate_object = self.varPortrait[selection.objectName() + '_rotate'][0]
|
item_rotate_object = self.varPortrait[selection.objectName() + '_rotate'][0]
|
||||||
if item_rotate_object == 0 or item_rotate_object == 180:
|
if item_rotate_object == 0 or item_rotate_object == 180:
|
||||||
@@ -410,6 +378,7 @@ def fletch_canvas(self):
|
|||||||
sourceFile = open(self.path, 'w')
|
sourceFile = open(self.path, 'w')
|
||||||
print(export_str, file=sourceFile)
|
print(export_str, file=sourceFile)
|
||||||
sourceFile.close()
|
sourceFile.close()
|
||||||
|
|
||||||
def type_page(self):
|
def type_page(self):
|
||||||
all_children = self.frame.children()
|
all_children = self.frame.children()
|
||||||
if self.toolButton_2.text() == 'Landscape':
|
if self.toolButton_2.text() == 'Landscape':
|
||||||
@@ -460,9 +429,30 @@ def fletch_canvas(self):
|
|||||||
frame_x = round(frame_w / 3)
|
frame_x = round(frame_w / 3)
|
||||||
frame_y = self.frame.y()
|
frame_y = self.frame.y()
|
||||||
self.frame.move(frame_x, frame_y)
|
self.frame.move(frame_x, frame_y)
|
||||||
|
|
||||||
|
def setParameter(self, selection_name):
|
||||||
|
if selection_name in self.varObject:
|
||||||
|
for table2Range in range(0, self.tableWidget_2.rowCount()):
|
||||||
|
rowName = self.tableWidget_2.item(table2Range, 0).text()
|
||||||
|
if rowName in self.varObject[selection_name]:
|
||||||
|
self.tableWidget_2.setItem(table2Range, 1, QTableWidgetItem(str(self.varObject[selection_name][rowName])))
|
||||||
|
else:
|
||||||
|
self.varObject[selection_name].update({rowName: ""})
|
||||||
|
self.tableWidget_2.setItem(table2Range, 1, QTableWidgetItem(''))
|
||||||
|
else:
|
||||||
|
self.varObject.update({selection_name: {"frame": "", "background": "", "path": ""}})
|
||||||
|
self.tableWidget_2.setItem(1, 1, QTableWidgetItem(''))
|
||||||
|
self.tableWidget_2.setItem(2, 1, QTableWidgetItem(''))
|
||||||
|
self.tableWidget_2.setItem(3, 1, QTableWidgetItem(''))
|
||||||
|
|
||||||
|
def setObject(self, event):
|
||||||
|
selection_name = (self.tableWidget.currentItem()).text()
|
||||||
|
rowName = self.tableWidget_2.item(event, 0).text()
|
||||||
|
rowValue = self.tableWidget_2.item(event, 1).text()
|
||||||
|
self.varObject[selection_name][rowName] = rowValue
|
||||||
|
|
||||||
def setSlider(self):
|
def setSlider(self):
|
||||||
if self.tableWidget.currentItem() != None:
|
if self.tableWidget.currentItem() is not None:
|
||||||
print(self.tableWidget.tabKeyNavigation())
|
|
||||||
selection_name = (self.tableWidget.currentItem()).text()
|
selection_name = (self.tableWidget.currentItem()).text()
|
||||||
all_children = self.frame.children()
|
all_children = self.frame.children()
|
||||||
selection = 0
|
selection = 0
|
||||||
@@ -474,7 +464,7 @@ def fletch_canvas(self):
|
|||||||
selection = children
|
selection = children
|
||||||
if selection != 0:
|
if selection != 0:
|
||||||
self.rotate_color(selection, last_children)
|
self.rotate_color(selection, last_children)
|
||||||
if self.radioButton.isChecked() == False:
|
if self.radioButton.isChecked() is False:
|
||||||
xx = round(selection.x() / 3.5)
|
xx = round(selection.x() / 3.5)
|
||||||
yy = round(selection.y() / 3.5)
|
yy = round(selection.y() / 3.5)
|
||||||
else:
|
else:
|
||||||
@@ -485,29 +475,30 @@ def fletch_canvas(self):
|
|||||||
self.verticalSlider.setValue(yy)
|
self.verticalSlider.setValue(yy)
|
||||||
self.spinBox.setValue(xx)
|
self.spinBox.setValue(xx)
|
||||||
self.spinBox_2.setValue(yy)
|
self.spinBox_2.setValue(yy)
|
||||||
|
self.setParameter(selection_name)
|
||||||
|
|
||||||
def rotate_color(self, selection, last_children):
|
def rotate_color(self, selection, last_children):
|
||||||
global last_select
|
global last_select
|
||||||
if self.radioButton.isChecked() == False:
|
if self.radioButton.isChecked() is False:
|
||||||
ColorCode = "10, 10, 80, 50"
|
ColorCode = "10, 10, 80, 50"
|
||||||
else:
|
else:
|
||||||
ColorCode = "249, 238, 148, 50"
|
ColorCode = "249, 238, 148, 50"
|
||||||
if self.rotate_object[selection.objectName()] == 0:
|
if self.rotate_object[selection.objectName()] == 0:
|
||||||
selection.setStyleSheet("border: 2px solid;border-color:red;border-bottom-color: blue;background-color: rgb("+ColorCode+")")
|
selection.setStyleSheet("border: 2px solid;border-color:red;border-bottom-color: blue;background-color: rgba(" + ColorCode + ")")
|
||||||
elif self.rotate_object[selection.objectName()] == 90:
|
elif self.rotate_object[selection.objectName()] == 90:
|
||||||
selection.setStyleSheet("border: 2px solid;border-color:red;border-left-color: blue;background-color: rgb("+ColorCode+")")
|
selection.setStyleSheet("border: 2px solid;border-color:red;border-left-color: blue;background-color: rgba(" + ColorCode + ")")
|
||||||
elif self.rotate_object[selection.objectName()] == 180:
|
elif self.rotate_object[selection.objectName()] == 180:
|
||||||
selection.setStyleSheet("border: 2px solid;border-color:red;border-top-color: blue;background-color: rgb("+ColorCode+")")
|
selection.setStyleSheet("border: 2px solid;border-color:red;border-top-color: blue;background-color: rgba(" + ColorCode + ")")
|
||||||
elif self.rotate_object[selection.objectName()] == 270:
|
elif self.rotate_object[selection.objectName()] == 270:
|
||||||
selection.setStyleSheet("border: 2px solid;border-color:red;border-right-color: blue;background-color: rgb("+ColorCode+")")
|
selection.setStyleSheet("border: 2px solid;border-color:red;border-right-color: blue;background-color: rgba(" + ColorCode + ")")
|
||||||
if last_children != 0:
|
if last_children != 0:
|
||||||
if last_select != selection.objectName():
|
if last_select != selection.objectName():
|
||||||
last_children.setStyleSheet("background-color: rgb(10, 10, 10, 50)")
|
last_children.setStyleSheet("background-color: rgba(10, 10, 10, 50)")
|
||||||
|
|
||||||
last_select = selection.objectName()
|
last_select = selection.objectName()
|
||||||
|
|
||||||
def rotate(self):
|
def rotate(self):
|
||||||
if self.tableWidget.currentItem() != None:
|
if self.tableWidget.currentItem() is not None:
|
||||||
selection_name = (self.tableWidget.currentItem()).text()
|
selection_name = (self.tableWidget.currentItem()).text()
|
||||||
all_children = self.frame.children()
|
all_children = self.frame.children()
|
||||||
selection = 0
|
selection = 0
|
||||||
@@ -521,7 +512,7 @@ def fletch_canvas(self):
|
|||||||
xx = round(selection.size().width())
|
xx = round(selection.size().width())
|
||||||
yy = round(selection.size().height())
|
yy = round(selection.size().height())
|
||||||
selection.resize(round(yy), round(xx))
|
selection.resize(round(yy), round(xx))
|
||||||
if self.radioButton.isChecked() == True:
|
if self.radioButton.isChecked() is True:
|
||||||
self.spinBox.setValue(yy)
|
self.spinBox.setValue(yy)
|
||||||
self.spinBox_2.setValue(xx)
|
self.spinBox_2.setValue(xx)
|
||||||
self.horizontalSlider.setValue(round(yy / 3.5))
|
self.horizontalSlider.setValue(round(yy / 3.5))
|
||||||
@@ -534,7 +525,7 @@ def fletch_canvas(self):
|
|||||||
self.rotate_color(selection, last_children)
|
self.rotate_color(selection, last_children)
|
||||||
|
|
||||||
def vertical(self):
|
def vertical(self):
|
||||||
if self.tableWidget.currentItem() != None:
|
if self.tableWidget.currentItem() is not None:
|
||||||
selection_name = (self.tableWidget.currentItem()).text()
|
selection_name = (self.tableWidget.currentItem()).text()
|
||||||
all_children = self.frame.children()
|
all_children = self.frame.children()
|
||||||
selection = 0
|
selection = 0
|
||||||
@@ -542,7 +533,7 @@ def fletch_canvas(self):
|
|||||||
if selection_name == children.objectName():
|
if selection_name == children.objectName():
|
||||||
selection = children
|
selection = children
|
||||||
if selection != 0:
|
if selection != 0:
|
||||||
if self.radioButton.isChecked() == False:
|
if self.radioButton.isChecked() is False:
|
||||||
selection.move(round(self.horizontalSlider.value() * 3.5), round(self.verticalSlider.value() * 3.5))
|
selection.move(round(self.horizontalSlider.value() * 3.5), round(self.verticalSlider.value() * 3.5))
|
||||||
else:
|
else:
|
||||||
selection.resize(round(self.horizontalSlider.value() * 3.5), round(self.verticalSlider.value() * 3.5))
|
selection.resize(round(self.horizontalSlider.value() * 3.5), round(self.verticalSlider.value() * 3.5))
|
||||||
@@ -550,7 +541,7 @@ def fletch_canvas(self):
|
|||||||
self.spinBox_2.setValue(round(self.verticalSlider.value()))
|
self.spinBox_2.setValue(round(self.verticalSlider.value()))
|
||||||
|
|
||||||
def horizontal(self):
|
def horizontal(self):
|
||||||
if self.tableWidget.currentItem() != None:
|
if self.tableWidget.currentItem() is not None:
|
||||||
selection_name = (self.tableWidget.currentItem()).text()
|
selection_name = (self.tableWidget.currentItem()).text()
|
||||||
all_children = self.frame.children()
|
all_children = self.frame.children()
|
||||||
selection = 0
|
selection = 0
|
||||||
@@ -558,10 +549,9 @@ def fletch_canvas(self):
|
|||||||
if selection_name == children.objectName():
|
if selection_name == children.objectName():
|
||||||
selection = children
|
selection = children
|
||||||
if selection != 0:
|
if selection != 0:
|
||||||
if self.radioButton.isChecked() == False:
|
if self.radioButton.isChecked() is False:
|
||||||
selection.move(round(self.horizontalSlider.value() * 3.5), round(self.verticalSlider.value() * 3.5))
|
selection.move(round(self.horizontalSlider.value() * 3.5), round(self.verticalSlider.value() * 3.5))
|
||||||
else:
|
else:
|
||||||
selection.resize(round(self.horizontalSlider.value() * 3.5), round(self.verticalSlider.value() * 3.5))
|
selection.resize(round(self.horizontalSlider.value() * 3.5), round(self.verticalSlider.value() * 3.5))
|
||||||
self.spinBox.setValue(round(self.horizontalSlider.value()))
|
self.spinBox.setValue(round(self.horizontalSlider.value()))
|
||||||
self.spinBox_2.setValue(round(self.verticalSlider.value()))
|
self.spinBox_2.setValue(round(self.verticalSlider.value()))
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,169 @@
|
|||||||
|
|
||||||
|
from qgis.core import (
|
||||||
|
QgsLayoutSize,
|
||||||
|
QgsUnitTypes,
|
||||||
|
QgsLayoutPoint,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def fletch_canvas(self):
|
||||||
|
if self.radioButton_6.isChecked():
|
||||||
|
values_page = 'A4'
|
||||||
|
else:
|
||||||
|
values_page = 'A3'
|
||||||
|
if self.radioButton_7.isChecked():
|
||||||
|
page_rotate = 'Portrait'
|
||||||
|
else:
|
||||||
|
page_rotate = 'Landscape'
|
||||||
|
|
||||||
|
if page_rotate == 'Portrait':
|
||||||
|
if values_page == 'A4':
|
||||||
|
self.template_parameters['Carte_size'] = QgsLayoutSize(200.0, 200, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_locals'] = QgsLayoutPoint(6, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_rotate'] = 0
|
||||||
|
self.template_parameters['Carte_2_size'] = QgsLayoutSize(85.71428571428571, 69, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(209, 3, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_rotate'] = 0
|
||||||
|
self.template_parameters['Legande_size'] = QgsLayoutSize(85.71428571428571, 131, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_locals'] = QgsLayoutPoint(209, 74, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_rotate'] = 0
|
||||||
|
self.template_parameters['Arrow_size'] = QgsLayoutSize(14.285714285714286, 14, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(189, 20, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_rotate'] = 0
|
||||||
|
self.template_parameters['Echelle_size'] = QgsLayoutSize(51.42857142857143, 7, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(9, 197, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_size'] = QgsLayoutSize(45.714285714285715, 11, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_locals'] = QgsLayoutPoint(3, 3, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_rotate'] = 0
|
||||||
|
self.template_parameters['Titre_size'] = QgsLayoutSize(154.28571428571428, 11, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_locals'] = QgsLayoutPoint(51, 3, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_rotate'] = 0
|
||||||
|
self.template_parameters['Credit_size'] = QgsLayoutSize(51.42857142857143, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_locals'] = QgsLayoutPoint(151, 197, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_rotate'] = 0
|
||||||
|
self.template_parameters['Source_size'] = QgsLayoutSize(51.42857142857143, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_locals'] = QgsLayoutPoint(229, 197, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_rotate'] = 0
|
||||||
|
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(125.71428571428571, 14, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(60, 20, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_rotate'] = 0
|
||||||
|
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(51.42857142857143, 13, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(9, 184, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_2_size'] = QgsLayoutSize(28.571428571428573, 29, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(9, 151, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_rotate'] = 0
|
||||||
|
if values_page == 'A3':
|
||||||
|
self.template_parameters['Carte_size'] = QgsLayoutSize(282, 282, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_locals'] = QgsLayoutPoint(8, 8, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_rotate'] = 0
|
||||||
|
self.template_parameters['Carte_2_size'] = QgsLayoutSize(121, 97, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(294, 4, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_rotate'] = 0
|
||||||
|
self.template_parameters['Legande_size'] = QgsLayoutSize(121, 185, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_locals'] = QgsLayoutPoint(294, 105, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_rotate'] = 0
|
||||||
|
self.template_parameters['Arrow_size'] = QgsLayoutSize(20, 20, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(266, 28, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_rotate'] = 0
|
||||||
|
self.template_parameters['Echelle_size'] = QgsLayoutSize(73, 10, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(12, 278, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_size'] = QgsLayoutSize(64, 16, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_locals'] = QgsLayoutPoint(4, 4, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_rotate'] = 0
|
||||||
|
self.template_parameters['Titre_size'] = QgsLayoutSize(218, 16, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_locals'] = QgsLayoutPoint(73, 4, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_rotate'] = 0
|
||||||
|
self.template_parameters['Credit_size'] = QgsLayoutSize(73, 8, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_locals'] = QgsLayoutPoint(214, 278, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_rotate'] = 0
|
||||||
|
self.template_parameters['Source_size'] = QgsLayoutSize(73, 8, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_locals'] = QgsLayoutPoint(322, 278, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_rotate'] = 0
|
||||||
|
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(177, 20, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(85, 28, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_rotate'] = 0
|
||||||
|
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(73, 18, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(12, 260, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_2_size'] = QgsLayoutSize(40, 40, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(12, 214, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_rotate'] = 0
|
||||||
|
if page_rotate == 'Landscape':
|
||||||
|
if values_page == 'A4':
|
||||||
|
self.template_parameters['Carte_size'] = QgsLayoutSize(200.0, 200, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_locals'] = QgsLayoutPoint(6, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_rotate'] = 0
|
||||||
|
self.template_parameters['Carte_2_size'] = QgsLayoutSize(85.71428571428571, 69, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(209, 3, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_rotate'] = 0
|
||||||
|
self.template_parameters['Legande_size'] = QgsLayoutSize(85.71428571428571, 131, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_locals'] = QgsLayoutPoint(209, 74, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_rotate'] = 0
|
||||||
|
self.template_parameters['Arrow_size'] = QgsLayoutSize(14.285714285714286, 14, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(189, 20, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_rotate'] = 0
|
||||||
|
self.template_parameters['Echelle_size'] = QgsLayoutSize(51.42857142857143, 7, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(9, 197, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_size'] = QgsLayoutSize(45.714285714285715, 11, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_locals'] = QgsLayoutPoint(3, 3, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_rotate'] = 0
|
||||||
|
self.template_parameters['Titre_size'] = QgsLayoutSize(154.28571428571428, 11, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_locals'] = QgsLayoutPoint(51, 3, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_rotate'] = 0
|
||||||
|
self.template_parameters['Credit_size'] = QgsLayoutSize(51.42857142857143, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_locals'] = QgsLayoutPoint(151, 197, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_rotate'] = 0
|
||||||
|
self.template_parameters['Source_size'] = QgsLayoutSize(51.42857142857143, 6, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_locals'] = QgsLayoutPoint(229, 197, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_rotate'] = 0
|
||||||
|
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(125.71428571428571, 14, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(60, 20, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_rotate'] = 0
|
||||||
|
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(51.42857142857143, 13, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(9, 184, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_2_size'] = QgsLayoutSize(28.571428571428573, 29, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(9, 151, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_rotate'] = 0
|
||||||
|
if values_page == 'A3':
|
||||||
|
self.template_parameters['Carte_size'] = QgsLayoutSize(282, 282, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_locals'] = QgsLayoutPoint(8, 8, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_rotate'] = 0
|
||||||
|
self.template_parameters['Carte_2_size'] = QgsLayoutSize(121, 97, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_locals'] = QgsLayoutPoint(294, 4, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Carte_2_rotate'] = 0
|
||||||
|
self.template_parameters['Legande_size'] = QgsLayoutSize(121, 185, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_locals'] = QgsLayoutPoint(294, 105, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Legande_rotate'] = 0
|
||||||
|
self.template_parameters['Arrow_size'] = QgsLayoutSize(20, 20, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_locals'] = QgsLayoutPoint(266, 28, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Arrow_rotate'] = 0
|
||||||
|
self.template_parameters['Echelle_size'] = QgsLayoutSize(73, 10, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_locals'] = QgsLayoutPoint(12, 278, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_size'] = QgsLayoutSize(64, 16, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_locals'] = QgsLayoutPoint(4, 4, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_rotate'] = 0
|
||||||
|
self.template_parameters['Titre_size'] = QgsLayoutSize(218, 16, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_locals'] = QgsLayoutPoint(73, 4, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Titre_rotate'] = 0
|
||||||
|
self.template_parameters['Credit_size'] = QgsLayoutSize(73, 8, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_locals'] = QgsLayoutPoint(214, 278, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Credit_rotate'] = 0
|
||||||
|
self.template_parameters['Source_size'] = QgsLayoutSize(73, 8, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_locals'] = QgsLayoutPoint(322, 278, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Source_rotate'] = 0
|
||||||
|
self.template_parameters['Sous_titre_size'] = QgsLayoutSize(177, 20, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_locals'] = QgsLayoutPoint(85, 28, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Sous_titre_rotate'] = 0
|
||||||
|
self.template_parameters['Echelle_2_size'] = QgsLayoutSize(73, 18, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_locals'] = QgsLayoutPoint(12, 260, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Echelle_2_rotate'] = 0
|
||||||
|
self.template_parameters['Logo_2_size'] = QgsLayoutSize(40, 40, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_locals'] = QgsLayoutPoint(12, 214, QgsUnitTypes.LayoutMillimeters)
|
||||||
|
self.template_parameters['Logo_2_rotate'] = 0
|
||||||
|
return self.template_parameters
|
||||||
@@ -5,8 +5,10 @@
|
|||||||
[general]
|
[general]
|
||||||
name=CenRa_PageRender
|
name=CenRa_PageRender
|
||||||
qgisMinimumVersion=3.0
|
qgisMinimumVersion=3.0
|
||||||
|
qgisMaximumVersion=4.99
|
||||||
|
supportsQt6=True
|
||||||
description=CenRa_PageRender
|
description=CenRa_PageRender
|
||||||
version=0.1.6
|
version=0.2.5
|
||||||
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
|
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
|
||||||
email=si_besoin@cen-rhonealpes.fr
|
email=si_besoin@cen-rhonealpes.fr
|
||||||
|
|
||||||
@@ -21,7 +23,7 @@ tracker=https://gitea.cenra-outils.org/api/v1/repos/CEN-RA/Plugin_QGIS/issues
|
|||||||
|
|
||||||
hasProcessingProvider=no
|
hasProcessingProvider=no
|
||||||
# Uncomment the following line and add your changelog:
|
# 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>23/03/2026 - Version 0.2.5: </h3> - Pache mineur.</p></br><p><h3>12/03/2026 - Version 0.2.4: </h3> - qgisMaximumVersion est 4.0.</p></br><p><h3>15/12/2025 - Version 0.2.3: </h3> - nouveau systeme de parametrage.</p></br><p><h3>12/12/2025 - Version 0.2.2: </h3> - bug sur le background.</p></br><p><h3>30/07/2025 - Version 0.2.1: </h3> - Correctife de bug.</p></br><p><h3>19/05/2025 - Version 0.2.0: </h3> - Compatible PyQt5 et PyQt6</p></br><p><h3>03/04/2025 - Version 0.1.6: </h3> - Mise a jour de securite.</p></br><p><h3>07/01/2025 - Version 0.1.5: </h3> - ByPass du certif ssl ci erreur.</br></p><p><h3>14/11/2024 - Version 0.1.4: </h3> - Implementation de la mollet. </br> - Implementation du dragging pour déplacer et modification de la taille </br></p></br><p><h3>08/11/2024 - Version 0.1.3: </h3> - Correctif de bug. </br><p><h3>21/10/2024 - Version 0.1.1: </h3> - Les match en if. </br> - Bouton de scroll et adaptation portrait.</p></br><p><h3>09/10/2024 - Version 0.1.0: </h3> - Création.</p>
|
||||||
|
|
||||||
# Tags are comma separated with spaces allowed
|
# Tags are comma separated with spaces allowed
|
||||||
tags=python
|
tags=python
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
import configparser
|
import configparser
|
||||||
import shutil
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
import base64
|
# import base64
|
||||||
import psycopg2
|
# import psycopg2
|
||||||
import psycopg2.extras
|
# import psycopg2.extras
|
||||||
from os.path import abspath, join, pardir, dirname
|
from os.path import abspath, join, pardir, dirname
|
||||||
from qgis.PyQt.QtWidgets import QApplication
|
from qgis.PyQt.QtWidgets import QApplication
|
||||||
from qgis.PyQt import uic
|
from qgis.PyQt import uic
|
||||||
@@ -107,46 +107,47 @@ def load_ui(*args):
|
|||||||
|
|
||||||
return ui_class
|
return ui_class
|
||||||
|
|
||||||
|
|
||||||
def send_issues(url, titre, body, labels):
|
def send_issues(url, titre, body, labels):
|
||||||
import requests
|
import requests
|
||||||
|
import urllib.request
|
||||||
import json
|
import json
|
||||||
import os
|
# import os
|
||||||
import qgis
|
|
||||||
|
|
||||||
usr = os.environ['USERNAME']
|
# usr = os.environ['USERNAME']
|
||||||
token = '9d0a4e0bea561710e0728f161f7edf4e5201e112'
|
token = '9d0a4e0bea561710e0728f161f7edf4e5201e112'
|
||||||
url = url + '?token=' + token
|
url = url + '?token=' + token
|
||||||
|
|
||||||
headers = {'Authorization': 'token ' + token, 'accept': 'application/json', 'Content-Type': 'application/json'}
|
headers = {'Authorization': 'token ' + token, 'accept': 'application/json', 'Content-Type': 'application/json'}
|
||||||
|
|
||||||
|
|
||||||
payload = {'title': titre, 'body': body, 'labels': labels}
|
payload = {'title': titre, 'body': body, 'labels': labels}
|
||||||
try:
|
try:
|
||||||
urllib.request.urlopen('https://google.com')
|
urllib.request.urlopen('https://google.com')
|
||||||
binar = True
|
binar = True
|
||||||
except:
|
except urllib.requests.URLError:
|
||||||
binar = False
|
binar = False
|
||||||
r = ''
|
r = ''
|
||||||
if binar:
|
if binar:
|
||||||
r = requests.post(url, data=json.dumps(payload), headers=headers)
|
r = requests.post(url, data=json.dumps(payload), headers=headers)
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
|
||||||
def maj_verif(NAME):
|
def maj_verif(NAME):
|
||||||
import qgis
|
import qgis
|
||||||
import urllib.request
|
import urllib.request
|
||||||
iface = qgis.utils.iface
|
iface = qgis.utils.iface
|
||||||
from qgis.core import Qgis
|
from qgis.core import Qgis
|
||||||
|
|
||||||
url = qgis.utils.pluginMetadata(NAME,'repository')
|
# url = qgis.utils.pluginMetadata(NAME, 'repository')
|
||||||
# URL = url+'/raw/branch/main/plugins.xml'
|
# URL = url+'/raw/branch/main/plugins.xml'
|
||||||
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/releases/plugins.xml'
|
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/plugins.xml'
|
||||||
# print(URL)
|
# print(URL)
|
||||||
version = qgis.utils.pluginMetadata(NAME, 'version')
|
version = qgis.utils.pluginMetadata(NAME, 'version')
|
||||||
len_version = len(version)
|
len_version = len(version)
|
||||||
try:
|
try:
|
||||||
urllib.request.urlopen('https://google.com')
|
urllib.request.urlopen('https://google.com')
|
||||||
binar = True
|
binar = True
|
||||||
except:
|
except urllib.error.URLError:
|
||||||
binar = False
|
binar = False
|
||||||
if binar:
|
if binar:
|
||||||
try:
|
try:
|
||||||
@@ -156,14 +157,16 @@ def maj_verif(NAME):
|
|||||||
version_plugin = version_web[valeur_version_web:valeur_version_web + len_version]
|
version_plugin = version_web[valeur_version_web:valeur_version_web + len_version]
|
||||||
if version_plugin != version:
|
if version_plugin != version:
|
||||||
iface.messageBar().pushMessage("MAJ :", "Des mise à jour de plugin sont disponibles.", level=Qgis.Info, duration=30)
|
iface.messageBar().pushMessage("MAJ :", "Des mise à jour de plugin sont disponibles.", level=Qgis.Info, duration=30)
|
||||||
except:
|
except urllib.requests.URLError:
|
||||||
print("error gitea version ssl")
|
print("error gitea version ssl")
|
||||||
else:
|
else:
|
||||||
iface.messageBar().pushMessage("WiFi :", "Pas de connection à internet.", level=Qgis.Warning, duration=30)
|
iface.messageBar().pushMessage("WiFi :", "Pas de connection à internet.", level=Qgis.Warning, duration=30)
|
||||||
|
|
||||||
|
|
||||||
def tr(text, context="@default"):
|
def tr(text, context="@default"):
|
||||||
return QApplication.translate(context, text)
|
return QApplication.translate(context, text)
|
||||||
|
|
||||||
|
|
||||||
def devlog(NAME):
|
def devlog(NAME):
|
||||||
import qgis
|
import qgis
|
||||||
devmaj = '<head><style>* {margin:0; padding:0; }</style></head>'
|
devmaj = '<head><style>* {margin:0; padding:0; }</style></head>'
|
||||||
|
|||||||
@@ -118,12 +118,6 @@
|
|||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">QFrame#frame{background-color: rgb(255, 255, 255, 170);}</string>
|
<string notr="true">QFrame#frame{background-color: rgb(255, 255, 255, 170);}</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShape">
|
|
||||||
<enum>QFrame::StyledPanel</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Raised</enum>
|
|
||||||
</property>
|
|
||||||
<widget class="QLabel" name="Carte">
|
<widget class="QLabel" name="Carte">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
@@ -133,27 +127,15 @@
|
|||||||
<height>700</height>
|
<height>700</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="autoFillBackground">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">background-color: rgb(10, 10, 10, 50)</string>
|
<string notr="true">background-color: rgba(10, 10, 10, 50)</string>
|
||||||
</property>
|
|
||||||
<property name="frameShape">
|
|
||||||
<enum>QFrame::NoFrame</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Plain</enum>
|
|
||||||
</property>
|
|
||||||
<property name="lineWidth">
|
|
||||||
<number>5</number>
|
|
||||||
</property>
|
|
||||||
<property name="midLineWidth">
|
|
||||||
<number>2</number>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
<property name="margin">
|
<property name="margin">
|
||||||
<number>5</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
@@ -167,11 +149,11 @@
|
|||||||
<height>240</height>
|
<height>240</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="autoFillBackground">
|
||||||
<string notr="true">background-color: rgb(10, 10, 10, 50)</string>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShadow">
|
<property name="styleSheet">
|
||||||
<enum>QFrame::Plain</enum>
|
<string notr="true">background-color: rgba(10, 10, 10, 50)</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
@@ -186,8 +168,11 @@
|
|||||||
<height>460</height>
|
<height>460</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="autoFillBackground">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">background-color: rgb(10, 10, 10, 50)</string>
|
<string notr="true">background-color: rgba(10, 10, 10, 50)</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
@@ -202,8 +187,11 @@
|
|||||||
<height>50</height>
|
<height>50</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="autoFillBackground">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">background-color: rgb(10, 10, 10, 50)</string>
|
<string notr="true">background-color: rgba(10, 10, 10, 50)</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
@@ -218,8 +206,11 @@
|
|||||||
<height>25</height>
|
<height>25</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="autoFillBackground">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">background-color: rgb(10, 10, 10, 50)</string>
|
<string notr="true">background-color: rgba(10, 10, 10, 50)</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
@@ -234,8 +225,11 @@
|
|||||||
<height>40</height>
|
<height>40</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="autoFillBackground">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">background-color: rgb(10, 10, 10, 50)</string>
|
<string notr="true">background-color: rgba(10, 10, 10, 50)</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
@@ -257,19 +251,7 @@
|
|||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">background-color: rgb(10, 10, 10, 50)</string>
|
<string notr="true">background-color: rgba(10, 10, 10, 50)</string>
|
||||||
</property>
|
|
||||||
<property name="frameShape">
|
|
||||||
<enum>QFrame::NoFrame</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Raised</enum>
|
|
||||||
</property>
|
|
||||||
<property name="lineWidth">
|
|
||||||
<number>-1</number>
|
|
||||||
</property>
|
|
||||||
<property name="midLineWidth">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
@@ -277,9 +259,6 @@
|
|||||||
<property name="scaledContents">
|
<property name="scaledContents">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
<property name="wordWrap">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
@@ -299,8 +278,11 @@
|
|||||||
<height>20</height>
|
<height>20</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="autoFillBackground">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">background-color: rgb(10, 10, 10, 50)</string>
|
<string notr="true">background-color: rgba(10, 10, 10, 50)</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
@@ -315,8 +297,11 @@
|
|||||||
<height>20</height>
|
<height>20</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="autoFillBackground">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">background-color: rgb(10, 10, 10, 50)</string>
|
<string notr="true">background-color: rgba(10, 10, 10, 50)</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
@@ -338,19 +323,7 @@
|
|||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">background-color: rgb(10, 10, 10, 50)</string>
|
<string notr="true">background-color: rgba(10, 10, 10, 50)</string>
|
||||||
</property>
|
|
||||||
<property name="frameShape">
|
|
||||||
<enum>QFrame::NoFrame</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Raised</enum>
|
|
||||||
</property>
|
|
||||||
<property name="lineWidth">
|
|
||||||
<number>-1</number>
|
|
||||||
</property>
|
|
||||||
<property name="midLineWidth">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
@@ -358,9 +331,6 @@
|
|||||||
<property name="scaledContents">
|
<property name="scaledContents">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
<property name="wordWrap">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
@@ -380,8 +350,11 @@
|
|||||||
<height>45</height>
|
<height>45</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="autoFillBackground">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">background-color: rgb(10, 10, 10, 50)</string>
|
<string notr="true">background-color: rgba(10, 10, 10, 50)</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
@@ -396,8 +369,11 @@
|
|||||||
<height>100</height>
|
<height>100</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="autoFillBackground">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">background-color: rgb(10, 10, 10, 50)</string>
|
<string notr="true">background-color: rgba(10, 10, 10, 50)</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
@@ -416,29 +392,23 @@
|
|||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">QFrame#frame_2{background-color: rgb(255, 255, 255, 170);}</string>
|
<string notr="true">QFrame#frame_2{background-color: rgb(255, 255, 255, 170);}</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShape">
|
|
||||||
<enum>QFrame::StyledPanel</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Raised</enum>
|
|
||||||
</property>
|
|
||||||
<widget class="QTableWidget" name="tableWidget">
|
<widget class="QTableWidget" name="tableWidget">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>10</y>
|
<y>10</y>
|
||||||
<width>161</width>
|
<width>161</width>
|
||||||
<height>641</height>
|
<height>381</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="midLineWidth">
|
<property name="midLineWidth">
|
||||||
<number>1</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="horizontalScrollBarPolicy">
|
<property name="horizontalScrollBarPolicy">
|
||||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
<enum>Qt::ScrollBarAsNeeded</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeAdjustPolicy">
|
<property name="sizeAdjustPolicy">
|
||||||
<enum>QAbstractScrollArea::AdjustToContentsOnFirstShow</enum>
|
<enum>QAbstractScrollArea::AdjustIgnored</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="editTriggers">
|
<property name="editTriggers">
|
||||||
<set>QAbstractItemView::NoEditTriggers</set>
|
<set>QAbstractItemView::NoEditTriggers</set>
|
||||||
@@ -462,10 +432,10 @@
|
|||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="selectionMode">
|
<property name="selectionMode">
|
||||||
<enum>QAbstractItemView::SingleSelection</enum>
|
<enum>QAbstractItemView::NoSelection</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="selectionBehavior">
|
<property name="selectionBehavior">
|
||||||
<enum>QAbstractItemView::SelectRows</enum>
|
<enum>QAbstractItemView::SelectItems</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="iconSize">
|
<property name="iconSize">
|
||||||
<size>
|
<size>
|
||||||
@@ -474,7 +444,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="textElideMode">
|
<property name="textElideMode">
|
||||||
<enum>Qt::ElideMiddle</enum>
|
<enum>Qt::ElideLeft</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="showGrid">
|
<property name="showGrid">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@@ -535,7 +505,7 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
<y>650</y>
|
<y>660</y>
|
||||||
<width>161</width>
|
<width>161</width>
|
||||||
<height>21</height>
|
<height>21</height>
|
||||||
</rect>
|
</rect>
|
||||||
@@ -544,6 +514,117 @@
|
|||||||
<string>Load</string>
|
<string>Load</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QTableWidget" name="tableWidget_2">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>400</y>
|
||||||
|
<width>161</width>
|
||||||
|
<height>241</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="lineWidth">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="midLineWidth">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="horizontalScrollBarPolicy">
|
||||||
|
<enum>Qt::ScrollBarAsNeeded</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeAdjustPolicy">
|
||||||
|
<enum>QAbstractScrollArea::AdjustIgnored</enum>
|
||||||
|
</property>
|
||||||
|
<property name="editTriggers">
|
||||||
|
<set>QAbstractItemView::NoEditTriggers</set>
|
||||||
|
</property>
|
||||||
|
<property name="tabKeyNavigation">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="dragEnabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="dragDropOverwriteMode">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="dragDropMode">
|
||||||
|
<enum>QAbstractItemView::NoDragDrop</enum>
|
||||||
|
</property>
|
||||||
|
<property name="defaultDropAction">
|
||||||
|
<enum>Qt::IgnoreAction</enum>
|
||||||
|
</property>
|
||||||
|
<property name="alternatingRowColors">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="selectionMode">
|
||||||
|
<enum>QAbstractItemView::NoSelection</enum>
|
||||||
|
</property>
|
||||||
|
<property name="selectionBehavior">
|
||||||
|
<enum>QAbstractItemView::SelectItems</enum>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>5</width>
|
||||||
|
<height>5</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="textElideMode">
|
||||||
|
<enum>Qt::ElideLeft</enum>
|
||||||
|
</property>
|
||||||
|
<property name="showGrid">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="cornerButtonEnabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="rowCount">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<property name="columnCount">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<attribute name="horizontalHeaderVisible">
|
||||||
|
<bool>false</bool>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="horizontalHeaderMinimumSectionSize">
|
||||||
|
<number>50</number>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="horizontalHeaderDefaultSectionSize">
|
||||||
|
<number>78</number>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="horizontalHeaderHighlightSections">
|
||||||
|
<bool>true</bool>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="verticalHeaderVisible">
|
||||||
|
<bool>false</bool>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="verticalHeaderMinimumSectionSize">
|
||||||
|
<number>20</number>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="verticalHeaderDefaultSectionSize">
|
||||||
|
<number>30</number>
|
||||||
|
</attribute>
|
||||||
|
<row/>
|
||||||
|
<row/>
|
||||||
|
<row/>
|
||||||
|
<column/>
|
||||||
|
<column/>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<property name="text">
|
||||||
|
<string>frame</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<property name="text">
|
||||||
|
<string>background</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<property name="text">
|
||||||
|
<string>path</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QRadioButton" name="radioButton">
|
<widget class="QRadioButton" name="radioButton">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
@@ -595,12 +676,12 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>240</x>
|
<x>240</x>
|
||||||
<y>10</y>
|
<y>10</y>
|
||||||
<width>61</width>
|
<width>88</width>
|
||||||
<height>22</height>
|
<height>22</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="buttonSymbols">
|
<property name="buttonSymbols">
|
||||||
<enum>QAbstractSpinBox::NoButtons</enum>
|
<enum>QAbstractSpinBox::UpDownArrows</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string/>
|
<string/>
|
||||||
@@ -617,12 +698,12 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>310</x>
|
<x>310</x>
|
||||||
<y>10</y>
|
<y>10</y>
|
||||||
<width>61</width>
|
<width>88</width>
|
||||||
<height>22</height>
|
<height>22</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="buttonSymbols">
|
<property name="buttonSymbols">
|
||||||
<enum>QAbstractSpinBox::NoButtons</enum>
|
<enum>QAbstractSpinBox::UpDownArrows</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string/>
|
<string/>
|
||||||
@@ -671,9 +752,6 @@
|
|||||||
<property name="value">
|
<property name="value">
|
||||||
<number>40</number>
|
<number>40</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="invertedAppearance">
|
<property name="invertedAppearance">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>CenRa_Metabase_editorwidget_base</class>
|
<class>CenRa_Metabase_editorwidget_base</class>
|
||||||
<widget class="QDialog" name="CenRa_Metabase_editorwidget_base">
|
<widget class="QDialog" name="CenRa_about_base">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
@@ -13,10 +13,6 @@
|
|||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Journal des modifications</string>
|
<string>Journal des modifications</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
|
||||||
<iconset>
|
|
||||||
<normaloff>../../CenRa_Metabase/tools/ui/icon.svg</normaloff>../../CenRa_Metabase/tools/ui/icon.svg</iconset>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QScrollArea" name="scrollArea">
|
<widget class="QScrollArea" name="scrollArea">
|
||||||
@@ -29,9 +25,6 @@
|
|||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::NoFrame</enum>
|
<enum>QFrame::NoFrame</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Plain</enum>
|
|
||||||
</property>
|
|
||||||
<property name="widgetResizable">
|
<property name="widgetResizable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@@ -56,7 +49,7 @@
|
|||||||
<property name="title">
|
<property name="title">
|
||||||
<string>DevLog</string>
|
<string>DevLog</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWebView" name="viewer" native="true">
|
<widget class="QTextBrowser" name="viewer">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
@@ -65,11 +58,6 @@
|
|||||||
<height>511</height>
|
<height>511</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="url" stdset="0">
|
|
||||||
<url>
|
|
||||||
<string>about:blank</string>
|
|
||||||
</url>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -78,19 +66,12 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="standardButtons">
|
<property name="standardButtons">
|
||||||
<set>QDialogButtonBox::Ok</set>
|
<set>QDialogButtonBox::Close|QDialogButtonBox::Ok</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
|
||||||
<customwidget>
|
|
||||||
<class>QWebView</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header location="global">QtWebKitWidgets/QWebView</header>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ __email__ = "info@3liz.org"
|
|||||||
|
|
||||||
|
|
||||||
from qgis.core import QgsApplication
|
from qgis.core import QgsApplication
|
||||||
from qgis.PyQt.QtCore import QCoreApplication, Qt, QTranslator, QUrl
|
from qgis.PyQt.QtCore import QUrl
|
||||||
from qgis.PyQt.QtGui import QDesktopServices, QIcon
|
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
|
from qgis.utils import iface
|
||||||
import qgis
|
import qgis
|
||||||
|
|
||||||
@@ -15,23 +15,26 @@ import qgis
|
|||||||
|
|
||||||
import socket
|
import socket
|
||||||
import os
|
import os
|
||||||
|
from qgis.PyQt.QtCore import QSettings
|
||||||
|
from .about_form import AboutDialog
|
||||||
from .tools.resources import (
|
from .tools.resources import (
|
||||||
plugin_path,
|
# plugin_path,
|
||||||
pyperclip,
|
pyperclip,
|
||||||
resources_path,
|
resources_path,
|
||||||
maj_verif,
|
maj_verif,
|
||||||
)
|
)
|
||||||
pyperclip()
|
pyperclip()
|
||||||
|
|
||||||
|
try:
|
||||||
from .postgis_editor import Postgis_Editor
|
from .postgis_editor import Postgis_Editor
|
||||||
from .postgis_creator import Postgis_Creator
|
from .postgis_creator import Postgis_Creator
|
||||||
from .postgis_rename import Postgis_Rename
|
from .postgis_rename import Postgis_Rename
|
||||||
from .about_form import AboutDialog
|
except NameError:
|
||||||
|
print('Module introuvable...')
|
||||||
from PyQt5.QtCore import *
|
|
||||||
|
|
||||||
IPAddr = socket.gethostbyname(socket.gethostname())
|
IPAddr = socket.gethostbyname(socket.gethostname())
|
||||||
|
|
||||||
|
|
||||||
class PgPostgis:
|
class PgPostgis:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
""" Constructor. """
|
""" Constructor. """
|
||||||
@@ -80,11 +83,7 @@ class PgPostgis:
|
|||||||
self.postgis_creator.triggered.connect(self.open_creator)
|
self.postgis_creator.triggered.connect(self.open_creator)
|
||||||
|
|
||||||
self.postgis_creator.setEnabled(False)
|
self.postgis_creator.setEnabled(False)
|
||||||
if IPAddr[0:11] == "100.100.100":
|
if os.access('N:/', os.R_OK):
|
||||||
self.postgis_creator.setEnabled(True)
|
|
||||||
elif IPAddr[0:9] == "192.168.0":
|
|
||||||
self.postgis_creator.setEnabled(True)
|
|
||||||
elif IPAddr[0:9] == "192.168.1":
|
|
||||||
self.postgis_creator.setEnabled(True)
|
self.postgis_creator.setEnabled(True)
|
||||||
|
|
||||||
if not self.action_editor:
|
if not self.action_editor:
|
||||||
@@ -95,11 +94,7 @@ class PgPostgis:
|
|||||||
self.postgis_editor.triggered.connect(self.open_editor)
|
self.postgis_editor.triggered.connect(self.open_editor)
|
||||||
|
|
||||||
self.postgis_editor.setEnabled(False)
|
self.postgis_editor.setEnabled(False)
|
||||||
if IPAddr[0:11] == "100.100.100":
|
if os.access('N:/', os.R_OK):
|
||||||
self.postgis_editor.setEnabled(True)
|
|
||||||
elif IPAddr[0:9] == "192.168.0":
|
|
||||||
self.postgis_editor.setEnabled(True)
|
|
||||||
elif IPAddr[0:9] == "192.168.1":
|
|
||||||
self.postgis_editor.setEnabled(True)
|
self.postgis_editor.setEnabled(True)
|
||||||
|
|
||||||
if not self.action_rename:
|
if not self.action_rename:
|
||||||
@@ -108,30 +103,21 @@ class PgPostgis:
|
|||||||
self.postgis_rename = QAction(icon3, 'dossier_rename', None)
|
self.postgis_rename = QAction(icon3, 'dossier_rename', None)
|
||||||
self.toolBar.addAction(self.postgis_rename)
|
self.toolBar.addAction(self.postgis_rename)
|
||||||
self.postgis_rename.triggered.connect(self.open_rename)
|
self.postgis_rename.triggered.connect(self.open_rename)
|
||||||
|
|
||||||
if os.environ['USERNAME'] == 'tlaveille' or os.environ['USERNAME'] == 'lpoulin' or os.environ['USERNAME'] == 'rclement':
|
|
||||||
self.action_rename.setEnabled(True)
|
|
||||||
self.postgis_rename.setEnabled(True)
|
|
||||||
self.postgis_rename.setVisible(1)
|
|
||||||
else:
|
|
||||||
self.action_rename.setEnabled(False)
|
|
||||||
self.postgis_rename.setEnabled(False)
|
self.postgis_rename.setEnabled(False)
|
||||||
self.postgis_rename.setVisible(0)
|
self.postgis_rename.setVisible(0)
|
||||||
|
|
||||||
self.postgis_rename.setEnabled(False)
|
if os.environ['USERNAME'] == 'tlaveille' or os.environ['USERNAME'] == 'lpoulin' or os.environ['USERNAME'] == 'rclement':
|
||||||
if IPAddr[0:11] == "100.100.100":
|
if os.access('N:/', os.R_OK):
|
||||||
self.postgis_rename.setEnabled(True)
|
|
||||||
elif IPAddr[0:9] == "192.168.0":
|
|
||||||
self.postgis_rename.setEnabled(True)
|
|
||||||
elif IPAddr[0:9] == "192.168.1":
|
|
||||||
self.postgis_rename.setEnabled(True)
|
self.postgis_rename.setEnabled(True)
|
||||||
|
self.postgis_rename.setVisible(1)
|
||||||
|
|
||||||
def open_about_dialog(self):
|
def open_about_dialog(self):
|
||||||
"""
|
"""
|
||||||
About dialog
|
About dialog
|
||||||
"""
|
"""
|
||||||
dialog = AboutDialog(iface)
|
dialog = AboutDialog(iface)
|
||||||
dialog.exec_()
|
dialog.exec()
|
||||||
|
|
||||||
def open_help():
|
def open_help():
|
||||||
""" Open the online help. """
|
""" Open the online help. """
|
||||||
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
|
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import os.path
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from qgis.PyQt import uic
|
from qgis.PyQt import uic
|
||||||
from qgis.PyQt.QtGui import QPixmap
|
# from qgis.PyQt.QtGui import QPixmap
|
||||||
from qgis.PyQt.QtWidgets import QDialog
|
from qgis.PyQt.QtWidgets import QDialog
|
||||||
|
|
||||||
from .tools.resources import devlog
|
from .tools.resources import devlog
|
||||||
|
|||||||
@@ -11,8 +11,10 @@
|
|||||||
[general]
|
[general]
|
||||||
name=CenRa_POSTGIS
|
name=CenRa_POSTGIS
|
||||||
qgisMinimumVersion=3.0
|
qgisMinimumVersion=3.0
|
||||||
|
qgisMaximumVersion=4.99
|
||||||
|
supportsQt6=True
|
||||||
description=Permet de crée un dossier dans la base PostGis
|
description=Permet de crée un dossier dans la base PostGis
|
||||||
version=2.7
|
version=3.4
|
||||||
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
|
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
|
||||||
email=si_besoin@cen-rhonealpes.fr
|
email=si_besoin@cen-rhonealpes.fr
|
||||||
|
|
||||||
@@ -21,7 +23,7 @@ email=si_besoin@cen-rhonealpes.fr
|
|||||||
# Optional items:
|
# Optional items:
|
||||||
|
|
||||||
# Uncomment the following line and add your changelog entries:
|
# 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>21/05/2026 - Version 3.4: </h3> - Optimisation des performances hors connexion.</p></br><p><h3>23/03/2026 - Version 3.3: </h3> - Optimisation pour QGIS.</p></br><p><h3>12/03/2026 - Version 3.2: </h3> - qgisMaximumVersion est 4.0.</p></br><p><h3>30/07/2025 - Version 3.1: </h3> - Correctife de bug.</p></br><p><h3>19/05/2025 - Version 3.0: </h3> - Compatible PyQt5 et PyQt6</p></br><p><h3>09/04/2025 - Version 2.9: </h3> - Correctif bug en TT.</p></br><p><h3>09/04/2025 - Version 2.8: </h3> - Optimisation pour le TT.</p></br><p><h3>03/04/2025 - Version 2.7: </h3> - Mise a jour de securite.</p></br><p><h3>12/02/2025 - Version 2.6: </h3> - InDev:renomé les schema et table.</p></br><p><h3>04/02/2025 - Version 2.5: </h3> - Correctif bug création de couche.</p></br><p><h3>23/01/2025 - Version 2.4: </h3> - Correctif sur les pkey.</p></br><p><h3>22/01/2025 - Version 2.3: </h3> - Correctif sur la creation de projet.</p></br><p><h3>21/01/2025 - Version 2.2: </h3> - Correctif sur la longeur des nom.</p></br><p><h3>07/01/2025 - Version 2.1: </h3> - ByPass du certif ssl ci erreur.</p></br><p><h3>22/10/2024 - Version 2.0:</h3>- Refont du code.</p>
|
||||||
|
|
||||||
# tags are comma separated with spaces allowed
|
# tags are comma separated with spaces allowed
|
||||||
tags=cenra, postgis, database
|
tags=cenra, postgis, database
|
||||||
|
|||||||
@@ -2,44 +2,51 @@
|
|||||||
|
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
# Import the PyQt and QGIS libraries
|
# Import the PyQt and QGIS libraries
|
||||||
from builtins import next
|
# from builtins import next
|
||||||
from builtins import str
|
# from builtins import str
|
||||||
from builtins import object
|
# from builtins import object
|
||||||
import qgis
|
import os
|
||||||
from qgis.PyQt.QtCore import QSettings
|
from qgis.PyQt.QtCore import QSettings
|
||||||
from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog,QMessageBox
|
from qgis.PyQt.QtWidgets import QDialog, QMessageBox
|
||||||
from qgis.PyQt.QtGui import QIcon
|
# 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.PyQt.QtGui import *
|
||||||
|
from qgis.PyQt import QtGui
|
||||||
|
|
||||||
|
# from qgis.core import *
|
||||||
|
from qgis.core import QgsSettings, Qgis
|
||||||
|
|
||||||
|
try:
|
||||||
|
if os.path.exists('N:'):
|
||||||
from .tools.PythonSQL import login_base
|
from .tools.PythonSQL import login_base
|
||||||
from .tools.SQLRequet import *
|
except ValueError:
|
||||||
|
print('Pas de fichier PythonSQL')
|
||||||
|
|
||||||
|
# from .tools.SQLRequet import *
|
||||||
|
|
||||||
from .tools.resources import (
|
from .tools.resources import (
|
||||||
load_ui,
|
load_ui,
|
||||||
resources_path,
|
resources_path,
|
||||||
send_issues,
|
# send_issues,
|
||||||
create_vierge,
|
create_vierge,
|
||||||
create_contour,
|
create_contour,
|
||||||
create_travaux,
|
create_travaux,
|
||||||
create_habita
|
create_habita
|
||||||
)
|
)
|
||||||
from .issues import CenRa_Issues
|
# from .issues import CenRa_Issues
|
||||||
|
|
||||||
from qgis.utils import iface
|
from qgis.utils import iface
|
||||||
import os.path
|
# import os.path
|
||||||
import webbrowser, os
|
# import webbrowser, os
|
||||||
import psycopg2
|
# import psycopg2
|
||||||
import psycopg2.extras
|
# import psycopg2.extras
|
||||||
import base64
|
# import base64
|
||||||
|
|
||||||
EDITOR_CLASS = load_ui('CenRa_Postgis_base.ui')
|
EDITOR_CLASS = load_ui('CenRa_Postgis_base.ui')
|
||||||
|
|
||||||
class Postgis_Creator(QDialog, EDITOR_CLASS):
|
|
||||||
|
|
||||||
|
class Postgis_Creator(QDialog, EDITOR_CLASS):
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
_ = parent
|
_ = parent
|
||||||
super().__init__()
|
super().__init__()
|
||||||
@@ -55,17 +62,17 @@ class Postgis_Creator(QDialog, EDITOR_CLASS):
|
|||||||
# show the dialog
|
# show the dialog
|
||||||
self.show()
|
self.show()
|
||||||
# Run the dialog event loop
|
# Run the dialog event loop
|
||||||
result = self.exec_()
|
result = self.exec()
|
||||||
# See if OK was pressed
|
# See if OK was pressed
|
||||||
if result == 1:
|
if result == 1:
|
||||||
|
|
||||||
# **********************************Debut_script****************************************
|
# **********************************Debut_script****************************************
|
||||||
|
# Creation du schema pour le nouveau site
|
||||||
### Creation du schema pour le nouveau site
|
|
||||||
if self.at.isChecked():
|
if self.at.isChecked():
|
||||||
schema = "_" + self.dept.currentText() + "_at_" + self.nom.text().lower() # Ajout de "_" pour eviter pb de numero en premier caractere
|
# Ajout de "_" pour eviter pb de numero en premier caractere
|
||||||
|
schema = "_" + self.dept.currentText() + "_at_" + self.nom.text().lower()
|
||||||
else:
|
else:
|
||||||
schema = "_" + self.dept.currentText() + "_" + self.nom.text().lower() # Ajout de "_" pour eviter pb de numero en premier caractere
|
# Ajout de "_" pour eviter pb de numero en premier caractere
|
||||||
|
schema = "_" + self.dept.currentText() + "_" + self.nom.text().lower()
|
||||||
|
|
||||||
if self.nom.text() == "" or self.nom.text() == "NULL":
|
if self.nom.text() == "" or self.nom.text() == "NULL":
|
||||||
QMessageBox.warning(None, "Oups :", "Veuillez renseigner un nom de dossier.")
|
QMessageBox.warning(None, "Oups :", "Veuillez renseigner un nom de dossier.")
|
||||||
@@ -99,6 +106,5 @@ class Postgis_Creator(QDialog, EDITOR_CLASS):
|
|||||||
create_travaux(self, schema, cur, con, host, port, dbname, user, mdp)
|
create_travaux(self, schema, cur, con, host, port, dbname, user, mdp)
|
||||||
create_vierge(self, schema, cur, con, host, port, dbname, user, mdp)
|
create_vierge(self, schema, cur, con, host, port, dbname, user, mdp)
|
||||||
|
|
||||||
|
|
||||||
con.close()
|
con.close()
|
||||||
pass
|
pass
|
||||||
@@ -4,42 +4,46 @@ from __future__ import absolute_import
|
|||||||
# Import the PyQt and QGIS libraries
|
# Import the PyQt and QGIS libraries
|
||||||
from builtins import next
|
from builtins import next
|
||||||
from builtins import str
|
from builtins import str
|
||||||
from builtins import object
|
import os
|
||||||
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.core import *
|
|
||||||
from qgis.core import QgsDataSourceUri
|
|
||||||
|
|
||||||
|
from qgis.PyQt.QtCore import QSettings
|
||||||
|
from qgis.PyQt.QtWidgets import QDialog, QMessageBox
|
||||||
|
# from qgis.PyQt.QtGui import QIcon
|
||||||
|
|
||||||
|
from qgis.PyQt import QtGui
|
||||||
|
|
||||||
|
# from qgis.core import *
|
||||||
|
from qgis.core import QgsSettings
|
||||||
|
|
||||||
|
try:
|
||||||
|
if os.path.exists('N:'):
|
||||||
from .tools.PythonSQL import login_base
|
from .tools.PythonSQL import login_base
|
||||||
from .tools.SQLRequet import *
|
except ValueError:
|
||||||
|
print('Pas de fichier PythonSQL')
|
||||||
|
# from .tools.SQLRequet import *
|
||||||
|
|
||||||
from .tools.resources import (
|
from .tools.resources import (
|
||||||
load_ui,
|
load_ui,
|
||||||
resources_path,
|
resources_path,
|
||||||
send_issues,
|
# send_issues,
|
||||||
create_vierge,
|
create_vierge,
|
||||||
create_contour,
|
create_contour,
|
||||||
create_travaux,
|
create_travaux,
|
||||||
create_habita
|
create_habita
|
||||||
)
|
)
|
||||||
from .issues import CenRa_Issues
|
# from .issues import CenRa_Issues
|
||||||
|
|
||||||
import os.path
|
# import os.path
|
||||||
import webbrowser, os
|
# import webbrowser
|
||||||
import psycopg2
|
# import psycopg2
|
||||||
import psycopg2.extras
|
# import psycopg2.extras
|
||||||
import base64
|
# import base64
|
||||||
from qgis.utils import iface
|
from qgis.utils import iface
|
||||||
|
|
||||||
EDITOR_CLASS = load_ui('CenRa_PostgisTable_base.ui')
|
EDITOR_CLASS = load_ui('CenRa_PostgisTable_base.ui')
|
||||||
|
|
||||||
class Postgis_Editor(QDialog, EDITOR_CLASS):
|
|
||||||
|
|
||||||
|
class Postgis_Editor(QDialog, EDITOR_CLASS):
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
_ = parent
|
_ = parent
|
||||||
super().__init__()
|
super().__init__()
|
||||||
@@ -49,7 +53,7 @@ class Postgis_Editor(QDialog, EDITOR_CLASS):
|
|||||||
self.setWindowIcon(QtGui.QIcon(resources_path('icons', 'icon.png')))
|
self.setWindowIcon(QtGui.QIcon(resources_path('icons', 'icon.png')))
|
||||||
self.iface = iface
|
self.iface = iface
|
||||||
|
|
||||||
### Outil Ajout de nouvelles couche a un dossier
|
# Outil Ajout de nouvelles couche a un dossier
|
||||||
def raise_(self):
|
def raise_(self):
|
||||||
self.activateWindow()
|
self.activateWindow()
|
||||||
account = login_base("account")
|
account = login_base("account")
|
||||||
@@ -66,7 +70,6 @@ class Postgis_Editor(QDialog, EDITOR_CLASS):
|
|||||||
where schemaname ~ E'^_(0|1|2|3|4|6|7|f)'
|
where schemaname ~ E'^_(0|1|2|3|4|6|7|f)'
|
||||||
group by schemaname
|
group by schemaname
|
||||||
order by schemaname)
|
order by schemaname)
|
||||||
|
|
||||||
select string_agg(schemaname,',')
|
select string_agg(schemaname,',')
|
||||||
from list_schema
|
from list_schema
|
||||||
group by "group";"""
|
group by "group";"""
|
||||||
@@ -81,12 +84,13 @@ class Postgis_Editor(QDialog, EDITOR_CLASS):
|
|||||||
|
|
||||||
self.schema.clear()
|
self.schema.clear()
|
||||||
self.schema.addItems(listItems)
|
self.schema.addItems(listItems)
|
||||||
self.schema.setCurrentIndex(-1) # Pour ne pas commencer la liste au premier schema
|
# Pour ne pas commencer la liste au premier schema
|
||||||
|
self.schema.setCurrentIndex(-1)
|
||||||
|
|
||||||
# show the dialog
|
# show the dialog
|
||||||
self.show()
|
self.show()
|
||||||
# Run the dialog event loop
|
# Run the dialog event loop
|
||||||
result = self.exec_()
|
result = self.exec()
|
||||||
# See if OK was pressed
|
# See if OK was pressed
|
||||||
if result == 1:
|
if result == 1:
|
||||||
# ******************************debut script*********************************
|
# ******************************debut script*********************************
|
||||||
|
|||||||
@@ -2,38 +2,40 @@
|
|||||||
|
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
# Import the PyQt and QGIS libraries
|
# Import the PyQt and QGIS libraries
|
||||||
from builtins import next
|
# from builtins import next
|
||||||
from builtins import str
|
from builtins import str
|
||||||
from builtins import object
|
# from builtins import object
|
||||||
import qgis
|
import os
|
||||||
from qgis.PyQt.QtCore import QSettings
|
from qgis.PyQt.QtCore import QSettings
|
||||||
from qgis.PyQt.QtWidgets import QAction, QMenu, QDialog, QMessageBox,QDialogButtonBox
|
from qgis.PyQt.QtWidgets import QDialog, QMessageBox, QDialogButtonBox
|
||||||
from qgis.PyQt.QtGui import QIcon
|
# 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.PyQt.QtGui import *
|
||||||
|
from qgis.PyQt import QtGui
|
||||||
|
|
||||||
|
# from qgis.core import *
|
||||||
|
from qgis.core import QgsSettings, QgsDataSourceUri, QgsProject
|
||||||
|
|
||||||
|
try:
|
||||||
|
if os.path.exists('N:'):
|
||||||
from .tools.PythonSQL import login_base
|
from .tools.PythonSQL import login_base
|
||||||
from .tools.SQLRequet import *
|
except ValueError:
|
||||||
|
print('Pas de fichier PythonSQL')
|
||||||
|
# from .tools.SQLRequet import *
|
||||||
|
|
||||||
from .tools.resources import (
|
from .tools.resources import (
|
||||||
load_ui,
|
load_ui,
|
||||||
resources_path,
|
resources_path,
|
||||||
send_issues,
|
# send_issues,
|
||||||
create_vierge,
|
|
||||||
create_contour,
|
|
||||||
create_travaux,
|
|
||||||
create_habita
|
|
||||||
)
|
)
|
||||||
from .issues import CenRa_Issues
|
# from .issues import CenRa_Issues
|
||||||
|
|
||||||
import os.path
|
# import os.path
|
||||||
import webbrowser, os
|
# import webbrowser
|
||||||
import psycopg2
|
# import psycopg2
|
||||||
import psycopg2.extras
|
# import psycopg2.extras
|
||||||
import base64
|
# import base64
|
||||||
from qgis.utils import iface
|
from qgis.utils import iface
|
||||||
|
|
||||||
EDITOR_CLASS = load_ui('CenRa_PostgisRename_base.ui')
|
EDITOR_CLASS = load_ui('CenRa_PostgisRename_base.ui')
|
||||||
@@ -47,10 +49,11 @@ try:
|
|||||||
dbname = account[4]
|
dbname = account[4]
|
||||||
cur = account[7]
|
cur = account[7]
|
||||||
con = account[8]
|
con = account[8]
|
||||||
except:
|
except NameError:
|
||||||
print('')
|
print('Fails to login DB for account')
|
||||||
class Postgis_Rename(QDialog, EDITOR_CLASS):
|
|
||||||
|
|
||||||
|
|
||||||
|
class Postgis_Rename(QDialog, EDITOR_CLASS):
|
||||||
def __init__(self, parent=None):
|
def __init__(self, parent=None):
|
||||||
_ = parent
|
_ = parent
|
||||||
super().__init__()
|
super().__init__()
|
||||||
@@ -62,11 +65,12 @@ class Postgis_Rename(QDialog, EDITOR_CLASS):
|
|||||||
|
|
||||||
self.schema.currentIndexChanged.connect(self.Test)
|
self.schema.currentIndexChanged.connect(self.Test)
|
||||||
self.buttonBox.accepted.connect(self.msgBox)
|
self.buttonBox.accepted.connect(self.msgBox)
|
||||||
### Outil Ajout de nouvelles couche a un dossier
|
# Outil Ajout de nouvelles couche a un dossier
|
||||||
|
|
||||||
def raise_(self):
|
def raise_(self):
|
||||||
self.activateWindow()
|
self.activateWindow()
|
||||||
self.groupBox_3.hide()
|
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;"""
|
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)
|
cur.execute(GET_ALL_SCHEMA)
|
||||||
AllSchema = cur.fetchall()
|
AllSchema = cur.fetchall()
|
||||||
@@ -115,10 +119,10 @@ class Postgis_Rename(QDialog, EDITOR_CLASS):
|
|||||||
if allIsGood == 2:
|
if allIsGood == 2:
|
||||||
self.groupBox_3.show()
|
self.groupBox_3.show()
|
||||||
self.loadValue()
|
self.loadValue()
|
||||||
self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(True)
|
self.buttonBox.button(QDialogButtonBox.StandardButton(0x00000400)).setEnabled(True)
|
||||||
else:
|
else:
|
||||||
self.groupBox_3.hide()
|
self.groupBox_3.hide()
|
||||||
self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False)
|
self.buttonBox.button(QDialogButtonBox.StandardButton(0x00000400)).setEnabled(False)
|
||||||
else:
|
else:
|
||||||
self.old_name.setText('')
|
self.old_name.setText('')
|
||||||
self.compte.setChecked(0)
|
self.compte.setChecked(0)
|
||||||
@@ -183,12 +187,10 @@ class Postgis_Rename(QDialog, EDITOR_CLASS):
|
|||||||
SQL_RENAME_SCHEMA = 'ALTER SCHEMA ' + oldSchemaName + ' RENAME TO ' + newSchemaName
|
SQL_RENAME_SCHEMA = 'ALTER SCHEMA ' + oldSchemaName + ' RENAME TO ' + newSchemaName
|
||||||
allSQLrun = allSQLrun + SQL_RENAME_SCHEMA
|
allSQLrun = allSQLrun + SQL_RENAME_SCHEMA
|
||||||
cur.execute(SQL_RENAME_SCHEMA)
|
cur.execute(SQL_RENAME_SCHEMA)
|
||||||
#print(allSQLrun)
|
|
||||||
con.commit()
|
con.commit()
|
||||||
for LayerOpen in allTableList:
|
for LayerOpen in allTableList:
|
||||||
self.UnloadLoadLayers(LayerOpen[0], LayerOpen[1], LayerOpen[2])
|
self.UnloadLoadLayers(LayerOpen[0], LayerOpen[1], LayerOpen[2])
|
||||||
|
|
||||||
|
|
||||||
def UnloadLoadLayers(self, OldName, NewSchema, NewTable):
|
def UnloadLoadLayers(self, OldName, NewSchema, NewTable):
|
||||||
allLayers = (QgsProject.instance().mapLayers().values())
|
allLayers = (QgsProject.instance().mapLayers().values())
|
||||||
listLayers = []
|
listLayers = []
|
||||||
@@ -205,7 +207,7 @@ class Postgis_Rename(QDialog, EDITOR_CLASS):
|
|||||||
host = QgsDataSourceUri(provider.dataSourceUri()).host()
|
host = QgsDataSourceUri(provider.dataSourceUri()).host()
|
||||||
port = QgsDataSourceUri(provider.dataSourceUri()).port()
|
port = QgsDataSourceUri(provider.dataSourceUri()).port()
|
||||||
|
|
||||||
### Affichage de la table
|
# Affichage de la table
|
||||||
uri = QgsDataSourceUri()
|
uri = QgsDataSourceUri()
|
||||||
# set host name, port, database name, username and password
|
# set host name, port, database name, username and password
|
||||||
uri.setConnection(host, port, dbname, user, mdp)
|
uri.setConnection(host, port, dbname, user, mdp)
|
||||||
@@ -217,9 +219,9 @@ class Postgis_Rename(QDialog, EDITOR_CLASS):
|
|||||||
def msgBox(self):
|
def msgBox(self):
|
||||||
self.QMBquestion = QMessageBox()
|
self.QMBquestion = QMessageBox()
|
||||||
self.QMBquestion.setWindowTitle(u"Attention !")
|
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.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() != '':
|
if self.new_name.text() != '':
|
||||||
error_caracteres = 0
|
error_caracteres = 0
|
||||||
for caracteres in ch:
|
for caracteres in ch:
|
||||||
@@ -231,5 +233,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())
|
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:
|
else:
|
||||||
QMessageBox.warning(None, "Oups :", "Votre projet doit avoire un nom !")
|
QMessageBox.warning(None, "Oups :", "Votre projet doit avoire un nom !")
|
||||||
if self.QMBquestion == QMessageBox.Yes:
|
if self.QMBquestion == QMessageBox.StandardButton(0x00004000):
|
||||||
self.updateName()
|
self.updateName()
|
||||||
|
|||||||
@@ -3,13 +3,13 @@
|
|||||||
import configparser
|
import configparser
|
||||||
import shutil
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
import base64
|
# import base64
|
||||||
import psycopg2
|
# import psycopg2
|
||||||
import psycopg2.extras
|
# import psycopg2.extras
|
||||||
import socket
|
import os
|
||||||
from os.path import abspath, join, pardir, dirname
|
from os.path import abspath, join, pardir, dirname
|
||||||
from qgis.core import QgsDataSourceUri
|
from qgis.core import QgsDataSourceUri
|
||||||
from .SQLRequet import *
|
from .SQLRequet import geom, champ_contour, champ_travaux_prevus_multilinestring, champ_travaux_prevus_point, champ_travaux_prevus_multipolygon, champ_vegethab_multipolygon, champ_vegethab_multilinestring, champ_vegethab_point, champ_viergeLigne, champ_viergePoint, champ_viergePolygone
|
||||||
from qgis.PyQt import uic
|
from qgis.PyQt import uic
|
||||||
|
|
||||||
__copyright__ = "Copyright 2019, 3Liz"
|
__copyright__ = "Copyright 2019, 3Liz"
|
||||||
@@ -109,60 +109,60 @@ def load_ui(*args):
|
|||||||
|
|
||||||
return ui_class
|
return ui_class
|
||||||
|
|
||||||
|
|
||||||
def pyperclip():
|
def pyperclip():
|
||||||
IPAddr=socket.gethostbyname(socket.gethostname())
|
dst = dirname(dirname(__file__)) + "\\tools\\"
|
||||||
dst = abspath(abspath(join(plugin_path(), "CenRa_POSTGIS\\tools\\")))
|
if os.access('N:/', os.R_OK):
|
||||||
if IPAddr[0:11] == "100.100.100": #4269
|
src = 'N:/SI_Systeme d information/Z_QGIS/PLUGIN/PythonSQL.py'
|
||||||
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
|
|
||||||
if IPAddr[0:9] == "192.168.0": #01
|
|
||||||
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
|
|
||||||
if IPAddr[0:9] == "192.168.1": #0726
|
|
||||||
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
|
|
||||||
try:
|
try:
|
||||||
shutil.copy(src, dst)
|
shutil.copy(src, dst)
|
||||||
except:
|
except FileNotFoundError:
|
||||||
print('404')
|
print('404')
|
||||||
|
except UnboundLocalError:
|
||||||
|
print('404')
|
||||||
|
|
||||||
|
|
||||||
def send_issues(url, titre, body, labels):
|
def send_issues(url, titre, body, labels):
|
||||||
import requests
|
import requests
|
||||||
|
import urllib.request
|
||||||
import json
|
import json
|
||||||
import os
|
# import os
|
||||||
import qgis
|
# import qgis
|
||||||
|
|
||||||
usr = os.environ['USERNAME']
|
# usr = os.environ['USERNAME']
|
||||||
token = '9d0a4e0bea561710e0728f161f7edf4e5201e112'
|
token = '9d0a4e0bea561710e0728f161f7edf4e5201e112'
|
||||||
url = url + '?token=' + token
|
url = url + '?token=' + token
|
||||||
|
|
||||||
headers = {'Authorization': 'token ' + token, 'accept': 'application/json', 'Content-Type': 'application/json'}
|
headers = {'Authorization': 'token ' + token, 'accept': 'application/json', 'Content-Type': 'application/json'}
|
||||||
|
|
||||||
|
|
||||||
payload = {'title': titre, 'body': body, 'labels': labels}
|
payload = {'title': titre, 'body': body, 'labels': labels}
|
||||||
try:
|
try:
|
||||||
urllib.request.urlopen('https://google.com')
|
urllib.request.urlopen('https://google.com')
|
||||||
binar = True
|
binar = True
|
||||||
except:
|
except ValueError:
|
||||||
binar = False
|
binar = False
|
||||||
r = ''
|
r = ''
|
||||||
if binar:
|
if binar:
|
||||||
r = requests.post(url, data=json.dumps(payload), headers=headers)
|
r = requests.post(url, data=json.dumps(payload), headers=headers)
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
|
||||||
def maj_verif(NAME):
|
def maj_verif(NAME):
|
||||||
import qgis
|
import qgis
|
||||||
import urllib.request
|
import urllib.request
|
||||||
iface = qgis.utils.iface
|
iface = qgis.utils.iface
|
||||||
from qgis.core import Qgis
|
from qgis.core import Qgis
|
||||||
|
|
||||||
url = qgis.utils.pluginMetadata(NAME,'repository')
|
# url = qgis.utils.pluginMetadata(NAME, 'repository')
|
||||||
# URL = url+'/raw/branch/main/plugins.xml'
|
# URL = url+'/raw/branch/main/plugins.xml'
|
||||||
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/releases/plugins.xml'
|
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/plugins.xml'
|
||||||
# print(URL)
|
# print(URL)
|
||||||
version = qgis.utils.pluginMetadata(NAME, 'version')
|
version = qgis.utils.pluginMetadata(NAME, 'version')
|
||||||
len_version = len(version)
|
len_version = len(version)
|
||||||
try:
|
try:
|
||||||
urllib.request.urlopen('https://google.com')
|
urllib.request.urlopen('https://google.com')
|
||||||
binar = True
|
binar = True
|
||||||
except:
|
except urllib.error.URLError:
|
||||||
binar = False
|
binar = False
|
||||||
if binar:
|
if binar:
|
||||||
try:
|
try:
|
||||||
@@ -172,20 +172,23 @@ def maj_verif(NAME):
|
|||||||
version_plugin = version_web[valeur_version_web: valeur_version_web + len_version]
|
version_plugin = version_web[valeur_version_web: valeur_version_web + len_version]
|
||||||
if version_plugin != version:
|
if version_plugin != version:
|
||||||
iface.messageBar().pushMessage("MAJ :", "Des mise à jour de plugin sont disponibles.", level=Qgis.Info, duration=30)
|
iface.messageBar().pushMessage("MAJ :", "Des mise à jour de plugin sont disponibles.", level=Qgis.Info, duration=30)
|
||||||
except:
|
except NameError:
|
||||||
print("error gitea version ssl")
|
print("error gitea version ssl")
|
||||||
else:
|
else:
|
||||||
iface.messageBar().pushMessage("WiFi :", "Pas de connection à internet.", level=Qgis.Warning, duration=30)
|
iface.messageBar().pushMessage("WiFi :", "Pas de connection à internet.", level=Qgis.Warning, duration=30)
|
||||||
|
|
||||||
|
|
||||||
def devlog(NAME):
|
def devlog(NAME):
|
||||||
import qgis
|
import qgis
|
||||||
devmaj = '<head><style>* {margin:0; padding:0; }</style></head>'
|
devmaj = '<head><style>* {margin:0; padding:0; }</style></head>'
|
||||||
devmaj = devmaj + qgis.utils.pluginMetadata(NAME, 'changelog')
|
devmaj = devmaj + qgis.utils.pluginMetadata(NAME, 'changelog')
|
||||||
return devmaj
|
return devmaj
|
||||||
|
|
||||||
|
|
||||||
def create_contour(self, schema, cur, con, host, port, dbname, user, mdp):
|
def create_contour(self, schema, cur, con, host, port, dbname, user, mdp):
|
||||||
### Creation de la table contour
|
# Creation de la table contour
|
||||||
if self.couche_contour.isChecked(): # Verifie si la checkbox est cochee
|
# Verifie si la checkbox est cochee
|
||||||
|
if self.couche_contour.isChecked():
|
||||||
if self.annee_1.text() == 'aaaa' or self.annee_1.text() == '':
|
if self.annee_1.text() == 'aaaa' or self.annee_1.text() == '':
|
||||||
tablename = schema + "_contour"
|
tablename = schema + "_contour"
|
||||||
else:
|
else:
|
||||||
@@ -216,21 +219,24 @@ def create_contour(self,schema,cur,con,host ,port ,dbname ,user ,mdp):
|
|||||||
cur.execute(SQL_trigger_area_ha)
|
cur.execute(SQL_trigger_area_ha)
|
||||||
cur.execute(SQL_trigger_date_creation)
|
cur.execute(SQL_trigger_date_creation)
|
||||||
cur.execute(SQL_trigger_date_maj)
|
cur.execute(SQL_trigger_date_maj)
|
||||||
cur.execute(SQL_style) ## Enregistrement du style (comme style par defaut) dans la table layer_styles
|
# Enregistrement du style (comme style par defaut) dans la table layer_styles
|
||||||
|
cur.execute(SQL_style)
|
||||||
cur.execute(SQL_GRANT_TABLE)
|
cur.execute(SQL_GRANT_TABLE)
|
||||||
|
|
||||||
con.commit()
|
con.commit()
|
||||||
|
|
||||||
## Affichage de la table
|
# Affichage de la table
|
||||||
uri = QgsDataSourceUri()
|
uri = QgsDataSourceUri()
|
||||||
# set host name, port, database name, username and password
|
# set host name, port, database name, username and password
|
||||||
uri.setConnection(host, port, dbname, user, mdp)
|
uri.setConnection(host, port, dbname, user, mdp)
|
||||||
# set database schema, table name, geometry column and optionaly subset (WHERE clause)
|
# set database schema, table name, geometry column and optionaly subset (WHERE clause)
|
||||||
uri.setDataSource(schema, tablename, geom)
|
uri.setDataSource(schema, tablename, geom)
|
||||||
|
|
||||||
layer = self.iface.addVectorLayer(uri.uri(), tablename_qgis, "postgres")
|
self.iface.addVectorLayer(uri.uri(), tablename_qgis, "postgres")
|
||||||
|
|
||||||
|
|
||||||
def create_travaux(self, schema, cur, con, host, port, dbname, user, mdp):
|
def create_travaux(self, schema, cur, con, host, port, dbname, user, mdp):
|
||||||
### Creation de la table travaux prevus
|
# Creation de la table travaux prevus
|
||||||
if self.couche_travaux_prevus.isChecked():
|
if self.couche_travaux_prevus.isChecked():
|
||||||
# **********Poly
|
# **********Poly
|
||||||
if self.annee_5.text() == 'aaaa' or self.annee_5.text() == '':
|
if self.annee_5.text() == 'aaaa' or self.annee_5.text() == '':
|
||||||
@@ -246,7 +252,6 @@ def create_travaux(self,schema,cur,con,host,port,dbname,user,mdp):
|
|||||||
cur.execute(RETURNE)
|
cur.execute(RETURNE)
|
||||||
sequence_name = cur.fetchone()[0]
|
sequence_name = cur.fetchone()[0]
|
||||||
|
|
||||||
|
|
||||||
SQL_pkey = "ALTER TABLE " + schema + "." + tablename + " ADD CONSTRAINT " + tablename[len(schema):] + "_pkey" + " PRIMARY KEY (gid)"
|
SQL_pkey = "ALTER TABLE " + schema + "." + tablename + " ADD CONSTRAINT " + tablename[len(schema):] + "_pkey" + " PRIMARY KEY (gid)"
|
||||||
SQL_trigger_date_creation = "CREATE TRIGGER date_creation" + tablename + " BEFORE INSERT ON " + schema + "." + tablename + " FOR EACH ROW EXECUTE PROCEDURE ref.date_creation();"
|
SQL_trigger_date_creation = "CREATE TRIGGER date_creation" + tablename + " BEFORE INSERT ON " + schema + "." + tablename + " FOR EACH ROW EXECUTE PROCEDURE ref.date_creation();"
|
||||||
SQL_trigger_date_maj = "CREATE TRIGGER date_maj" + tablename + " BEFORE INSERT OR UPDATE ON " + schema + "." + tablename + " FOR EACH ROW EXECUTE PROCEDURE ref.date_maj();"
|
SQL_trigger_date_maj = "CREATE TRIGGER date_maj" + tablename + " BEFORE INSERT OR UPDATE ON " + schema + "." + tablename + " FOR EACH ROW EXECUTE PROCEDURE ref.date_maj();"
|
||||||
@@ -264,19 +269,20 @@ def create_travaux(self,schema,cur,con,host,port,dbname,user,mdp):
|
|||||||
cur.execute(SQL_trigger_date_maj)
|
cur.execute(SQL_trigger_date_maj)
|
||||||
cur.execute(SQL_trigger_area_m2)
|
cur.execute(SQL_trigger_area_m2)
|
||||||
cur.execute(SQL_trigger_area_ha)
|
cur.execute(SQL_trigger_area_ha)
|
||||||
cur.execute(SQL_style) ## Enregistrement du style (comme style par defaut) dans la table layer_styles
|
# Enregistrement du style (comme style par defaut) dans la table layer_styles
|
||||||
|
cur.execute(SQL_style)
|
||||||
cur.execute(SQL_GRANT_TABLE)
|
cur.execute(SQL_GRANT_TABLE)
|
||||||
|
|
||||||
con.commit()
|
con.commit()
|
||||||
|
|
||||||
## Affichage de la table
|
# Affichage de la table
|
||||||
uri = QgsDataSourceUri()
|
uri = QgsDataSourceUri()
|
||||||
# set host name, port, database name, username and password
|
# set host name, port, database name, username and password
|
||||||
uri.setConnection(host, port, dbname, user, mdp)
|
uri.setConnection(host, port, dbname, user, mdp)
|
||||||
# set database schema, table name, geometry column and optionaly subset (WHERE clause)
|
# set database schema, table name, geometry column and optionaly subset (WHERE clause)
|
||||||
uri.setDataSource(schema, tablename, geom)
|
uri.setDataSource(schema, tablename, geom)
|
||||||
|
|
||||||
layer = self.iface.addVectorLayer(uri.uri(), tablename_qgis, "postgres")
|
self.iface.addVectorLayer(uri.uri(), tablename_qgis, "postgres")
|
||||||
|
|
||||||
# **********ligne
|
# **********ligne
|
||||||
if self.annee_5.text() == 'aaaa' or self.annee_5.text() == '':
|
if self.annee_5.text() == 'aaaa' or self.annee_5.text() == '':
|
||||||
@@ -309,19 +315,20 @@ def create_travaux(self,schema,cur,con,host,port,dbname,user,mdp):
|
|||||||
cur.execute(SQL_trigger_date_maj)
|
cur.execute(SQL_trigger_date_maj)
|
||||||
cur.execute(SQL_trigger_length_m)
|
cur.execute(SQL_trigger_length_m)
|
||||||
cur.execute(SQL_trigger_length_km)
|
cur.execute(SQL_trigger_length_km)
|
||||||
cur.execute(SQL_style) ## Enregistrement du style (comme style par defaut) dans la table layer_styles
|
# Enregistrement du style (comme style par defaut) dans la table layer_styles
|
||||||
|
cur.execute(SQL_style)
|
||||||
cur.execute(SQL_GRANT_TABLE)
|
cur.execute(SQL_GRANT_TABLE)
|
||||||
|
|
||||||
con.commit()
|
con.commit()
|
||||||
|
|
||||||
## Affichage de la table
|
# Affichage de la table
|
||||||
uri = QgsDataSourceUri()
|
uri = QgsDataSourceUri()
|
||||||
# set host name, port, database name, username and password
|
# set host name, port, database name, username and password
|
||||||
uri.setConnection(host, port, dbname, user, mdp)
|
uri.setConnection(host, port, dbname, user, mdp)
|
||||||
# set database schema, table name, geometry column and optionaly subset (WHERE clause)
|
# set database schema, table name, geometry column and optionaly subset (WHERE clause)
|
||||||
uri.setDataSource(schema, tablename, geom)
|
uri.setDataSource(schema, tablename, geom)
|
||||||
|
|
||||||
layer = self.iface.addVectorLayer(uri.uri(), tablename_qgis, "postgres")
|
self.iface.addVectorLayer(uri.uri(), tablename_qgis, "postgres")
|
||||||
|
|
||||||
# **********point
|
# **********point
|
||||||
if self.annee_5.text() == 'aaaa' or self.annee_5.text() == '':
|
if self.annee_5.text() == 'aaaa' or self.annee_5.text() == '':
|
||||||
@@ -352,22 +359,24 @@ def create_travaux(self,schema,cur,con,host,port,dbname,user,mdp):
|
|||||||
cur.execute(SQL_trigger_date_creation)
|
cur.execute(SQL_trigger_date_creation)
|
||||||
cur.execute(SQL_trigger_date_maj)
|
cur.execute(SQL_trigger_date_maj)
|
||||||
cur.execute(SQL_trigger_coordonnees)
|
cur.execute(SQL_trigger_coordonnees)
|
||||||
cur.execute(SQL_style) ## Enregistrement du style (comme style par defaut) dans la table layer_styles
|
# Enregistrement du style (comme style par defaut) dans la table layer_styles
|
||||||
|
cur.execute(SQL_style)
|
||||||
cur.execute(SQL_GRANT_TABLE)
|
cur.execute(SQL_GRANT_TABLE)
|
||||||
|
|
||||||
con.commit()
|
con.commit()
|
||||||
|
|
||||||
## Affichage de la table
|
# Affichage de la table
|
||||||
uri = QgsDataSourceUri()
|
uri = QgsDataSourceUri()
|
||||||
# set host name, port, database name, username and password
|
# set host name, port, database name, username and password
|
||||||
uri.setConnection(host, port, dbname, user, mdp)
|
uri.setConnection(host, port, dbname, user, mdp)
|
||||||
# set database schema, table name, geometry column and optionaly subset (WHERE clause)
|
# set database schema, table name, geometry column and optionaly subset (WHERE clause)
|
||||||
uri.setDataSource(schema, tablename, geom)
|
uri.setDataSource(schema, tablename, geom)
|
||||||
|
|
||||||
layer = self.iface.addVectorLayer(uri.uri(), tablename_qgis, "postgres")
|
self.iface.addVectorLayer(uri.uri(), tablename_qgis, "postgres")
|
||||||
|
|
||||||
|
|
||||||
def create_habita(self, schema, cur, con, host, port, dbname, user, mdp):
|
def create_habita(self, schema, cur, con, host, port, dbname, user, mdp):
|
||||||
### Creation de la table habitat
|
# Creation de la table habitat
|
||||||
if self.couche_habitat.isChecked():
|
if self.couche_habitat.isChecked():
|
||||||
if self.annee_2.text() == 'aaaa' or self.annee_2.text() == '':
|
if self.annee_2.text() == 'aaaa' or self.annee_2.text() == '':
|
||||||
tablename = schema + "_habitat"
|
tablename = schema + "_habitat"
|
||||||
@@ -400,14 +409,14 @@ def create_habita(self,schema,cur,con,host ,port ,dbname ,user ,mdp):
|
|||||||
cur.execute(SQL_GRANT_TABLE)
|
cur.execute(SQL_GRANT_TABLE)
|
||||||
|
|
||||||
con.commit()
|
con.commit()
|
||||||
### Affichage de la table
|
# Affichage de la table
|
||||||
uri = QgsDataSourceUri()
|
uri = QgsDataSourceUri()
|
||||||
# set host name, port, database name, username and password
|
# set host name, port, database name, username and password
|
||||||
uri.setConnection(host, port, dbname, user, mdp)
|
uri.setConnection(host, port, dbname, user, mdp)
|
||||||
# set database schema, table name, geometry column and optionaly subset (WHERE clause)
|
# set database schema, table name, geometry column and optionaly subset (WHERE clause)
|
||||||
uri.setDataSource(schema, tablename_1, geom)
|
uri.setDataSource(schema, tablename_1, geom)
|
||||||
|
|
||||||
layer = self.iface.addVectorLayer(uri.uri(), tablename_qgis, "postgres")
|
self.iface.addVectorLayer(uri.uri(), tablename_qgis, "postgres")
|
||||||
|
|
||||||
tablename_2 = tablename + "_lignes"
|
tablename_2 = tablename + "_lignes"
|
||||||
RETURNE = "SELECT pg_get_serial_sequence('" + schema + "." + tablename_2 + "','gid')"
|
RETURNE = "SELECT pg_get_serial_sequence('" + schema + "." + tablename_2 + "','gid')"
|
||||||
@@ -434,14 +443,14 @@ def create_habita(self,schema,cur,con,host ,port ,dbname ,user ,mdp):
|
|||||||
cur.execute(SQL_GRANT_TABLE)
|
cur.execute(SQL_GRANT_TABLE)
|
||||||
|
|
||||||
con.commit()
|
con.commit()
|
||||||
### Affichage de la table
|
# Affichage de la table
|
||||||
uri = QgsDataSourceUri()
|
uri = QgsDataSourceUri()
|
||||||
# set host name, port, database name, username and password
|
# set host name, port, database name, username and password
|
||||||
uri.setConnection(host, port, dbname, user, mdp)
|
uri.setConnection(host, port, dbname, user, mdp)
|
||||||
# set database schema, table name, geometry column and optionaly subset (WHERE clause)
|
# set database schema, table name, geometry column and optionaly subset (WHERE clause)
|
||||||
uri.setDataSource(schema, tablename_2, geom)
|
uri.setDataSource(schema, tablename_2, geom)
|
||||||
|
|
||||||
layer = self.iface.addVectorLayer(uri.uri(), tablename_qgis, "postgres")
|
self.iface.addVectorLayer(uri.uri(), tablename_qgis, "postgres")
|
||||||
|
|
||||||
tablename_3 = tablename + "_polygones"
|
tablename_3 = tablename + "_polygones"
|
||||||
RETURNE = "SELECT pg_get_serial_sequence('" + schema + "." + tablename_3 + "','gid')"
|
RETURNE = "SELECT pg_get_serial_sequence('" + schema + "." + tablename_3 + "','gid')"
|
||||||
@@ -468,16 +477,18 @@ def create_habita(self,schema,cur,con,host ,port ,dbname ,user ,mdp):
|
|||||||
cur.execute(SQL_GRANT_TABLE)
|
cur.execute(SQL_GRANT_TABLE)
|
||||||
|
|
||||||
con.commit()
|
con.commit()
|
||||||
### Affichage de la table
|
# Affichage de la table
|
||||||
uri = QgsDataSourceUri()
|
uri = QgsDataSourceUri()
|
||||||
# set host name, port, database name, username and password
|
# set host name, port, database name, username and password
|
||||||
uri.setConnection(host, port, dbname, user, mdp)
|
uri.setConnection(host, port, dbname, user, mdp)
|
||||||
# set database schema, table name, geometry column and optionaly subset (WHERE clause)
|
# set database schema, table name, geometry column and optionaly subset (WHERE clause)
|
||||||
uri.setDataSource(schema, tablename_3, geom)
|
uri.setDataSource(schema, tablename_3, geom)
|
||||||
|
|
||||||
layer = self.iface.addVectorLayer(uri.uri(), tablename_qgis, "postgres")
|
self.iface.addVectorLayer(uri.uri(), tablename_qgis, "postgres")
|
||||||
|
|
||||||
|
|
||||||
def create_vierge(self, schema, cur, con, host, port, dbname, user, mdp):
|
def create_vierge(self, schema, cur, con, host, port, dbname, user, mdp):
|
||||||
### Creation de la table vierge
|
# Creation de la table vierge
|
||||||
if self.couche_vierge.isChecked():
|
if self.couche_vierge.isChecked():
|
||||||
if self.annee_4.text() == 'aaaa' or self.annee_4.text() == '':
|
if self.annee_4.text() == 'aaaa' or self.annee_4.text() == '':
|
||||||
tablename = schema + "_" + self.nom_couche_vierge.text().lower()
|
tablename = schema + "_" + self.nom_couche_vierge.text().lower()
|
||||||
@@ -526,11 +537,11 @@ def create_vierge(self,schema,cur,con,host ,port ,dbname ,user ,mdp):
|
|||||||
|
|
||||||
con.commit()
|
con.commit()
|
||||||
|
|
||||||
### Affichage de la table
|
# Affichage de la table
|
||||||
uri = QgsDataSourceUri()
|
uri = QgsDataSourceUri()
|
||||||
# set host name, port, database name, username and password
|
# set host name, port, database name, username and password
|
||||||
uri.setConnection(host, port, dbname, user, mdp)
|
uri.setConnection(host, port, dbname, user, mdp)
|
||||||
# set database schema, table name, geometry column and optionaly subset (WHERE clause)
|
# set database schema, table name, geometry column and optionaly subset (WHERE clause)
|
||||||
uri.setDataSource(schema, tablename, geom)
|
uri.setDataSource(schema, tablename, geom)
|
||||||
|
|
||||||
layer = self.iface.addVectorLayer(uri.uri(), tablename_qgis, "postgres")
|
self.iface.addVectorLayer(uri.uri(), tablename_qgis, "postgres")
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>CenRa_Metabase_editorwidget_base</class>
|
<class>CenRa_Metabase_editorwidget_base</class>
|
||||||
<widget class="QDialog" name="CenRa_Metabase_editorwidget_base">
|
<widget class="QDialog" name="CenRa_about_base">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
@@ -13,10 +13,6 @@
|
|||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Journal des modifications</string>
|
<string>Journal des modifications</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
|
||||||
<iconset>
|
|
||||||
<normaloff>../../CenRa_Metabase/tools/ui/icon.svg</normaloff>../../CenRa_Metabase/tools/ui/icon.svg</iconset>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QScrollArea" name="scrollArea">
|
<widget class="QScrollArea" name="scrollArea">
|
||||||
@@ -29,9 +25,6 @@
|
|||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::NoFrame</enum>
|
<enum>QFrame::NoFrame</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Plain</enum>
|
|
||||||
</property>
|
|
||||||
<property name="widgetResizable">
|
<property name="widgetResizable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@@ -56,7 +49,7 @@
|
|||||||
<property name="title">
|
<property name="title">
|
||||||
<string>DevLog</string>
|
<string>DevLog</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWebView" name="viewer" native="true">
|
<widget class="QTextBrowser" name="viewer">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
@@ -65,11 +58,6 @@
|
|||||||
<height>511</height>
|
<height>511</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="url" stdset="0">
|
|
||||||
<url>
|
|
||||||
<string>about:blank</string>
|
|
||||||
</url>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -78,19 +66,12 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="standardButtons">
|
<property name="standardButtons">
|
||||||
<set>QDialogButtonBox::Ok</set>
|
<set>QDialogButtonBox::Close|QDialogButtonBox::Ok</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
|
||||||
<customwidget>
|
|
||||||
<class>QWebView</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header location="global">QtWebKitWidgets/QWebView</header>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
"""
|
"""
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
|
||||||
def classFactory(iface):
|
def classFactory(iface):
|
||||||
# load SICEN class from file SICEN
|
# load SICEN class from file SICEN
|
||||||
from .sicen import SICEN
|
from .sicen import SICEN
|
||||||
|
|||||||
@@ -29,9 +29,6 @@
|
|||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::NoFrame</enum>
|
<enum>QFrame::NoFrame</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Plain</enum>
|
|
||||||
</property>
|
|
||||||
<property name="widgetResizable">
|
<property name="widgetResizable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@@ -41,7 +38,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>453</width>
|
<width>453</width>
|
||||||
<height>547</height>
|
<height>570</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
@@ -56,7 +53,7 @@
|
|||||||
<property name="title">
|
<property name="title">
|
||||||
<string>DevLog</string>
|
<string>DevLog</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWebView" name="viewer" native="true">
|
<widget class="QTextBrowser" name="viewer">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>10</x>
|
<x>10</x>
|
||||||
@@ -65,11 +62,6 @@
|
|||||||
<height>511</height>
|
<height>511</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="url" stdset="0">
|
|
||||||
<url>
|
|
||||||
<string>about:blank</string>
|
|
||||||
</url>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
@@ -78,19 +70,12 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="standardButtons">
|
<property name="standardButtons">
|
||||||
<set>QDialogButtonBox::Ok</set>
|
<set>QDialogButtonBox::NoButton</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
|
||||||
<customwidget>
|
|
||||||
<class>QWebView</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header location="global">QtWebKitWidgets/QWebView</header>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
@@ -11,8 +11,10 @@
|
|||||||
[general]
|
[general]
|
||||||
name=CenRa SICEN
|
name=CenRa SICEN
|
||||||
qgisMinimumVersion=3.0
|
qgisMinimumVersion=3.0
|
||||||
|
qgisMaximumVersion=4.99
|
||||||
|
supportsQt6=True
|
||||||
description=Filtre des données saisies dans SICEN et export d'une liste d'espèces.
|
description=Filtre des données saisies dans SICEN et export d'une liste d'espèces.
|
||||||
version=1.9
|
version=2.2
|
||||||
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
|
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
|
||||||
email=si_besoin@cen-rhonealpes.fr
|
email=si_besoin@cen-rhonealpes.fr
|
||||||
|
|
||||||
@@ -21,7 +23,7 @@ email=si_besoin@cen-rhonealpes.fr
|
|||||||
# Optional items:
|
# Optional items:
|
||||||
|
|
||||||
# Uncomment the following line and add your changelog entries:
|
# 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>12/03/2026 - Version 2.2: </h3> - qgisMaximumVersion est 4.0.</p></br><p><h3>30/07/2025 - Version 2.1: </h3> - Correctife de bug.</p></br><p><h3>19/05/2025 - Version 2.0: </h3> - Compatible PyQt5 et PyQt6</p></br><p><h3>09/04/2025 - Version 1.11: </h3> - Correctif bug en TT.</p></br><p><h3>09/04/2025 - Version 1.10: </h3> - Optimisation pour le TT.</p></br><p><h3>03/04/2025 - Version 1.9: </h3> - Mise a jour de securite.</p></br><p><h3>07/01/2025 - Version 1.8: </h3> - ByPass du certif ssl ci erreur.</br></p><p><h3>13/09/2024 - Version 1.7:</h3> - Il est maintenant possible de sélectionné plusieurs entité pour le filtre par Emprise.</br>- Ajoute d'un changelog.</br>- Ajoute une vérification de mise à jour.</p>
|
||||||
|
|
||||||
# tags are comma separated with spaces allowed
|
# tags are comma separated with spaces allowed
|
||||||
tags=cenra, postgis, sicen
|
tags=cenra, postgis, sicen
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#
|
#
|
||||||
# WARNING! All changes made in this file will be lost!
|
# WARNING! All changes made in this file will be lost!
|
||||||
|
|
||||||
from PyQt5 import QtCore
|
from qgis.PyQt import QtCore
|
||||||
|
|
||||||
qt_resource_data = b"\
|
qt_resource_data = b"\
|
||||||
\x00\x00\x0d\x89\
|
\x00\x00\x0d\x89\
|
||||||
@@ -557,10 +557,13 @@ else:
|
|||||||
rcc_version = 2
|
rcc_version = 2
|
||||||
qt_resource_struct = qt_resource_struct_v2
|
qt_resource_struct = qt_resource_struct_v2
|
||||||
|
|
||||||
|
|
||||||
def qInitResources():
|
def qInitResources():
|
||||||
QtCore.qRegisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
|
QtCore.qRegisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
|
||||||
|
|
||||||
|
|
||||||
def qCleanupResources():
|
def qCleanupResources():
|
||||||
QtCore.qUnregisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
|
QtCore.qUnregisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
|
||||||
|
|
||||||
|
|
||||||
qInitResources()
|
qInitResources()
|
||||||
|
|||||||
@@ -1,55 +1,20 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
"""
|
|
||||||
/***************************************************************************
|
|
||||||
SICEN
|
|
||||||
A QGIS plugin
|
|
||||||
Filtre sur données SICEN
|
|
||||||
-------------------
|
|
||||||
begin : 2014-10-17
|
|
||||||
copyright : (C) 2014 by Guillaume COSTES (CENRA)
|
|
||||||
email : guillaume.costes@espaces-naturels.fr
|
|
||||||
***************************************************************************/
|
|
||||||
|
|
||||||
/***************************************************************************
|
|
||||||
* *
|
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
|
||||||
* it under the terms of the GNU General Public License as published by *
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or *
|
|
||||||
* (at your option) any later version. *
|
|
||||||
* *
|
|
||||||
***************************************************************************/
|
|
||||||
"""
|
|
||||||
"""from __future__ import absolute_import
|
|
||||||
# Import the PyQt and QGIS libraries
|
|
||||||
from builtins import str
|
|
||||||
from builtins import object
|
|
||||||
from PyQt4.QtCore import *
|
|
||||||
from PyQt4.QtGui import *
|
|
||||||
from qgis.core import *
|
|
||||||
from qgis.gui import *
|
|
||||||
from qgis.utils import iface"""
|
|
||||||
|
|
||||||
from builtins import str
|
from builtins import str
|
||||||
from builtins import object
|
from builtins import object
|
||||||
import os
|
import os
|
||||||
from PyQt5.QtCore import *
|
|
||||||
from PyQt5.QtGui import *
|
|
||||||
from qgis.PyQt import uic
|
|
||||||
from qgis.core import *
|
|
||||||
from qgis.core import QgsDataSourceUri, QgsWkbTypes, QgsLayerTreeGroup, QgsLayerTreeLayer
|
|
||||||
from qgis.PyQt.QtGui import QFont
|
|
||||||
from qgis.PyQt.QtWidgets import QMenu, QAction, QDialog, QDialogButtonBox, QLabel, QApplication, QTabWidget, QWidget, QGroupBox, QGridLayout, QComboBox, QCheckBox, QCalendarWidget, QToolBox, QFrame, QLineEdit, QSizePolicy, QFileDialog #Modifié
|
|
||||||
|
|
||||||
|
# from qgis.PyQt import uic
|
||||||
|
from qgis.core import QgsDataSourceUri, QgsLayerTreeLayer, QgsProject, QgsVectorLayer, Qgis
|
||||||
|
from qgis.PyQt.QtGui import QIcon
|
||||||
|
from qgis.PyQt.QtWidgets import QMenu, QAction, QFileDialog
|
||||||
|
from qgis.PyQt.QtCore import QSettings, QTranslator, QCoreApplication, qVersion
|
||||||
|
|
||||||
# Initialize Qt resources from file resources.py
|
# Initialize Qt resources from file resources.py
|
||||||
from . import resources_rc
|
# from . import resources_rc
|
||||||
# Import the code for the dialog
|
# Import the code for the dialog
|
||||||
from .sicendialog import SICENDialog
|
from .sicendialog import SICENDialog
|
||||||
|
|
||||||
from .tools.resources import maj_verif,pyperclip
|
|
||||||
pyperclip()
|
|
||||||
from .tools.PythonSQL import login_base
|
|
||||||
|
|
||||||
import os.path
|
import os.path
|
||||||
import qgis
|
import qgis
|
||||||
import datetime
|
import datetime
|
||||||
@@ -57,12 +22,15 @@ import csv
|
|||||||
|
|
||||||
from .forms.about_form import AboutDialog
|
from .forms.about_form import AboutDialog
|
||||||
|
|
||||||
import psycopg2
|
|
||||||
import psycopg2.extras
|
|
||||||
import base64
|
|
||||||
import socket
|
import socket
|
||||||
import os
|
import os
|
||||||
#import sys
|
|
||||||
|
from .tools.resources import maj_verif, pyperclip, resources_path
|
||||||
|
pyperclip()
|
||||||
|
try:
|
||||||
|
from .tools.PythonSQL import login_base
|
||||||
|
except ValueError:
|
||||||
|
print('Pas de fichier PythonSQL')
|
||||||
|
|
||||||
|
|
||||||
class SICEN(object):
|
class SICEN(object):
|
||||||
@@ -99,49 +67,44 @@ class SICEN(object):
|
|||||||
self.toolBar = self.iface.addToolBar("SICEN")
|
self.toolBar = self.iface.addToolBar("SICEN")
|
||||||
self.toolBar.setObjectName("SICEN")
|
self.toolBar.setObjectName("SICEN")
|
||||||
|
|
||||||
## Create action that will start plugin configuration
|
# Create action that will start plugin configuration
|
||||||
self.action = QAction(
|
self.action_open = QAction(
|
||||||
QIcon(":/plugins/sicen/sicen.png"),
|
QIcon(resources_path("icon", "sicen.png")),
|
||||||
u"Ouverture des données SICEN", self.iface.mainWindow())
|
u"Ouverture des données SICEN", self.iface.mainWindow())
|
||||||
self.action.setEnabled(False)
|
self.action_open.setEnabled(False)
|
||||||
IPAddr=socket.gethostbyname(socket.gethostname())
|
if os.access('N:/', os.R_OK):
|
||||||
if IPAddr[0:11] == "100.100.100":
|
self.action_open.setEnabled(True)
|
||||||
self.action.setEnabled(True)
|
|
||||||
elif IPAddr[0:9] == "192.168.0":
|
|
||||||
self.action.setEnabled(True)
|
|
||||||
elif IPAddr[0:9] == "192.168.1":
|
|
||||||
self.action.setEnabled(True)
|
|
||||||
# connect the action to the run method
|
# connect the action to the run method
|
||||||
self.action.triggered.connect(self.ouverture)
|
self.action_open.triggered.connect(self.ouverture)
|
||||||
|
|
||||||
# Add toolbar button and menu item
|
# Add toolbar button and menu item
|
||||||
self.toolBar.addAction(self.action)
|
self.toolBar.addAction(self.action_open)
|
||||||
self.iface.addPluginToMenu(u"SICEN", self.action)
|
self.iface.addPluginToMenu(u"SICEN", self.action_open)
|
||||||
|
|
||||||
## Create action that will start plugin configuration
|
# Create action that will start plugin configuration
|
||||||
self.action = QAction(
|
self.action_export = QAction(
|
||||||
QIcon(":/plugins/sicen/sicen_export.png"),
|
QIcon(resources_path("icon", "sicen_export.png")),
|
||||||
u"Export liste d'espèces", self.iface.mainWindow())
|
u"Export liste d'espèces", self.iface.mainWindow())
|
||||||
self.action.setEnabled(False)
|
self.action_export.setEnabled(False)
|
||||||
IPAddr = socket.gethostbyname(socket.gethostname())
|
IPAddr = socket.gethostbyname(socket.gethostname())
|
||||||
if IPAddr[0:11] == "100.100.100":
|
if IPAddr[0:11] == "100.100.100":
|
||||||
self.action.setEnabled(True)
|
self.action_export.setEnabled(True)
|
||||||
elif IPAddr[0:9] == "192.168.0":
|
elif IPAddr[0:9] == "192.168.0":
|
||||||
self.action.setEnabled(True)
|
self.action_export.setEnabled(True)
|
||||||
elif IPAddr[0:9] == "192.168.1":
|
elif IPAddr[0:9] == "192.168.1":
|
||||||
self.action.setEnabled(True)
|
self.action_export.setEnabled(True)
|
||||||
# connect the action to the run method
|
# connect the action to the run method
|
||||||
self.action.triggered.connect(self.export)
|
self.action_export.triggered.connect(self.export)
|
||||||
|
|
||||||
# Add toolbar button and menu item
|
# Add toolbar button and menu item
|
||||||
self.toolBar.addAction(self.action)
|
self.toolBar.addAction(self.action_export)
|
||||||
self.iface.addPluginToMenu(u"SICEN", self.action)
|
self.iface.addPluginToMenu(u"SICEN", self.action_export)
|
||||||
|
|
||||||
self.menu = QMenu()
|
self.menu = QMenu()
|
||||||
self.menu.setTitle(QCoreApplication.translate("SICEN", "&SICEN"))
|
self.menu.setTitle(QCoreApplication.translate("SICEN", "&SICEN"))
|
||||||
|
|
||||||
self.sicen_ouverture = QAction( QIcon(":/plugins/SICEN/sicen.png"), QCoreApplication.translate("SICEN", u"Ouverture des données SICEN" ), self.iface.mainWindow() )
|
self.sicen_ouverture = QAction(QIcon(resources_path("icon", "sicen.png")), QCoreApplication.translate("SICEN", u"Ouverture des données SICEN"), self.iface.mainWindow())
|
||||||
self.sicen_export = QAction( QIcon(":/plugins/SICEN/sicen_export.png"), QCoreApplication.translate("SICEN", u"Export liste d'espèces" ), self.iface.mainWindow() )
|
self.sicen_export = QAction(QIcon(resources_path("icon", "sicen_export.png")), QCoreApplication.translate("SICEN", u"Export liste d'espèces"), self.iface.mainWindow())
|
||||||
|
|
||||||
self.menu.addActions([self.sicen_ouverture, self.sicen_export])
|
self.menu.addActions([self.sicen_ouverture, self.sicen_export])
|
||||||
|
|
||||||
@@ -155,12 +118,14 @@ class SICEN(object):
|
|||||||
|
|
||||||
def open_about_dialog(self):
|
def open_about_dialog(self):
|
||||||
dialog = AboutDialog(self.iface)
|
dialog = AboutDialog(self.iface)
|
||||||
dialog.exec_()
|
dialog.exec()
|
||||||
|
|
||||||
def unload(self):
|
def unload(self):
|
||||||
# Remove the plugin menu item and icon
|
# Remove the plugin menu item and icon
|
||||||
self.iface.removePluginMenu(u"&SICEN", self.action)
|
self.iface.removePluginMenu(u"&SICEN", self.action_open)
|
||||||
self.iface.removeToolBarIcon(self.action)
|
self.iface.removeToolBarIcon(self.action_open)
|
||||||
|
self.iface.removePluginMenu(u"&SICEN", self.action_export)
|
||||||
|
self.iface.removeToolBarIcon(self.action_export)
|
||||||
|
|
||||||
# run method that performs all the real work
|
# run method that performs all the real work
|
||||||
def ouverture(self):
|
def ouverture(self):
|
||||||
@@ -174,7 +139,7 @@ class SICEN(object):
|
|||||||
cur = account[7]
|
cur = account[7]
|
||||||
con = account[8]
|
con = account[8]
|
||||||
|
|
||||||
## Creation des listes deroulantes
|
# Creation des listes deroulantes
|
||||||
# Listing de valeur des champs
|
# Listing de valeur des champs
|
||||||
SQL_observateur = u"""SELECT DISTINCT nom || '_' || prenom as nom FROM md.personne ORDER BY nom"""
|
SQL_observateur = u"""SELECT DISTINCT nom || '_' || prenom as nom FROM md.personne ORDER BY nom"""
|
||||||
SQL_nom_com = u"""SELECT DISTINCT nom FROM saisie.commune ORDER BY nom"""
|
SQL_nom_com = u"""SELECT DISTINCT nom FROM saisie.commune ORDER BY nom"""
|
||||||
@@ -200,14 +165,14 @@ class SICEN(object):
|
|||||||
|
|
||||||
con.close()
|
con.close()
|
||||||
|
|
||||||
|
|
||||||
# Ajout des items dans les combobox
|
# Ajout des items dans les combobox
|
||||||
self.dlg.observateur_1.clear()
|
self.dlg.observateur_1.clear()
|
||||||
i = 0
|
i = 0
|
||||||
while i < len(list_observateur):
|
while i < len(list_observateur):
|
||||||
self.dlg.observateur_1.addItems(list_observateur[i])
|
self.dlg.observateur_1.addItems(list_observateur[i])
|
||||||
i = i + 1
|
i = i + 1
|
||||||
self.dlg.observateur_1.setCurrentIndex(-1) # Pour ne pas commencer la liste au premier item
|
# Pour ne pas commencer la liste au premier item
|
||||||
|
self.dlg.observateur_1.setCurrentIndex(-1)
|
||||||
|
|
||||||
self.dlg.observateur_2.clear()
|
self.dlg.observateur_2.clear()
|
||||||
i = 0
|
i = 0
|
||||||
@@ -268,7 +233,7 @@ class SICEN(object):
|
|||||||
# show the dialog
|
# show the dialog
|
||||||
self.dlg.show()
|
self.dlg.show()
|
||||||
# Run the dialog event loop
|
# Run the dialog event loop
|
||||||
result = self.dlg.exec_()
|
result = self.dlg.exec()
|
||||||
# See if OK was pressed
|
# See if OK was pressed
|
||||||
if result == 1:
|
if result == 1:
|
||||||
|
|
||||||
@@ -495,7 +460,6 @@ class SICEN(object):
|
|||||||
else:
|
else:
|
||||||
sql_UICN = ''
|
sql_UICN = ''
|
||||||
|
|
||||||
|
|
||||||
if self.dlg.PATRIMONIALITE.isChecked() == 1:
|
if self.dlg.PATRIMONIALITE.isChecked() == 1:
|
||||||
sql_patrimonialite = """"patrimonialite" IS NOT NULL """
|
sql_patrimonialite = """"patrimonialite" IS NOT NULL """
|
||||||
else:
|
else:
|
||||||
@@ -541,7 +505,6 @@ class SICEN(object):
|
|||||||
else:
|
else:
|
||||||
sql_patri74 = ''
|
sql_patri74 = ''
|
||||||
|
|
||||||
|
|
||||||
if self.dlg.ZNIEFF.isChecked() == 1:
|
if self.dlg.ZNIEFF.isChecked() == 1:
|
||||||
sql_znieff = """"znieff" IS NOT NULL """
|
sql_znieff = """"znieff" IS NOT NULL """
|
||||||
else:
|
else:
|
||||||
@@ -572,7 +535,7 @@ class SICEN(object):
|
|||||||
else:
|
else:
|
||||||
sql_pr = ''
|
sql_pr = ''
|
||||||
|
|
||||||
reqwhere_pat = sql_lrd01 + 'OR' + sql_lrd07 + 'OR' + sql_lrd26 + 'OR' + sql_lrd38 + 'OR' + sql_lrd42 + 'OR' + sql_lrd69 + 'OR' + sql_lrd73 + 'OR' + sql_lrd74 + 'OR' + sql_lre + 'OR' + sql_LRN_Flore + 'OR' + sql_LRN_Oiseaux + 'OR' + sql_LRN_Ortho + 'OR' + sql_LRN_Autre + 'OR' + sql_LRR_Flore + 'OR' + sql_LRR_Oiseaux + 'OR' + sql_LRR_Autre + 'OR' + sql_UICN + 'OR' + sql_pd38 + 'OR' + sql_pd42 + 'OR' + sql_pn + 'OR' + sql_pr + 'OR' + sql_dh_an2 + 'OR' + sql_patri01 + 'OR' + sql_patri07 + 'OR' + sql_patri26 + 'OR' + sql_patri38 + 'OR' + sql_patri42 + 'OR' + sql_patri69 + 'OR' + sql_patri73 + 'OR' + sql_patri74 + 'OR' + sql_patrimonialite
|
reqwhere_pat = sql_lrd01 + 'OR' + sql_lrd07 + 'OR' + sql_lrd26 + 'OR' + sql_lrd38 + 'OR' + sql_lrd42 + 'OR' + sql_lrd69 + 'OR' + sql_lrd73 + 'OR' + sql_lrd74 + 'OR' + sql_lre + 'OR' + sql_LRN_Flore + 'OR' + sql_LRN_Oiseaux + 'OR' + sql_LRN_Ortho + 'OR' + sql_LRN_Autre + 'OR' + sql_LRR_Flore + 'OR' + sql_LRR_Oiseaux + 'OR' + sql_LRR_Autre + 'OR' + sql_UICN + 'OR' + sql_pd38 + 'OR' + sql_pd42 + 'OR' + sql_pn + 'OR' + sql_pr + 'OR' + sql_znieff + 'OR' + sql_dh_an2 + 'OR' + sql_patri01 + 'OR' + sql_patri07 + 'OR' + sql_patri26 + 'OR' + sql_patri38 + 'OR' + sql_patri42 + 'OR' + sql_patri69 + 'OR' + sql_patri73 + 'OR' + sql_patri74 + 'OR' + sql_patrimonialite
|
||||||
|
|
||||||
while reqwhere_pat.find('OROR') != - 1:
|
while reqwhere_pat.find('OROR') != - 1:
|
||||||
reqwhere_pat = reqwhere_pat.replace('OROR', 'OR')
|
reqwhere_pat = reqwhere_pat.replace('OROR', 'OR')
|
||||||
@@ -585,7 +548,7 @@ class SICEN(object):
|
|||||||
if self.dlg.bouton_geom.isChecked() == 1:
|
if self.dlg.bouton_geom.isChecked() == 1:
|
||||||
|
|
||||||
layer = self.iface.activeLayer()
|
layer = self.iface.activeLayer()
|
||||||
if layer == None :
|
if layer is None:
|
||||||
# self.iface.messageBar().pushMessage(u"Vous devez sélectionner une table !", level=QgsMessageBar.WARNING, duration=5)
|
# self.iface.messageBar().pushMessage(u"Vous devez sélectionner une table !", level=QgsMessageBar.WARNING, duration=5)
|
||||||
self.iface.messageBar().pushMessage("Ooops", u"Vous devez sélectionner une table !", level=Qgis.Warning, duration=5)
|
self.iface.messageBar().pushMessage("Ooops", u"Vous devez sélectionner une table !", level=Qgis.Warning, duration=5)
|
||||||
|
|
||||||
@@ -619,14 +582,14 @@ class SICEN(object):
|
|||||||
while reqwhere_final[:3] == 'AND':
|
while reqwhere_final[:3] == 'AND':
|
||||||
reqwhere_final = reqwhere_final[3:]
|
reqwhere_final = reqwhere_final[3:]
|
||||||
|
|
||||||
## Affichage des tables
|
# Affichage des tables
|
||||||
table_name = 'observations'
|
table_name = 'observations'
|
||||||
|
|
||||||
uri = QgsDataSourceUri()
|
uri = QgsDataSourceUri()
|
||||||
uri.setConnection(host, port, dbname, user, mdp)
|
uri.setConnection(host, port, dbname, user, mdp)
|
||||||
|
|
||||||
if self.dlg.centroide.isChecked() == 1:
|
if self.dlg.centroide.isChecked() == 1:
|
||||||
### Centroide
|
# Centroide
|
||||||
if reqwhere_final.find('()') != - 1:
|
if reqwhere_final.find('()') != - 1:
|
||||||
reqwhere_final = ''
|
reqwhere_final = ''
|
||||||
print(reqwhere_final)
|
print(reqwhere_final)
|
||||||
@@ -659,9 +622,9 @@ class SICEN(object):
|
|||||||
# groups = toc.
|
# groups = toc.
|
||||||
# groups = toc.groups()
|
# groups = toc.groups()
|
||||||
# index = groups.index(nomgroupe)
|
# index = groups.index(nomgroupe)
|
||||||
index = 1
|
# index = 1
|
||||||
|
|
||||||
### Polygone
|
# Polygone
|
||||||
reqwhere_final_poly = '(' + reqwhere_final + " AND GeometryType(geometrie) LIKE '%POLYGON%'" + ')'
|
reqwhere_final_poly = '(' + reqwhere_final + " AND GeometryType(geometrie) LIKE '%POLYGON%'" + ')'
|
||||||
if reqwhere_final_poly.find('()') != - 1:
|
if reqwhere_final_poly.find('()') != - 1:
|
||||||
reqwhere_final_poly = "(GeometryType(geometrie) LIKE '%POLYGON%')"
|
reqwhere_final_poly = "(GeometryType(geometrie) LIKE '%POLYGON%')"
|
||||||
@@ -680,7 +643,7 @@ class SICEN(object):
|
|||||||
# groupe.addLayer(layer_poly)
|
# groupe.addLayer(layer_poly)
|
||||||
groupe.insertChildNode(0, QgsLayerTreeLayer(layer_poly))
|
groupe.insertChildNode(0, QgsLayerTreeLayer(layer_poly))
|
||||||
|
|
||||||
### Point
|
# Point
|
||||||
reqwhere_final_point = '(' + reqwhere_final + " AND GeometryType(geometrie) LIKE '%POINT%'" + ')'
|
reqwhere_final_point = '(' + reqwhere_final + " AND GeometryType(geometrie) LIKE '%POINT%'" + ')'
|
||||||
if reqwhere_final_point.find('()') != - 1:
|
if reqwhere_final_point.find('()') != - 1:
|
||||||
reqwhere_final_point = "(GeometryType(geometrie) LIKE '%POINT%')"
|
reqwhere_final_point = "(GeometryType(geometrie) LIKE '%POINT%')"
|
||||||
@@ -699,7 +662,7 @@ class SICEN(object):
|
|||||||
# groupe.addLayer(layer_point)
|
# groupe.addLayer(layer_point)
|
||||||
groupe.insertChildNode(0, QgsLayerTreeLayer(layer_point))
|
groupe.insertChildNode(0, QgsLayerTreeLayer(layer_point))
|
||||||
|
|
||||||
### Ligne
|
# Ligne
|
||||||
reqwhere_final_ligne = '(' + reqwhere_final + " AND GeometryType(geometrie) LIKE '%LINE%'" + ')'
|
reqwhere_final_ligne = '(' + reqwhere_final + " AND GeometryType(geometrie) LIKE '%LINE%'" + ')'
|
||||||
if reqwhere_final_ligne.find('()') != - 1:
|
if reqwhere_final_ligne.find('()') != - 1:
|
||||||
reqwhere_final_ligne = "(GeometryType(geometrie) LIKE '%LINE%')"
|
reqwhere_final_ligne = "(GeometryType(geometrie) LIKE '%LINE%')"
|
||||||
@@ -722,8 +685,7 @@ class SICEN(object):
|
|||||||
# legende.setGroupExpanded (index, True)
|
# legende.setGroupExpanded (index, True)
|
||||||
|
|
||||||
# self.iface.messageBar().pushMessage(u"Extraction réussie : ", u" Pensez à renommer vos couches pour plus de lisibilité.", level=QgsMessageBar.INFO, duration=10)
|
# self.iface.messageBar().pushMessage(u"Extraction réussie : ", u" Pensez à renommer vos couches pour plus de lisibilité.", level=QgsMessageBar.INFO, duration=10)
|
||||||
self.iface.messageBar().pushMessage("Info", u"Extraction réussie : ", u" Pensez à renommer vos couches pour plus de lisibilité.", level=Qgis.Success, duration=4)
|
self.iface.messageBar().pushMessage("Info", u"Extraction réussie : ", u" Pensez à renommer vos couches pour plus de lisibilité.", level=Qgis.Info, duration=4)
|
||||||
|
|
||||||
|
|
||||||
elif layer.selectedFeatureCount() == 0:
|
elif layer.selectedFeatureCount() == 0:
|
||||||
# self.iface.messageBar().pushMessage(u"Vous devez sélectionner au moins un polygone !", level=QgsMessageBar.WARNING, duration=5)
|
# self.iface.messageBar().pushMessage(u"Vous devez sélectionner au moins un polygone !", level=QgsMessageBar.WARNING, duration=5)
|
||||||
@@ -752,13 +714,13 @@ class SICEN(object):
|
|||||||
while reqwhere_final[:3] == 'AND':
|
while reqwhere_final[:3] == 'AND':
|
||||||
reqwhere_final = reqwhere_final[3:]
|
reqwhere_final = reqwhere_final[3:]
|
||||||
|
|
||||||
## Affichage des tables
|
# Affichage des tables
|
||||||
table_name = 'observations'
|
table_name = 'observations'
|
||||||
|
|
||||||
uri = QgsDataSourceUri()
|
uri = QgsDataSourceUri()
|
||||||
uri.setConnection(host, port, dbname, user, mdp)
|
uri.setConnection(host, port, dbname, user, mdp)
|
||||||
|
|
||||||
## Centroide
|
# Centroide
|
||||||
if self.dlg.centroide.isChecked() == 1:
|
if self.dlg.centroide.isChecked() == 1:
|
||||||
if reqwhere_final.find('()') != - 1:
|
if reqwhere_final.find('()') != - 1:
|
||||||
reqwhere_final = ''
|
reqwhere_final = ''
|
||||||
@@ -791,9 +753,9 @@ class SICEN(object):
|
|||||||
# groups = toc.
|
# groups = toc.
|
||||||
# groups = toc.groups()
|
# groups = toc.groups()
|
||||||
# index = groups.index(nomgroupe)
|
# index = groups.index(nomgroupe)
|
||||||
index = 1
|
# index = 1
|
||||||
|
|
||||||
### Polygone
|
# Polygone
|
||||||
reqwhere_final_poly = '(' + reqwhere_final + " AND GeometryType(geometrie) LIKE '%POLYGON%'" + ')'
|
reqwhere_final_poly = '(' + reqwhere_final + " AND GeometryType(geometrie) LIKE '%POLYGON%'" + ')'
|
||||||
if reqwhere_final_poly.find('()') != - 1:
|
if reqwhere_final_poly.find('()') != - 1:
|
||||||
reqwhere_final_poly = "(GeometryType(geometrie) LIKE '%POLYGON%')"
|
reqwhere_final_poly = "(GeometryType(geometrie) LIKE '%POLYGON%')"
|
||||||
@@ -812,7 +774,7 @@ class SICEN(object):
|
|||||||
# groupe.addLayer(layer_poly)
|
# groupe.addLayer(layer_poly)
|
||||||
groupe.insertChildNode(0, QgsLayerTreeLayer(layer_poly))
|
groupe.insertChildNode(0, QgsLayerTreeLayer(layer_poly))
|
||||||
|
|
||||||
### Point
|
# Point
|
||||||
reqwhere_final_point = '(' + reqwhere_final + " AND GeometryType(geometrie) LIKE '%POINT%'" + ')'
|
reqwhere_final_point = '(' + reqwhere_final + " AND GeometryType(geometrie) LIKE '%POINT%'" + ')'
|
||||||
if reqwhere_final_point.find('()') != - 1:
|
if reqwhere_final_point.find('()') != - 1:
|
||||||
reqwhere_final_point = "(GeometryType(geometrie) LIKE '%POINT%')"
|
reqwhere_final_point = "(GeometryType(geometrie) LIKE '%POINT%')"
|
||||||
@@ -831,7 +793,7 @@ class SICEN(object):
|
|||||||
# groupe.addLayer(layer_point)
|
# groupe.addLayer(layer_point)
|
||||||
groupe.insertChildNode(0, QgsLayerTreeLayer(layer_point))
|
groupe.insertChildNode(0, QgsLayerTreeLayer(layer_point))
|
||||||
|
|
||||||
### Ligne
|
# Ligne
|
||||||
reqwhere_final_ligne = '(' + reqwhere_final + " AND GeometryType(geometrie) LIKE '%LINE%'" + ')'
|
reqwhere_final_ligne = '(' + reqwhere_final + " AND GeometryType(geometrie) LIKE '%LINE%'" + ')'
|
||||||
if reqwhere_final_ligne.find('()') != - 1:
|
if reqwhere_final_ligne.find('()') != - 1:
|
||||||
reqwhere_final_ligne = "(GeometryType(geometrie) LIKE '%LINE%')"
|
reqwhere_final_ligne = "(GeometryType(geometrie) LIKE '%LINE%')"
|
||||||
@@ -854,7 +816,7 @@ class SICEN(object):
|
|||||||
# legende.setGroupExpanded (index, True)
|
# legende.setGroupExpanded (index, True)
|
||||||
|
|
||||||
# self.iface.messageBar().pushMessage(u"Extraction réussie : ", u" Pensez à renommer vos couches pour plus de lisibilité.", level=QgsMessageBar.INFO, duration=10)
|
# self.iface.messageBar().pushMessage(u"Extraction réussie : ", u" Pensez à renommer vos couches pour plus de lisibilité.", level=QgsMessageBar.INFO, duration=10)
|
||||||
self.iface.messageBar().pushMessage("Info", u"Extraction réussie : ", u" Pensez à renommer vos couches pour plus de lisibilité.", level=Qgis.Success, duration=10)
|
self.iface.messageBar().pushMessage("Info", u"Extraction réussie : ", u" Pensez à renommer vos couches pour plus de lisibilité.", level=Qgis.Info, duration=10)
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -862,7 +824,7 @@ class SICEN(object):
|
|||||||
|
|
||||||
layer = self.iface.activeLayer()
|
layer = self.iface.activeLayer()
|
||||||
|
|
||||||
if layer == None :
|
if layer is None:
|
||||||
# self.iface.messageBar().pushMessage(u"Vous devez sélectionner une table !", level=QgsMessageBar.WARNING, duration=5)
|
# self.iface.messageBar().pushMessage(u"Vous devez sélectionner une table !", level=QgsMessageBar.WARNING, duration=5)
|
||||||
self.iface.messageBar().pushMessage("Ooops", u"Vous devez sélectionner une table !", level=Qgis.Warning, duration=5)
|
self.iface.messageBar().pushMessage("Ooops", u"Vous devez sélectionner une table !", level=Qgis.Warning, duration=5)
|
||||||
|
|
||||||
@@ -876,13 +838,13 @@ class SICEN(object):
|
|||||||
buffer = '100'
|
buffer = '100'
|
||||||
|
|
||||||
account = login_base("account")
|
account = login_base("account")
|
||||||
user = account[0]
|
# user = account[0]
|
||||||
mdp = account[1]
|
# mdp = account[1]
|
||||||
host = account[2]
|
# host = account[2]
|
||||||
port = account[3]
|
# port = account[3]
|
||||||
dbname = account[4]
|
# dbname = account[4]
|
||||||
cur = account[7]
|
cur = account[7]
|
||||||
con = account[8]
|
# con = account[8]
|
||||||
|
|
||||||
SQL_list_sp = u"""SELECT DISTINCT classe::text,ordre::text,nom_complet::text,split_part(nom_vern::text,', ',1) as nom_vern,cd_ref::text as cd_ref,max(COALESCE(date_obs, date_debut_obs))::text AS derniere_obs FROM _agregation_ra.observations_table WHERE ST_intersects(geometrie,ST_Buffer(ST_geomFromText('""" + poly + "',2154), " + buffer + " ))GROUP BY classe::text, ordre::text, nom_complet::text, nom_vern::text, cd_ref::text ORDER BY nom_complet::text"""
|
SQL_list_sp = u"""SELECT DISTINCT classe::text,ordre::text,nom_complet::text,split_part(nom_vern::text,', ',1) as nom_vern,cd_ref::text as cd_ref,max(COALESCE(date_obs, date_debut_obs))::text AS derniere_obs FROM _agregation_ra.observations_table WHERE ST_intersects(geometrie,ST_Buffer(ST_geomFromText('""" + poly + "',2154), " + buffer + " ))GROUP BY classe::text, ordre::text, nom_complet::text, nom_vern::text, cd_ref::text ORDER BY nom_complet::text"""
|
||||||
cur.execute(SQL_list_sp)
|
cur.execute(SQL_list_sp)
|
||||||
@@ -892,44 +854,51 @@ class SICEN(object):
|
|||||||
file = open(chemin_fichier, 'w', newline='', encoding='utf-8')
|
file = open(chemin_fichier, 'w', newline='', encoding='utf-8')
|
||||||
# file.write('\ufeff'.encode('utf8')) # BOM (optionel...Permet a Excel d'ouvrir proprement le fichier en UTF-8)
|
# file.write('\ufeff'.encode('utf8')) # BOM (optionel...Permet a Excel d'ouvrir proprement le fichier en UTF-8)
|
||||||
file.write('\ufeff')
|
file.write('\ufeff')
|
||||||
writer = csv.writer(file, delimiter = ';') # délimiteur ';' pour faciliter l'ouverture avec Excel
|
# délimiteur ';' pour faciliter l'ouverture avec Excel
|
||||||
writer.writerow(['Classe', 'Ordre', 'Nom Complet', 'Nom Vernaculaire','cd_ref', 'Date Derniere Observation']) # Création des entêtes
|
writer = csv.writer(file, delimiter=';')
|
||||||
|
# Création des entêtes
|
||||||
|
writer.writerow(['Classe', 'Ordre', 'Nom Complet', 'Nom Vernaculaire', 'cd_ref', 'Date Derniere Observation'])
|
||||||
|
|
||||||
for row in data_sp : # Boucle d'écriture ligne par ligne dans le csv
|
# Boucle d'écriture ligne par ligne dans le csv
|
||||||
|
for row in data_sp:
|
||||||
# print(1)
|
# print(1)
|
||||||
list_sp = []
|
list_sp = []
|
||||||
if row[0] == None : # Si la valeur est 'None' l'encodage ne peut se faire donc boucle d'évitement
|
# Si la valeur est 'None' l'encodage ne peut se faire donc boucle d'évitement
|
||||||
|
if row[0] is None:
|
||||||
row0 = str(row[0])
|
row0 = str(row[0])
|
||||||
row0 = ''
|
row0 = ''
|
||||||
else:
|
else:
|
||||||
row0 = row[0]
|
row0 = row[0]
|
||||||
# print(row0)
|
# print(row0)
|
||||||
list_sp.append(row0)
|
list_sp.append(row0)
|
||||||
if row[1] == None : # Si la valeur est 'None' l'encodage ne peut se faire donc boucle d'évitement
|
# Si la valeur est 'None' l'encodage ne peut se faire donc boucle d'évitement
|
||||||
|
if row[1] is None:
|
||||||
row1 = str(row[1])
|
row1 = str(row[1])
|
||||||
row1 = ''
|
row1 = ''
|
||||||
else:
|
else:
|
||||||
row1 = row[1]
|
row1 = row[1]
|
||||||
list_sp.append(row1)
|
list_sp.append(row1)
|
||||||
if row[2] == None : # Si la valeur est 'None' l'encodage ne peut se faire donc boucle d'évitement
|
# Si la valeur est 'None' l'encodage ne peut se faire donc boucle d'évitement
|
||||||
|
if row[2] is None:
|
||||||
row2 = str(row[2])
|
row2 = str(row[2])
|
||||||
row2 = ''
|
row2 = ''
|
||||||
else:
|
else:
|
||||||
row2 = row[2]
|
row2 = row[2]
|
||||||
list_sp.append(row2)
|
list_sp.append(row2)
|
||||||
if row[3] == None : # Si la valeur est 'None' l'encodage ne peut se faire donc boucle d'évitement
|
# Si la valeur est 'None' l'encodage ne peut se faire donc boucle d'évitement
|
||||||
|
if row[3] is None:
|
||||||
row3 = str(row[3])
|
row3 = str(row[3])
|
||||||
row3 = ''
|
row3 = ''
|
||||||
else:
|
else:
|
||||||
row3 = row[3]
|
row3 = row[3]
|
||||||
list_sp.append(row3)
|
list_sp.append(row3)
|
||||||
if row[4] == None :
|
if row[4] is None:
|
||||||
row4 = str(row[4])
|
row4 = str(row[4])
|
||||||
row4 = ''
|
row4 = ''
|
||||||
else:
|
else:
|
||||||
row4 = row[4]
|
row4 = row[4]
|
||||||
list_sp.append(row4)
|
list_sp.append(row4)
|
||||||
if row[5] == None :
|
if row[5] is None:
|
||||||
row5 = str(row[5])
|
row5 = str(row[5])
|
||||||
row5 = ''
|
row5 = ''
|
||||||
else:
|
else:
|
||||||
@@ -940,7 +909,7 @@ class SICEN(object):
|
|||||||
|
|
||||||
file.close()
|
file.close()
|
||||||
# self.iface.messageBar().pushMessage(u"Export réussi dans " + chemin_fichier , level=QgsMessageBar.INFO, duration=5)
|
# self.iface.messageBar().pushMessage(u"Export réussi dans " + chemin_fichier , level=QgsMessageBar.INFO, duration=5)
|
||||||
self.iface.messageBar().pushMessage("Ooops", u"Export réussi dans " + chemin_fichier, level=Qgis.Success, duration=5)
|
self.iface.messageBar().pushMessage("Ooops", u"Export réussi dans " + chemin_fichier, level=Qgis.Info, duration=5)
|
||||||
|
|
||||||
elif (layer.selectedFeatureCount() == 0):
|
elif (layer.selectedFeatureCount() == 0):
|
||||||
# self.iface.messageBar().pushMessage(u"Vous devez sélectionner au moins un polygone !", level=QgsMessageBar.WARNING, duration=5)
|
# self.iface.messageBar().pushMessage(u"Vous devez sélectionner au moins un polygone !", level=QgsMessageBar.WARNING, duration=5)
|
||||||
|
|||||||
@@ -20,8 +20,8 @@
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from qgis.PyQt import QtCore, QtGui
|
# from qgis.PyQt import QtCore, QtGui
|
||||||
from qgis.PyQt.QtWidgets import QAction, QDialog
|
from qgis.PyQt.QtWidgets import QDialog
|
||||||
from .ui_sicen import Ui_SICEN
|
from .ui_sicen import Ui_SICEN
|
||||||
# create the dialog for zoom to point
|
# create the dialog for zoom to point
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
@@ -3,10 +3,10 @@
|
|||||||
import configparser
|
import configparser
|
||||||
import shutil
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
import socket
|
# import base64
|
||||||
import base64
|
# import psycopg2
|
||||||
import psycopg2
|
# import psycopg2.extras
|
||||||
import psycopg2.extras
|
import os
|
||||||
from os.path import abspath, join, pardir, dirname
|
from os.path import abspath, join, pardir, dirname
|
||||||
|
|
||||||
from qgis.PyQt import uic
|
from qgis.PyQt import uic
|
||||||
@@ -108,60 +108,60 @@ def load_ui(*args):
|
|||||||
|
|
||||||
return ui_class
|
return ui_class
|
||||||
|
|
||||||
|
|
||||||
def pyperclip():
|
def pyperclip():
|
||||||
IPAddr=socket.gethostbyname(socket.gethostname())
|
dst = dirname(dirname(__file__)) + "\\tools\\"
|
||||||
dst = abspath(abspath(join(plugin_path(), "CenRa_SICEN\\tools\\")))
|
if os.access('N:/', os.R_OK):
|
||||||
if IPAddr[0:11] == "100.100.100": #4269
|
src = 'N:/SI_Systeme d information/Z_QGIS/PLUGIN/PythonSQL.py'
|
||||||
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
|
|
||||||
if IPAddr[0:9] == "192.168.0": #01
|
|
||||||
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
|
|
||||||
if IPAddr[0:9] == "192.168.1": #0726
|
|
||||||
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\PythonSQL.py'
|
|
||||||
try:
|
try:
|
||||||
shutil.copy(src, dst)
|
shutil.copy(src, dst)
|
||||||
except:
|
except FileNotFoundError:
|
||||||
print('404')
|
print('404')
|
||||||
|
except UnboundLocalError:
|
||||||
|
print('404')
|
||||||
|
|
||||||
|
|
||||||
def send_issues(url, titre, body, labels):
|
def send_issues(url, titre, body, labels):
|
||||||
import requests
|
import requests
|
||||||
|
import urllib.request
|
||||||
import json
|
import json
|
||||||
import os
|
# import os
|
||||||
import qgis
|
# import qgis
|
||||||
|
|
||||||
usr = os.environ['USERNAME']
|
# usr = os.environ['USERNAME']
|
||||||
token = '9d0a4e0bea561710e0728f161f7edf4e5201e112'
|
token = '9d0a4e0bea561710e0728f161f7edf4e5201e112'
|
||||||
url = url + '?token=' + token
|
url = url + '?token=' + token
|
||||||
|
|
||||||
headers = {'Authorization': 'token ' + token, 'accept': 'application/json', 'Content-Type': 'application/json'}
|
headers = {'Authorization': 'token ' + token, 'accept': 'application/json', 'Content-Type': 'application/json'}
|
||||||
|
|
||||||
|
|
||||||
payload = {'title': titre, 'body': body, 'labels': labels}
|
payload = {'title': titre, 'body': body, 'labels': labels}
|
||||||
try:
|
try:
|
||||||
urllib.request.urlopen('https://google.com')
|
urllib.request.urlopen('https://google.com')
|
||||||
binar = True
|
binar = True
|
||||||
except:
|
except ValueError:
|
||||||
binar = False
|
binar = False
|
||||||
r = ''
|
r = ''
|
||||||
if binar:
|
if binar:
|
||||||
r = requests.post(url, data=json.dumps(payload), headers=headers)
|
r = requests.post(url, data=json.dumps(payload), headers=headers)
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
|
||||||
def maj_verif(NAME):
|
def maj_verif(NAME):
|
||||||
import qgis
|
import qgis
|
||||||
import urllib.request
|
import urllib.request
|
||||||
iface = qgis.utils.iface
|
iface = qgis.utils.iface
|
||||||
from qgis.core import Qgis
|
from qgis.core import Qgis
|
||||||
|
|
||||||
url = qgis.utils.pluginMetadata(NAME,'repository')
|
# url = qgis.utils.pluginMetadata(NAME, 'repository')
|
||||||
# URL = url+'/raw/branch/main/plugins.xml'
|
# URL = url+'/raw/branch/main/plugins.xml'
|
||||||
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/releases/plugins.xml'
|
URL = 'https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/plugins.xml'
|
||||||
# print(URL)
|
# print(URL)
|
||||||
version = qgis.utils.pluginMetadata(NAME, 'version')
|
version = qgis.utils.pluginMetadata(NAME, 'version')
|
||||||
len_version = len(version)
|
len_version = len(version)
|
||||||
try:
|
try:
|
||||||
urllib.request.urlopen('https://google.com')
|
urllib.request.urlopen('https://google.com')
|
||||||
binar = True
|
binar = True
|
||||||
except:
|
except urllib.error.URLError:
|
||||||
binar = False
|
binar = False
|
||||||
if binar:
|
if binar:
|
||||||
try:
|
try:
|
||||||
@@ -171,11 +171,11 @@ def maj_verif(NAME):
|
|||||||
version_plugin = version_web[valeur_version_web:valeur_version_web + len_version]
|
version_plugin = version_web[valeur_version_web:valeur_version_web + len_version]
|
||||||
if version_plugin != version:
|
if version_plugin != version:
|
||||||
iface.messageBar().pushMessage("MAJ :", "Des mise à jour de plugin sont disponibles.", level=Qgis.Info, duration=30)
|
iface.messageBar().pushMessage("MAJ :", "Des mise à jour de plugin sont disponibles.", level=Qgis.Info, duration=30)
|
||||||
except:
|
except urllib.error.URLError:
|
||||||
print("error gitea version ssl")
|
print("error gitea version ssl")
|
||||||
else:
|
else:
|
||||||
iface.messageBar().pushMessage("WiFi :", "Pas de connection à internet.", level=Qgis.Warning, duration=30)
|
iface.messageBar().pushMessage("WiFi :", "Pas de connection à internet.", level=Qgis.Warning, duration=30)
|
||||||
#return version_plugin
|
|
||||||
|
|
||||||
def devlog(NAME):
|
def devlog(NAME):
|
||||||
import qgis
|
import qgis
|
||||||
|
|||||||
@@ -8,9 +8,10 @@
|
|||||||
# WARNING! All changes made in this file will be lost!
|
# WARNING! All changes made in this file will be lost!
|
||||||
|
|
||||||
from builtins import object
|
from builtins import object
|
||||||
from qgis.PyQt import QtCore, QtGui
|
from qgis.PyQt import QtCore
|
||||||
from qgis.PyQt.QtGui import QFont
|
from qgis.PyQt.QtGui import QFont
|
||||||
from qgis.PyQt.QtWidgets import QAction, QDialog, QDialogButtonBox, QLabel, QApplication, QTabWidget, QWidget, QGroupBox, QGridLayout, QComboBox, QCheckBox, QCalendarWidget, QToolBox, QFrame, QLineEdit, QSizePolicy #Modifié
|
# Modifié
|
||||||
|
from qgis.PyQt.QtWidgets import QDialogButtonBox, QLabel, QApplication, QTabWidget, QWidget, QGroupBox, QGridLayout, QComboBox, QCheckBox, QCalendarWidget, QToolBox, QFrame, QLineEdit, QSizePolicy
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -21,20 +22,22 @@ except AttributeError:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
_encoding = QApplication.UnicodeUTF8
|
_encoding = QApplication.UnicodeUTF8
|
||||||
|
|
||||||
def _translate(context, text, disambig):
|
def _translate(context, text, disambig):
|
||||||
return QApplication.translate(context, text, disambig, _encoding)
|
return QApplication.translate(context, text, disambig, _encoding)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
def _translate(context, text, disambig):
|
def _translate(context, text, disambig):
|
||||||
return QApplication.translate(context, text, disambig)
|
return QApplication.translate(context, text, disambig)
|
||||||
|
|
||||||
|
|
||||||
class Ui_SICEN(object):
|
class Ui_SICEN(object):
|
||||||
def setupUi(self, SICEN):
|
def setupUi(self, SICEN):
|
||||||
SICEN.setObjectName(_fromUtf8("SICEN"))
|
SICEN.setObjectName(_fromUtf8("SICEN"))
|
||||||
SICEN.resize(592, 556)
|
SICEN.resize(592, 556)
|
||||||
self.buttonBox = QDialogButtonBox(SICEN)
|
self.buttonBox = QDialogButtonBox(SICEN)
|
||||||
self.buttonBox.setGeometry(QtCore.QRect(390, 520, 161, 32))
|
self.buttonBox.setGeometry(QtCore.QRect(390, 520, 161, 32))
|
||||||
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
# self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
|
||||||
self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel|QDialogButtonBox.Ok)
|
self.buttonBox.setStandardButtons(QDialogButtonBox.StandardButton(0x00400000) | QDialogButtonBox.StandardButton(0x00000400))
|
||||||
self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
|
self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
|
||||||
self.Titre = QLabel(SICEN)
|
self.Titre = QLabel(SICEN)
|
||||||
self.Titre.setGeometry(QtCore.QRect(110, 10, 331, 31))
|
self.Titre.setGeometry(QtCore.QRect(110, 10, 331, 31))
|
||||||
@@ -46,8 +49,8 @@ class Ui_SICEN(object):
|
|||||||
self.Titre.setObjectName(_fromUtf8("Titre"))
|
self.Titre.setObjectName(_fromUtf8("Titre"))
|
||||||
self.Emprise = QTabWidget(SICEN)
|
self.Emprise = QTabWidget(SICEN)
|
||||||
self.Emprise.setGeometry(QtCore.QRect(10, 80, 571, 431))
|
self.Emprise.setGeometry(QtCore.QRect(10, 80, 571, 431))
|
||||||
self.Emprise.setTabPosition(QTabWidget.North)
|
self.Emprise.setTabPosition(QTabWidget.TabPosition(0))
|
||||||
self.Emprise.setTabShape(QTabWidget.Rounded)
|
self.Emprise.setTabShape(QTabWidget.TabShape(0))
|
||||||
self.Emprise.setObjectName(_fromUtf8("Emprise"))
|
self.Emprise.setObjectName(_fromUtf8("Emprise"))
|
||||||
self.tab_2 = QWidget()
|
self.tab_2 = QWidget()
|
||||||
self.tab_2.setObjectName(_fromUtf8("tab_2"))
|
self.tab_2.setObjectName(_fromUtf8("tab_2"))
|
||||||
@@ -57,7 +60,7 @@ class Ui_SICEN(object):
|
|||||||
font.setBold(True)
|
font.setBold(True)
|
||||||
font.setWeight(75)
|
font.setWeight(75)
|
||||||
self.groupBox_4.setFont(font)
|
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.groupBox_4.setObjectName(_fromUtf8("groupBox_4"))
|
||||||
self.gridLayoutWidget_5 = QWidget(self.groupBox_4)
|
self.gridLayoutWidget_5 = QWidget(self.groupBox_4)
|
||||||
self.gridLayoutWidget_5.setGeometry(QtCore.QRect(10, 20, 521, 51))
|
self.gridLayoutWidget_5.setGeometry(QtCore.QRect(10, 20, 521, 51))
|
||||||
@@ -99,7 +102,7 @@ class Ui_SICEN(object):
|
|||||||
font.setBold(True)
|
font.setBold(True)
|
||||||
font.setWeight(75)
|
font.setWeight(75)
|
||||||
self.groupBox_5.setFont(font)
|
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.groupBox_5.setObjectName(_fromUtf8("groupBox_5"))
|
||||||
self.gridLayoutWidget_6 = QWidget(self.groupBox_5)
|
self.gridLayoutWidget_6 = QWidget(self.groupBox_5)
|
||||||
self.gridLayoutWidget_6.setGeometry(QtCore.QRect(10, 20, 521, 41))
|
self.gridLayoutWidget_6.setGeometry(QtCore.QRect(10, 20, 521, 41))
|
||||||
@@ -113,7 +116,7 @@ class Ui_SICEN(object):
|
|||||||
font.setItalic(True)
|
font.setItalic(True)
|
||||||
font.setWeight(50)
|
font.setWeight(50)
|
||||||
self.label.setFont(font)
|
self.label.setFont(font)
|
||||||
self.label.setAlignment(QtCore.Qt.AlignCenter)
|
self.label.setAlignment(QtCore.Qt.Alignment(5))
|
||||||
self.label.setObjectName(_fromUtf8("label"))
|
self.label.setObjectName(_fromUtf8("label"))
|
||||||
self.gridLayout_6.addWidget(self.label, 0, 0, 1, 1)
|
self.gridLayout_6.addWidget(self.label, 0, 0, 1, 1)
|
||||||
self.label_2 = QLabel(self.gridLayoutWidget_6)
|
self.label_2 = QLabel(self.gridLayoutWidget_6)
|
||||||
@@ -122,7 +125,7 @@ class Ui_SICEN(object):
|
|||||||
font.setItalic(True)
|
font.setItalic(True)
|
||||||
font.setWeight(50)
|
font.setWeight(50)
|
||||||
self.label_2.setFont(font)
|
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.label_2.setObjectName(_fromUtf8("label_2"))
|
||||||
self.gridLayout_6.addWidget(self.label_2, 0, 1, 1, 1)
|
self.gridLayout_6.addWidget(self.label_2, 0, 1, 1, 1)
|
||||||
self.nom_com_1 = QComboBox(self.gridLayoutWidget_6)
|
self.nom_com_1 = QComboBox(self.gridLayoutWidget_6)
|
||||||
@@ -147,7 +150,7 @@ class Ui_SICEN(object):
|
|||||||
font.setBold(True)
|
font.setBold(True)
|
||||||
font.setWeight(75)
|
font.setWeight(75)
|
||||||
self.groupBox_7.setFont(font)
|
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.groupBox_7.setObjectName(_fromUtf8("groupBox_7"))
|
||||||
self.gridLayoutWidget_8 = QWidget(self.groupBox_7)
|
self.gridLayoutWidget_8 = QWidget(self.groupBox_7)
|
||||||
self.gridLayoutWidget_8.setGeometry(QtCore.QRect(10, 20, 520, 191))
|
self.gridLayoutWidget_8.setGeometry(QtCore.QRect(10, 20, 520, 191))
|
||||||
@@ -161,7 +164,7 @@ class Ui_SICEN(object):
|
|||||||
font.setItalic(True)
|
font.setItalic(True)
|
||||||
font.setWeight(50)
|
font.setWeight(50)
|
||||||
self.label_3.setFont(font)
|
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.label_3.setObjectName(_fromUtf8("label_3"))
|
||||||
self.gridLayout_8.addWidget(self.label_3, 0, 0, 1, 1)
|
self.gridLayout_8.addWidget(self.label_3, 0, 0, 1, 1)
|
||||||
self.label_4 = QLabel(self.gridLayoutWidget_8)
|
self.label_4 = QLabel(self.gridLayoutWidget_8)
|
||||||
@@ -170,7 +173,7 @@ class Ui_SICEN(object):
|
|||||||
font.setItalic(True)
|
font.setItalic(True)
|
||||||
font.setWeight(50)
|
font.setWeight(50)
|
||||||
self.label_4.setFont(font)
|
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.label_4.setObjectName(_fromUtf8("label_4"))
|
||||||
self.gridLayout_8.addWidget(self.label_4, 0, 1, 1, 1)
|
self.gridLayout_8.addWidget(self.label_4, 0, 1, 1, 1)
|
||||||
self.date_min = QCalendarWidget(self.gridLayoutWidget_8)
|
self.date_min = QCalendarWidget(self.gridLayoutWidget_8)
|
||||||
@@ -188,7 +191,7 @@ class Ui_SICEN(object):
|
|||||||
font.setBold(True)
|
font.setBold(True)
|
||||||
font.setWeight(75)
|
font.setWeight(75)
|
||||||
self.groupBox_8.setFont(font)
|
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.groupBox_8.setObjectName(_fromUtf8("groupBox_8"))
|
||||||
self.gridLayoutWidget_9 = QWidget(self.groupBox_8)
|
self.gridLayoutWidget_9 = QWidget(self.groupBox_8)
|
||||||
self.gridLayoutWidget_9.setGeometry(QtCore.QRect(10, 20, 491, 21))
|
self.gridLayoutWidget_9.setGeometry(QtCore.QRect(10, 20, 491, 21))
|
||||||
@@ -202,7 +205,7 @@ class Ui_SICEN(object):
|
|||||||
font.setBold(False)
|
font.setBold(False)
|
||||||
font.setWeight(50)
|
font.setWeight(50)
|
||||||
self.Animalia.setFont(font)
|
self.Animalia.setFont(font)
|
||||||
self.Animalia.setLayoutDirection(QtCore.Qt.RightToLeft)
|
self.Animalia.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
|
||||||
self.Animalia.setObjectName(_fromUtf8("Animalia"))
|
self.Animalia.setObjectName(_fromUtf8("Animalia"))
|
||||||
self.gridLayout_9.addWidget(self.Animalia, 0, 0, 1, 1)
|
self.gridLayout_9.addWidget(self.Animalia, 0, 0, 1, 1)
|
||||||
self.Plantae = QCheckBox(self.gridLayoutWidget_9)
|
self.Plantae = QCheckBox(self.gridLayoutWidget_9)
|
||||||
@@ -226,8 +229,8 @@ class Ui_SICEN(object):
|
|||||||
font.setItalic(True)
|
font.setItalic(True)
|
||||||
font.setWeight(50)
|
font.setWeight(50)
|
||||||
self.label_6.setFont(font)
|
self.label_6.setFont(font)
|
||||||
self.label_6.setLayoutDirection(QtCore.Qt.LeftToRight)
|
self.label_6.setLayoutDirection(QtCore.Qt.LayoutDirection(0))
|
||||||
self.label_6.setAlignment(QtCore.Qt.AlignCenter)
|
self.label_6.setAlignment(QtCore.Qt.Alignment(5))
|
||||||
self.label_6.setObjectName(_fromUtf8("label_6"))
|
self.label_6.setObjectName(_fromUtf8("label_6"))
|
||||||
self.gridLayout_11.addWidget(self.label_6, 4, 0, 1, 1)
|
self.gridLayout_11.addWidget(self.label_6, 4, 0, 1, 1)
|
||||||
self.nom_vern = QComboBox(self.gridLayoutWidget_10)
|
self.nom_vern = QComboBox(self.gridLayoutWidget_10)
|
||||||
@@ -245,7 +248,7 @@ class Ui_SICEN(object):
|
|||||||
font.setItalic(True)
|
font.setItalic(True)
|
||||||
font.setWeight(50)
|
font.setWeight(50)
|
||||||
self.label_5.setFont(font)
|
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.label_5.setObjectName(_fromUtf8("label_5"))
|
||||||
self.gridLayout_11.addWidget(self.label_5, 2, 0, 1, 1)
|
self.gridLayout_11.addWidget(self.label_5, 2, 0, 1, 1)
|
||||||
self.nom_complet = QComboBox(self.gridLayoutWidget_10)
|
self.nom_complet = QComboBox(self.gridLayoutWidget_10)
|
||||||
@@ -271,7 +274,7 @@ class Ui_SICEN(object):
|
|||||||
font.setItalic(True)
|
font.setItalic(True)
|
||||||
font.setWeight(50)
|
font.setWeight(50)
|
||||||
self.label_13.setFont(font)
|
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.label_13.setObjectName(_fromUtf8("label_13"))
|
||||||
self.gridLayout_11.addWidget(self.label_13, 0, 0, 1, 1)
|
self.gridLayout_11.addWidget(self.label_13, 0, 0, 1, 1)
|
||||||
self.Emprise.addTab(self.tab, _fromUtf8(""))
|
self.Emprise.addTab(self.tab, _fromUtf8(""))
|
||||||
@@ -279,8 +282,8 @@ class Ui_SICEN(object):
|
|||||||
self.tab_3.setObjectName(_fromUtf8("tab_3"))
|
self.tab_3.setObjectName(_fromUtf8("tab_3"))
|
||||||
self.protections = QToolBox(self.tab_3)
|
self.protections = QToolBox(self.tab_3)
|
||||||
self.protections.setGeometry(QtCore.QRect(10, 10, 511, 391))
|
self.protections.setGeometry(QtCore.QRect(10, 10, 511, 391))
|
||||||
self.protections.setFrameShape(QFrame.NoFrame)
|
self.protections.setFrameShape(QFrame.Shape(0))
|
||||||
self.protections.setFrameShadow(QFrame.Plain)
|
self.protections.setFrameShadow(QFrame.Shadow(0x0010))
|
||||||
self.protections.setLineWidth(1)
|
self.protections.setLineWidth(1)
|
||||||
self.protections.setObjectName(_fromUtf8("protections"))
|
self.protections.setObjectName(_fromUtf8("protections"))
|
||||||
self.page_2 = QWidget()
|
self.page_2 = QWidget()
|
||||||
@@ -292,7 +295,7 @@ class Ui_SICEN(object):
|
|||||||
font.setBold(True)
|
font.setBold(True)
|
||||||
font.setWeight(75)
|
font.setWeight(75)
|
||||||
self.groupBox.setFont(font)
|
self.groupBox.setFont(font)
|
||||||
self.groupBox.setAlignment(QtCore.Qt.AlignCenter)
|
self.groupBox.setAlignment(QtCore.Qt.Alignment(5))
|
||||||
self.groupBox.setObjectName(_fromUtf8("groupBox"))
|
self.groupBox.setObjectName(_fromUtf8("groupBox"))
|
||||||
self.gridLayoutWidget_2 = QWidget(self.groupBox)
|
self.gridLayoutWidget_2 = QWidget(self.groupBox)
|
||||||
self.gridLayoutWidget_2.setGeometry(QtCore.QRect(10, 20, 491, 88))
|
self.gridLayoutWidget_2.setGeometry(QtCore.QRect(10, 20, 491, 88))
|
||||||
@@ -306,7 +309,7 @@ class Ui_SICEN(object):
|
|||||||
font.setBold(False)
|
font.setBold(False)
|
||||||
font.setWeight(50)
|
font.setWeight(50)
|
||||||
self.LRD_38.setFont(font)
|
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.LRD_38.setObjectName(_fromUtf8("LRD_38"))
|
||||||
self.gridLayout_2.addWidget(self.LRD_38, 3, 0, 1, 1)
|
self.gridLayout_2.addWidget(self.LRD_38, 3, 0, 1, 1)
|
||||||
self.LRD_01 = QCheckBox(self.gridLayoutWidget_2)
|
self.LRD_01 = QCheckBox(self.gridLayoutWidget_2)
|
||||||
@@ -314,7 +317,7 @@ class Ui_SICEN(object):
|
|||||||
font.setBold(False)
|
font.setBold(False)
|
||||||
font.setWeight(50)
|
font.setWeight(50)
|
||||||
self.LRD_01.setFont(font)
|
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.LRD_01.setObjectName(_fromUtf8("LRD_01"))
|
||||||
self.gridLayout_2.addWidget(self.LRD_01, 0, 0, 1, 1)
|
self.gridLayout_2.addWidget(self.LRD_01, 0, 0, 1, 1)
|
||||||
self.LRD_07 = QCheckBox(self.gridLayoutWidget_2)
|
self.LRD_07 = QCheckBox(self.gridLayoutWidget_2)
|
||||||
@@ -322,7 +325,7 @@ class Ui_SICEN(object):
|
|||||||
font.setBold(False)
|
font.setBold(False)
|
||||||
font.setWeight(50)
|
font.setWeight(50)
|
||||||
self.LRD_07.setFont(font)
|
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.LRD_07.setObjectName(_fromUtf8("LRD_07"))
|
||||||
self.gridLayout_2.addWidget(self.LRD_07, 1, 0, 1, 1)
|
self.gridLayout_2.addWidget(self.LRD_07, 1, 0, 1, 1)
|
||||||
self.LRD_26 = QCheckBox(self.gridLayoutWidget_2)
|
self.LRD_26 = QCheckBox(self.gridLayoutWidget_2)
|
||||||
@@ -330,7 +333,7 @@ class Ui_SICEN(object):
|
|||||||
font.setBold(False)
|
font.setBold(False)
|
||||||
font.setWeight(50)
|
font.setWeight(50)
|
||||||
self.LRD_26.setFont(font)
|
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.LRD_26.setObjectName(_fromUtf8("LRD_26"))
|
||||||
self.gridLayout_2.addWidget(self.LRD_26, 2, 0, 1, 1)
|
self.gridLayout_2.addWidget(self.LRD_26, 2, 0, 1, 1)
|
||||||
self.LRD_42 = QCheckBox(self.gridLayoutWidget_2)
|
self.LRD_42 = QCheckBox(self.gridLayoutWidget_2)
|
||||||
@@ -367,7 +370,7 @@ class Ui_SICEN(object):
|
|||||||
font.setBold(True)
|
font.setBold(True)
|
||||||
font.setWeight(75)
|
font.setWeight(75)
|
||||||
self.groupBox_2.setFont(font)
|
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.groupBox_2.setObjectName(_fromUtf8("groupBox_2"))
|
||||||
self.gridLayoutWidget_3 = QWidget(self.groupBox_2)
|
self.gridLayoutWidget_3 = QWidget(self.groupBox_2)
|
||||||
self.gridLayoutWidget_3.setGeometry(QtCore.QRect(10, 20, 491, 42))
|
self.gridLayoutWidget_3.setGeometry(QtCore.QRect(10, 20, 491, 42))
|
||||||
@@ -381,7 +384,7 @@ class Ui_SICEN(object):
|
|||||||
font.setBold(False)
|
font.setBold(False)
|
||||||
font.setWeight(50)
|
font.setWeight(50)
|
||||||
self.LRR_Flore.setFont(font)
|
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.LRR_Flore.setObjectName(_fromUtf8("LRR_Flore"))
|
||||||
self.gridLayout_3.addWidget(self.LRR_Flore, 0, 0, 1, 1)
|
self.gridLayout_3.addWidget(self.LRR_Flore, 0, 0, 1, 1)
|
||||||
self.LRR_Oiseaux = QCheckBox(self.gridLayoutWidget_3)
|
self.LRR_Oiseaux = QCheckBox(self.gridLayoutWidget_3)
|
||||||
@@ -389,7 +392,7 @@ class Ui_SICEN(object):
|
|||||||
font.setBold(False)
|
font.setBold(False)
|
||||||
font.setWeight(50)
|
font.setWeight(50)
|
||||||
self.LRR_Oiseaux.setFont(font)
|
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.LRR_Oiseaux.setObjectName(_fromUtf8("LRR_Oiseaux"))
|
||||||
self.gridLayout_3.addWidget(self.LRR_Oiseaux, 1, 0, 1, 1)
|
self.gridLayout_3.addWidget(self.LRR_Oiseaux, 1, 0, 1, 1)
|
||||||
self.LRR_Autre = QCheckBox(self.gridLayoutWidget_3)
|
self.LRR_Autre = QCheckBox(self.gridLayoutWidget_3)
|
||||||
@@ -405,7 +408,7 @@ class Ui_SICEN(object):
|
|||||||
font.setBold(True)
|
font.setBold(True)
|
||||||
font.setWeight(75)
|
font.setWeight(75)
|
||||||
self.groupBox_3.setFont(font)
|
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.groupBox_3.setObjectName(_fromUtf8("groupBox_3"))
|
||||||
self.gridLayoutWidget_4 = QWidget(self.groupBox_3)
|
self.gridLayoutWidget_4 = QWidget(self.groupBox_3)
|
||||||
self.gridLayoutWidget_4.setGeometry(QtCore.QRect(10, 20, 491, 42))
|
self.gridLayoutWidget_4.setGeometry(QtCore.QRect(10, 20, 491, 42))
|
||||||
@@ -426,7 +429,7 @@ class Ui_SICEN(object):
|
|||||||
font.setBold(False)
|
font.setBold(False)
|
||||||
font.setWeight(50)
|
font.setWeight(50)
|
||||||
self.LRN_Flore.setFont(font)
|
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.LRN_Flore.setObjectName(_fromUtf8("LRN_Flore"))
|
||||||
self.gridLayout_4.addWidget(self.LRN_Flore, 0, 0, 1, 1)
|
self.gridLayout_4.addWidget(self.LRN_Flore, 0, 0, 1, 1)
|
||||||
self.LRN_Oiseaux = QCheckBox(self.gridLayoutWidget_4)
|
self.LRN_Oiseaux = QCheckBox(self.gridLayoutWidget_4)
|
||||||
@@ -434,7 +437,7 @@ class Ui_SICEN(object):
|
|||||||
font.setBold(False)
|
font.setBold(False)
|
||||||
font.setWeight(50)
|
font.setWeight(50)
|
||||||
self.LRN_Oiseaux.setFont(font)
|
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.LRN_Oiseaux.setObjectName(_fromUtf8("LRN_Oiseaux"))
|
||||||
self.gridLayout_4.addWidget(self.LRN_Oiseaux, 1, 0, 1, 1)
|
self.gridLayout_4.addWidget(self.LRN_Oiseaux, 1, 0, 1, 1)
|
||||||
self.LRN_Ortho = QCheckBox(self.gridLayoutWidget_4)
|
self.LRN_Ortho = QCheckBox(self.gridLayoutWidget_4)
|
||||||
@@ -456,7 +459,7 @@ class Ui_SICEN(object):
|
|||||||
font.setBold(True)
|
font.setBold(True)
|
||||||
font.setWeight(75)
|
font.setWeight(75)
|
||||||
self.UICN.setFont(font)
|
self.UICN.setFont(font)
|
||||||
self.UICN.setLayoutDirection(QtCore.Qt.RightToLeft)
|
self.UICN.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
|
||||||
self.UICN.setObjectName(_fromUtf8("UICN"))
|
self.UICN.setObjectName(_fromUtf8("UICN"))
|
||||||
self.gridLayout_12.addWidget(self.UICN, 0, 0, 1, 1)
|
self.gridLayout_12.addWidget(self.UICN, 0, 0, 1, 1)
|
||||||
self.LRE = QCheckBox(self.gridLayoutWidget_11)
|
self.LRE = QCheckBox(self.gridLayoutWidget_11)
|
||||||
@@ -485,19 +488,19 @@ class Ui_SICEN(object):
|
|||||||
self.gridLayout.setHorizontalSpacing(50)
|
self.gridLayout.setHorizontalSpacing(50)
|
||||||
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
|
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
|
||||||
self.PATRI38 = QCheckBox(self.gridLayoutWidget)
|
self.PATRI38 = QCheckBox(self.gridLayoutWidget)
|
||||||
self.PATRI38.setLayoutDirection(QtCore.Qt.RightToLeft)
|
self.PATRI38.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
|
||||||
self.PATRI38.setObjectName(_fromUtf8("PATRI38"))
|
self.PATRI38.setObjectName(_fromUtf8("PATRI38"))
|
||||||
self.gridLayout.addWidget(self.PATRI38, 3, 0, 1, 1)
|
self.gridLayout.addWidget(self.PATRI38, 3, 0, 1, 1)
|
||||||
self.PATRI01 = QCheckBox(self.gridLayoutWidget)
|
self.PATRI01 = QCheckBox(self.gridLayoutWidget)
|
||||||
self.PATRI01.setLayoutDirection(QtCore.Qt.RightToLeft)
|
self.PATRI01.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
|
||||||
self.PATRI01.setObjectName(_fromUtf8("PATRI01"))
|
self.PATRI01.setObjectName(_fromUtf8("PATRI01"))
|
||||||
self.gridLayout.addWidget(self.PATRI01, 0, 0, 1, 1)
|
self.gridLayout.addWidget(self.PATRI01, 0, 0, 1, 1)
|
||||||
self.PATRI07 = QCheckBox(self.gridLayoutWidget)
|
self.PATRI07 = QCheckBox(self.gridLayoutWidget)
|
||||||
self.PATRI07.setLayoutDirection(QtCore.Qt.RightToLeft)
|
self.PATRI07.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
|
||||||
self.PATRI07.setObjectName(_fromUtf8("PATRI07"))
|
self.PATRI07.setObjectName(_fromUtf8("PATRI07"))
|
||||||
self.gridLayout.addWidget(self.PATRI07, 1, 0, 1, 1)
|
self.gridLayout.addWidget(self.PATRI07, 1, 0, 1, 1)
|
||||||
self.PATRI26 = QCheckBox(self.gridLayoutWidget)
|
self.PATRI26 = QCheckBox(self.gridLayoutWidget)
|
||||||
self.PATRI26.setLayoutDirection(QtCore.Qt.RightToLeft)
|
self.PATRI26.setLayoutDirection(QtCore.Qt.LayoutDirection(1))
|
||||||
self.PATRI26.setObjectName(_fromUtf8("PATRI26"))
|
self.PATRI26.setObjectName(_fromUtf8("PATRI26"))
|
||||||
self.gridLayout.addWidget(self.PATRI26, 2, 0, 1, 1)
|
self.gridLayout.addWidget(self.PATRI26, 2, 0, 1, 1)
|
||||||
self.PATRI42 = QCheckBox(self.gridLayoutWidget)
|
self.PATRI42 = QCheckBox(self.gridLayoutWidget)
|
||||||
@@ -529,7 +532,7 @@ class Ui_SICEN(object):
|
|||||||
font.setBold(True)
|
font.setBold(True)
|
||||||
font.setWeight(75)
|
font.setWeight(75)
|
||||||
self.groupBox_6.setFont(font)
|
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.groupBox_6.setObjectName(_fromUtf8("groupBox_6"))
|
||||||
self.gridLayoutWidget_7 = QWidget(self.groupBox_6)
|
self.gridLayoutWidget_7 = QWidget(self.groupBox_6)
|
||||||
self.gridLayoutWidget_7.setGeometry(QtCore.QRect(10, 20, 491, 21))
|
self.gridLayoutWidget_7.setGeometry(QtCore.QRect(10, 20, 491, 21))
|
||||||
@@ -550,7 +553,7 @@ class Ui_SICEN(object):
|
|||||||
font.setBold(False)
|
font.setBold(False)
|
||||||
font.setWeight(50)
|
font.setWeight(50)
|
||||||
self.PD_38.setFont(font)
|
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.PD_38.setObjectName(_fromUtf8("PD_38"))
|
||||||
self.gridLayout_7.addWidget(self.PD_38, 0, 0, 1, 1)
|
self.gridLayout_7.addWidget(self.PD_38, 0, 0, 1, 1)
|
||||||
self.PR = QCheckBox(self.page_3)
|
self.PR = QCheckBox(self.page_3)
|
||||||
@@ -604,14 +607,14 @@ class Ui_SICEN(object):
|
|||||||
self.label_12.setObjectName(_fromUtf8("label_12"))
|
self.label_12.setObjectName(_fromUtf8("label_12"))
|
||||||
self.gridLayout_10.addWidget(self.label_12, 1, 1, 1, 1)
|
self.gridLayout_10.addWidget(self.label_12, 1, 1, 1, 1)
|
||||||
self.buffer = QLineEdit(self.gridLayoutWidget_12)
|
self.buffer = QLineEdit(self.gridLayoutWidget_12)
|
||||||
sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
|
sizePolicy = QSizePolicy(QSizePolicy.Policy(4), QSizePolicy.Policy(0))
|
||||||
sizePolicy.setHorizontalStretch(0)
|
sizePolicy.setHorizontalStretch(0)
|
||||||
sizePolicy.setVerticalStretch(0)
|
sizePolicy.setVerticalStretch(0)
|
||||||
sizePolicy.setHeightForWidth(self.buffer.sizePolicy().hasHeightForWidth())
|
sizePolicy.setHeightForWidth(self.buffer.sizePolicy().hasHeightForWidth())
|
||||||
self.buffer.setSizePolicy(sizePolicy)
|
self.buffer.setSizePolicy(sizePolicy)
|
||||||
self.buffer.setMaximumSize(QtCore.QSize(100, 16777215))
|
self.buffer.setMaximumSize(QtCore.QSize(100, 16777215))
|
||||||
self.buffer.setInputMethodHints(QtCore.Qt.ImhPreferNumbers)
|
self.buffer.setInputMethodHints(QtCore.Qt.InputMethodHint(0x8))
|
||||||
self.buffer.setAlignment(QtCore.Qt.AlignCenter)
|
self.buffer.setAlignment(QtCore.Qt.Alignment(5))
|
||||||
self.buffer.setObjectName(_fromUtf8("buffer"))
|
self.buffer.setObjectName(_fromUtf8("buffer"))
|
||||||
self.gridLayout_10.addWidget(self.buffer, 2, 2, 1, 1)
|
self.gridLayout_10.addWidget(self.buffer, 2, 2, 1, 1)
|
||||||
self.label_8 = QLabel(self.gridLayoutWidget_12)
|
self.label_8 = QLabel(self.gridLayoutWidget_12)
|
||||||
@@ -664,7 +667,7 @@ class Ui_SICEN(object):
|
|||||||
font.setBold(False)
|
font.setBold(False)
|
||||||
font.setWeight(50)
|
font.setWeight(50)
|
||||||
self.bouton_geom.setFont(font)
|
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.setText(_fromUtf8(""))
|
||||||
self.bouton_geom.setIconSize(QtCore.QSize(20, 20))
|
self.bouton_geom.setIconSize(QtCore.QSize(20, 20))
|
||||||
self.bouton_geom.setObjectName(_fromUtf8("bouton_geom"))
|
self.bouton_geom.setObjectName(_fromUtf8("bouton_geom"))
|
||||||
@@ -681,7 +684,8 @@ class Ui_SICEN(object):
|
|||||||
self.Emprise.setCurrentIndex(0)
|
self.Emprise.setCurrentIndex(0)
|
||||||
self.protections.setCurrentIndex(0)
|
self.protections.setCurrentIndex(0)
|
||||||
self.buttonBox.accepted.connect(SICEN.accept)
|
self.buttonBox.accepted.connect(SICEN.accept)
|
||||||
self.buttonBox.rejected.connect(SICEN.reject) #Modifié
|
# Modifié
|
||||||
|
self.buttonBox.rejected.connect(SICEN.reject)
|
||||||
QtCore.QMetaObject.connectSlotsByName(SICEN)
|
QtCore.QMetaObject.connectSlotsByName(SICEN)
|
||||||
|
|
||||||
def retranslateUi(self, SICEN):
|
def retranslateUi(self, SICEN):
|
||||||
@@ -753,4 +757,3 @@ class Ui_SICEN(object):
|
|||||||
self.label_11.setText(_translate("SICEN", "4.", None))
|
self.label_11.setText(_translate("SICEN", "4.", None))
|
||||||
self.Emprise.setTabText(self.Emprise.indexOf(self.tab_4), _translate("SICEN", "Filtre par Emprise", None))
|
self.Emprise.setTabText(self.Emprise.indexOf(self.tab_4), _translate("SICEN", "Filtre par Emprise", None))
|
||||||
self.centroide.setText(_translate("SICEN", "Utiliser les centroïdes pour les observations autres que ponctuelles", None))
|
self.centroide.setText(_translate("SICEN", "Utiliser les centroïdes pour les observations autres que ponctuelles", None))
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ Pour la création et le partage :heart:
|
|||||||
|Nom|Version|Statue|Date de création|
|
|Nom|Version|Statue|Date de création|
|
||||||
|---|---|---|---|
|
|---|---|---|---|
|
||||||
|CenRa_AUTOMAP|1.2|Releases|2024-09-25|
|
|CenRa_AUTOMAP|1.2|Releases|2024-09-25|
|
||||||
|CenRa_COPIE|2.1|Releases|06-02-2024|
|
|CenRa_COPIE|2.2|Releases|06-02-2024|
|
||||||
|CenRa_FLUX|2.5|Releases|06-02-2024|
|
|CenRa_FLUX|2.5|Releases|06-02-2024|
|
||||||
|CenRa_METABASE|0.2.0|Alpha|12-09-2024|
|
|CenRa_METABASE|0.2.0|Alpha|12-09-2024|
|
||||||
|CenRa_PAGERENDER|0.1.5|Alpha|09-10-2024|
|
|CenRa_PAGERENDER|0.1.5|Alpha|09-10-2024|
|
||||||
|
|||||||
@@ -1,25 +1,27 @@
|
|||||||
<plugins>
|
<plugins>
|
||||||
<pyqgis_plugin name="CenRa_POSTGIS" version="2.7">
|
<pyqgis_plugin name="CenRa_POSTGIS" version="3.4">
|
||||||
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
|
<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>
|
<qgis_minimum_version>3.16</qgis_minimum_version>
|
||||||
|
<qgis_maximum_version>4.99</qgis_maximum_version>
|
||||||
<homepage>https://plateformesig.cenra-outils.org/</homepage>
|
<homepage>https://plateformesig.cenra-outils.org/</homepage>
|
||||||
<file_name>CenRa_POSTGIS.zip</file_name>
|
<file_name>CenRa_POSTGIS.zip</file_name>
|
||||||
<icon>CEN-Rhone-Alpes.png</icon>
|
<icon>CEN-Rhone-Alpes.png</icon>
|
||||||
<author_name>CEN-Rhone-Alpes</author_name>
|
<author_name>CEN-Rhone-Alpes</author_name>
|
||||||
<download_url>https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/CenRa_POSTGIS.zip</download_url>
|
<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>
|
<uploaded_by>CEN-Rhone-Alpes</uploaded_by>
|
||||||
<create_date>2024-02-06</create_date>
|
<create_date>2026-05-21</create_date>
|
||||||
<update_date>2025-04-03</update_date>
|
<update_date>2026-03-12</update_date>
|
||||||
<experimental>False</experimental>
|
<experimental>False</experimental>
|
||||||
<deprecated>False</deprecated>
|
<deprecated>False</deprecated>
|
||||||
<tags>cenra,postgis</tags>
|
<tags>cenra,postgis</tags>
|
||||||
</pyqgis_plugin>
|
</pyqgis_plugin>
|
||||||
|
|
||||||
<pyqgis_plugin name="CenRa_COPIE" version="2.2">
|
<pyqgis_plugin name="CenRa_COPIE" version="3.2">
|
||||||
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
|
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
|
||||||
<version>2.2</version>
|
<version>3.2</version>
|
||||||
<qgis_minimum_version>3.16</qgis_minimum_version>
|
<qgis_minimum_version>3.16</qgis_minimum_version>
|
||||||
|
<qgis_maximum_version>4.99</qgis_maximum_version>
|
||||||
<homepage>https://plateformesig.cenra-outils.org/</homepage>
|
<homepage>https://plateformesig.cenra-outils.org/</homepage>
|
||||||
<file_name>CenRa_COPIE.zip</file_name>
|
<file_name>CenRa_COPIE.zip</file_name>
|
||||||
<icon>CEN-Rhone-Alpes.png</icon>
|
<icon>CEN-Rhone-Alpes.png</icon>
|
||||||
@@ -27,16 +29,17 @@
|
|||||||
<download_url>https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/CenRa_COPIE.zip</download_url>
|
<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>
|
<uploaded_by>CEN-Rhone-Alpes</uploaded_by>
|
||||||
<create_date>2024-02-06</create_date>
|
<create_date>2024-02-06</create_date>
|
||||||
<update_date>2025-04-03</update_date>
|
<update_date>2026-03-12</update_date>
|
||||||
<experimental>False</experimental>
|
<experimental>False</experimental>
|
||||||
<deprecated>False</deprecated>
|
<deprecated>False</deprecated>
|
||||||
<tags>cenra,copie</tags>
|
<tags>cenra,copie</tags>
|
||||||
</pyqgis_plugin>
|
</pyqgis_plugin>
|
||||||
|
|
||||||
<pyqgis_plugin name="CenRa_SICEN" version="1.9">
|
<pyqgis_plugin name="CenRa_SICEN" version="2.2">
|
||||||
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
|
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
|
||||||
<version>1.9</version>
|
<version>2.2</version>
|
||||||
<qgis_minimum_version>3.16</qgis_minimum_version>
|
<qgis_minimum_version>3.16</qgis_minimum_version>
|
||||||
|
<qgis_maximum_version>4.99</qgis_maximum_version>
|
||||||
<homepage>https://plateformesig.cenra-outils.org/</homepage>
|
<homepage>https://plateformesig.cenra-outils.org/</homepage>
|
||||||
<file_name>CenRa_SICEN.zip</file_name>
|
<file_name>CenRa_SICEN.zip</file_name>
|
||||||
<icon>CEN-Rhone-Alpes.png</icon>
|
<icon>CEN-Rhone-Alpes.png</icon>
|
||||||
@@ -44,33 +47,35 @@
|
|||||||
<download_url>https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/CenRa_SICEN.zip</download_url>
|
<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>
|
<uploaded_by>CEN-Rhone-Alpes</uploaded_by>
|
||||||
<create_date>2024-02-06</create_date>
|
<create_date>2024-02-06</create_date>
|
||||||
<update_date>2025-04-03</update_date>
|
<update_date>2026-03-12</update_date>
|
||||||
<experimental>False</experimental>
|
<experimental>False</experimental>
|
||||||
<deprecated>False</deprecated>
|
<deprecated>False</deprecated>
|
||||||
<tags>cenra,sicen</tags>
|
<tags>cenra,sicen</tags>
|
||||||
</pyqgis_plugin>
|
</pyqgis_plugin>
|
||||||
|
|
||||||
<pyqgis_plugin name="CenRa_FLUX" version="2.6">
|
<pyqgis_plugin name="CenRa_FLUX" version="3.23">
|
||||||
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
|
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
|
||||||
<version>2.6</version>
|
<version>3.23</version>
|
||||||
<qgis_minimum_version>3.16</qgis_minimum_version>
|
<qgis_minimum_version>3.16</qgis_minimum_version>
|
||||||
|
<qgis_maximum_version>4.99</qgis_maximum_version>
|
||||||
<homepage>https://plateformesig.cenra-outils.org/</homepage>
|
<homepage>https://plateformesig.cenra-outils.org/</homepage>
|
||||||
<file_name>CenRa_FLUX.zip</file_name>
|
<file_name>CenRa_FLUX.zip</file_name>
|
||||||
<icon>CEN-Rhone-Alpes.png</icon>
|
<icon>CEN-Rhone-Alpes.png</icon>
|
||||||
<author_name>CEN-Rhone-Alpes</author_name>
|
<author_name>CEN-Rhone-Alpes</author_name>
|
||||||
<download_url>https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/CenRa_FLUX.zip</download_url>
|
<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>
|
<uploaded_by>CEN-Rhone-Alpes</uploaded_by>
|
||||||
<create_date>2024-02-06</create_date>
|
<create_date>2026-05-21</create_date>
|
||||||
<update_date>2025-04-03</update_date>
|
<update_date>2026-03-12</update_date>
|
||||||
<experimental>False</experimental>
|
<experimental>False</experimental>
|
||||||
<deprecated>False</deprecated>
|
<deprecated>False</deprecated>
|
||||||
<tags>cenra,flux</tags>
|
<tags>cenra,flux</tags>
|
||||||
</pyqgis_plugin>
|
</pyqgis_plugin>
|
||||||
|
|
||||||
<pyqgis_plugin name="CenRa_METABASE" version="0.2.1">
|
<pyqgis_plugin name="CenRa_METABASE" version="0.3.2">
|
||||||
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
|
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
|
||||||
<version>0.2.1</version>
|
<version>0.3.2</version>
|
||||||
<qgis_minimum_version>3.16</qgis_minimum_version>
|
<qgis_minimum_version>3.16</qgis_minimum_version>
|
||||||
|
<qgis_maximum_version>4.99</qgis_maximum_version>
|
||||||
<homepage>https://plateformesig.cenra-outils.org/</homepage>
|
<homepage>https://plateformesig.cenra-outils.org/</homepage>
|
||||||
<file_name>CenRa_METABASE.zip</file_name>
|
<file_name>CenRa_METABASE.zip</file_name>
|
||||||
<icon>CEN-Rhone-Alpes.png</icon>
|
<icon>CEN-Rhone-Alpes.png</icon>
|
||||||
@@ -78,41 +83,43 @@
|
|||||||
<download_url>https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/CenRa_METABASE.zip</download_url>
|
<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>
|
<uploaded_by>CEN-Rhone-Alpes</uploaded_by>
|
||||||
<create_date>2024-09-12</create_date>
|
<create_date>2024-09-12</create_date>
|
||||||
<update_date>2025-04-03</update_date>
|
<update_date>2026-03-12</update_date>
|
||||||
<experimental>True</experimental>
|
<experimental>True</experimental>
|
||||||
<deprecated>False</deprecated>
|
<deprecated>False</deprecated>
|
||||||
<tags>cenra,metabase</tags>
|
<tags>cenra,metabase</tags>
|
||||||
</pyqgis_plugin>
|
</pyqgis_plugin>
|
||||||
|
|
||||||
<pyqgis_plugin name="CenRa_AUTOMAP" version="1.4">
|
<pyqgis_plugin name="CenRa_AUTOMAP" version="2.11">
|
||||||
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
|
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
|
||||||
<version>1.4</version>
|
<version>2.11</version>
|
||||||
<qgis_minimum_version>3.16</qgis_minimum_version>
|
<qgis_minimum_version>3.16</qgis_minimum_version>
|
||||||
|
<qgis_maximum_version>4.99</qgis_maximum_version>
|
||||||
<homepage>https://plateformesig.cenra-outils.org/</homepage>
|
<homepage>https://plateformesig.cenra-outils.org/</homepage>
|
||||||
<file_name>CenRa_AUTOMAP.zip</file_name>
|
<file_name>CenRa_AUTOMAP.zip</file_name>
|
||||||
<icon>CEN-Rhone-Alpes.png</icon>
|
<icon>CEN-Rhone-Alpes.png</icon>
|
||||||
<author_name>CEN-Rhone-Alpes</author_name>
|
<author_name>CEN-Rhone-Alpes</author_name>
|
||||||
<download_url>https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/CenRa_AUTOMAP.zip</download_url>
|
<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>
|
<uploaded_by>CEN-Rhone-Alpes</uploaded_by>
|
||||||
<create_date>2024-09-25</create_date>
|
<create_date>2026-05-21</create_date>
|
||||||
<update_date>2025-04-03</update_date>
|
<update_date>2026-03-12</update_date>
|
||||||
<experimental>False</experimental>
|
<experimental>False</experimental>
|
||||||
<deprecated>False</deprecated>
|
<deprecated>False</deprecated>
|
||||||
<tags>cenra,mise en page,atlas</tags>
|
<tags>cenra,mise en page,atlas</tags>
|
||||||
</pyqgis_plugin>
|
</pyqgis_plugin>
|
||||||
|
|
||||||
<pyqgis_plugin name="CenRa_PAGERENDER" version="0.1.6">
|
<pyqgis_plugin name="CenRa_PAGERENDER" version="0.2.5">
|
||||||
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
|
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
|
||||||
<version>0.1.6</version>
|
<version>0.2.5</version>
|
||||||
<qgis_minimum_version>3.16</qgis_minimum_version>
|
<qgis_minimum_version>3.16</qgis_minimum_version>
|
||||||
|
<qgis_maximum_version>4.99</qgis_maximum_version>
|
||||||
<homepage>https://plateformesig.cenra-outils.org/</homepage>
|
<homepage>https://plateformesig.cenra-outils.org/</homepage>
|
||||||
<file_name>CenRa_PAGERENDER.zip</file_name>
|
<file_name>CenRa_PAGERENDER.zip</file_name>
|
||||||
<icon>CEN-Rhone-Alpes.png</icon>
|
<icon>CEN-Rhone-Alpes.png</icon>
|
||||||
<author_name>CEN-Rhone-Alpes</author_name>
|
<author_name>CEN-Rhone-Alpes</author_name>
|
||||||
<download_url>https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/CenRa_PAGERENDER.zip</download_url>
|
<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>
|
<uploaded_by>CEN-Rhone-Alpes</uploaded_by>
|
||||||
<create_date>2024-10-09</create_date>
|
<create_date>2026-03-23</create_date>
|
||||||
<update_date>2025-04-03</update_date>
|
<update_date>2026-03-12</update_date>
|
||||||
<experimental>True</experimental>
|
<experimental>True</experimental>
|
||||||
<deprecated>False</deprecated>
|
<deprecated>False</deprecated>
|
||||||
<tags>cenra,mise en page,atlas</tags>
|
<tags>cenra,mise en page,atlas</tags>
|
||||||
@@ -122,6 +129,7 @@
|
|||||||
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
|
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
|
||||||
<version>0.1.0</version>
|
<version>0.1.0</version>
|
||||||
<qgis_minimum_version>3.16</qgis_minimum_version>
|
<qgis_minimum_version>3.16</qgis_minimum_version>
|
||||||
|
<qgis_maximum_version>4.99</qgis_maximum_version>
|
||||||
<homepage>https://plateformesig.cenra-outils.org/</homepage>
|
<homepage>https://plateformesig.cenra-outils.org/</homepage>
|
||||||
<file_name>CenRa_gn2qgis.zip</file_name>
|
<file_name>CenRa_gn2qgis.zip</file_name>
|
||||||
<icon>CEN-Rhone-Alpes.png</icon>
|
<icon>CEN-Rhone-Alpes.png</icon>
|
||||||
@@ -139,6 +147,7 @@
|
|||||||
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
|
<description>Depot pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.</description>
|
||||||
<version>0.1.0</version>
|
<version>0.1.0</version>
|
||||||
<qgis_minimum_version>3.16</qgis_minimum_version>
|
<qgis_minimum_version>3.16</qgis_minimum_version>
|
||||||
|
<qgis_maximum_version>4.99</qgis_maximum_version>
|
||||||
<homepage>https://plateformesig.cenra-outils.org/</homepage>
|
<homepage>https://plateformesig.cenra-outils.org/</homepage>
|
||||||
<file_name>BiodivAURA.zip</file_name>
|
<file_name>BiodivAURA.zip</file_name>
|
||||||
<icon>CEN-Rhone-Alpes.png</icon>
|
<icon>CEN-Rhone-Alpes.png</icon>
|
||||||
|
|||||||