forked from CEN-RA/Plugin_QGIS
comment code writing in comments
This commit is contained in:
parent
7ad428ff5d
commit
bf4cb3de7f
@ -119,39 +119,39 @@ class PgMetadata:
|
|||||||
# self.issues_action = QAction(icon, 'CenRa_Metabase',None)
|
# self.issues_action = QAction(icon, 'CenRa_Metabase',None)
|
||||||
# self.toolBar.addAction(self.issues_action)
|
# self.toolBar.addAction(self.issues_action)
|
||||||
# self.issues_action.triggered.connect(self.open_issues)
|
# self.issues_action.triggered.connect(self.open_issues)
|
||||||
'''
|
# '''
|
||||||
if not self.locator_filter:
|
# if not self.locator_filter:
|
||||||
self.locator_filter = LocatorFilter(iface)
|
# self.locator_filter = LocatorFilter(iface)
|
||||||
iface.registerLocatorFilter(self.locator_filter)
|
# iface.registerLocatorFilter(self.locator_filter)
|
||||||
|
|
||||||
@staticmethod
|
# @staticmethod
|
||||||
def check_invalid_connection_names():
|
# def check_invalid_connection_names():
|
||||||
""" Check for invalid connection names in the QgsSettings. """
|
# """ Check for invalid connection names in the QgsSettings. """
|
||||||
valid, invalid = validate_connections_names()
|
# valid, invalid = validate_connections_names()
|
||||||
n_invalid = len(invalid)
|
# n_invalid = len(invalid)
|
||||||
|
|
||||||
if n_invalid == 0:
|
# if n_invalid == 0:
|
||||||
return
|
# return
|
||||||
|
|
||||||
invalid_text = ', '.join(invalid)
|
# invalid_text = ', '.join(invalid)
|
||||||
msg = QMessageBox()
|
# msg = QMessageBox()
|
||||||
msg.setIcon(QMessageBox.Warning)
|
# msg.setIcon(QMessageBox.Warning)
|
||||||
msg.setWindowTitle(tr('PgMetadata: Database connection(s) not available'))
|
# msg.setWindowTitle(tr('PgMetadata: Database connection(s) not available'))
|
||||||
msg.setText(tr(
|
# msg.setText(tr(
|
||||||
f'{n_invalid} connection(s) listed in PgMetadata’s settings are invalid or '
|
# f'{n_invalid} connection(s) listed in PgMetadata’s settings are invalid or '
|
||||||
f'no longer available: {invalid_text}'))
|
# f'no longer available: {invalid_text}'))
|
||||||
msg.setInformativeText(tr(
|
# msg.setInformativeText(tr(
|
||||||
'Do you want to remove these connection(s) from the PgMetadata settings? '
|
# 'Do you want to remove these connection(s) from the PgMetadata settings? '
|
||||||
'(You can also do this later with the “Set Connections” tool.)'))
|
# '(You can also do this later with the “Set Connections” tool.)'))
|
||||||
msg.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
|
# msg.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
|
||||||
clicked = msg.exec()
|
# clicked = msg.exec()
|
||||||
|
|
||||||
if clicked == QMessageBox.Yes:
|
# if clicked == QMessageBox.Yes:
|
||||||
iface.messageBar().pushSuccess('PgMetadata', tr(f'{n_invalid} invalid connection(s) removed.'))
|
# iface.messageBar().pushSuccess('PgMetadata', tr(f'{n_invalid} invalid connection(s) removed.'))
|
||||||
store_connections(valid)
|
# store_connections(valid)
|
||||||
if clicked == QMessageBox.No:
|
# if clicked == QMessageBox.No:
|
||||||
iface.messageBar().pushInfo('PgMetadata', tr(f'Keeping {n_invalid} invalid connections.'))
|
# 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
|
||||||
@ -160,7 +160,7 @@ class PgMetadata:
|
|||||||
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/'))
|
||||||
|
|
||||||
def open_dock(self):
|
def open_dock(self):
|
||||||
""" Open the dock. """
|
""" Open the dock. """
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user