Native gui: ongoing work, cables and fuses
This commit is contained in:
@@ -49,6 +49,15 @@ class InventoryView(View):
|
||||
self.topwidget.set_visible_child(self.box['inv_edit'])
|
||||
|
||||
def on_but_detail_clicked(self, widget):
|
||||
invid = treeview.get_value(self.tree['inventory'], 0)
|
||||
self.inv.load(invid)
|
||||
self.display_record()
|
||||
self.topwidget.set_visible_child(self.box['inv_detail'])
|
||||
|
||||
def on_tvw_inventory_row_activated(self, widget, path, column):
|
||||
invid = treeview.get_value(widget, 0)
|
||||
self.inv.load(invid)
|
||||
self.display_record()
|
||||
self.topwidget.set_visible_child(self.box['inv_detail'])
|
||||
|
||||
# buttons on detail page
|
||||
@@ -65,3 +74,26 @@ class InventoryView(View):
|
||||
|
||||
def on_but_cancel_clicked(self, widget):
|
||||
self.topwidget.set_visible_child(self.box['inventory'])
|
||||
|
||||
def display_record(self):
|
||||
# TODO nice formatting
|
||||
self.label['name'].set_text(self.inv.invname)
|
||||
self.label['conttype'].set_text(self.inv.conttype)
|
||||
self.label['storage'].set_text(str(self.inv.sid))
|
||||
self.label['box'].set_text(str(self.inv.boxid))
|
||||
self.label['equipment'].set_text(str(self.inv.eid))
|
||||
self.label['number'].set_text(self.format_int(self.inv.number))
|
||||
self.label['weight'].set_text(self.format_float(self.inv.weight, suffix='kg'))
|
||||
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)
|
||||
self.label['remarks'].set_text(self.inv.remarks or '')
|
||||
|
||||
def edit_record(self):
|
||||
self.entry['user_login'].set_text(user.login)
|
||||
self.entry['user_displayname'].set_text(user.displayname)
|
||||
combobox.activate_row(self.combo['user_role'], user.role)
|
||||
combobox.activate_row(self.combo['user_lang'], user.language)
|
||||
self.check['user_locked'].set_active('locked' in user.flags)
|
||||
self.check['user_deleted'].set_active('deleted' in user.flags)
|
||||
self.entry['user_pass'].set_text('')
|
||||
|
||||
Reference in New Issue
Block a user