Work on native gui. Display records and add missing tasks and measurements.
This commit is contained in:
+24
-2
@@ -40,7 +40,20 @@ class MaintenanceView(View):
|
||||
self.topwidget.set_visible_child(self.box['maint_edit'])
|
||||
|
||||
def on_but_detail_clicked(self, widget):
|
||||
self.topwidget.set_visible_child(self.box['maintv_detail'])
|
||||
maintid = treeview.get_value(self.tree['maintenance'], 0)
|
||||
if not maintid:
|
||||
return
|
||||
self.maint.load(maintid)
|
||||
self.display_record()
|
||||
self.topwidget.set_visible_child(self.box['maint_detail'])
|
||||
self.button['close'].grab_focus()
|
||||
|
||||
def on_tvw_maintenance_row_activated(self, widget, path, column):
|
||||
maintid = treeview.get_value(widget, 0)
|
||||
self.maint.load(maintid)
|
||||
self.display_record()
|
||||
self.topwidget.set_visible_child(self.box['maint_detail'])
|
||||
self.button['close'].grab_focus()
|
||||
|
||||
# buttons on detail page
|
||||
# edit2 uses edit callback
|
||||
@@ -58,7 +71,16 @@ class MaintenanceView(View):
|
||||
self.topwidget.set_visible_child(self.box['maintenance'])
|
||||
|
||||
def display_record(self):
|
||||
pass
|
||||
self.label['activities'].set_text(self.maint.activities)
|
||||
self.label['equipment'].set_text(str(self.maint.eid))
|
||||
self.label['series'].set_text(str(self.maint.series))
|
||||
self.label['interval'].set_text(self.format_int(self.maint.interval_hours))
|
||||
self.label['last'].set_text(self.format_int(self.maint.last_hours))
|
||||
self.label['plandate'].set_text(self.format_date(self.maint.plan_date))
|
||||
self.label['completion'].set_text(self.format_date(self.maint.completion_date))
|
||||
self.label['status'].set_text(self.maint.maintstate)
|
||||
self.label['remarks'].set_text(self.maint.remarks or '')
|
||||
|
||||
|
||||
def edit_record(self):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user