filtre par localisation bug fix
This commit is contained in:
parent
799a635edc
commit
21a652fdb2
@ -718,6 +718,22 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
||||
|
||||
def getCanevas(self):
|
||||
"""Filtre les couches selon l'emprise du canevas QGIS actuel"""
|
||||
|
||||
# Récupération de la liste des favoris de l'utilisateur
|
||||
SQLFavTable = "SELECT concat(schema_name, '.', table_name) FROM admin_sig.favtable WHERE utilisateur LIKE '" + user + "';"
|
||||
if dbtype == refdb:
|
||||
conSIG = psycopg2.connect("host=" + host + " port=" + port + " dbname=" + sigdb + " user=" + user + " password=" + mdp)
|
||||
curSIG = conSIG.cursor(cursor_factory=psycopg2.extras.DictCursor)
|
||||
curSIG.execute(SQLFavTable)
|
||||
list_fav = curSIG.fetchall()
|
||||
conSIG.close()
|
||||
else:
|
||||
cur.execute(SQLFavTable)
|
||||
list_fav = cur.fetchall()
|
||||
FavList = []
|
||||
for favFind in list_fav:
|
||||
FavList.append(favFind[0])
|
||||
|
||||
# Récupération de l'emprise du canevas
|
||||
poly = iface.mapCanvas().extent()
|
||||
geom = (str(poly.xMinimum()) + ',' + str(poly.yMinimum()) + ',' + str(poly.xMaximum()) + ',' + str(poly.yMaximum()))
|
||||
@ -750,13 +766,28 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
||||
TableSomme = cur.fetchall()[0][0]
|
||||
|
||||
if e[0][1:3] != 'fo':
|
||||
schema_name = e[0][4:]
|
||||
DepName = QTableWidgetItem(e[0][1:3])
|
||||
SchemaName = QTableWidgetItem(e[0][4:])
|
||||
SchemaName = QTableWidgetItem(schema_name)
|
||||
else:
|
||||
schema_name = e[0][6:]
|
||||
DepName = QTableWidgetItem('form')
|
||||
SchemaName = QTableWidgetItem(e[0][6:])
|
||||
TableName = QTableWidgetItem(e[1][len(e[0]) + 1:])
|
||||
FavoritStatut = QTableWidgetItem('FavIcon')
|
||||
SchemaName = QTableWidgetItem(schema_name)
|
||||
table_name = e[1][len(e[0]) + 1:]
|
||||
TableName = QTableWidgetItem(table_name)
|
||||
|
||||
FavStatut = 0
|
||||
if (schema_name + '.' + table_name) not in FavList:
|
||||
FAV = "mStarIconAdd.png"
|
||||
FavStatut = 0
|
||||
else:
|
||||
FAV = "mStarIconDel.png"
|
||||
FavStatut = 1
|
||||
iconFav = QIcon()
|
||||
iconFav.addPixmap(QtGui.QPixmap(resources_path('icons', FAV)), QIcon.Mode(0), QIcon.State(1))
|
||||
self.FavButton = QPushButton(iconFav, "")
|
||||
self.FavButton.clicked.connect(self.AddOrDelToUserFav)
|
||||
|
||||
self.tableWidget.insertRow(row_count)
|
||||
|
||||
itemIcon = QTableWidgetItem()
|
||||
@ -768,7 +799,9 @@ class Flux_Editor(QDialog, EDITOR_CLASS):
|
||||
self.tableWidget.setItem(row_count, 1, DepName)
|
||||
self.tableWidget.setItem(row_count, 2, SchemaName)
|
||||
self.tableWidget.setItem(row_count, 3, TableName)
|
||||
self.tableWidget.setItem(row_count, 3, FavoritStatut)
|
||||
item = QTableWidgetItem(str(FavStatut))
|
||||
self.tableWidget.setItem(row_count, 4, item)
|
||||
self.tableWidget.setCellWidget(row_count, 4, self.FavButton)
|
||||
if TableSomme == 0:
|
||||
for j in range(self.tableWidget.columnCount()):
|
||||
self.tableWidget.item(row_count, j).setBackground(QtGui.QColor(246, 185, 73, 50))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user