Skip to content

Commit

Permalink
Merge pull request #126 from lpoaura/refresh_data_from_settings
Browse files Browse the repository at this point in the history
Refresh data from settings
  • Loading branch information
lpofredc committed Mar 25, 2024
2 parents ddd491f + bb6aac7 commit 6c548b7
Show file tree
Hide file tree
Showing 6 changed files with 292 additions and 247 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/), and this

<!-- ## Unreleased [{version_tag}](https://github.com/opengisch/qgis-plugin-ci/releases/tag/{version_tag}) - YYYY-MM-DD -->

## Unreleased
## Unreleased - 2024-03-25

* Migrate wiki docs to github pages using sphinx
* Update github workflows
* Update plugin name
* Move refresh data from plugin menu to plugin settings window

## 3.2.2 - 2024-03-14

* Load plugin menu on plugin startup
* Update queries
* New pre-commit SQL formatter
* Update tester github workflow

## 3.2.1 - 2024-03-14

Expand Down
6 changes: 4 additions & 2 deletions docs/usage/advanced_filter.md
Original file line number Diff line number Diff line change
Expand Up @@ -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|
|-|-|-|
Expand Down
25 changes: 23 additions & 2 deletions plugin_qgis_lpo/gui/dlg_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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 \
Expand Down
Loading

0 comments on commit 6c548b7

Please sign in to comment.