Work on native gui. Display records and add missing tasks and measurements.

This commit is contained in:
2026-09-30 16:18:44 +02:00
parent c3109b9d2a
commit 131af7d9e7
45 changed files with 6043 additions and 1966 deletions
+8
View File
@@ -5,6 +5,7 @@ from gi.repository import GLib, Gtk, Gdk
from .view import View
from yms import gtkutils, combobox, treeview
from yms.lookup import Dropdown
from yms.model import inventory
class InventoryView(View):
@@ -39,6 +40,8 @@ class InventoryView(View):
treeview.add_column(self.tree['inventory'], _('Remarks'), 5)
self.tree['inventory'].set_model(self.lst_inventory)
self.dd_category = self.context.lookup.dropdown(Dropdown.INVENTORY_CATEGORY)
# buttons on list page
def on_but_new_clicked(self, widget):
self.topwidget.set_visible_child(self.box['inv_edit'])
@@ -51,6 +54,7 @@ class InventoryView(View):
self.inv.load(invid)
self.display_record()
self.topwidget.set_visible_child(self.box['inv_detail'])
self.button['close'].grab_focus()
def on_tvw_inventory_row_activated(self, widget, path, column):
invid = treeview.get_value(widget, 0)
@@ -85,6 +89,10 @@ class InventoryView(View):
self.label['price'].set_text(self.format_float(self.inv.price, suffix='€'))
self.label['purchdate'].set_text(self.format_date(self.inv.purchdate))
self.label['condition'].set_text(self.inv.invcond)
if self.inv.icat is not None:
self.label['category'].set_text(self.dd_category[self.inv.icat])
else:
self.label['category'].set_text('')
self.label['remarks'].set_text(self.inv.remarks or '')
def edit_record(self):