Skip to content

Commit

Permalink
Merge branch 'dev-3.6' into master-3.6
Browse files Browse the repository at this point in the history
# Conflicts:
#	core/ui/toolbars/utilities/style_manager.ui
#	dbmodel
  • Loading branch information
smaspons committed Sep 24, 2024
2 parents 7aa4707 + e928459 commit 7ae03ce
Show file tree
Hide file tree
Showing 91 changed files with 2,249 additions and 2,027 deletions.
2 changes: 1 addition & 1 deletion config/giswater.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use_notify = TRUE # Use postgres notify
show_help = 0
locale = en_US, es_ES, ca_ES, pt_BR, pt_PT, fr_FR
deprecated_section_init = psector_rapport, cadtools, search, qgis_toolbar_hidebuttons, dialogs, btn_search,
current_selections, action_shortcuts
current_selections, action_shortcuts, toolbars_shortcuts
deprecated_section_session = psector_rapport, cadtools, visit, import_file, search
deprecated_vars_init = system.super_user, system.log_sql_shortcut, system.log_level, system.log_sql,
system.db_limit_characters, system.check_backend_function, system.user_level, system.log_limit_characters,
Expand Down
56 changes: 4 additions & 52 deletions config/user_params.config
Original file line number Diff line number Diff line change
Expand Up @@ -29,58 +29,6 @@ shortcut_reset_plugin = None #Shortcut to perform a reset of Giswater
shortcut_open_curselectors = None #Shortcut to open the current selectors docker
shortcut_toggle_log_db = Alt+1 #Shortcut to show DB&Notify logs

[init.toolbars_shortcuts]
# basic
37 = None #GwInfoButton
142 = None #GwSelectorButton
143 = None #GwSearchButton
# om
26 = None #GwMincutButton
27 = None #GwMincutManagerButton
43 = None #GwProfileButton
56 = None #GwFlowTraceButton
57 = None #GwFlowExitButton
64 = None #GwVisitButton
65 = None #GwVisitManagerButton
84 = None #GwDateSelectorButton
# edit
01 = None #GwPointAddButton
02 = None #GwArcAddButton
16 = None #GwArcDivideButton
17 = None #GwArcFusionButton
20 = None #GwConnectLinkButton
28 = None #GwFeatureTypeChangeButton
33 = None #GwElementButton
34 = None #GwDocumentButton
39 = None #GwDimensioningButton
44 = None #GwFeatureReplaceButton
66 = None #GwDocumentManagerButton
67 = None #GwElementManagerButton
68 = None #GwFeatureEndButton
69 = None #GwFeatureDeleteButton
# cad
71 = None #GwAuxCircleAddButton
72 = None #GwAuxPointAddButton
# epa
23 = None #GwGo2EpaButton
25 = None #GwGo2EpaManagerButton
29 = None #GwGo2EpaSelectorButton
215 = None #GwDscenarioManagerButton
# plan
45 = None #GwPsectorButton
46 = None #GwPsectorManagerButton
# utilities
58 = None #GwPrintButton
59 = None #GwProjectCheckButton
83 = None #GwCSVButton
99 = None #GwConfigButton
206 = None #GwToolBoxButton
214 = None #GwWorkspaceManagerButton
# toc
306 = None #GwAddChildLayerButton
218 = None
308 = None

[init.toolbars_position]
_toolbars_order = basic, om, edit, cad, epa, plan, utilities, toc

Expand Down Expand Up @@ -329,6 +277,8 @@ _dlg_style_manager_width = None
_dlg_style_manager_height = None
_dlg_feature_add_width = None
_dlg_feature_add_height = None
_dlg_nonvisual_roughness_width = None
_dlg_nonvisual_roughness_height = None

[session.dialogs_position]
dlg_admin_translation_x = None
Expand Down Expand Up @@ -537,6 +487,8 @@ _dlg_style_manager_x = None
_dlg_style_manager_y = None
_dlg_feature_add_x = None
_dlg_feature_add_y = None
_dlg_nonvisual_roughness_x = None
_dlg_nonvisual_roughness_y = None

[session.dialogs_tab]
_dlg_selector_basic = None
Expand Down
1 change: 1 addition & 0 deletions core/load_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ def _get_project_variables(self):
lib_vars.project_vars['project_role'] = tools_qgis.get_project_variable('gwProjectRole')
lib_vars.project_vars['project_type'] = tools_qgis.get_project_variable('gwProjectType')
lib_vars.project_vars['store_credentials'] = tools_qgis.get_project_variable('gwStoreCredentials')
lib_vars.project_vars['current_style'] = tools_qgis.get_project_variable('gwCurrentStyle')


def _get_user_variables(self):
Expand Down
2 changes: 2 additions & 0 deletions core/load_project_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ def _set_config_value(self, item, column):
section = item.parent().text(0)
parameter = item.text(1)
value = item.text(2)
if value == '':
value = "None"
tools_gw.set_config_parser(section, parameter, value, file_name=file_name, prefix=False, chk_user_params=False)


Expand Down
9 changes: 5 additions & 4 deletions core/shared/mincut.py
Original file line number Diff line number Diff line change
Expand Up @@ -2085,7 +2085,7 @@ def _mincut_task_finished(self, snapped_point, elem_type, element_id, signal):
self.dlg_mincut.btn_accept.setEnabled(True)


def _refresh_mincut(self, triggered=None, action="mincutNetwork"):
def _refresh_mincut(self, triggered=None, action="mincutNetwork", zoom=True):
""" B2-125: Refresh current mincut """

# Manage if task is already running
Expand Down Expand Up @@ -2125,10 +2125,10 @@ def _refresh_mincut(self, triggered=None, action="mincutNetwork"):
self.mincut_task = GwAutoMincutTask("Mincut execute", self, element_id, action=action, timer=self.timer)
QgsApplication.taskManager().addTask(self.mincut_task)
QgsApplication.taskManager().triggerTask(self.mincut_task)
self.mincut_task.task_finished.connect(partial(self._refresh_mincut_finished))
self.mincut_task.task_finished.connect(partial(self._refresh_mincut_finished, zoom))


def _refresh_mincut_finished(self, signal):
def _refresh_mincut_finished(self, zoom, signal):

try:
self.dlg_mincut.btn_cancel_task.hide()
Expand All @@ -2155,7 +2155,7 @@ def _refresh_mincut_finished(self, signal):

# Zoom to rectangle (zoom to mincut)
polygon = complet_result['body']['data'].get('geometry')
if polygon:
if polygon and zoom:
polygon = polygon[9:len(polygon) - 2]
polygon = polygon.split(',')
if polygon[0] == '':
Expand Down Expand Up @@ -2246,6 +2246,7 @@ def _custom_mincut_snapping(self, action, point, btn):
self._custom_mincut_execute(element_id)
elif action.objectName() == "actionChangeValveStatus":
self._change_valve_status_execute(element_id)
self._refresh_mincut(zoom=False)
tools_qgis.refresh_map_canvas(True)
self.set_visible_mincut_layers()
self._remove_selection()
Expand Down
2 changes: 2 additions & 0 deletions core/threads/toolbox_execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ def finished(self, result):
elif result:
tools_gw.fill_tab_log(self.dialog, self.json_result['body']['data'], True, True, 1, False, False)
self.dialog.btn_run.setEnabled(False)
elif self.json_result:
tools_gw.manage_json_exception(self.json_result)
# If sql function return null
elif result is False:
msg = f"Database returned null. Check postgres function 'gw_fct_getinfofromid'"
Expand Down
Loading

0 comments on commit 7ae03ce

Please sign in to comment.