Implement record locking for native gui
This commit is contained in:
1 parent
1a6674c819
commit
669c15109a
16 files changed
+162
-66
No files matched your search
+6
-2
@@ -162,11 +162,13 @@ class CablesView(View):
|
||||
self.topwidget.set_visible_child(self.box['cable_edit'])
|
||||
|
||||
def on_but_edit_clicked(self, widget):
|
||||
self.newrecord = False
|
||||
self.label['title_edit'].set_text(_("Edit Cable"))
|
||||
cableid = treeview.get_value(self.tree['cables'], 0)
|
||||
if not cableid:
|
||||
return
|
||||
self.newrecord = False
|
||||
self.label['title_edit'].set_text(_("Edit Cable"))
|
||||
if not self.record_lock('cable', cableid):
|
||||
return
|
||||
self.cable.load(cableid)
|
||||
self.edit_record()
|
||||
self.topwidget.set_visible_child(self.box['cable_edit'])
|
||||
@@ -215,6 +217,7 @@ class CablesView(View):
|
||||
# TODO error in infobox
|
||||
print(self.context.db.last_error())
|
||||
return
|
||||
self.record_unlock()
|
||||
if self.newrecord:
|
||||
self.load_list()
|
||||
self.newrecord = False
|
||||
@@ -222,5 +225,6 @@ class CablesView(View):
|
||||
self.topwidget.set_visible_child(self.box['cable_detail'])
|
||||
|
||||
def on_but_cancel_clicked(self, widget):
|
||||
self.record_unlock()
|
||||
self.topwidget.set_visible_child(self.box['cables'])
|
||||
|
||||
Reference in new issue
Block a user