Skip to content

Commit

Permalink
Temporary hide some buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry committed Oct 27, 2023
1 parent 949161b commit 2febb21
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 26 deletions.
11 changes: 11 additions & 0 deletions lizmap/dialogs/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,17 @@ def __init__(self, parent=None):

# Filtering features
self.tab_filtering.setCurrentIndex(0)

# Temporary for the next release
self.tab_filtering.removeTab(2)
# Temporary fixer buttons
self.button_use_estimated_md.setVisible(False)
self.label_66.setVisible(False)
self.button_trust_project.setVisible(False)
self.label_79.setVisible(False)
self.button_simplify_geom.setVisible(False)
self.label_82.setVisible(False)

self.helper_list_group.setReadOnly(True)
self.button_helper_group.setToolTip(tr('Select features having at least one group not matching on the server'))
self.button_helper_group.clicked.connect(self.select_unknown_features_group)
Expand Down
51 changes: 25 additions & 26 deletions lizmap/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,11 @@
from lizmap.forms.tooltip_edition import ToolTipEditionDialog
from lizmap.lizmap_api.config import LizmapConfig
from lizmap.ogc_project_validity import OgcProjectValidity
from lizmap.project_checker_tools import (
from lizmap.project_checker_tools import ( # project_trust_layer_metadata,
auto_generated_primary_key_field,
duplicated_layer_name_or_group,
duplicated_layer_with_filter,
invalid_int8_primary_key,
project_trust_layer_metadata,
simplify_provider_side,
use_estimated_metadata,
)
Expand Down Expand Up @@ -2915,7 +2914,7 @@ def project_config_file(
), Html.P)
self.dlg.log_panel.append(message, Html.P)
show_log_panel = True
if Qgis.QGIS_VERSION_INT >= 32200:
if Qgis.QGIS_VERSION_INT >= 39900:
error_cfg_saving = True
self.dlg.log_panel.append(error_cfg_suggest, Html.P)
self.dlg.log_panel.append(error_cfg_message, Html.P, level=Qgis.Critical)
Expand Down Expand Up @@ -3004,8 +3003,7 @@ def project_config_file(
self.dlg.log_panel.end_table()
self.dlg.log_panel.append(tr(
'Visit the layer properties, then in the "Rendering" tab to enable it.'), Html.P)
self.dlg.log_panel.append(error_cfg_suggest, Html.P)
self.dlg.log_panel.append(error_cfg_message, Html.P, level=Qgis.Critical)
# self.dlg.log_panel.append(error_cfg_message, Html.P, level=Qgis.Critical)
show_log_panel = True
error_cfg_saving = True
self.dlg.enabled_simplify_geom(True)
Expand All @@ -3025,7 +3023,7 @@ def project_config_file(
'Edit your PostgreSQL connection to enable this option, then change the datasource by right clicking '
'on each layer above, then click "Change datasource" in the menu. Finally reselect your layer in the '
'new dialog.'), Html.P)
if Qgis.QGIS_VERSION_INT >= 32200:
if Qgis.QGIS_VERSION_INT >= 39900:
self.dlg.log_panel.append(error_cfg_suggest, Html.P)
self.dlg.log_panel.append(error_cfg_message, Html.P, level=Qgis.Critical)
show_log_panel = True
Expand All @@ -3034,32 +3032,33 @@ def project_config_file(
else:
self.dlg.log_panel.append(warning_suggest, Html.P)

if not project_trust_layer_metadata(self.project):
self.dlg.log_panel.append(tr('Trust project metadata'), Html.H2)
self.dlg.log_panel.append(tr(
'The project does not have the "Trust project metadata" enabled at the project level'), Html.P)
self.dlg.log_panel.append(tr(
'In the project properties → Data sources → at the bottom, there is a checkbox to trust the project '
'when the layer has no metadata.'), Html.P)
self.dlg.log_panel.append(error_cfg_suggest, Html.P)
self.dlg.log_panel.append(error_cfg_message, Html.P, level=Qgis.Critical)
show_log_panel = True
error_cfg_saving = True
self.dlg.enabled_trust_project(True)
# if not project_trust_layer_metadata(self.project):
# self.dlg.log_panel.append(tr('Trust project metadata'), Html.H2)
# self.dlg.log_panel.append(tr(
# 'The project does not have the "Trust project metadata" enabled at the project level'), Html.P)
# self.dlg.log_panel.append(tr(
# 'In the project properties → Data sources → at the bottom, there is a checkbox to trust the project '
# 'when the layer has no metadata.'), Html.P)
# self.dlg.log_panel.append(error_cfg_suggest, Html.P)
# self.dlg.log_panel.append(error_cfg_message, Html.P, level=Qgis.Critical)
# show_log_panel = True
# error_cfg_saving = True
# self.dlg.enabled_trust_project(True)

if with_gui and show_log_panel:
self.dlg.mOptionsListWidget.setCurrentRow(log_index_panel)
self.dlg.out_log.moveCursor(QTextCursor.Start)
self.dlg.out_log.ensureCursorVisible()

if with_gui and error_cfg_saving and not ignore_error:
self.dlg.log_panel.append(tr('Issues which can be fixed automatically'), Html.H2)
self.dlg.log_panel.append(tr(
'You have issue(s) listed above, and there is a wizard to auto fix your project. Saving the '
'configuration file is stopping.'), Html.Strong, time=True)
self.dlg.display_message_bar(
"Error", tr('You must fix some issues about this project'), Qgis.Critical)
return None
_ = error_cfg_saving
# if with_gui and error_cfg_saving and not ignore_error:
# self.dlg.log_panel.append(tr('Issues which can be fixed automatically'), Html.H2)
# self.dlg.log_panel.append(tr(
# 'You have issue(s) listed above, and there is a wizard to auto fix your project. Saving the '
# 'configuration file is stopping.'), Html.Strong, time=True)
# self.dlg.display_message_bar(
# "Error", tr('You must fix some issues about this project'), Qgis.Critical)
# return None

metadata = {
'qgis_desktop_version': qgis_version(),
Expand Down

0 comments on commit 2febb21

Please sign in to comment.