Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh data from settings #126

Merged
merged 5 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

Check warning on line 13 in plugin_qgis_lpo/gui/dlg_settings.py

View check run for this annotation

Codecov / codecov/patch

plugin_qgis_lpo/gui/dlg_settings.py#L13

Added line #L13 was not covered by tests

# PyQGIS
from qgis.core import Qgis, QgsApplication
from qgis.core import (

Check warning on line 16 in plugin_qgis_lpo/gui/dlg_settings.py

View check run for this annotation

Codecov / codecov/patch

plugin_qgis_lpo/gui/dlg_settings.py#L16

Added line #L16 was not covered by tests
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

Check warning on line 36 in plugin_qgis_lpo/gui/dlg_settings.py

View check run for this annotation

Codecov / codecov/patch

plugin_qgis_lpo/gui/dlg_settings.py#L36

Added line #L36 was not covered by tests
from plugin_qgis_lpo.toolbelt import PlgLogger, PlgOptionsManager
from plugin_qgis_lpo.toolbelt.preferences import PlgSettingsStructure

Expand Down Expand Up @@ -76,15 +85,27 @@
)

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")))

Check warning on line 94 in plugin_qgis_lpo/gui/dlg_settings.py

View check run for this annotation

Codecov / codecov/patch

plugin_qgis_lpo/gui/dlg_settings.py#L94

Added line #L94 was not covered by tests
self.btn_refresh_data.pressed.connect(
lambda: self.openRefreshProcessing(parent)
)
self.log(f"TYPE PARENT {type(parent)}", log_level=0, push=True)

Check warning on line 98 in plugin_qgis_lpo/gui/dlg_settings.py

View check run for this annotation

Codecov / codecov/patch

plugin_qgis_lpo/gui/dlg_settings.py#L98

Added line #L98 was not covered by tests
# load previously saved settings
self.load_settings()

def openRefreshProcessing(self, parent):

Check warning on line 102 in plugin_qgis_lpo/gui/dlg_settings.py

View check run for this annotation

Codecov / codecov/patch

plugin_qgis_lpo/gui/dlg_settings.py#L102

Added line #L102 was not covered by tests
"""Open refresh data processing algorithm and close settings window"""
processing.createAlgorithmDialog(

Check warning on line 104 in plugin_qgis_lpo/gui/dlg_settings.py

View check run for this annotation

Codecov / codecov/patch

plugin_qgis_lpo/gui/dlg_settings.py#L104

Added line #L104 was not covered by tests
f"plugin_qgis_lpo:{RefreshData().name()}"
).show()
parent.close()

Check warning on line 107 in plugin_qgis_lpo/gui/dlg_settings.py

View check run for this annotation

Codecov / codecov/patch

plugin_qgis_lpo/gui/dlg_settings.py#L107

Added line #L107 was not covered by tests

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