changeset 5ad7f307f7e5 in tryton:6.2
details: https://hg.tryton.org/tryton?cmd=changeset&node=5ad7f307f7e5
description:
Select the clicked line when activating a button in list view
issue11212
review433141003
(grafted from e97626052a77e58d84dafbe11c32f7ccea4fdfaa)
diffstat:
tryton/gui/window/view_form/view/list_gtk/widget.py | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diffs (21 lines):
diff -r b0a43b934892 -r 5ad7f307f7e5
tryton/gui/window/view_form/view/list_gtk/widget.py
--- a/tryton/gui/window/view_form/view/list_gtk/widget.py Thu Sep 01
22:07:13 2022 +0200
+++ b/tryton/gui/window/view_form/view/list_gtk/widget.py Sat Sep 17
18:58:55 2022 +0200
@@ -1305,11 +1305,17 @@
store = self.view.treeview.get_model()
record = store.get_value(store.get_iter(path), 0)
+ if self.view.record and self.view.record != record:
+ widget.stop_emission_by_name('clicked')
+ return True
+
state_changes = record.expr_eval(
self.attrs.get('states', {}))
if state_changes.get('invisible') \
or state_changes.get('readonly'):
return True
+
+ self.view.treeview.set_cursor(path)
widget.handler_block_by_func(self.button_clicked)
try:
self.view.screen.button(self.attrs)