This commit is contained in:
2025-07-28 16:45:44 +02:00
parent 1cd816c706
commit 7a3814a429
3 changed files with 181 additions and 172 deletions
+10 -11
View File
@@ -11,7 +11,7 @@ from qgis.utils import iface
import qgis
#include <QSettings>
# include <QSettings>
'''
from pg_metadata.connection_manager import (
store_connections,
@@ -24,8 +24,9 @@ from pg_metadata.processing.provider import PgMetadataProvider
from pg_metadata.qgis_plugin_tools.tools.custom_logging import setup_logger
'''
import os
from qgis.PyQt.QtCore import QSettings
from .tools.resources import (
plugin_path,
# plugin_path,
resources_path,
pyperclip,
maj_verif,
@@ -37,9 +38,6 @@ from .style_invoke import AutoMap_Style
from .about_form import AboutDialog
from qgis.PyQt.QtCore import *
class PgAutoMap:
def __init__(self):
""" Constructor. """
@@ -51,18 +49,18 @@ class PgAutoMap:
self.dock_action = None
self.help_action = None
plugin_dir = os.path.dirname(__file__)
end_find = plugin_dir.rfind('\\')+1
end_find = plugin_dir.rfind('\\') + 1
global NAME
NAME = plugin_dir[end_find:]
maj_verif(NAME)
# Display About window on first use
version = qgis.utils.pluginMetadata('CenRa_AUTOMAP','version')
version = qgis.utils.pluginMetadata('CenRa_AUTOMAP', 'version')
s = QSettings()
versionUse = s.value("automap/version", 1, type=str)
if str(versionUse) != str(version) :
if str(versionUse) != str(version):
s.setValue("automap/version", str(version))
print(versionUse,version)
print(versionUse, version)
self.open_about_dialog()
def initGui(self):
@@ -80,7 +78,7 @@ class PgAutoMap:
if not self.canvas_editor:
self.canvas_editor = AutoMap_Editor()
self.automap_action = QAction(icon, 'CenRa_AutoMap',None)
self.automap_action = QAction(icon, 'CenRa_AutoMap', None)
self.toolBar.addAction(self.automap_action)
self.automap_action.triggered.connect(self.open_editor)
@@ -129,6 +127,7 @@ class PgAutoMap:
"""
dialog = AboutDialog(iface)
dialog.exec()
def open_help():
""" Open the online help. """
QDesktopServices.openUrl(QUrl('https://plateformesig.cenra-outils.org/'))
@@ -140,7 +139,7 @@ class PgAutoMap:
def unload(self):
""" Unload the plugin. """
if self.canvas_editor:
iface.removePluginMenu('CenRa_AutoMap',self.automap_action)
iface.removePluginMenu('CenRa_AutoMap', self.automap_action)
if self.provider:
QgsApplication.processingRegistry().removeProvider(self.provider)