Fixed vessel change code in native gui

This commit is contained in:
thooge committed 2026-11-12 19:34:59 +01:00
1 parent 09387280fc
commit db74fb6970
16 files changed
+192 -33

No files matched your search

+8
View File
@@ -34,6 +34,9 @@ class StorageView(View):
self.dd_capaunit = self.context.lookup.enum('storage.capaunit')
combobox.load_from_dict(self.combo['capaunit'], {"-1": _("─── none ───")} | self.dd_capaunit)
# subscribe to data change events
self.context.subscribe("vessel_modified", self.vessel_modified)
def get_list_row(self):
return (
self.storage.sid,
@@ -67,6 +70,11 @@ class StorageView(View):
# restore previous selected row
selection.select_iter(treeiter)
def vessel_modified(self, eventtype, data):
self.tree['storage'].get_selection().unselect_all()
self.load_list()
self.topwidget.set_visible_child(self.box['storage'])
def clear_record(self):
self.storage.clear()
self.entry['sname'].set_text('')