diff --git a/config/giswater.config b/config/giswater.config index 808b7d3ca..6bcad26bb 100644 --- a/config/giswater.config +++ b/config/giswater.config @@ -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, diff --git a/config/user_params.config b/config/user_params.config index 5c3adc898..8be997300 100644 --- a/config/user_params.config +++ b/config/user_params.config @@ -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 @@ -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 @@ -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 diff --git a/core/load_project.py b/core/load_project.py index 5b0029532..3c1214ea7 100644 --- a/core/load_project.py +++ b/core/load_project.py @@ -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): diff --git a/core/load_project_menu.py b/core/load_project_menu.py index 2003d3a20..7aca79e16 100644 --- a/core/load_project_menu.py +++ b/core/load_project_menu.py @@ -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) diff --git a/core/shared/mincut.py b/core/shared/mincut.py index 2f38e895a..b82682d77 100644 --- a/core/shared/mincut.py +++ b/core/shared/mincut.py @@ -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 @@ -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() @@ -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] == '': @@ -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() diff --git a/core/threads/toolbox_execute.py b/core/threads/toolbox_execute.py index 8ffa3b46b..f686af27c 100644 --- a/core/threads/toolbox_execute.py +++ b/core/threads/toolbox_execute.py @@ -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'" diff --git a/core/toolbars/edit/featuretype_change_button.py b/core/toolbars/edit/featuretype_change_button.py index 6d4ceefda..61ca00492 100644 --- a/core/toolbars/edit/featuretype_change_button.py +++ b/core/toolbars/edit/featuretype_change_button.py @@ -18,7 +18,9 @@ from ...utils import tools_gw from ....libs import tools_qgis, tools_qt, tools_db from .... import global_vars - +from qgis.PyQt.QtWidgets import QAction, QAbstractItemView, QCheckBox, QComboBox, QCompleter, QDoubleSpinBox, \ + QDateEdit, QGridLayout, QLabel, QLineEdit, QListWidget, QListWidgetItem, QPushButton, QSizePolicy, \ + QSpinBox, QSpacerItem, QTableView, QTabWidget, QWidget, QTextEdit, QRadioButton, QToolBox class GwFeatureTypeChangeButton(GwMaptool): """ Button 28: Change feature type @@ -153,79 +155,6 @@ def _set_active_layer(self, name): self.current_layer = tools_qgis.get_layer_by_tablename(tablename) self.iface.setActiveLayer(self.current_layer) - - def _open_catalog(self, feature_type): - - # Get feature_type - child_type = tools_qt.get_text(self.dlg_change, self.dlg_change.feature_type_new) - if child_type == 'null': - msg = "New feature type is null. Please, select a valid value" - tools_qt.show_info_box(msg, "Info") - return - - self.catalog = GwCatalog() - self.catalog.open_catalog(self.dlg_change, 'featurecat_id', feature_type, child_type) - - - def _edit_change_elem_type_accept(self): - """ Update current type of feature and save changes in database """ - - project_type = tools_gw.get_project_type() - feature_type_new = tools_qt.get_text(self.dlg_change, self.dlg_change.feature_type_new) - featurecat_id = tools_qt.get_text(self.dlg_change, self.dlg_change.featurecat_id) - - if feature_type_new != "null": - - if (featurecat_id != "null" and featurecat_id is not None and project_type == 'ws') or ( - project_type == 'ud'): - - # Get function input parameters - feature = f'"type":"{self.feature_type}"' - extras = f'"feature_id":"{self.feature_id}"' - extras += f', "feature_type_new":"{feature_type_new}"' - extras += f', "featurecat_id":"{featurecat_id}"' - body = tools_gw.create_body(feature=feature, extras=extras) - - # Execute SQL function and show result to the user - complet_result = tools_gw.execute_procedure('gw_fct_setchangefeaturetype', body) - if not complet_result: - message = "Error replacing feature" - tools_qgis.show_warning(message) - # Check in init config file if user wants to keep map tool active or not - self.manage_active_maptool() - tools_gw.close_dialog(self.dlg_change) - return - - tools_gw.set_config_parser("btn_featuretype_change", "feature_type_new", feature_type_new) - tools_gw.set_config_parser("btn_featuretype_change", "featurecat_id", featurecat_id) - message = "Values has been updated" - tools_qgis.show_info(message) - - else: - message = "Field catalog_id required!" - tools_qgis.show_warning(message, dialog=self.dlg_change) - return - - else: - message = "Feature has not been updated because no catalog has been selected" - tools_qgis.show_warning(message) - - # Close form - tools_gw.close_dialog(self.dlg_change) - - # Refresh map canvas - self.refresh_map_canvas() - - # Check if the expression is valid - expr_filter = f"{self.feature_type}_id = '{self.feature_id}'" - (is_valid, expr) = tools_qt.check_expression_filter(expr_filter) # @UnusedVariable - if not is_valid: - return - - # Check in init config file if user wants to keep map tool active or not - self.manage_active_maptool() - - def _open_custom_form(self, layer, expr): """ Open custom from selected layer """ @@ -242,76 +171,81 @@ def _open_custom_form(self, layer, expr): dialog.dlg_closed.connect(partial(tools_qgis.restore_user_layer, self.tablename)) - def _change_elem_type(self, feature): + def _open_dialog(self): + """ Open Feature Change Dialog dynamic """ - # Create the dialog, fill feature_type and define its signals + feature = f'"tableName":"{self.tablename}", "id":"{self.feature_id}"' + body = tools_gw.create_body(feature = feature) + json_result = tools_gw.execute_procedure('gw_fct_getchangefeaturetype', body) self.dlg_change = GwFeatureTypeChangeUi(self) tools_gw.load_settings(self.dlg_change) - tools_gw.add_icon(self.dlg_change.btn_catalog, "195") - - # Get featuretype_id from current feature - project_type = tools_gw.get_project_type() - if project_type == 'ws': - self.dlg_change.feature_type_new.currentIndexChanged.connect(partial(self._filter_catalog)) - elif project_type == 'ud': - sql = (f"SELECT DISTINCT(id), id as idval " - f"FROM {self.cat_table} " - f"WHERE active IS TRUE OR active IS NULL " - f"ORDER BY id") - rows = tools_db.get_rows(sql, log_sql=True) - tools_qt.fill_combo_values(self.dlg_change.featurecat_id, rows) - - # Set default value - featurecat_id = tools_gw.get_config_parser("btn_featuretype_change", "featurecat_id", "user", "session") - if featurecat_id not in (None, "None"): - tools_qt.set_combo_value(self.dlg_change.featurecat_id, featurecat_id, 1, add_new=False) - tools_qt.set_autocompleter(self.dlg_change.featurecat_id) - - # Get feature type from current feature - feature_type = feature.attribute(self.feature_edit_type) - self.dlg_change.feature_type.setText(feature_type) - - # Fill 1st combo boxes-new system feature type - sql = (f"SELECT DISTINCT(id), id as idval " - f"FROM cat_feature " - f"WHERE lower(feature_type) = '{self.feature_type}' AND active is True " - f"ORDER BY id") - rows = tools_db.get_rows(sql) - rows.insert(0, ['', '']) - feature_type_new = tools_gw.get_config_parser("btn_featuretype_change", "feature_type_new", "user", "session") - tools_qt.fill_combo_values(self.dlg_change.feature_type_new, rows) - if feature_type_new in (None, "None"): - feature_type_new = feature_type - in_combo = tools_qt.set_combo_value(self.dlg_change.feature_type_new, feature_type_new, 0, add_new=False) - if not in_combo: - tools_qt.set_combo_value(self.dlg_change.feature_type_new, feature_type, 0) - - # Set buttons signals - self.dlg_change.btn_catalog.clicked.connect(partial(self._open_catalog, self.feature_type)) - self.dlg_change.btn_accept.clicked.connect(self._edit_change_elem_type_accept) - self.dlg_change.btn_cancel.clicked.connect(partial(tools_gw.close_dialog, self.dlg_change)) - - # Open dialog + self._manage_dlg_widgets(self.dlg_change, json_result) tools_gw.open_dialog(self.dlg_change, 'featuretype_change') - def _filter_catalog(self): + def _manage_dlg_widgets(self, dialog, complet_result): + """ Creates and populates all the widgets """ - feature_type_new = tools_qt.get_text(self.dlg_change, self.dlg_change.feature_type_new) - if feature_type_new == "null": - return + layout_list = [] + widget_offset = 0 + prev_layout = "" + layout_orientations = {} - # Populate catalog_id - sql = (f"SELECT DISTINCT(id), id as idval " - f"FROM {self.cat_table} " - f"WHERE {self.feature_type}type_id = '{feature_type_new}' AND (active IS TRUE OR active IS NULL) " - f"ORDER BY id") - rows = tools_db.get_rows(sql) - tools_qt.fill_combo_values(self.dlg_change.featurecat_id, rows) - featurecat_id = tools_gw.get_config_parser("btn_featuretype_change", "featurecat_id", "user", "session") - if featurecat_id not in (None, "None"): - tools_qt.set_combo_value(self.dlg_change.featurecat_id, featurecat_id, 1, add_new=False) - tools_qt.set_autocompleter(self.dlg_change.featurecat_id) + + for layout_name, layout_info in complet_result['body']['form']['layouts'].items(): + orientation = layout_info.get('lytOrientation') + if orientation: + layout_orientations[layout_name] = orientation + + for field in complet_result['body']['data']['fields']: + + if field['columnname'] == 'btn_catalog' and self.feature_type == 'gully': + continue + else: + if field.get('hidden'): + continue + + if field['widgettype'] is "button": + continue + + if field.get('widgetcontrols') and field['widgetcontrols'].get('hiddenWhenNull') \ + and field.get('value') in (None, ''): + continue + label, widget = tools_gw.set_widgets(dialog, complet_result, field, self.tablename, self) + if widget is None: + continue + + layout = dialog.findChild(QGridLayout, field['layoutname']) + if layout is not None: + if layout.objectName() != prev_layout: + widget_offset = 0 + prev_layout = layout.objectName() + + orientation = layout_orientations.get(layout.objectName(), + "vertical") + layout.setProperty('lytOrientation', orientation) + + # Take the QGridLayout with the intention of adding a QSpacerItem later + if layout not in layout_list and layout.objectName() in ('lyt_main_1', 'lyt_main_2', 'lyt_main_3','lyt_buttons'): + layout_list.append(layout) + + if field['layoutorder'] is None: + message = "The field layoutorder is not configured for" + msg = f"formname:{self.tablename}, columnname:{field['columnname']}" + tools_qgis.show_message(message, 2, parameter=msg, dialog=dialog) + continue + + # Manage widget and label positions + label_pos = field['widgetcontrols']['labelPosition'] if ( + 'widgetcontrols' in field and field['widgetcontrols'] and 'labelPosition' in field[ + 'widgetcontrols']) else None + widget_pos = field['layoutorder'] + widget_offset + + # The data tab is somewhat special (it has 2 columns) + if 'lyt_data' in layout.objectName() or 'lyt_epa_data' in layout.objectName(): + tools_gw.add_widget(dialog, field, label, widget) + else: + tools_gw.add_widget_combined(dialog, field, label, widget) def _featuretype_change(self, event): @@ -349,6 +283,124 @@ def _featuretype_change(self, event): self.feature_edit_type = f'{self.feature_type}_type' self.feature_type_cat = f'{self.feature_type}type_id' self.feature_id = snapped_feat.attribute(f'{self.feature_type}_id') - self._change_elem_type(snapped_feat) + self._open_dialog() + # endregion - # endregion \ No newline at end of file + +def btn_cancel_featuretype_change(**kwargs): + """ Close form """ + + dialog = kwargs["dialog"] + tools_gw.close_dialog(dialog) + + +def btn_accept_featuretype_change(**kwargs): + """ Update current type of feature and save changes in database """ + + this = kwargs["class"] + dialog = kwargs["dialog"] + + project_type = tools_gw.get_project_type() + feature_type_new = tools_qt.get_widget_value(dialog, "tab_none_feature_type_new") + featurecat_id = tools_qt.get_widget_value(dialog, "tab_none_featurecat_id") + + if feature_type_new != "null": + + if (featurecat_id != "null" and featurecat_id is not None and project_type == 'ws') or ( + project_type == 'ud'): + + # Get function input parameters + feature = f'"type":"{this.feature_type}"' + extras = f'"feature_id":"{this.feature_id}"' + extras += f', "feature_type_new":"{feature_type_new}"' + extras += f', "featurecat_id":"{featurecat_id}"' + body = tools_gw.create_body(feature=feature, extras=extras) + + # Execute SQL function and show result to the user + complet_result = tools_gw.execute_procedure('gw_fct_setchangefeaturetype', body) + if not complet_result: + message = "Error replacing feature" + tools_qgis.show_warning(message) + # Check in init config file if user wants to keep map tool active or not + this.manage_active_maptool() + tools_gw.close_dialog(dialog) + return + + tools_gw.set_config_parser("btn_featuretype_change", "feature_type_new", feature_type_new) + tools_gw.set_config_parser("btn_featuretype_change", "featurecat_id", featurecat_id) + message = "Values has been updated" + tools_qgis.show_info(message) + + else: + message = "Field catalog_id required!" + tools_qgis.show_warning(message, dialog=dialog) + return + + else: + message = "Feature has not been updated because no catalog has been selected" + tools_qgis.show_warning(message) + + # Close form + tools_gw.close_dialog(dialog) + + # Refresh map canvas + this.refresh_map_canvas() + + # Check if the expression is valid + expr_filter = f"{this.feature_type}_id = '{this.feature_id}'" + (is_valid, expr) = tools_qt.check_expression_filter(expr_filter) # @UnusedVariable + if not is_valid: + return + + # Check in init config file if user wants to keep map tool active or not + this.manage_active_maptool() + + +def btn_catalog_featuretype_change(**kwargs): + """ Open Catalog form """ + + dialog = kwargs["dialog"] + this = kwargs["class"] + + # Get feature_type + child_type = tools_qt.get_text(dialog, "tab_none_feature_type_new") + if child_type == 'null': + msg = "New feature type is null. Please, select a valid value" + tools_qt.show_info_box(msg, "Info") + return + + this.catalog = GwCatalog() + this.catalog.open_catalog(dialog, 'tab_none_featurecat_id', this.feature_type, child_type) + + +def cmb_new_featuretype_selection_changed(**kwargs): + """ When new featuretype change, catalog_id changes as well """ + + dialog = kwargs["dialog"] + cmb_new_feature_type = kwargs["widget"] + this = kwargs["class"] + cmb_catalog_id = tools_qt.get_widget(dialog,"tab_none_featurecat_id") + project_type = tools_gw.get_project_type() + + tools_qt.set_stylesheet(cmb_catalog_id, style="") + + # Populate catalog_id + feature_type_new = tools_qt.get_widget_value(dialog, cmb_new_feature_type) + if project_type == 'ws': + sql = (f"SELECT DISTINCT(id), id as idval " + f"FROM {this.cat_table} " + f"WHERE {this.feature_type}type_id = '{feature_type_new}' AND (active IS TRUE OR active IS NULL) " + f"ORDER BY id") + else: + sql = (f"SELECT DISTINCT(id), id as idval " + f"FROM {this.cat_table} " + f"WHERE {this.feature_type}_type = '{feature_type_new}' AND (active IS TRUE OR active IS NULL) " + f"ORDER BY id") + rows = tools_db.get_rows(sql) + tools_qt.fill_combo_values(cmb_catalog_id, rows) + + # Manage if there is no catalog for the selected feature type + if not rows or len(rows) == 0: + tools_qt.set_stylesheet(cmb_catalog_id, style="background-color: #ff8080") + msg = "There is no catalog for this feature type. Please add one in the corresponding cat table." + tools_qgis.show_critical(msg, dialog=dialog) diff --git a/core/toolbars/epa/go2epa_button.py b/core/toolbars/epa/go2epa_button.py index 274a12229..214434adc 100644 --- a/core/toolbars/epa/go2epa_button.py +++ b/core/toolbars/epa/go2epa_button.py @@ -556,10 +556,9 @@ def _update_values(self, _json): return False tools_gw.manage_current_selections_docker(json_result) - """# TODO: do this with symbology?""" # Refresh epa world view if is active and it has changed - # if tools_gw.is_epa_world_active() and any(widget['widget'] == 'inp_options_networkmode' for widget in _json): - # tools_gw.set_epa_world(True, selector_change=True) + if any(widget['widget'] == 'inp_options_networkmode' for widget in _json): + tools_qgis.force_refresh_map_canvas() message = "Values has been updated" tools_qgis.show_info(message) diff --git a/core/toolbars/epa/go2epa_manager_button.py b/core/toolbars/epa/go2epa_manager_button.py index 48f4e0cc3..017946364 100644 --- a/core/toolbars/epa/go2epa_manager_button.py +++ b/core/toolbars/epa/go2epa_manager_button.py @@ -440,7 +440,10 @@ def _show_inp_data(self, dialog, widget): if not result_ids: return - result_ids_json = "ARRAY[" + ",".join(f"'{result_id}'" for result_id in result_ids) + "]" + input_param = { + "result_ids": result_ids + } + result_ids_json = f"'{json.dumps(input_param)}'::json" json_result = tools_gw.execute_procedure( function_name="gw_fct_getinpdata", parameters=result_ids_json, diff --git a/core/toolbars/toc/add_child_layer_button.py b/core/toolbars/toc/add_child_layer_button.py index bc7b40d43..d3677cf5c 100644 --- a/core/toolbars/toc/add_child_layer_button.py +++ b/core/toolbars/toc/add_child_layer_button.py @@ -16,7 +16,7 @@ from ..dialog import GwAction from ...utils import tools_gw -from ....libs import tools_qgis, tools_qt +from ....libs import tools_qgis, tools_qt, lib_vars class GwAddChildLayerButton(GwAction): @@ -151,10 +151,14 @@ def _check_action_ischecked(self, tablename, the_geom=None, field_id=None, group :param group: Name of the group that will be created in the toc (String) :param is_checked: This parameter is sent by the action itself with the trigger (Bool) """ + + style_id: str = "-1" if state == 2: layer = tools_qgis.get_layer_by_tablename(tablename) if layer is None: - tools_gw.add_layer_database(tablename, the_geom, field_id, group, sub_group, alias=alias, sub_sub_group=sub_sub_group) + if lib_vars.project_vars['current_style'] is not None: + style_id = lib_vars.project_vars['current_style'] + tools_gw.add_layer_database(tablename, the_geom, field_id, group, sub_group, style_id=style_id, alias=alias, sub_sub_group=sub_sub_group) elif state == 0: layer = tools_qgis.get_layer_by_tablename(tablename) if layer is not None: diff --git a/core/toolbars/toc/layerstyle_change_button.py b/core/toolbars/toc/layerstyle_change_button.py index 57baff5e4..418bf29e8 100644 --- a/core/toolbars/toc/layerstyle_change_button.py +++ b/core/toolbars/toc/layerstyle_change_button.py @@ -15,7 +15,7 @@ from qgis.core import QgsMapLayerStyle from ..dialog import GwAction from ...utils import tools_gw -from ....libs import tools_qgis, tools_db +from ....libs import tools_qgis, tools_db, lib_vars def get_contexts_params() -> List[Tuple[int, str]]: @@ -115,4 +115,6 @@ def _apply_context(self, styleconfig_id: int, style_name: str) -> None: """Apply styles for the selected context.""" apply_styles_to_layers(styleconfig_id, style_name) + lib_vars.project_vars['current_style'] = f"{styleconfig_id}" + tools_qgis.set_project_variable('gwCurrentStyle', f"{styleconfig_id}") tools_qgis.show_info(f"Applied styles for context: {style_name}") diff --git a/core/toolbars/utilities/mapzone_manager.py b/core/toolbars/utilities/mapzone_manager.py index 240847c44..83e56aa06 100644 --- a/core/toolbars/utilities/mapzone_manager.py +++ b/core/toolbars/utilities/mapzone_manager.py @@ -268,6 +268,7 @@ def manage_config(self, dialog, tableview=None): tools_gw.add_icon(self.config_dlg.btn_snapping_nodeParent, "137") tools_gw.add_icon(self.config_dlg.btn_snapping_toArc, "137") tools_gw.add_icon(self.config_dlg.btn_snapping_forceClosed, "137") + tools_gw.add_icon(self.config_dlg.btn_snapping_ignore, "137") # Set variables self._reset_config_vars() @@ -306,6 +307,16 @@ def manage_config(self, dialog, tableview=None): self.config_dlg.btn_remove_forceClosed.clicked.connect( partial(self._remove_force_closed, self.config_dlg) ) + # Ignore + self.config_dlg.btn_snapping_ignore.clicked.connect( + partial(self.get_snapped_feature_id, self.config_dlg, self.config_dlg.btn_snapping_ignore, + 'v_edit_node', 'ignore', None, self.child_type)) + self.config_dlg.btn_add_ignore.clicked.connect( + partial(self._add_ignore, self.config_dlg) + ) + self.config_dlg.btn_remove_ignore.clicked.connect( + partial(self._remove_ignore, self.config_dlg) + ) # Preview self.config_dlg.btn_clear_preview.clicked.connect(partial(self._clear_preview, self.config_dlg)) # Dialog buttons @@ -366,6 +377,11 @@ def _reset_config_vars(self, mode=0): tools_qt.set_widget_text(self.config_dlg, 'txt_forceClosed', '') tools_qt.set_widget_enabled(self.config_dlg, 'btn_add_forceClosed', False) tools_qt.set_widget_enabled(self.config_dlg, self.config_dlg.btn_remove_forceClosed, False) + if mode in (0, 4): + self.ignore_list = set() + tools_qt.set_widget_text(self.config_dlg, 'txt_ignore', '') + tools_qt.set_widget_enabled(self.config_dlg, 'btn_add_ignore', False) + tools_qt.set_widget_enabled(self.config_dlg, self.config_dlg.btn_remove_ignore, False) def get_snapped_feature_id(self, dialog, action, layer_name, option, widget_name, child_type): """ Snap feature and set a value into dialog """ @@ -440,7 +456,7 @@ def _get_id(self, dialog, action, option, emit_point, child_type, point, event): # @options{'key':['att to get from snapped feature', 'function to call']} options = {'nodeParent': ['node_id', '_set_node_parent'], 'toArc': ['arc_id', '_set_to_arc'], - 'forceClosed': ['node_id', '_set_force_closed']} + 'forceClosed': ['node_id', '_set_force_closed'], 'ignore': ['node_id', '_set_ignore']} if event == Qt.RightButton: self._cancel_snapping_tool(dialog, action) @@ -521,6 +537,20 @@ def _set_force_closed(self, feat_id): tools_qt.set_widget_enabled(self.config_dlg, self.config_dlg.btn_add_forceClosed, True) tools_qt.set_widget_enabled(self.config_dlg, self.config_dlg.btn_remove_forceClosed, True) + def _set_ignore(self, feat_id): + """ + Function called in def _get_id(self, dialog, action, option, point, event): + getattr(self, options[option][1])(feat_id) + + :param feat_id: Id of the snapped feature + """ + # Set variable, set widget text and enable add button + self.ignore_list.add(feat_id) + ignore_list_aux = [int(ignore) for ignore in self.ignore_list] + tools_qt.set_widget_text(self.config_dlg, 'txt_ignore', f"{ignore_list_aux}") + tools_qt.set_widget_enabled(self.config_dlg, self.config_dlg.btn_add_ignore, True) + tools_qt.set_widget_enabled(self.config_dlg, self.config_dlg.btn_remove_ignore, True) + def _add_node_parent(self, dialog): """ ADD button for nodeParent """ @@ -649,6 +679,70 @@ def _remove_force_closed(self, dialog): self._cancel_snapping_tool(dialog, dialog.btn_add_forceClosed) self._reset_config_vars(3) + def _add_ignore(self, dialog): + """ ADD button for ignore """ + + ignore_list = json.dumps(list(self.ignore_list)) + preview = tools_qt.get_text(dialog, 'txt_preview') + + parameters = f'"action": "ADD", "configZone": "{self.mapzone_type}", "mapzoneId": "{self.mapzone_id}", ' \ + f'"ignore": {ignore_list}' + if self.netscenario_id is not None: + parameters += f', "netscenarioId": {self.netscenario_id}' + if preview: + parameters += f', "config": {preview}' + extras = f'"parameters": {{{parameters}}}' + body = tools_gw.create_body(extras=extras) + json_result = tools_gw.execute_procedure('gw_fct_config_mapzones', body) + if json_result is None: + return + + if 'status' in json_result and json_result['status'] == 'Accepted': + if json_result['message']: + level = 1 + if 'level' in json_result['message']: + level = int(json_result['message']['level']) + tools_qgis.show_message(json_result['message']['text'], level, dialog=dialog) + + preview = json_result['body']['data'].get('preview') + if preview: + tools_qt.set_widget_text(dialog, 'txt_preview', json.dumps(preview)) + + self._cancel_snapping_tool(dialog, dialog.btn_add_ignore) + self._reset_config_vars(4) + + def _remove_ignore(self, dialog): + """ REMOVE button for ignore """ + + ignore_list = json.dumps(list(self.ignore_list)) + preview = tools_qt.get_text(dialog, 'txt_preview') + + parameters = f'"action": "REMOVE", "configZone": "{self.mapzone_type}", "mapzoneId": "{self.mapzone_id}", ' \ + f'"ignore": {ignore_list}' + if self.netscenario_id is not None: + parameters += f', "netscenarioId": {self.netscenario_id}' + if preview: + parameters += f', "config": {preview}' + extras = f'"parameters": {{{parameters}}}' + body = tools_gw.create_body(extras=extras) + json_result = tools_gw.execute_procedure('gw_fct_config_mapzones', body) + if json_result is None: + return + + if 'status' in json_result and json_result['status'] == 'Accepted': + if json_result['message']: + level = 1 + if 'level' in json_result['message']: + level = int(json_result['message']['level']) + tools_qgis.show_message(json_result['message']['text'], level, dialog=dialog) + + preview = json_result['body']['data'].get('preview') + if preview: + tools_qt.set_widget_text(dialog, 'txt_preview', json.dumps(preview)) + + self._cancel_snapping_tool(dialog, dialog.btn_remove_ignore) + self._reset_config_vars(4) + def _clear_preview(self, dialog): """ Set preview textbox to '' """ diff --git a/core/toolbars/utilities/style_manager.py b/core/toolbars/utilities/style_manager.py index 47c9360c9..ba9c45a68 100644 --- a/core/toolbars/utilities/style_manager.py +++ b/core/toolbars/utilities/style_manager.py @@ -57,7 +57,9 @@ def manage_styles(self): # Connect signals to the style buttons self.style_mng_dlg.btn_delete_style.clicked.connect(self._delete_selected_styles) self.style_mng_dlg.btn_update_style.clicked.connect(self._update_selected_style) - self.style_mng_dlg.btn_refresh_all.clicked.connect(self._refresh_all_styles) + self.style_mng_dlg.btn_refresh_all.clicked.connect(partial(self._refresh_all_styles, self.style_mng_dlg)) + + self.style_mng_dlg.btn_close.clicked.connect(partial(tools_gw.close_dialog, self.style_mng_dlg, True, 'core')) self.style_mng_dlg.btn_close.clicked.connect(partial(tools_gw.close_dialog, self.style_mng_dlg, True, 'core')) @@ -550,7 +552,7 @@ def _update_selected_style(self): tools_qgis.show_warning(f"Failed to update styles: {e}", dialog=self.style_mng_dlg) - def _refresh_all_styles(self): + def _refresh_all_styles(self, dialog): """Refresh all styles in the database based on the current QGIS layer styles.""" try: # Get all loaded layers in the project @@ -578,7 +580,7 @@ def _refresh_all_styles(self): # tools_qgis.show_warning(f"Style '{style}' not found in database.", dialog=self.style_mng_dlg) msg = "All layers have been successfully refreshed." - tools_qgis.show_success(msg) + tools_qgis.show_success(msg, dialog=dialog) self._load_styles() except Exception as e: diff --git a/core/ui/toolbars/basic/info_epa_demand.ui b/core/ui/toolbars/basic/info_epa_demand.ui index 25bfb9c67..af5eceb58 100644 --- a/core/ui/toolbars/basic/info_epa_demand.ui +++ b/core/ui/toolbars/basic/info_epa_demand.ui @@ -25,7 +25,7 @@ 0 0 947 - 404 + 407 @@ -82,8 +82,8 @@ - - + + Qt::Horizontal @@ -96,7 +96,7 @@ - + false @@ -106,7 +106,7 @@ - + Cancel diff --git a/core/ui/toolbars/basic/info_epa_dwf.ui b/core/ui/toolbars/basic/info_epa_dwf.ui index 9ed752ef1..4bee6062b 100644 --- a/core/ui/toolbars/basic/info_epa_dwf.ui +++ b/core/ui/toolbars/basic/info_epa_dwf.ui @@ -25,7 +25,7 @@ 0 0 947 - 379 + 384 @@ -85,7 +85,7 @@ 0 0 947 - 379 + 384 @@ -142,8 +142,8 @@ - - + + Qt::Horizontal @@ -156,7 +156,7 @@ - + false @@ -166,7 +166,7 @@ - + Cancel diff --git a/core/ui/toolbars/basic/info_epa_orifice.ui b/core/ui/toolbars/basic/info_epa_orifice.ui index 59a99d693..c69049d8f 100644 --- a/core/ui/toolbars/basic/info_epa_orifice.ui +++ b/core/ui/toolbars/basic/info_epa_orifice.ui @@ -25,7 +25,7 @@ 0 0 947 - 379 + 384 @@ -85,7 +85,7 @@ 0 0 947 - 379 + 384 @@ -142,8 +142,8 @@ - - + + Qt::Horizontal @@ -156,7 +156,7 @@ - + false @@ -166,7 +166,7 @@ - + Cancel diff --git a/core/ui/toolbars/basic/info_epa_outlet.ui b/core/ui/toolbars/basic/info_epa_outlet.ui index d739c4241..40f31a310 100644 --- a/core/ui/toolbars/basic/info_epa_outlet.ui +++ b/core/ui/toolbars/basic/info_epa_outlet.ui @@ -25,7 +25,7 @@ 0 0 947 - 379 + 384 @@ -85,7 +85,7 @@ 0 0 947 - 379 + 384 @@ -142,8 +142,8 @@ - - + + Qt::Horizontal @@ -156,7 +156,7 @@ - + false @@ -166,7 +166,7 @@ - + Cancel diff --git a/core/ui/toolbars/basic/info_epa_pump.ui b/core/ui/toolbars/basic/info_epa_pump.ui index 7e6dada6b..1ba1227c2 100644 --- a/core/ui/toolbars/basic/info_epa_pump.ui +++ b/core/ui/toolbars/basic/info_epa_pump.ui @@ -25,7 +25,7 @@ 0 0 947 - 379 + 384 @@ -85,7 +85,7 @@ 0 0 947 - 379 + 384 @@ -142,7 +142,7 @@ - + diff --git a/core/ui/toolbars/basic/info_epa_weir.ui b/core/ui/toolbars/basic/info_epa_weir.ui index 22f41cb93..ce7af32e9 100644 --- a/core/ui/toolbars/basic/info_epa_weir.ui +++ b/core/ui/toolbars/basic/info_epa_weir.ui @@ -25,7 +25,7 @@ 0 0 947 - 379 + 384 @@ -85,7 +85,7 @@ 0 0 947 - 379 + 384 @@ -142,8 +142,8 @@ - - + + Qt::Horizontal @@ -156,7 +156,7 @@ - + false @@ -166,7 +166,7 @@ - + Cancel diff --git a/core/ui/toolbars/basic/info_feature.ui b/core/ui/toolbars/basic/info_feature.ui index e353f7eb8..d984f6c0e 100644 --- a/core/ui/toolbars/basic/info_feature.ui +++ b/core/ui/toolbars/basic/info_feature.ui @@ -25,8 +25,8 @@ - - + + Qt::Horizontal @@ -39,21 +39,21 @@ - + Accept - + Cancel - + Apply @@ -95,8 +95,8 @@ 0 0 - 726 - 335 + 734 + 365 @@ -116,8 +116,8 @@ 0 0 - 98 - 28 + 734 + 365 @@ -151,8 +151,8 @@ 0 0 - 111 - 64 + 734 + 357 @@ -191,7 +191,7 @@ 0 0 98 - 42 + 36 diff --git a/core/ui/toolbars/basic/search.ui b/core/ui/toolbars/basic/search.ui index b5adf27dc..7c7ee9d8d 100644 --- a/core/ui/toolbars/basic/search.ui +++ b/core/ui/toolbars/basic/search.ui @@ -6,8 +6,8 @@ 0 0 - 349 - 282 + 395 + 278 @@ -33,6 +33,9 @@ + + + diff --git a/core/ui/toolbars/basic/search_workcat.ui b/core/ui/toolbars/basic/search_workcat.ui index 56327499d..835d4238d 100644 --- a/core/ui/toolbars/basic/search_workcat.ui +++ b/core/ui/toolbars/basic/search_workcat.ui @@ -381,8 +381,8 @@ - - + + Qt::Horizontal @@ -395,7 +395,7 @@ - + diff --git a/core/ui/toolbars/edit/arc_fusion.ui b/core/ui/toolbars/edit/arc_fusion.ui index 02c80e580..5405d2469 100644 --- a/core/ui/toolbars/edit/arc_fusion.ui +++ b/core/ui/toolbars/edit/arc_fusion.ui @@ -14,6 +14,40 @@ Arc fusion + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + OK + + + + + + + Cancel + + + + + @@ -260,37 +294,6 @@ - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - OK - - - - - - - Cancel - - - - - diff --git a/core/ui/toolbars/edit/auxcircle.ui b/core/ui/toolbars/edit/auxcircle.ui index 61da61ace..101b631bf 100644 --- a/core/ui/toolbars/edit/auxcircle.ui +++ b/core/ui/toolbars/edit/auxcircle.ui @@ -6,8 +6,8 @@ 0 0 - 422 - 142 + 376 + 107 @@ -17,33 +17,6 @@ true - - - - Accept - - - - - - - Cancel - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -74,6 +47,40 @@ + + + + 0 + + + + + Accept + + + + + + + Qt::Horizontal + + + + 40 + 0 + + + + + + + + Cancel + + + + + diff --git a/core/ui/toolbars/edit/auxpoint.ui b/core/ui/toolbars/edit/auxpoint.ui index ef0e40088..dc15293bc 100644 --- a/core/ui/toolbars/edit/auxpoint.ui +++ b/core/ui/toolbars/edit/auxpoint.ui @@ -6,8 +6,8 @@ 0 0 - 435 - 234 + 412 + 211 @@ -17,36 +17,6 @@ true - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - Cancel - - - - - - - Accept - - - @@ -187,6 +157,40 @@ + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 40 + 20 + + + + + + + + Accept + + + + + + + Cancel + + + + + diff --git a/core/ui/toolbars/edit/dimensioning.ui b/core/ui/toolbars/edit/dimensioning.ui index c293113d1..35320c0c4 100644 --- a/core/ui/toolbars/edit/dimensioning.ui +++ b/core/ui/toolbars/edit/dimensioning.ui @@ -6,8 +6,8 @@ 0 0 - 674 - 549 + 660 + 433 @@ -56,8 +56,8 @@ - - + + Qt::Horizontal @@ -70,14 +70,14 @@ - + Accept - + Cancel diff --git a/core/ui/toolbars/edit/doc.ui b/core/ui/toolbars/edit/doc.ui index 65994c7e6..115a27300 100644 --- a/core/ui/toolbars/edit/doc.ui +++ b/core/ui/toolbars/edit/doc.ui @@ -583,7 +583,7 @@ - + diff --git a/core/ui/toolbars/edit/doc_manager.ui b/core/ui/toolbars/edit/doc_manager.ui index 847075884..a625a0ad3 100644 --- a/core/ui/toolbars/edit/doc_manager.ui +++ b/core/ui/toolbars/edit/doc_manager.ui @@ -6,8 +6,8 @@ 0 0 - 421 - 785 + 393 + 633 @@ -20,28 +20,8 @@ - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Close - - - - - + + 0 @@ -49,19 +29,19 @@ - + Delete - - - - Filter by: Doc name + + + + true - - + + 0 @@ -69,7 +49,7 @@ - Delete + Create @@ -86,15 +66,15 @@ - - - - true + + + + Filter by: Doc name - - + + 0 @@ -102,10 +82,37 @@ - Create + + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Close + + + + + diff --git a/core/ui/toolbars/edit/element.ui b/core/ui/toolbars/edit/element.ui index 272604ba5..02f3dce9a 100644 --- a/core/ui/toolbars/edit/element.ui +++ b/core/ui/toolbars/edit/element.ui @@ -7,7 +7,7 @@ 0 0 418 - 604 + 661 @@ -23,37 +23,6 @@ - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Accept - - - - - - - Cancel - - - - - @@ -710,6 +679,40 @@ + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Accept + + + + + + + Cancel + + + + + diff --git a/core/ui/toolbars/edit/element_manager.ui b/core/ui/toolbars/edit/element_manager.ui index 7e7130669..9d11346c9 100644 --- a/core/ui/toolbars/edit/element_manager.ui +++ b/core/ui/toolbars/edit/element_manager.ui @@ -27,45 +27,13 @@ - - - - - 0 - 0 - - - - Delete - - - - - - - - 0 - 0 - - + + - + Create - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -86,20 +54,59 @@ - - + + + + + 0 + 0 + + - Close + Delete - - + + + + + 0 + 0 + + - Create + + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Close + + + + + diff --git a/core/ui/toolbars/edit/feature_delete.ui b/core/ui/toolbars/edit/feature_delete.ui index 825384ad9..be8164295 100644 --- a/core/ui/toolbars/edit/feature_delete.ui +++ b/core/ui/toolbars/edit/feature_delete.ui @@ -14,26 +14,6 @@ Delete feature - - - - Close - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -171,6 +151,33 @@ + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Close + + + + + diff --git a/core/ui/toolbars/edit/feature_end.ui b/core/ui/toolbars/edit/feature_end.ui index d68436ded..8858d8137 100644 --- a/core/ui/toolbars/edit/feature_end.ui +++ b/core/ui/toolbars/edit/feature_end.ui @@ -370,7 +370,7 @@ - + diff --git a/core/ui/toolbars/edit/feature_end_connec.ui b/core/ui/toolbars/edit/feature_end_connec.ui index 2cfc3e995..66398cd94 100644 --- a/core/ui/toolbars/edit/feature_end_connec.ui +++ b/core/ui/toolbars/edit/feature_end_connec.ui @@ -7,7 +7,7 @@ 0 0 696 - 551 + 583 @@ -20,27 +20,6 @@ - - - - true - - - - - - - Cancel - - - - - - - Accept - - - @@ -52,18 +31,12 @@ - - - - Qt::Horizontal - - - - 40 - 20 - + + + + true - + @@ -108,6 +81,40 @@ + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Accept + + + + + + + Cancel + + + + + diff --git a/core/ui/toolbars/edit/feature_replace.ui b/core/ui/toolbars/edit/feature_replace.ui index 354617ca0..52fb721ba 100644 --- a/core/ui/toolbars/edit/feature_replace.ui +++ b/core/ui/toolbars/edit/feature_replace.ui @@ -6,14 +6,48 @@ 0 0 - 499 - 386 + 490 + 422 Replace feature + + + + 0 + + + + + Ok + + + + + + + Cancel + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + @@ -529,37 +563,6 @@ - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Ok - - - - - - - Cancel - - - - - diff --git a/core/ui/toolbars/edit/featuretype_change.ui b/core/ui/toolbars/edit/featuretype_change.ui index 369c0a372..66e37495b 100644 --- a/core/ui/toolbars/edit/featuretype_change.ui +++ b/core/ui/toolbars/edit/featuretype_change.ui @@ -6,254 +6,63 @@ 0 0 - 319 - 161 + 642 + 250 + + + 16777215 + 250 + + Change feature type - - - Qt::Horizontal - - - QSizePolicy::Expanding + + + QLayout::SetMinimumSize - - - 250 - 20 - - - + - - - - - 0 - 0 - + + + + QLayout::SetMinimumSize - - Cancel - - + - - - - - 0 - 0 - + + + + QLayout::SetMinimumSize - - Accept - - - - - - - - - - 8 - - - - QFrame::NoFrame - - - QFrame::Raised - - - New feature type: - - - 3 - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 36 - 20 - - - - - - - - true - - - - 0 - 0 - - - - true - - - - - - - - - - 8 - - - - QFrame::NoFrame - - - QFrame::Raised - - - Current feature type: - - - 3 - - - Qt::LinksAccessibleByMouse - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - - - - + + + + QLayout::SetMinimumSize + - - - - - - - 0 - 0 - - - - - 8 - - - - QFrame::NoFrame - - - QFrame::Raised - - - Catalog id: - - - 3 - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 73 - 20 - - - - - - - - true - - - - - - - - 0 - 0 - - - - - 24 - 24 - - - - - 24 - 24 - - - - - - - - 24 - 24 - - - - - + + + + Qt::Vertical + + + + 20 + 40 + + + - - feature_type - diff --git a/core/ui/toolbars/edit/workcat_manager.ui b/core/ui/toolbars/edit/workcat_manager.ui index 2d91c1710..01b5c7220 100644 --- a/core/ui/toolbars/edit/workcat_manager.ui +++ b/core/ui/toolbars/edit/workcat_manager.ui @@ -20,26 +20,6 @@ - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Close - - - @@ -60,6 +40,19 @@ + + + + + 0 + 0 + + + + Create + + + @@ -93,18 +86,32 @@ - - - - - 0 - 0 - + + + + 0 - - Create - - + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Close + + + + diff --git a/core/ui/toolbars/epa/dscenario_manager.ui b/core/ui/toolbars/epa/dscenario_manager.ui index de8ea0ecc..b5ec06833 100644 --- a/core/ui/toolbars/epa/dscenario_manager.ui +++ b/core/ui/toolbars/epa/dscenario_manager.ui @@ -20,26 +20,6 @@ - - - - Close - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -169,12 +149,38 @@ + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Close + + + + + btn_delete tbl_dscenario - btn_cancel diff --git a/core/ui/toolbars/epa/go2epa.ui b/core/ui/toolbars/epa/go2epa.ui index 9b2c390df..3391feded 100644 --- a/core/ui/toolbars/epa/go2epa.ui +++ b/core/ui/toolbars/epa/go2epa.ui @@ -15,18 +15,11 @@ - - - QLayout::SetDefaultConstraint + + + 0 - - - - - - - - + Qt::Horizontal @@ -39,7 +32,14 @@ - + + + + + + + + @@ -52,14 +52,14 @@ - + Cancel - + @@ -95,7 +95,7 @@ 0 0 571 - 489 + 494 @@ -419,7 +419,7 @@ 0 0 571 - 489 + 494 diff --git a/core/ui/toolbars/epa/go2epa_manager.ui b/core/ui/toolbars/epa/go2epa_manager.ui index 6e84e2984..29a4d7deb 100644 --- a/core/ui/toolbars/epa/go2epa_manager.ui +++ b/core/ui/toolbars/epa/go2epa_manager.ui @@ -57,30 +57,10 @@ - - - - Close - - - - - - - Filter by: Result id - - - - - - - - 0 - 0 - - - - Delete + + + + true @@ -97,35 +77,32 @@ - - + + - Set corporate + Show inp data - - + + - + 0 0 + + Delete + - - - - Qt::Horizontal - - - - 40 - 20 - + + + + Edit - + @@ -134,27 +111,57 @@ - - + + - Edit + Set corporate - - - - true + + + + Filter by: Result id - - - - Show inp data + + + + + 0 + 0 + + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Close + + + + + diff --git a/core/ui/toolbars/epa/go2epa_options.ui b/core/ui/toolbars/epa/go2epa_options.ui index c086ae47d..e896803ef 100644 --- a/core/ui/toolbars/epa/go2epa_options.ui +++ b/core/ui/toolbars/epa/go2epa_options.ui @@ -34,8 +34,8 @@ 0 0 - 396 - 336 + 404 + 349 @@ -124,8 +124,8 @@ 0 0 - 396 - 336 + 404 + 349 @@ -187,11 +187,11 @@ - - - QLayout::SetDefaultConstraint + + + 0 - + Qt::Horizontal @@ -204,7 +204,7 @@ - + @@ -217,7 +217,7 @@ - + diff --git a/core/ui/toolbars/epa/go2epa_selector.ui b/core/ui/toolbars/epa/go2epa_selector.ui index 8c43064b3..7fa5f90b8 100644 --- a/core/ui/toolbars/epa/go2epa_selector.ui +++ b/core/ui/toolbars/epa/go2epa_selector.ui @@ -14,6 +14,40 @@ Result compare selector + + + + 0 + + + + + Accept + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Cancel + + + + + @@ -279,37 +313,6 @@ - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Accept - - - - - - - Cancel - - - - - diff --git a/core/ui/toolbars/epa/nonvisual_controls.ui b/core/ui/toolbars/epa/nonvisual_controls.ui index f255755c2..6fb2c28ab 100644 --- a/core/ui/toolbars/epa/nonvisual_controls.ui +++ b/core/ui/toolbars/epa/nonvisual_controls.ui @@ -14,47 +14,6 @@ Simple Controls Editor - - - - QLayout::SetDefaultConstraint - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - OK - - - - - - - Cancel - - - - - - - - - Qt::Horizontal - - - @@ -111,6 +70,47 @@ + + + + Qt::Horizontal + + + + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + OK + + + + + + + Cancel + + + + + diff --git a/core/ui/toolbars/epa/nonvisual_curve.ui b/core/ui/toolbars/epa/nonvisual_curve.ui index e4782e984..1645b382d 100644 --- a/core/ui/toolbars/epa/nonvisual_curve.ui +++ b/core/ui/toolbars/epa/nonvisual_curve.ui @@ -14,47 +14,6 @@ Curve Editor - - - - QLayout::SetDefaultConstraint - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - OK - - - - - - - Cancel - - - - - - - - - Qt::Horizontal - - - @@ -217,6 +176,47 @@ + + + + Qt::Horizontal + + + + + + + 0 + + + + + OK + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Cancel + + + + + diff --git a/core/ui/toolbars/epa/nonvisual_lids.ui b/core/ui/toolbars/epa/nonvisual_lids.ui index bb8a7d54e..2ed7b62d5 100644 --- a/core/ui/toolbars/epa/nonvisual_lids.ui +++ b/core/ui/toolbars/epa/nonvisual_lids.ui @@ -913,8 +913,18 @@ - - + + + 0 + + + + + Cancel + + + + Qt::Horizontal @@ -927,21 +937,14 @@ - + OK - - - - Cancel - - - - + Help diff --git a/core/ui/toolbars/epa/nonvisual_manager.ui b/core/ui/toolbars/epa/nonvisual_manager.ui index 8ea9ecbad..13b117383 100644 --- a/core/ui/toolbars/epa/nonvisual_manager.ui +++ b/core/ui/toolbars/epa/nonvisual_manager.ui @@ -92,19 +92,6 @@ - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -148,13 +135,6 @@ - - - - Close - - - @@ -187,13 +167,39 @@ + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Close + + + + + txt_filter btn_duplicate btn_delete - btn_cancel diff --git a/core/ui/toolbars/epa/nonvisual_pattern_ud.ui b/core/ui/toolbars/epa/nonvisual_pattern_ud.ui index 61121399d..e075cb115 100644 --- a/core/ui/toolbars/epa/nonvisual_pattern_ud.ui +++ b/core/ui/toolbars/epa/nonvisual_pattern_ud.ui @@ -14,12 +14,19 @@ Pattern Editor - - - - QLayout::SetDefaultConstraint + + + + 0 - + + + + OK + + + + Qt::Horizontal @@ -32,14 +39,7 @@ - - - - OK - - - - + Cancel diff --git a/core/ui/toolbars/epa/nonvisual_pattern_ws.ui b/core/ui/toolbars/epa/nonvisual_pattern_ws.ui index 8972656f9..ec168013e 100644 --- a/core/ui/toolbars/epa/nonvisual_pattern_ws.ui +++ b/core/ui/toolbars/epa/nonvisual_pattern_ws.ui @@ -14,40 +14,6 @@ Pattern Editor - - - - QLayout::SetDefaultConstraint - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - OK - - - - - - - Cancel - - - - - @@ -252,6 +218,40 @@ + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + OK + + + + + + + Cancel + + + + + diff --git a/core/ui/toolbars/epa/nonvisual_print.ui b/core/ui/toolbars/epa/nonvisual_print.ui index 3d92af294..d9379bea2 100644 --- a/core/ui/toolbars/epa/nonvisual_print.ui +++ b/core/ui/toolbars/epa/nonvisual_print.ui @@ -36,7 +36,7 @@ - + diff --git a/core/ui/toolbars/epa/nonvisual_roughness.ui b/core/ui/toolbars/epa/nonvisual_roughness.ui index 150cb0915..a114cd7f9 100644 --- a/core/ui/toolbars/epa/nonvisual_roughness.ui +++ b/core/ui/toolbars/epa/nonvisual_roughness.ui @@ -7,47 +7,13 @@ 0 0 344 - 353 + 420 Rule-Based Controls Editor - - - - QLayout::SetDefaultConstraint - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - OK - - - - - - - Cancel - - - - - @@ -154,6 +120,40 @@ + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + OK + + + + + + + Cancel + + + + + diff --git a/core/ui/toolbars/epa/nonvisual_rules.ui b/core/ui/toolbars/epa/nonvisual_rules.ui index e00cdf945..d741f29cb 100644 --- a/core/ui/toolbars/epa/nonvisual_rules.ui +++ b/core/ui/toolbars/epa/nonvisual_rules.ui @@ -14,47 +14,6 @@ Rule-Based Controls Editor - - - - QLayout::SetDefaultConstraint - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - OK - - - - - - - Cancel - - - - - - - - - Qt::Horizontal - - - @@ -111,6 +70,47 @@ + + + + Qt::Horizontal + + + + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + OK + + + + + + + Cancel + + + + + diff --git a/core/ui/toolbars/epa/nonvisual_timeseries.ui b/core/ui/toolbars/epa/nonvisual_timeseries.ui index d63c7b1ea..adbc16658 100644 --- a/core/ui/toolbars/epa/nonvisual_timeseries.ui +++ b/core/ui/toolbars/epa/nonvisual_timeseries.ui @@ -14,12 +14,19 @@ Time Series Editor - - - - QLayout::SetDefaultConstraint + + + + Qt::Horizontal + + + + + + + 0 - + Qt::Horizontal @@ -32,14 +39,14 @@ - + OK - + Cancel @@ -48,13 +55,6 @@ - - - - Qt::Horizontal - - - diff --git a/core/ui/toolbars/om/mincut.ui b/core/ui/toolbars/om/mincut.ui index 9dc871e3e..467261e71 100644 --- a/core/ui/toolbars/om/mincut.ui +++ b/core/ui/toolbars/om/mincut.ui @@ -31,8 +31,8 @@ 0 0 - 574 - 652 + 578 + 666 @@ -929,15 +929,11 @@ - - - - - - - - - + + + 0 + + Qt::Horizontal @@ -950,21 +946,28 @@ - + + + + + + + + OK - + Cancel task - + Cancel @@ -1154,9 +1157,6 @@ scrollArea tbl_hydro txt_infolog - btn_accept - btn_cancel_task - btn_cancel diff --git a/core/ui/toolbars/om/mincut_composer.ui b/core/ui/toolbars/om/mincut_composer.ui index 1c1e963f3..eb850e582 100644 --- a/core/ui/toolbars/om/mincut_composer.ui +++ b/core/ui/toolbars/om/mincut_composer.ui @@ -115,7 +115,7 @@ - + diff --git a/core/ui/toolbars/om/mincut_connec.ui b/core/ui/toolbars/om/mincut_connec.ui index a91611480..379432dee 100644 --- a/core/ui/toolbars/om/mincut_connec.ui +++ b/core/ui/toolbars/om/mincut_connec.ui @@ -86,8 +86,11 @@ - - + + + 0 + + Qt::Horizontal @@ -100,7 +103,7 @@ - + Accept diff --git a/core/ui/toolbars/om/mincut_end.ui b/core/ui/toolbars/om/mincut_end.ui index aeba4796d..9db8951da 100644 --- a/core/ui/toolbars/om/mincut_end.ui +++ b/core/ui/toolbars/om/mincut_end.ui @@ -6,53 +6,14 @@ 0 0 - 380 - 577 + 365 + 467 Mincut end - - - - Qt::Horizontal - - - - 155 - 20 - - - - - - - - - 0 - 0 - - - - Accept - - - - - - - - 0 - 0 - - - - Cancel - - - @@ -468,12 +429,54 @@ + + + + 0 + + + + + + 0 + 0 + + + + Accept + + + + + + + Qt::Horizontal + + + + 155 + 20 + + + + + + + + + 0 + 0 + + + + Cancel + + + + + - - btn_accept - btn_cancel - diff --git a/core/ui/toolbars/om/mincut_hydrometer.ui b/core/ui/toolbars/om/mincut_hydrometer.ui index 6ad06f7e2..536057c2b 100644 --- a/core/ui/toolbars/om/mincut_hydrometer.ui +++ b/core/ui/toolbars/om/mincut_hydrometer.ui @@ -151,8 +151,11 @@ - - + + + 0 + + Qt::Horizontal @@ -165,7 +168,7 @@ - + Accept diff --git a/core/ui/toolbars/om/mincut_manager.ui b/core/ui/toolbars/om/mincut_manager.ui index 86eb4d8be..94295b6f3 100644 --- a/core/ui/toolbars/om/mincut_manager.ui +++ b/core/ui/toolbars/om/mincut_manager.ui @@ -39,6 +39,9 @@ + + + diff --git a/core/ui/toolbars/om/profile.ui b/core/ui/toolbars/om/profile.ui index 5c188b359..77bedd8d6 100644 --- a/core/ui/toolbars/om/profile.ui +++ b/core/ui/toolbars/om/profile.ui @@ -26,7 +26,7 @@ 0 0 317 - 403 + 394 @@ -146,6 +146,9 @@ + + + diff --git a/core/ui/toolbars/om/profile_list.ui b/core/ui/toolbars/om/profile_list.ui index a3f272db7..cf932a190 100644 --- a/core/ui/toolbars/om/profile_list.ui +++ b/core/ui/toolbars/om/profile_list.ui @@ -6,26 +6,13 @@ 0 0 - 249 - 300 + 247 + 329 Load profiles - - - - 160 - 270 - 75 - 23 - - - - Open - - @@ -49,18 +36,44 @@ - + - 75 + 29 270 - 75 - 23 + 201 + 41 - - Delete - + + + + + Open + + + + + + + Delete + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + diff --git a/core/ui/toolbars/om/selector_date.ui b/core/ui/toolbars/om/selector_date.ui index 7095bce92..a4929ac2c 100644 --- a/core/ui/toolbars/om/selector_date.ui +++ b/core/ui/toolbars/om/selector_date.ui @@ -6,7 +6,7 @@ 0 0 - 357 + 363 150 @@ -140,38 +140,41 @@ - - - - Qt::Horizontal - - - - 125 - 20 - - - - - - - - Close - - - - - - - OK - - + + + + + + Qt::Horizontal + + + + 125 + 20 + + + + + + + + OK + + + + + + + Close + + + + date_from - btn_close diff --git a/core/ui/toolbars/plan/netscenario.ui b/core/ui/toolbars/plan/netscenario.ui index a7846fdef..4e3be1d07 100644 --- a/core/ui/toolbars/plan/netscenario.ui +++ b/core/ui/toolbars/plan/netscenario.ui @@ -14,6 +14,13 @@ Dialog + + + + -1 + + + @@ -143,22 +150,22 @@ - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - -1 + + + + 0 - + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + diff --git a/core/ui/toolbars/plan/netscenario_manager.ui b/core/ui/toolbars/plan/netscenario_manager.ui index acf78e219..783e3859b 100644 --- a/core/ui/toolbars/plan/netscenario_manager.ui +++ b/core/ui/toolbars/plan/netscenario_manager.ui @@ -20,13 +20,6 @@ - - - - Toggle active - - - @@ -34,26 +27,13 @@ - - - - + + + + QAbstractItemView::SingleSelection - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -67,17 +47,13 @@ - - - - Current netscenario + + + + - - - - - Update + @@ -106,50 +82,24 @@ - - - - - 0 - 0 - - - - - - - - - + + - + Current netscenario - - - - - 0 - 0 - - + + - Delete + Toggle active - - + + - Close - - - - - - - QAbstractItemView::SingleSelection + Update @@ -166,13 +116,23 @@ - - - + + + + + + + + + + 0 + 0 + + - + Delete @@ -183,6 +143,53 @@ + + + + + + + + + + + + 0 + 0 + + + + + + + + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Close + + + + + diff --git a/core/ui/toolbars/plan/psector.ui b/core/ui/toolbars/plan/psector.ui index a3035d8aa..3aa55a0b9 100644 --- a/core/ui/toolbars/plan/psector.ui +++ b/core/ui/toolbars/plan/psector.ui @@ -972,7 +972,7 @@ 0 0 916 - 301 + 304 @@ -1730,8 +1730,11 @@ - - + + + 0 + + Qt::Horizontal @@ -1744,14 +1747,14 @@ - + Accept - + Cancel diff --git a/core/ui/toolbars/plan/psector_duplicate.ui b/core/ui/toolbars/plan/psector_duplicate.ui index 483bd6c6b..df68aee7d 100644 --- a/core/ui/toolbars/plan/psector_duplicate.ui +++ b/core/ui/toolbars/plan/psector_duplicate.ui @@ -146,44 +146,51 @@ - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - Accept - - - - - - - - 0 - 0 - - - - Cancel + + + + 0 - + + + + + 0 + 0 + + + + Accept + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Cancel + + + + diff --git a/core/ui/toolbars/plan/psector_manager.ui b/core/ui/toolbars/plan/psector_manager.ui index 063a96cea..211a34117 100644 --- a/core/ui/toolbars/plan/psector_manager.ui +++ b/core/ui/toolbars/plan/psector_manager.ui @@ -14,6 +14,31 @@ Psector management + + + + + 380 + 16777215 + + + + + + + + + + Info: + + + + + + + + + @@ -26,15 +51,8 @@ - - - - Show inactive - - - - - + + 0 @@ -42,25 +60,33 @@ - Delete + Toggle active - - - - - 0 - 0 - + + + + Filter by: Psector name + + + + - + Merge - - + + + + Show inactive + + + + + 0 @@ -68,14 +94,14 @@ - Toggle active + Duplicate - - + + - Filter by: Psector name + Create @@ -92,19 +118,6 @@ - - - - - 0 - 0 - - - - Duplicate - - - @@ -118,33 +131,32 @@ - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - + + + + + 0 + 0 + + - Create + Delete - - + + + + + 0 + 0 + + - Close + @@ -161,37 +173,32 @@ - - - - Merge - - - - - - - - - - - 380 - 16777215 - - - - - - - - - - Info: - - - - - + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Close + + + + @@ -203,7 +210,6 @@ btn_update_psector btn_delete tbl_psm - btn_cancel diff --git a/core/ui/toolbars/plan/psector_rapport.ui b/core/ui/toolbars/plan/psector_rapport.ui index 758ef7b2a..2dcab396c 100644 --- a/core/ui/toolbars/plan/psector_rapport.ui +++ b/core/ui/toolbars/plan/psector_rapport.ui @@ -7,40 +7,13 @@ 0 0 479 - 304 + 241 Psector rapport - - - - Create - - - - - - - Qt::Horizontal - - - - 254 - 20 - - - - - - - - Cancel - - - @@ -157,12 +130,39 @@ + + + + + + Create + + + + + + + Qt::Horizontal + + + + 254 + 20 + + + + + + + + Cancel + + + + + - - btn_ok - btn_cancel - diff --git a/core/ui/toolbars/plan/psector_repair.ui b/core/ui/toolbars/plan/psector_repair.ui index 849b51212..e6b27394d 100644 --- a/core/ui/toolbars/plan/psector_repair.ui +++ b/core/ui/toolbars/plan/psector_repair.ui @@ -14,26 +14,12 @@ Dialog - - - - - - - true - - - - - - - - - - - - + + + 0 + + Qt::Horizontal @@ -46,14 +32,14 @@ - + Repair - + Close @@ -62,6 +48,23 @@ + + + + + + + true + + + + + + + + + + diff --git a/core/ui/toolbars/plan/replace_arc.ui b/core/ui/toolbars/plan/replace_arc.ui index 522171a4b..fd636649b 100644 --- a/core/ui/toolbars/plan/replace_arc.ui +++ b/core/ui/toolbars/plan/replace_arc.ui @@ -82,8 +82,8 @@ 0 0 - 98 - 89 + 327 + 118 @@ -99,8 +99,11 @@ - - + + + 0 + + Qt::Horizontal @@ -113,14 +116,14 @@ - + Accept - + Cancel diff --git a/core/ui/toolbars/utilities/config.ui b/core/ui/toolbars/utilities/config.ui index 052d15110..7bb90b183 100644 --- a/core/ui/toolbars/utilities/config.ui +++ b/core/ui/toolbars/utilities/config.ui @@ -22,8 +22,11 @@ - - + + + 0 + + Qt::Horizontal @@ -36,14 +39,14 @@ - + Accept - + Cancel @@ -325,8 +328,8 @@ 0 0 - 159 - 206 + 866 + 600 @@ -474,8 +477,8 @@ 0 0 - 233 - 130 + 866 + 600 @@ -643,8 +646,8 @@ 0 0 - 98 - 59 + 866 + 600 @@ -700,8 +703,8 @@ 0 0 - 177 - 130 + 866 + 600 diff --git a/core/ui/toolbars/utilities/create_style_group.ui b/core/ui/toolbars/utilities/create_style_group.ui index c63c5c279..f602e15d9 100644 --- a/core/ui/toolbars/utilities/create_style_group.ui +++ b/core/ui/toolbars/utilities/create_style_group.ui @@ -14,26 +14,6 @@ Add category - - - - Cancel - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -168,12 +148,39 @@ - - - - Accept + + + + 0 - + + + + Accept + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Cancel + + + + @@ -183,8 +190,6 @@ idval descript sys_role - btn_add - btn_cancel diff --git a/core/ui/toolbars/utilities/csv.ui b/core/ui/toolbars/utilities/csv.ui index 7f2e4667b..92d20e4f9 100644 --- a/core/ui/toolbars/utilities/csv.ui +++ b/core/ui/toolbars/utilities/csv.ui @@ -38,7 +38,7 @@ - + diff --git a/core/ui/toolbars/utilities/mapzone_config.ui b/core/ui/toolbars/utilities/mapzone_config.ui index 631ea7442..c7b61ea34 100644 --- a/core/ui/toolbars/utilities/mapzone_config.ui +++ b/core/ui/toolbars/utilities/mapzone_config.ui @@ -6,17 +6,91 @@ 0 0 - 658 - 492 + 865 + 566 Mapzone Config - - - + + + + + + Preview: + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Clear Preview + + + + + + + + + true + + + + + + + + + + 0 + 0 + + + + true + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:7.8pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9.75pt;">Using this form you can configure graphconfig field for the selected mapzone. </span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9.75pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9.75pt;">How does it work?</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9.75pt;">1- Select the header of the mapzone using the nodeParent selection tool.</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9.75pt;">2- Select the direction of the water using the toArc selection tool. Multiple selection is allowed.</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9.75pt;">3- Press ADD to visualize your configuration on the Preview. If there are more headers, repeat the process and they will be added to the Preview.</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9.75pt;">4- If you want to configure a node that will always be closed for this mapzone, select it using the forceClosed tool and ADD.</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9.75pt;">To remove some wrong configuration, you have to select the affected nodeParent and click REMOVE. This node and its related toArc will be deleted from the Preview.</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9.75pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9.75pt;">Click OK to end set your Preview as the value on graphconfig field.</span></p></body></html> + + + + + + + 0 + + Qt::Horizontal @@ -29,14 +103,14 @@ - + OK - + Cancel @@ -45,7 +119,7 @@ - + @@ -54,23 +128,10 @@ - - - - true - - - - - - - - 0 - 0 - - + + - + toArc: @@ -81,6 +142,13 @@ + + + + forceClosed: + + + @@ -88,10 +156,31 @@ - - + + - toArc: + + + + + + + + true + + + + + + + REMOVE + + + + + + + ADD @@ -108,15 +197,21 @@ - - + + + + + 0 + 0 + + - forceClosed: + - - + + 0 @@ -128,20 +223,23 @@ - - + + - REMOVE + ADD - - + + - ADD + ignore + + + @@ -149,86 +247,22 @@ - - + + - ADD + REMOVE - - - - - - + + - Preview: - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Clear Preview - - - - - - - - - true + ADD - - - - - 0 - 0 - - - - true - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9.75pt;">Using this form you can configure graphconfig field for the selected mapzone. </span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9.75pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9.75pt;">How does it work?</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9.75pt;">1- Select the header of the mapzone using the nodeParent selection tool.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9.75pt;">2- Select the direction of the water using the toArc selection tool. Multiple selection is allowed.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9.75pt;">3- Press ADD to visualize your configuration on the Preview. If there are more headers, repeat the process and they will be added to the Preview.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9.75pt;">4- If you want to configure a node that will always be closed for this mapzone, select it using the forceClosed tool and ADD.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9.75pt;">To remove some wrong configuration, you have to select the affected nodeParent and click REMOVE. This node and its related toArc will be deleted from the Preview.</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9.75pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9.75pt;">Click OK to end set your Preview as the value on graphconfig field.</span></p></body></html> - - - diff --git a/core/ui/toolbars/utilities/mapzone_manager.ui b/core/ui/toolbars/utilities/mapzone_manager.ui index c387930e4..18cd73fe9 100644 --- a/core/ui/toolbars/utilities/mapzone_manager.ui +++ b/core/ui/toolbars/utilities/mapzone_manager.ui @@ -81,13 +81,6 @@ - - - - Close - - - @@ -114,19 +107,6 @@ - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -187,13 +167,39 @@ + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Close + + + + + txt_name btn_config btn_delete - btn_cancel diff --git a/core/ui/toolbars/utilities/print.ui b/core/ui/toolbars/utilities/print.ui index 14294e1cd..8ee1e34b5 100644 --- a/core/ui/toolbars/utilities/print.ui +++ b/core/ui/toolbars/utilities/print.ui @@ -14,22 +14,37 @@ Fastprint + + + + Map options: + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - + + + 0 + + Qt::NoFocus @@ -39,7 +54,7 @@ - + Qt::NoFocus @@ -49,7 +64,20 @@ - + + + + Qt::Horizontal + + + + 40 + 20 + + + + + Qt::NoFocus @@ -73,31 +101,6 @@ - - - - Map options: - - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - diff --git a/core/ui/toolbars/utilities/project_check.ui b/core/ui/toolbars/utilities/project_check.ui index 6a330680d..17ff0be04 100644 --- a/core/ui/toolbars/utilities/project_check.ui +++ b/core/ui/toolbars/utilities/project_check.ui @@ -14,30 +14,6 @@ Check project - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Accept - - - - - @@ -85,6 +61,33 @@ + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Accept + + + + + diff --git a/core/ui/toolbars/utilities/style_manager.ui b/core/ui/toolbars/utilities/style_manager.ui index fae766106..08a852eb4 100644 --- a/core/ui/toolbars/utilities/style_manager.ui +++ b/core/ui/toolbars/utilities/style_manager.ui @@ -20,13 +20,6 @@ - - - - Close - - - @@ -73,8 +66,8 @@ - - + + 0 @@ -82,7 +75,20 @@ - + Delete style + + + + + + + + 0 + 0 + + + + Update style @@ -109,8 +115,8 @@ - - + + 0 @@ -118,12 +124,26 @@ - Delete style + Add style - - + + + + Filter by: layername + + + + + + + true + + + + + 0 @@ -131,12 +151,12 @@ - Update style + - - + + 0 @@ -144,7 +164,7 @@ - Add style + @@ -161,19 +181,6 @@ - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -181,6 +188,33 @@ + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Close + + + + + diff --git a/core/ui/toolbars/utilities/toolbox.ui b/core/ui/toolbars/utilities/toolbox.ui index d3c45b2bd..c7f03b7a6 100644 --- a/core/ui/toolbars/utilities/toolbox.ui +++ b/core/ui/toolbars/utilities/toolbox.ui @@ -35,6 +35,9 @@ + + + diff --git a/core/ui/toolbars/utilities/toolbox_reports.ui b/core/ui/toolbars/utilities/toolbox_reports.ui index 7cdd0eacb..eceb428d8 100644 --- a/core/ui/toolbars/utilities/toolbox_reports.ui +++ b/core/ui/toolbars/utilities/toolbox_reports.ui @@ -40,7 +40,7 @@ - + true @@ -117,7 +117,7 @@ - + diff --git a/core/ui/toolbars/utilities/toolbox_tool.ui b/core/ui/toolbars/utilities/toolbox_tool.ui index 38183a9f1..7a90d24ac 100644 --- a/core/ui/toolbars/utilities/toolbox_tool.ui +++ b/core/ui/toolbars/utilities/toolbox_tool.ui @@ -14,6 +14,54 @@ + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + Cancel + + + + + + + Run + + + + + + + Close + + + + + @@ -163,51 +211,6 @@ - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Run - - - - - - - Cancel - - - - - - - Close - - - - - diff --git a/core/ui/toolbars/utilities/workspace_create.ui b/core/ui/toolbars/utilities/workspace_create.ui index 8ab38380b..73d6a1508 100644 --- a/core/ui/toolbars/utilities/workspace_create.ui +++ b/core/ui/toolbars/utilities/workspace_create.ui @@ -14,45 +14,6 @@ Create new workspace - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - Accept - - - - - - - - 0 - 0 - - - - Cancel - - - @@ -157,6 +118,52 @@ + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Accept + + + + + + + + 0 + 0 + + + + Cancel + + + + + diff --git a/core/ui/toolbars/utilities/workspace_manager.ui b/core/ui/toolbars/utilities/workspace_manager.ui index d13212678..e768e3813 100644 --- a/core/ui/toolbars/utilities/workspace_manager.ui +++ b/core/ui/toolbars/utilities/workspace_manager.ui @@ -6,8 +6,8 @@ 0 0 - 1003 - 786 + 1008 + 788 @@ -61,8 +61,8 @@ - - + + 0 @@ -70,45 +70,39 @@ - Set current + Toggle privacy - - + + + + QAbstractItemView::SingleSelection + + + + + - + 0 0 - Delete + - - + + - Filter by: Workspace name + Update - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - + + 0 @@ -116,21 +110,20 @@ - + Create - - - - Update + + + + + 0 + 0 + - - - - - Close + Delete @@ -147,8 +140,8 @@ - - + + 0 @@ -156,32 +149,19 @@ - Create - - - - - - - QAbstractItemView::SingleSelection + Set current - - - - - 0 - 0 - - + + - + Filter by: Workspace name - - + + 0 @@ -189,10 +169,37 @@ - Toggle privacy + + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Close + + + + + @@ -203,7 +210,6 @@ btn_current btn_delete tbl_wrkspcm - btn_cancel diff --git a/core/utils/tools_backend_calls.py b/core/utils/tools_backend_calls.py index 0a6c39fe2..326dd7f2d 100644 --- a/core/utils/tools_backend_calls.py +++ b/core/utils/tools_backend_calls.py @@ -78,6 +78,9 @@ def add_object(**kwargs): # Check if this object is already associated to current feature field_object_id = dialog.findChild(QWidget, func_params['sourcewidget']).property('columnname') + if qtable_name == 'tbl_document' or 'doc' in tab_name: + field_object_id = 'doc_id' + tablename = func_params['sourceview'] + "_x_" + feature_type sql = ("SELECT * FROM " + str(tablename) + "" " WHERE " + str(field_id) + " = '" + str(feature_id) + "'" @@ -211,7 +214,8 @@ def open_visit(**kwargs): def manage_document(doc_id, **kwargs): """ Function called in class tools_gw.add_button(...) --> - widget.clicked.connect(partial(getattr(self, function_name), **kwargs)) """ + widget.clicked.connect(partial(getattr(self, function_name), **kwargs)) + Function called by: columnname ='btn_doc_new' """ feature = None complet_result = kwargs['complet_result'] feature_type = complet_result['body']['feature']['featureType'] @@ -937,12 +941,12 @@ def _get_list(complet_result, form_name='', tab_name='', filter_fields='', widge def _manage_document_new(doc, **kwargs): """ Get inserted doc_id and add it to current feature """ - if doc.doc_id is None: + if doc.doc_name is None: return dialog = kwargs['dialog'] func_params = kwargs['func_params'] - tools_qt.set_widget_text(dialog, f"{func_params['sourcewidget']}", doc.doc_id) + tools_qt.set_widget_text(dialog, f"{func_params['sourcewidget']}", doc.doc_name) add_object(**kwargs) diff --git a/core/utils/tools_gw.py b/core/utils/tools_gw.py index e1f57a23b..278bc82c5 100644 --- a/core/utils/tools_gw.py +++ b/core/utils/tools_gw.py @@ -16,6 +16,7 @@ from typing import Literal, Dict import webbrowser import xml.etree.ElementTree as ET +from sip import isdeleted if 'nt' in sys.builtin_module_names: import ctypes @@ -53,6 +54,7 @@ # These imports are for the add_{widget} functions (modules need to be imported in order to find it by its name) # noinspection PyUnresolvedReferences from ..shared import info, mincut_tools +from ..toolbars.edit import featuretype_change_button QgsGeometryType = Literal['line', 'point', 'polygon'] @@ -1507,8 +1509,13 @@ def add_widget(dialog, field, lbl, widget): layout = dialog.findChild(QGridLayout, field['layoutname']) if layout in (None, 'null', 'NULL', 'Null'): return - row = int(field['layoutorder']) - col = 0 + orientation = layout.property('lytOrientation') + if orientation == 'horizontal': + row = 0 + col = int(field['layoutorder']) + else: # default vertical + row = int(field['layoutorder']) + col = 0 if lbl is None: col = row row = 0 @@ -1523,6 +1530,40 @@ def add_widget(dialog, field, lbl, widget): layout.setColumnStretch(col, 1) +def add_widget_combined(dialog, field, label, widget): + """ Insert widget into layout based on orientation and label position """ + layout = dialog.findChild(QGridLayout, field['layoutname']) + + orientation = layout.property('lytOrientation') + widget_pos = int(field.get('layoutorder', 0)) + row, col = (0, widget_pos) if orientation == "horizontal" else (widget_pos, 0) + + label_pos = field['widgetcontrols']['labelPosition'] if ( + 'widgetcontrols' in field and field['widgetcontrols'] and 'labelPosition' in field['widgetcontrols']) else None + print("orientation combined: ", orientation) + if label: + layout.addWidget(label, row, col) + if orientation == "horizontal": + if label_pos == 'top': + row += 1 + else: + print("entro col") + col += 1 + else: + if label_pos == 'top': + row += 1 + else: + col = 1 + layout.setColumnStretch(col, 1) + + if isinstance(widget, QSpacerItem): + layout.addItem(widget, row, col) + else: + layout.addWidget(widget, row, col) + + if label and orientation == "horizontal": + layout.setColumnStretch(col, 1) + def get_dialog_changed_values(dialog, chk, widget, field, list, value=None): elem = {} @@ -1576,6 +1617,7 @@ def add_button(**kwargs): module = tools_backend_calls -> def manage_document(doc_id, **kwargs): module = tools_backend_calls -> def manage_element(element_id, **kwargs): module = tools_backend_calls -> def open_selected_element(**kwargs): + module = featuretype_change_button -> def btn_accept_featuretype_change(**kwargs): """ field = kwargs['field'] @@ -3174,7 +3216,7 @@ def set_tablemodel_config(dialog, widget, table_name, sort_order=0, schema_name= """ Configuration of tables. Set visibility and width of columns """ widget = tools_qt.get_widget(dialog, widget) - if not widget: + if not widget or isdeleted(widget): return widget if schema_name is not None: @@ -4408,7 +4450,7 @@ def set_filter_listeners(complet_result, dialog, widget_list, columnname, widget def set_widgets(dialog, complet_result, field, tablename, class_info): """ functions called in -> widget = getattr(self, f"manage_{field['widgettype']}")(**kwargs) - def manage_text(self, **kwargs) + def _manage_text(**kwargs) def manage_typeahead(self, **kwargs) def manage_combo(self, **kwargs) def manage_check(self, **kwargs) diff --git a/i18n/giswater_ca_ES.qm b/i18n/giswater_ca_ES.qm index 449d0b263..785588c5a 100644 Binary files a/i18n/giswater_ca_ES.qm and b/i18n/giswater_ca_ES.qm differ diff --git a/i18n/giswater_ca_ES.ts b/i18n/giswater_ca_ES.ts index 852bb687c..e45625fa5 100644 --- a/i18n/giswater_ca_ES.ts +++ b/i18n/giswater_ca_ES.ts @@ -6438,7 +6438,7 @@ lbl_doc_id - Id doc: + Nom doc: tooltip_lbl_doc_id diff --git a/i18n/giswater_en_US.qm b/i18n/giswater_en_US.qm index 3c75b2f9c..dc6a432e6 100644 Binary files a/i18n/giswater_en_US.qm and b/i18n/giswater_en_US.qm differ diff --git a/i18n/giswater_en_US.ts b/i18n/giswater_en_US.ts index a767c89dd..4434794f1 100644 --- a/i18n/giswater_en_US.ts +++ b/i18n/giswater_en_US.ts @@ -6439,7 +6439,7 @@ lbl_doc_id - Doc id: + Doc name: tooltip_lbl_doc_id diff --git a/i18n/giswater_es_ES.qm b/i18n/giswater_es_ES.qm index f115a0cfc..ed1311ac1 100644 Binary files a/i18n/giswater_es_ES.qm and b/i18n/giswater_es_ES.qm differ diff --git a/i18n/giswater_es_ES.ts b/i18n/giswater_es_ES.ts index e1c0a14fb..973037ae7 100644 --- a/i18n/giswater_es_ES.ts +++ b/i18n/giswater_es_ES.ts @@ -6439,7 +6439,7 @@ Por otro lado, debe saber que la tabla de trazabilidad almacenará información lbl_doc_id - Id doc: + Nombre doc: tooltip_lbl_doc_id diff --git a/main.py b/main.py index 1473d22e0..10c21c3e7 100644 --- a/main.py +++ b/main.py @@ -67,6 +67,8 @@ def unload(self, hide_gw_button=None): lib_vars.project_vars['main_schema'] = None lib_vars.project_vars['project_role'] = None lib_vars.project_vars['project_type'] = None + lib_vars.project_vars['store_credentials'] = None + lib_vars.project_vars['current_style'] = None except Exception as e: tools_log.log_info(f"Exception in unload when reset values for lib_vars.project_vars: {e}") diff --git a/metadata.txt b/metadata.txt index 07c663c17..426094fe8 100644 --- a/metadata.txt +++ b/metadata.txt @@ -4,21 +4,15 @@ qgisMinimumVersion=3.22 qgisMaximumVersion=3.38 description=Plugin to manage water networks (water supply, sewerage and urban drainage) using QGIS and PostGIS-PostgreSQL about=Disclaimer: This plugin is released using the open source GNU-GPL3 license. Although a reasonable effort has been made to assure that the results obtained are correct, some of the capabilities provided by Giswater are experimental, therefore the development team and the Giswater Association are not responsible and assume no liability whatsoever for any results or any use made of the results obtained from the program, nor for any damages or litigation that result from the use of these programs for any purpose. -version=3.6.012 +version=3.6.013 author=David Erill, Barbara Rzepka, Sergi Muñoz, Josep Lluís Sala, Edgar Fusté, Albert Bofill, Sergi Maspons, Elies Bertran, Abel García Juanes, Maria Guzmán, Jordi Blanch, Xavier Torret, Daniel Marín, Ferran Martínez -Changelog=Version 3.6.012 - - Change "Set archive" button to "Toggle archive" (go2epa manager) - - Show the dates when an EPA result has been corporate - - New button "Show INP data" in go2epa manager - - Add the option to set geometry to a document (it can automatically get coordinates from the document's metadata) - - Add "name" field for documents - - Add workcat, psector & visit tabs in document dialog - - Create workcat manager - - Allow tab ordering in GwInfo (via config_form_tabs) - - New style manager & style change button - - Improve mincut dialog by ordering the toolbar actions - - Remove prices manager +Changelog=Version 3.6.013 + - Configure 'Change feature type' form in config_form_fields and add 4 new widgets: Fluid, Location, Category & Function. + - Fix valves symbology. + - Add 'ignore' to mapzone config. + - Remove toolbars_shortcuts from user config files (it wasn't used). + - Add project variable 'gwCurrentStyle' tags= giswater, water networks, sewerage, urban drainage, EPANET, SWMM