ouverture des couche flage 00

This commit is contained in:
Tom LAVEILLE 2026-02-26 15:14:49 +01:00
parent a3b634d514
commit 5a03084daa

View File

@ -392,6 +392,8 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
table_name = str(value[1][len(value[0]) + 1:])
else:
table_name = str(value[1])
if type_val == "00":
table_name = value[1]
else:
type_val = ''
schema_name = str(value[0])
@ -598,7 +600,6 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
for row in range(0, self.tableWidget_2.rowCount()):
color_rgba_db = 855030089 # Code couleur pour couche dans autre BD
color_rgba_droit = 851150528 # Code couleur pour droits insuffisants
print(self.tableWidget_2.item(row, 1).background().color().rgba())
if self.tableWidget_2.item(row, 1).background().color().rgba() == color_rgba_droit:
self.QMBquestion = QMessageBox.question(iface.mainWindow(), u"Attention !", "Vous ne disposez pas des droit pour la couche «" + str(self.tableWidget_2.item(row, 1).text()) + ' ' + str(self.tableWidget_2.item(row, 2).text()) + "» !", QMessageBox.StandardButton(0x00004000))
elif self.tableWidget_2.item(row, 1).background().color().rgba() != color_rgba_db:
@ -633,7 +634,6 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
elif code == 'qgis':
# Chargement d'un projet QGIS stocké dans la base de données
schema = self.tableWidget_2.item(row, 2).text()
print(schema)
table = self.tableWidget_2.item(row, 3).text()
uri_project = 'postgresql://' + user + ':' + mdp + '@' + host + ':' + port + '?sslmode=disable&dbname=' + dbtype + "&schema=" + schema + '&project=' + table
QgsProject.instance().read(uri_project)