Skip to content

Commit

Permalink
Enhancement: Allow close dialog pressing the escape key
Browse files Browse the repository at this point in the history
  • Loading branch information
nestorip committed Dec 9, 2020
1 parent 4fdaab5 commit 5fea71f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion actions/api_dimensioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# -*- coding: latin-1 -*-
from qgis.core import QgsPointXY
from qgis.gui import QgsMapToolEmitPoint, QgsMapTip
from qgis.PyQt.QtCore import Qt, QTimer
from qgis.PyQt.QtCore import QTimer, Qt
from qgis.PyQt.QtWidgets import QAction, QCheckBox, QComboBox, QCompleter, QGridLayout, QLabel, QLineEdit, \
QSizePolicy, QSpacerItem

Expand Down Expand Up @@ -70,6 +70,7 @@ def open_form(self, qgis_feature=None, layer=None, db_return=None, fid=None):
self.dlg_dim.btn_cancel.clicked.connect(partial(self.cancel_dimensioning))
self.dlg_dim.dlg_closed.connect(partial(self.cancel_dimensioning))
self.dlg_dim.dlg_closed.connect(partial(self.save_settings, self.dlg_dim))
self.dlg_dim.key_escape.connect(partial(self.close_dialog, self.dlg_dim))

self.create_map_tips()
# when funcion is called from new feature
Expand Down
2 changes: 1 addition & 1 deletion sql
Submodule sql updated 94 files
+13 −13 example/user/ud/ud_93_sample_catalogs.sql
+0 −2 example/user/ud/ud_94_sample_ext.sql
+11 −3 example/user/ud/ud_99_sample_other.sql
+4 −1 example/user/ws/ws_93_sample_catalogs.sql
+23 −7 example/user/ws/ws_99_sample_other.sql
+1 −0 i18n/CA/ws.sql
+1 −0 i18n/EN/ws.sql
+1 −0 i18n/ES/ws.sql
+40 −26 ud/fct/ud_gw_fct_pg2epa_main.sql
+8 −5 ud/ftrg/ud_gw_trg_edit_arc.sql
+4 −4 ud/ftrg/ud_gw_trg_edit_connec.sql
+2 −2 ud/ftrg/ud_gw_trg_edit_dma.sql
+3 −3 ud/ftrg/ud_gw_trg_edit_gully.sql
+44 −42 ud/ftrg/ud_gw_trg_edit_inp_arc.sql
+14 −1 ud/ftrg/ud_gw_trg_edit_inp_node.sql
+3 −3 ud/ftrg/ud_gw_trg_edit_node.sql
+1 −1 ud/ftrg/ud_gw_trg_edit_raingage.sql
+1 −1 ud/ftrg/ud_gw_trg_edit_review_arc.sql
+1 −1 ud/ftrg/ud_gw_trg_edit_review_connec.sql
+1 −1 ud/ftrg/ud_gw_trg_edit_review_gully.sql
+1 −1 ud/ftrg/ud_gw_trg_edit_review_node.sql
+1 −1 ud/ftrg/ud_gw_trg_node_update.sql
+5 −3 ud/ftrg/ud_gw_trg_plan_gully_x_psector.sql
+1 −3 ud/ftrg/ud_gw_trg_topocontrol_node.sql
+9 −3 ud/ftrg/ud_gw_trg_vi.sql
+75 −0 updates/34/34025/ud/ddl.sql
+7 −1 updates/34/34025/ud/dml.sql
+29 −0 updates/34/34025/ud/trg.sql
+15 −1 updates/34/34025/utils/ddl.sql
+70 −1 updates/34/34025/utils/dml.sql
+26 −0 updates/34/34025/utils/tablect.sql
+14 −1 updates/34/34025/ws/ddl.sql
+99 −1 updates/34/34025/ws/ddlview.sql
+72 −8 updates/34/34025/ws/dml.sql
+2 −2 utils/fct/gw_fct_admin_manage_child_config.sql
+1 −1 utils/fct/gw_fct_admin_manage_child_views.sql
+1 −1 utils/fct/gw_fct_admin_manage_visit.sql
+3 −2 utils/fct/gw_fct_admin_manage_visit_view.sql
+1 −1 utils/fct/gw_fct_admin_role_permissions.sql
+1 −1 utils/fct/gw_fct_admin_test_ci.sql
+4 −0 utils/fct/gw_fct_check_importdxf.sql
+53 −7 utils/fct/gw_fct_getcatalog.sql
+44 −5 utils/fct/gw_fct_getfeatureupsert.sql
+7 −3 utils/fct/gw_fct_getinfofromcoordinates.sql
+74 −12 utils/fct/gw_fct_getinfofromid.sql
+10 −5 utils/fct/gw_fct_gettoolbox.sql
+1 −1 utils/fct/gw_fct_grafanalytics_check_data.sql
+12 −8 utils/fct/gw_fct_import_elements.sql
+1 −1 utils/fct/gw_fct_node_builtfromarc.sql
+0 −160 utils/fct/gw_fct_odbc2pg_check_data.sql
+0 −134 utils/fct/gw_fct_odbc2pg_hydro_filldata.sql
+0 −80 utils/fct/gw_fct_odbc2pg_main.sql
+18 −8 utils/fct/gw_fct_om_visit_event_manager.sql
+5 −0 utils/fct/gw_fct_setcatalog.sql
+9 −1 utils/fct/gw_fct_setdelete.sql
+2 −1 utils/fct/gw_fct_setselectors.sql
+2 −1 utils/fct/gw_fct_setvisit.sql
+2 −2 utils/ftrg/gw_trg_cat_feature.sql
+6 −6 utils/ftrg/gw_trg_edit_address.sql
+1 −1 utils/ftrg/gw_trg_edit_dimensions.sql
+1 −1 utils/ftrg/gw_trg_edit_element.sql
+4 −3 utils/ftrg/gw_trg_edit_exploitation.sql
+2 −2 utils/ftrg/gw_trg_edit_macrodma.sql
+2 −2 utils/ftrg/gw_trg_edit_om_visits.sql
+6 −6 utils/ftrg/gw_trg_edit_plot.sql
+13 −3 utils/ftrg/gw_trg_edit_psector.sql
+3 −3 utils/ftrg/gw_trg_edit_samplepoint.sql
+7 −7 utils/ftrg/gw_trg_edit_streetaxis.sql
+4 −2 utils/ftrg/gw_trg_om_visit_multievent.sql
+6 −5 utils/ftrg/gw_trg_plan_arc_x_psector.sql
+5 −3 utils/ftrg/gw_trg_plan_connec_x_psector.sql
+12 −10 utils/ftrg/gw_trg_plan_node_x_psector.sql
+1 −1 utils/ftrg/gw_trg_visit_expl.sql
+21 −10 ws/fct/ws_gw_fct_grafanalytics_mapzones.sql
+26 −17 ws/fct/ws_gw_fct_import_epanet_inp.sql
+3 −3 ws/fct/ws_gw_fct_mincut_result_overlap.sql
+14 −11 ws/fct/ws_gw_fct_pg2epa_check_data.sql
+36 −32 ws/fct/ws_gw_fct_pg2epa_main.sql
+14 −30 ws/fct/ws_gw_fct_settoarc.sql
+17 −10 ws/ftrg/ws_gw_trg_edit_arc.sql
+3 −3 ws/ftrg/ws_gw_trg_edit_connec.sql
+2 −2 ws/ftrg/ws_gw_trg_edit_dma.sql
+2 −2 ws/ftrg/ws_gw_trg_edit_dqa.sql
+11 −1 ws/ftrg/ws_gw_trg_edit_inp_node.sql
+2 −2 ws/ftrg/ws_gw_trg_edit_macrodqa.sql
+3 −3 ws/ftrg/ws_gw_trg_edit_node.sql
+3 −3 ws/ftrg/ws_gw_trg_edit_presszone.sql
+1 −1 ws/ftrg/ws_gw_trg_edit_review_arc.sql
+1 −1 ws/ftrg/ws_gw_trg_edit_review_connec.sql
+1 −1 ws/ftrg/ws_gw_trg_edit_review_node.sql
+2 −2 ws/ftrg/ws_gw_trg_edit_unconnected.sql
+1 −1 ws/ftrg/ws_gw_trg_node_update.sql
+1 −1 ws/ftrg/ws_gw_trg_topocontrol_node.sql
+2 −2 ws/ftrg/ws_gw_trg_vi.sql
7 changes: 6 additions & 1 deletion ui_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,12 @@ class ConfigUi(GwMainWindow, FORM_CLASS):

FORM_CLASS = get_ui_class('dimensioning.ui')
class DimensioningUi(GwMainWindow, FORM_CLASS):
pass
key_escape = QtCore.pyqtSignal()

def keyPressEvent(self, event):
if event.key() == QtCore.Qt.Key_Escape:
self.key_escape.emit()
return super(DimensioningUi, self).keyPressEvent(event)


FORM_CLASS = get_ui_class('go2epa_options.ui')
Expand Down

0 comments on commit 5fea71f

Please sign in to comment.