Skip to content

Commit

Permalink
UX - Fix bug about missing LWC target version in the UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry committed Jan 18, 2024
1 parent 9996baa commit dce5918
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 0 additions & 2 deletions lizmap/dialogs/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ def __init__(self, parent=None, is_dev_version=True, lwc_version: LwcVersions =
self.mOptionsStackedWidget.currentChanged.connect(self.panel_changed)

self.is_dev_version = is_dev_version
self.navigation_menu_ok = None

self.label_lizmap_logo.setText('')
pixmap = QPixmap(resources_path('icons', 'logo.png'))
Expand Down Expand Up @@ -1094,7 +1093,6 @@ def save_settings(self):

def allow_navigation(self, allow_navigation: bool, message: str = ''):
""" Allow the navigation or not in the UI. """
self.navigation_menu_ok = allow_navigation
for i in range(1, self.mOptionsListWidget.count()):
item = self.mOptionsListWidget.item(i)
if allow_navigation:
Expand Down
8 changes: 3 additions & 5 deletions lizmap/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -917,11 +917,6 @@ def current_lwc_version(self) -> LwcVersions:

def target_server_changed(self):
""" When the server destination has changed in the selector. """
if not self.dlg.navigation_menu_ok:
# If the menu is not allowed, it means we don't need to know if the server has changed
# The user is still on the first information panel and it's not OK.
return

current_authid = self.dlg.server_combo.currentData(ServerComboData.AuthId.value)
current_url = self.dlg.server_combo.currentData(ServerComboData.ServerUrl.value)
current_metadata = self.dlg.server_combo.currentData(ServerComboData.JsonMetadata.value)
Expand Down Expand Up @@ -985,6 +980,9 @@ def target_repository_changed(self):
def lwc_version_changed(self):
""" When the version has changed in the selector, we update features with the blue background. """
current_version = self.current_lwc_version()
if not current_version:
LOGGER.info("No LWC version currently defined in the combobox, skipping LWC target version changed.")
return

LOGGER.debug("Saving new value about the LWC target version : {}".format(current_version.value))
QgsSettings().setValue('lizmap/lizmap_web_client_version', str(current_version.value))
Expand Down

0 comments on commit dce5918

Please sign in to comment.