Skip to content

Commit

Permalink
New checkbox to disable the automatic permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry committed Jul 4, 2024
1 parent ca8fd43 commit 81217a6
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 16 deletions.
3 changes: 3 additions & 0 deletions lizmap/dialogs/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ def __init__(self, parent=None, is_dev_version=True, lwc_version: LwcVersions =
self.label_link.setToolTip(tooltip)
self.inLayerLink.setToolTip(tooltip)

self.automatic_permalink.setToolTip(tr(
"On every pan, zoom, toggle of a layer, the permalink can be automatically updated in the URL."))

self.use_native_scales.setToolTip(tr(
"It's recommended, for instance on EPSG:3857, text on an external tile will have a better rendering."
))
Expand Down
5 changes: 4 additions & 1 deletion lizmap/lizmap_api/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,11 @@ def __init__(self, project, fix_json=False):
'hideProject': {
'wType': 'checkbox', 'type': 'boolean', 'default': False
},
'automatic_permalink': {
'wType': 'checkbox', 'type': 'boolean', 'default': False, 'use_proper_boolean': True,
},
'wms_single_request_for_all_layers': {
'wType': 'checkbox', 'type': 'boolean', 'default': False
'wType': 'checkbox', 'type': 'boolean', 'default': False, 'use_proper_boolean': True,
},
'tmTimeFrameSize': {
'wType': 'spinbox', 'type': 'integer', 'default': 10
Expand Down
5 changes: 5 additions & 0 deletions lizmap/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,8 @@ def write_log_message(message, tag, level):
# Scales
self.dlg.use_native_scales,
self.dlg.hide_scale_value,
# Permalink
self.dlg.automatic_permalink,
]
self.lwc_versions[LwcVersions.Lizmap_3_8] = [
# Single WMS
Expand Down Expand Up @@ -511,6 +513,7 @@ def write_log_message(message, tag, level):
self.global_options['hideOverview']['widget'] = self.dlg.cbHideOverview
self.global_options['hideNavbar']['widget'] = self.dlg.cbHideNavbar
self.global_options['hideProject']['widget'] = self.dlg.cbHideProject
self.global_options['automatic_permalink']['widget'] = self.dlg.automatic_permalink
self.global_options['wms_single_request_for_all_layers']['widget'] = self.dlg.checkbox_wms_single_request_all_layers
self.global_options['tmTimeFrameSize']['widget'] = self.dlg.inTimeFrameSize
self.global_options['tmTimeFrameType']['widget'] = self.dlg.liTimeFrameType
Expand Down Expand Up @@ -3776,6 +3779,8 @@ def project_config_file(
liz2json["options"]['maxScale'] = self.maximum_scale_value()
if key == 'use_native_zoom_levels':
liz2json["options"]['use_native_zoom_levels'] = self.dlg.use_native_scales.isChecked()
if key == 'automatic_permalink':
liz2json["options"]['automatic_permalink'] = self.dlg.automatic_permalink.isChecked()

for key in self.layers_table.keys():
manager = self.layers_table[key].get('manager')
Expand Down
42 changes: 27 additions & 15 deletions lizmap/resources/ui/ui_lizmap.ui
Original file line number Diff line number Diff line change
Expand Up @@ -795,21 +795,32 @@ QListWidget::item::selected {
</property>
<layout class="QVBoxLayout" name="verticalLayout_15">
<item>
<widget class="QCheckBox" name="cbHideProject">
<property name="text">
<string>Hide project in Lizmap Web Client</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkbox_wms_single_request_all_layers">
<property name="toolTip">
<string>All the map layers will be loaded as a single WMS image</string>
</property>
<property name="text">
<string>Load layers as single WMS layer</string>
</property>
</widget>
<layout class="QGridLayout" name="gridLayout_12">
<item row="0" column="0">
<widget class="QCheckBox" name="cbHideProject">
<property name="text">
<string>Hide project in Lizmap Web Client</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="checkbox_wms_single_request_all_layers">
<property name="toolTip">
<string>All the map layers will be loaded as a single WMS image</string>
</property>
<property name="text">
<string>Load layers as single WMS layer</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="automatic_permalink">
<property name="text">
<string>Enable automatic permalink</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_15">
Expand Down Expand Up @@ -5399,6 +5410,7 @@ This is different to the map maximum extent (defined in QGIS project properties,
<tabstop>server_combo</tabstop>
<tabstop>scrollArea</tabstop>
<tabstop>cbHideProject</tabstop>
<tabstop>automatic_permalink</tabstop>
<tabstop>checkbox_wms_single_request_all_layers</tabstop>
<tabstop>inAcl</tabstop>
<tabstop>button_wizard_group_visibility_project</tabstop>
Expand Down

0 comments on commit 81217a6

Please sign in to comment.