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

Add new options about safeguards #521

Merged
merged 2 commits into from
Nov 17, 2023
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
10 changes: 10 additions & 0 deletions lizmap/definitions/lizmap_cloud.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
__copyright__ = 'Copyright 2023, 3Liz'
__license__ = 'GPL version 3'
__email__ = '[email protected]'

CLOUD_DOMAIN = 'lizmap.com'
CLOUD_NAME = 'Lizmap Cloud'
CLOUD_MAX_PARENT_FOLDER = 2 # TODO Check COG, is-it 3 ?

CLOUD_ONLINE_URL = 'https://docs.lizmap.cloud'
CLOUD_ONLINE_LANGUAGES = ('en', 'fr')
12 changes: 7 additions & 5 deletions lizmap/definitions/online_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
from qgis.core import QgsSettings
from qgis.PyQt.QtCore import QLocale, QUrl

from lizmap.definitions.lizmap_cloud import (
CLOUD_ONLINE_LANGUAGES,
CLOUD_ONLINE_URL,
)

DOMAIN = 'https://docs.lizmap.com'
VERSION = 'current'
ONLINE_HELP_LANGUAGES = ('en', 'es', 'it', 'ja', 'pt', 'fi', 'fr')

CLOUD = 'https://docs.lizmap.cloud'
CLOUD_HELP_LANGUAGES = ('en', 'fr')


def current_locale() -> str:
""" Get the main language, with 2 characters only. """
Expand All @@ -25,9 +27,9 @@ def current_locale() -> str:
def online_cloud_help(page: str = '') -> QUrl:
""" Online help URL according to locale and version. """
locale = current_locale()
if locale not in CLOUD_HELP_LANGUAGES:
if locale not in CLOUD_ONLINE_LANGUAGES:
locale = 'en'
return QUrl(f"{CLOUD}/{locale}/{page}")
return QUrl(f"{CLOUD_ONLINE_URL}/{locale}/{page}")


def online_lwc_help(page: str = '', version=VERSION) -> QUrl:
Expand Down
26 changes: 26 additions & 0 deletions lizmap/definitions/qgis_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""Definitions for QgsSettings."""

# TODO, use the settings API from QGIS 3.30 etc
# Mail QGIS-Dev 24/10/2023

__copyright__ = 'Copyright 2023, 3Liz'
__license__ = 'GPL version 3'
__email__ = '[email protected]'

KEY = 'lizmap'


class Settings:

@classmethod
def key(cls, key):
return KEY + '/' + key

PreventEcw = 'prevent_ecw'
PreventPgAuthDb = 'prevent_pg_auth_db'
PreventPgService = 'prevent_pg_service'
ForcePgUserPass = 'force_pg_user_password'
PreventDrive = 'prevent_drive'
AllowParentFolder = 'allow_parent_folder'
NumberParentFolder = 'number_parent_folder'
BeginnerMode = 'beginner_mode'
15 changes: 0 additions & 15 deletions lizmap/definitions/warnings.py

This file was deleted.

Loading