correctif et ajout de fonctionnaliter

This commit is contained in:
Tom LAVEILLE 2024-11-08 09:57:47 +01:00
parent b685580d54
commit 7fd53159e9
14 changed files with 75 additions and 22 deletions

View File

@ -26,6 +26,7 @@ from qgis.PyQt.QtWidgets import (
QToolButton,
QTableWidget,
QTableWidgetItem,
QMessageBox,
QVBoxLayout,
)
from .tools.PythonSQL import *
@ -242,9 +243,9 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
def limite_flux(self):
if self.tableWidget_2.rowCount() > 3:
if self.tableWidget_2.rowCount() > 5:
self.QMBquestion = QMessageBox.question(iface.mainWindow(), u"Attention !",
"Le nombre de flux à charger en une seule fois est limité à 3 pour des questions de performances. Souhaitez vous tout de même charger les " + str(
"Le nombre de flux à charger en une seule fois est limité à 5 pour des questions de performances. Souhaitez vous tout de même charger les " + str(
self.tableWidget_2.rowCount()) + " flux sélectionnés ? (risque de plantage de QGIS)",
QMessageBox.Yes | QMessageBox.No)
if self.QMBquestion == QMessageBox.Yes:
@ -253,7 +254,7 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
if self.QMBquestion == QMessageBox.No:
print("Annulation du chargement des couches")
if self.tableWidget_2.rowCount() <= 3:
if self.tableWidget_2.rowCount() <= 5:
self.chargement_flux()
def chargement_flux(self):

View File

@ -6,7 +6,7 @@
name=CenRa_FLUX
qgisMinimumVersion=3.0
description=Permet d'ouvrire une table dans la base PostGis
version=2.0
version=2.1
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
email=si_besoin@cen-rhonealpes.fr
@ -32,7 +32,7 @@ icon=icon.png
# experimental flag
experimental=False
changelog=<h1>CenRA_FLUX:</h1></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=<h1>CenRA_FLUX:</h1></br><p><h3>22/10/2024 - Version 2.1:</h3> - Correctif de bug.</br> - Evolution de la limit de 3 à 5. </br></p></br><p><h3>22/10/2024 - Version 2.0:</h3> - Reformatage du code.</br></p></br><p><h3>03/10/2024 - Version 1.14:</h3> - Remonte la fênetre dans la pille.</br></p><p><h3>13/09/2024 - Version 1.13:</h3>- MAJ sur le lien du changelog</br>- Bug-fix: Ouvre MultiPolygone et Polygon séparément.</p></br><p><h3>10/09/2024 - Version 1.11:</h3>- Ouverture de table contenant plusieurs géométries.</p></br><p><h3>26/08/2024 - Version 1.10:</h3>- Ajoute d'un changelog et vérification de mise à jour.</p>
# deprecated flag (applies to the whole plugin, not just a single version)
deprecated=False

View File

@ -64,6 +64,12 @@ class Metabase_Editor(QDialog, EDITOR_CLASS):
self.issues_app.setAutoRaise(True)
self.issues_app.setText('')
self.issues_app.setIcon(QIcon(QgsApplication.iconPath('mIconInfo.svg')))
self.auto_adding.setIcon(QtGui.QIcon(resources_path('icons','auto_add.png')))
self.auto_adding.hide()
if os.getlogin() == 'tlaveille' or 'lpoulin' or 'rclement':
self.auto_adding.show()
self.auto_adding.clicked.connect(self.auto_run)
self.issues_app.clicked.connect(self.issues_open)
self.categories_select_view.itemDoubleClicked.connect(self.add_categories_view)
self.categories_view.itemDoubleClicked.connect(self.deleter_categories_view)
@ -78,6 +84,20 @@ class Metabase_Editor(QDialog, EDITOR_CLASS):
self.delete_lien_button.clicked.connect(self.delete_lien)
self.delete_contact_button.clicked.connect(self.delete_contact)
def auto_run(self):
self.role_box.setCurrentIndex(1)
self.nom_line.setText('LAVEILLE')
self.organisation_box.setCurrentIndex(1)
self.email_line.setText('tom.laveille@cen-rhonealpes.fr')
self.telephone_line.setText('0451260811')
self.add_contact()
self.type_box.setCurrentIndex(16)
self.url_line.setText('www.cen-rhonealpes.fr')
self.mime_box.setCurrentIndex(16)
self.format_box.setCurrentIndex(0)
self.taille_line.setText('45')
self.add_lien()
def add_metadata(self):
table_name = layer.dataProvider().uri().table()
schema_name = layer.dataProvider().uri().schema()
@ -363,7 +383,6 @@ class Metabase_Editor(QDialog, EDITOR_CLASS):
self.nbr_layers.setPlainText(count_layers)
self.typegeom_plaintext.setPlainText(geomtype)
crs_name = str(layer.crs().description())
self.crsname_plaintext.setPlainText(crs_name)
crs_code = str(layer.crs().authid())

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

@ -101,9 +101,9 @@
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Myriad Pro Black'; font-size:10pt; font-weight:600; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
@ -365,7 +365,7 @@ p, li { white-space: pre-wrap; }
<date>
<year>2024</year>
<month>12</month>
<day>25</day>
<day>24</day>
</date>
</property>
<property name="currentSection">
@ -830,7 +830,7 @@ p, li { white-space: pre-wrap; }
<date>
<year>2024</year>
<month>12</month>
<day>23</day>
<day>22</day>
</date>
</property>
<property name="currentSection">
@ -1582,7 +1582,7 @@ p, li { white-space: pre-wrap; }
<date>
<year>2024</year>
<month>12</month>
<day>24</day>
<day>23</day>
</date>
</property>
<property name="currentSection">
@ -1681,7 +1681,7 @@ p, li { white-space: pre-wrap; }
<date>
<year>2024</year>
<month>12</month>
<day>24</day>
<day>23</day>
</date>
</property>
<property name="currentSection">
@ -1879,6 +1879,31 @@ p, li { white-space: pre-wrap; }
<enum>Qt::NoArrow</enum>
</property>
</widget>
<widget class="QToolButton" name="auto_adding">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>550</x>
<y>10</y>
<width>41</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string notr="true">...</string>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="arrowType">
<enum>Qt::NoArrow</enum>
</property>
</widget>
</widget>
<tabstops>
<tabstop>titre_line</tabstop>

View File

@ -135,6 +135,7 @@ class PageRender_Editor(QDialog, EDITOR_CLASS):
self.path = path[1:]+'\\demoV2.py'
#self.tabWidget.setStyleSheet('background-image: url('+path+'/tools/bg/Capture.png);')
self.toolButton.setIcon(QtGui.QIcon(resources_path('ui','rotate.png')))
self.horizontalSlider.valueChanged.connect(self.horizontal)
self.verticalSlider.valueChanged.connect(self.vertical)

View File

@ -6,7 +6,7 @@
name=CenRa_PageRender
qgisMinimumVersion=3.0
description=CenRa_PageRender
version=1.2
version=1.3
author=Conservatoire d'Espaces Naturels de Rhône-Alpes
email=si_besoin@cen-rhonealpes.fr
@ -21,7 +21,7 @@ tracker=https://gitea.cenra-outils.org/api/v1/repos/CEN-RA/Plugin_QGIS/issues
hasProcessingProvider=no
# Uncomment the following line and add your changelog:
changelog=<h2>CenRa_PageRender:</h2></br><p><h3>21/10/2024 - Version 1.1: </h3> - Les match en if. </br> - Bouton de scroll et adaptation portrait.</p></br><p><h3>09/10/2024 - Version 1.0: </h3> - Création.</p>
changelog=<h2>CenRa_PageRender:</h2></br><p><h3>08/11/2024 - Version 1.3: </h3> - Correctif de bug. </br><p><h3>21/10/2024 - Version 1.1: </h3> - Les match en if. </br> - Bouton de scroll et adaptation portrait.</p></br><p><h3>09/10/2024 - Version 1.0: </h3> - Création.</p>
# Tags are comma separated with spaces allowed
tags=python

View File

@ -547,7 +547,7 @@
<rect>
<x>210</x>
<y>10</y>
<width>20</width>
<width>16</width>
<height>21</height>
</rect>
</property>
@ -674,6 +674,9 @@
<property name="invertedAppearance">
<bool>true</bool>
</property>
<property name="invertedControls">
<bool>true</bool>
</property>
</widget>
<zorder>frame</zorder>
<zorder>horizontalSlider</zorder>

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -416,9 +416,11 @@ class Postgis_Editor(QDialog, EDITOR_CLASS):
SQL_trigger_length_m = "CREATE TRIGGER length_m" + tablename + " BEFORE INSERT OR UPDATE ON " + schema + "." + tablename + " FOR EACH ROW EXECUTE PROCEDURE ref.length_m();"
SQL_trigger_length_km = "CREATE TRIGGER length_km" + tablename + " BEFORE INSERT OR UPDATE ON " + schema + "." + tablename + " FOR EACH ROW EXECUTE PROCEDURE ref.length_km();"
SQL_trigger_coordonnees = "CREATE TRIGGER coordonnees" + tablename + " BEFORE INSERT OR UPDATE ON " + schema + "." + tablename + " FOR EACH ROW EXECUTE PROCEDURE ref.coordonnees();"
SQL_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 "+schema+"."+tablename+"_gid_seq TO grp_qgis;"
cur.execute(SQL_vierge)
cur.execute(SQL_pkey)
cur.execute(SQL_GRANT_TABLE)
if self.couche_vierge_point.isChecked() == 1 :
cur.execute(SQL_trigger_coordonnees)

View File

@ -29,6 +29,8 @@ else:
os_user = os.environ['USERNAME']
if os_user == 'STAGE':
os_user='stage'
if os_user == 'Administrateur':
os_user='stage'
geom = "geom"
champ_travaux_prevus_multipolygon="""(gid serial NOT NULL, groupe_gestion text, gestion_lib text, id_gestion text, datedebut date, datefin date, commentaire text, surface_m2 double precision, surface_ha double precision, date_creation date, date_maj date, geom geometry(MultiPolygon,2154))"""

View File

@ -51,9 +51,9 @@
<tags>cenra,sicen</tags>
</pyqgis_plugin>
<pyqgis_plugin name="CenRa_FLUX" version="2.0">
<pyqgis_plugin name="CenRa_FLUX" version="2.1">
<description><![CDATA[Dépôt pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.]]></description>
<version>2.0</version>
<version>2.1</version>
<qgis_minimum_version>3.16</qgis_minimum_version>
<homepage>https://plateformesig.cenra-outils.org/</homepage>
<file_name>CenRa_FLUX.zip</file_name>
@ -62,7 +62,7 @@
<download_url>https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/CenRa_FLUX.zip</download_url>
<uploaded_by>CEN-Rhone-Alpes</uploaded_by>
<create_date>2024-02-06</create_date>
<update_date>2024-10-22</update_date>
<update_date>2024-11-08</update_date>
<experimental>False</experimental>
<deprecated>False</deprecated>
<tags>cenra,flux</tags>
@ -102,9 +102,9 @@
<tags>cenra,mise en page,atlas</tags>
</pyqgis_plugin>
<pyqgis_plugin name="CenRa_PAGERENDER" version="1.2">
<pyqgis_plugin name="CenRa_PAGERENDER" version="1.3">
<description><![CDATA[Dépôt pour les extensiont QGIS du CEN Rhone-Alpes, sur GitHub.]]></description>
<version>1.2</version>
<version>1.3</version>
<qgis_minimum_version>3.16</qgis_minimum_version>
<homepage>https://plateformesig.cenra-outils.org/</homepage>
<file_name>CenRa_PAGERENDER.zip</file_name>
@ -113,7 +113,7 @@
<download_url>https://gitea.cenra-outils.org/CEN-RA/Plugin_QGIS/releases/download/latest/CenRa_PAGERENDER.zip</download_url>
<uploaded_by>CEN-Rhone-Alpes</uploaded_by>
<create_date>2024-10-09</create_date>
<update_date>2024-10-21</update_date>
<update_date>2024-11-08</update_date>
<experimental>True</experimental>
<deprecated>False</deprecated>
<tags>cenra,mise en page,atlas</tags>