Do not trigger button on not selected records

Closes #11824
(grafted from 08779343f15d8d37b859218172796e01692ac1db)

--HG--
branch : 6.0
This commit is contained in:
Nicolas Évrard committed 2023-02-03 18:19:31 +01:00
1 parent 0c4734dca8
commit 2d657f919c
2 files changed
+9

No files matched your search

+5
View File
@@ -10,6 +10,11 @@
},
set record(value) {
this._record = value;
},
button_clicked: function(event) {
if (Sao.common.compare(this.screen.selected_records, [this.record])) {
Sao.View.ListGroupViewForm._super.button_clicked.call(this, event);
}
}
});
@@ -22,6 +22,10 @@ class ListBoxViewForm(ViewForm):
def record(self, value):
self._record = value
def button_clicked(self, widget):
if self.screen.selected_records == [self.record]:
super().button_clicked(widget)
class ListBoxItem(GObject.Object):