comment code writing in comments

This commit is contained in:
Colas Geier 2025-02-04 18:18:25 +01:00
parent 01c3cfcca6
commit c1ceb1eeaf

View File

@ -77,48 +77,49 @@ class PgAutoMap:
self.automap_action = QAction(icon, 'CenIsere_AutoMap',None)
self.toolBar.addAction(self.automap_action)
self.automap_action.triggered.connect(self.open_editor)
'''
if not self.locator_filter:
self.locator_filter = LocatorFilter(iface)
iface.registerLocatorFilter(self.locator_filter)
# '''
# 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)
# @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
# 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 PgMetadatas 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()
# 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 PgMetadatas 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.'))
'''
# 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):
"""
About dialog
"""
dialog = AutoMapAboutDialog(iface)
dialog.exec_()
def open_help():
""" Open the online help. """
QDesktopServices.openUrl(QUrl('https://plateformesig.CenIsere-outils.org/'))
# QDesktopServices.openUrl(QUrl('https://plateformesig.CenIsere-outils.org/'))
def open_editor(self):
self.canvas_editor.show()