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
+8
-4
@@ -143,11 +143,13 @@ class BoxesView(View):
|
||||
self.topwidget.set_visible_child(self.box['box_edit'])
|
||||
|
||||
def on_but_edit_clicked(self, widget):
|
||||
self.newrecord = False
|
||||
self.label['title_edit'].set_text(_("Edit Box"))
|
||||
boxid = treeview.get_value(self.tree['box'], 0)
|
||||
if not boxid:
|
||||
return
|
||||
self.newrecord = False
|
||||
self.label['title_edit'].set_text(_("Edit Box"))
|
||||
if not self.record_lock('box', boxid):
|
||||
return
|
||||
self.sbox.load(boxid)
|
||||
self.edit_record()
|
||||
self.topwidget.set_visible_child(self.box['box_edit'])
|
||||
@@ -191,7 +193,9 @@ class BoxesView(View):
|
||||
return
|
||||
self.save_record()
|
||||
print(self.sbox)
|
||||
self.sbox.save()
|
||||
if not self.sbox.save():
|
||||
pass
|
||||
self.record_unlock()
|
||||
if self.newrecord:
|
||||
self.load_list()
|
||||
self.newrecord = False
|
||||
@@ -218,5 +222,5 @@ class BoxesView(View):
|
||||
return False
|
||||
|
||||
def on_but_cancel_clicked(self, widget):
|
||||
self.record_unlock()
|
||||
self.topwidget.set_visible_child(self.box['box'])
|
||||
self.newrecord = False
|
||||
Reference in new issue
Block a user