From 261cda419fa6064d6923ecbd68fdb48b14ed30f8 Mon Sep 17 00:00:00 2001 From: Fred C Date: Mon, 25 Mar 2024 20:50:08 +0100 Subject: [PATCH 1/5] update version --- plugin_qgis_lpo/metadata.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin_qgis_lpo/metadata.txt b/plugin_qgis_lpo/metadata.txt index 6218826..e285bd2 100644 --- a/plugin_qgis_lpo/metadata.txt +++ b/plugin_qgis_lpo/metadata.txt @@ -21,5 +21,5 @@ qgisMinimumVersion=3.16 qgisMaximumVersion=3.99 # versioning -version=3.2.0 +version=3.3.0 changelog=https://github.com/lpoaura/PluginQGis-LPOData/blob/master/CHANGELOG.md From 5bde8dfd8f89d4d1c4a01a3246c6efe2a5405e7e Mon Sep 17 00:00:00 2001 From: Fred C Date: Mon, 25 Mar 2024 21:12:56 +0100 Subject: [PATCH 2/5] update docs warning --- docs/usage/advanced_filter.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/usage/advanced_filter.md b/docs/usage/advanced_filter.md index 61ef89a..9864982 100644 --- a/docs/usage/advanced_filter.md +++ b/docs/usage/advanced_filter.md @@ -4,8 +4,10 @@ ## Filtres classiques -> [!IMPORTANT] -> A partir de la version `3.0.0`, le `and` en début de requête n'est plus à mentionner. +:::{Warning} +A partir de la version `3.0.0`, le `and` en début de requête n'est plus à mentionner. +::: + |Filtrer sur...|Un seul critère|Plusieurs critères| |-|-|-| From 79c62f5d3f1709e3325177584ed4f80d8858234e Mon Sep 17 00:00:00 2001 From: Fred C Date: Mon, 25 Mar 2024 21:13:27 +0100 Subject: [PATCH 3/5] Menu --- CHANGELOG.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e60a834..176fd0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/), and this -## Unreleased +## Unreleased - 2024-03-25 + +* Migrate wiki docs to github pages using sphinx +* Update github workflows +* Update plugin name +* Remove refresh data from plugin menu + +## 3.2.2 - 2024-03- + +* Load plugin menu on plugin startup +* Update queries +* New pre-commit SQL formatter +* Update tester github workflow ## 3.2.1 - 2024-03-14 From d40d577816c001bef4429458bbfe6a85c07d13d8 Mon Sep 17 00:00:00 2001 From: Fred C Date: Mon, 25 Mar 2024 22:33:10 +0100 Subject: [PATCH 4/5] Refresh data on --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 176fd0b..b19cabb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,9 +11,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/), and this * Migrate wiki docs to github pages using sphinx * Update github workflows * Update plugin name -* Remove refresh data from plugin menu +* Move refresh data from plugin menu to plugin settings window -## 3.2.2 - 2024-03- +## 3.2.2 - 2024-03-14 * Load plugin menu on plugin startup * Update queries From bb6aac768cb0ee960b610915784f0fa490802042 Mon Sep 17 00:00:00 2001 From: Fred C Date: Mon, 25 Mar 2024 22:37:37 +0100 Subject: [PATCH 5/5] add refresh window opening from settings --- plugin_qgis_lpo/gui/dlg_settings.py | 25 +- plugin_qgis_lpo/gui/dlg_settings.ui | 488 +++++++++++---------- plugin_qgis_lpo/processing/refresh_data.py | 4 +- 3 files changed, 274 insertions(+), 243 deletions(-) diff --git a/plugin_qgis_lpo/gui/dlg_settings.py b/plugin_qgis_lpo/gui/dlg_settings.py index 7a5a510..b6b6b5b 100644 --- a/plugin_qgis_lpo/gui/dlg_settings.py +++ b/plugin_qgis_lpo/gui/dlg_settings.py @@ -10,8 +10,16 @@ from pathlib import Path from urllib.parse import quote +import processing + # PyQGIS -from qgis.core import Qgis, QgsApplication +from qgis.core import ( + Qgis, + QgsApplication, + QgsProcessingException, + QgsProviderConnectionException, + QgsProviderRegistry, +) from qgis.gui import QgsOptionsPageWidget, QgsOptionsWidgetFactory from qgis.PyQt import uic from qgis.PyQt.Qt import QUrl @@ -25,6 +33,7 @@ __uri_tracker__, __version__, ) +from plugin_qgis_lpo.processing.refresh_data import RefreshData from plugin_qgis_lpo.toolbelt import PlgLogger, PlgOptionsManager from plugin_qgis_lpo.toolbelt.preferences import PlgSettingsStructure @@ -76,15 +85,27 @@ def __init__(self, parent): ) self.btn_report.pressed.connect( - partial(QDesktopServices.openUrl, QUrl(f"{__uri_tracker__}new/choose")) + partial(QDesktopServices.openUrl, QUrl(f"{__uri_tracker__}/new/choose")) ) self.btn_reset.setIcon(QIcon(QgsApplication.iconPath("mActionUndo.svg"))) self.btn_reset.pressed.connect(self.reset_settings) + self.btn_refresh_data.setIcon(QIcon(str(__icon_dir_path__ / "refresh.png"))) + self.btn_refresh_data.pressed.connect( + lambda: self.openRefreshProcessing(parent) + ) + self.log(f"TYPE PARENT {type(parent)}", log_level=0, push=True) # load previously saved settings self.load_settings() + def openRefreshProcessing(self, parent): + """Open refresh data processing algorithm and close settings window""" + processing.createAlgorithmDialog( + f"plugin_qgis_lpo:{RefreshData().name()}" + ).show() + parent.close() + def apply(self): """Called to permanently apply the settings shown in the options page (e.g. \ save them to QgsSettings objects). This is usually called when the options \ diff --git a/plugin_qgis_lpo/gui/dlg_settings.ui b/plugin_qgis_lpo/gui/dlg_settings.ui index b96a023..2b947ee 100644 --- a/plugin_qgis_lpo/gui/dlg_settings.ui +++ b/plugin_qgis_lpo/gui/dlg_settings.ui @@ -1,245 +1,255 @@ - wdg_plugin_qgis_lpo_settings - - - - 0 - 0 - 538 - 273 - - - - Traitement des données LPO - Settings + wdg_plugin_qgis_lpo_settings + + + + 0 + 0 + 538 + 273 + + + + Traitement des données LPO - Settings + + + + + + + + + + 0 + 25 + + + + + 16777215 + 30 + + + + + 75 + true + + + + + + + <html><head/><body><p align="center"><span style=" font-weight:600;">PluginTitle - Version X.X.X</span></p></body></html> + + + true + + + Qt::AlignCenter + + + true + + + false + + + Qt::TextSelectableByMouse + + + + + + + + 0 + 100 + + + + + + + Miscellaneous + + + false + + + + + + + 0 + 25 + + + + + 16777215 + 30 + + + + + + + X.X.X + + + Qt::NoTextInteraction + + + + + + + + 0 + 25 + + + + + 16777215 + 30 + + + + + + + Version used to save settings: + + + + + + + Qt::Vertical + + + + 20 + 56 + + + + + + + + + 0 + 25 + + + + + 16777215 + 30 + + + + Enable debug mode. + + + true + + + + + + Debug mode (degraded performances) + + + false + + + + + + + + + + Refresh data + + + + + + + + 200 + 25 + + + + + 16777215 + 30 + + + + true + + + Reset settings to factory defaults + + + + + + + + 200 + 25 + + + + + 500 + 30 + - - - - - - - - 0 - 25 - - - - - 16777215 - 30 - - - - - 75 - true - - - - - - - <html><head/><body><p align="center"><span style=" font-weight:600;">PluginTitle - Version X.X.X</span></p></body></html> - - - true - - - Qt::AlignCenter - - - true - - - false - - - Qt::TextSelectableByMouse - - - - - - - - 0 - 100 - - - - - - - Miscellaneous - - - false - - - - - - - 0 - 25 - - - - - 16777215 - 30 - - - - - - - X.X.X - - - Qt::NoTextInteraction - - - - - - - - 200 - 25 - - - - - 500 - 30 - - - - - - - Report an issue - - - - - - - - 0 - 25 - - - - - 16777215 - 30 - - - - - - - Version used to save settings: - - - - - - - - 200 - 25 - - - - - 500 - 30 - - - - - - - Help - - - - - - - - 200 - 25 - - - - - 16777215 - 30 - - - - true - - - Reset setttings to factory defaults - - - - - - - - 0 - 25 - - - - - 16777215 - 30 - - - - Enable debug mode. - - - true - - - - - - Debug mode (degraded performances) - - - false - - - - - - - - - - Qt::Vertical - - - - 20 - 56 - - - - - + + + + Report an issue + + + + + + + + 200 + 25 + + + + + 500 + 30 + + + + + + + Help + + + + - - + + + + + diff --git a/plugin_qgis_lpo/processing/refresh_data.py b/plugin_qgis_lpo/processing/refresh_data.py index 8118d49..a7a5c04 100644 --- a/plugin_qgis_lpo/processing/refresh_data.py +++ b/plugin_qgis_lpo/processing/refresh_data.py @@ -139,7 +139,7 @@ def populate_settings( ) -> None: """Querying database and populate Qgis Settings""" self.log( - message=self.tr(f"Populate {setting} settings from database - BEGIN"), + message=self.tr(f"{setting} - Data download"), log_level=0, push=False, ) @@ -154,7 +154,7 @@ def populate_settings( self._db_variables.setValue(setting, query_output) self.log( - message=self.tr(f"Populate {setting} settings from database - END"), + message=self.tr(f"{setting} - Data successfully downloaded"), log_level=3, push=False, )