More work on native gui. Make data editable.
This commit is contained in:
1 parent
5641e1706f
commit
7aa5d2af3b
43 files changed
+2686
-1037
No files matched your search
@@ -26,7 +26,6 @@ class MeasurementView(View):
|
||||
|
||||
# measurement units
|
||||
self.dd_unit = self.context.lookup.dropdown(Dropdown.UNIT)
|
||||
print("Unit: {self.dd_unit}")
|
||||
combobox.load_from_dict(self.combo['unit'], self.dd_unit, 1)
|
||||
|
||||
# equipment
|
||||
@@ -86,6 +85,7 @@ class MeasurementView(View):
|
||||
combobox.activate_row(self.combo['equipment'], -1)
|
||||
combobox.activate_row(self.combo['category'], -1)
|
||||
self.text['note'].get_buffer().set_text('')
|
||||
self.entry['name'].grab_focus()
|
||||
|
||||
def display_record(self):
|
||||
self.label['name'].set_text(self.measure.mname)
|
||||
@@ -115,14 +115,15 @@ class MeasurementView(View):
|
||||
combobox.activate_row(self.combo['equipment'], self.measure.eid)
|
||||
combobox.activate_row(self.combo['category'], self.measure.mcat)
|
||||
self.text['note'].get_buffer().set_text(self.task.note or '')
|
||||
self.entry['name'].grab_focus()
|
||||
|
||||
def save_record(self):
|
||||
# fields must have been validated beforehand
|
||||
self.measure.mname = self.entry['name'].get_text()
|
||||
self.measure.nval = combobox.get_list_value(self.combo['dimensions'])
|
||||
self.measure.val1 = int(self.spin['val1'].get_value())
|
||||
self.measure.val2 = int(self.spin['val2'].get_value())
|
||||
self.measure.val3 = int(self.spin['val3'].get_value())
|
||||
self.measure.val1 = self.spin['val1'].get_value_as_int()
|
||||
self.measure.val2 = self.spin['val2'].get_value_as_int()
|
||||
self.measure.val3 = self.spin['val3'].get_value_as_int()
|
||||
self.measure.accuracy = combobox.get_list_value(self.combo['accurace'])
|
||||
self.measure.mdate = self.entry['date'].get_text()
|
||||
self.measure.eid = combobox.get_list_value(self.combo['equipment'])
|
||||
@@ -185,6 +186,8 @@ class MeasurementView(View):
|
||||
self.save_record()
|
||||
print(self.measure)
|
||||
self.measure.save()
|
||||
self.display_record()
|
||||
self.topwidget.set_visible_child(self.box['measure_detail'])
|
||||
|
||||
def on_but_cancel_clicked(self, widget):
|
||||
self.topwidget.set_visible_child(self.box['measurement'])
|
||||
Reference in new issue
Block a user