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
-3
@@ -149,11 +149,13 @@ class TasksView(View):
|
||||
self.topwidget.set_visible_child(self.box['task_edit'])
|
||||
|
||||
def on_but_edit_clicked(self, widget):
|
||||
self.newrecord = False
|
||||
self.label['title_edit'].set_text(_("Edit Task"))
|
||||
taskid = treeview.get_value(self.tree['tasks'], 0)
|
||||
if not taskid:
|
||||
return
|
||||
self.newrecord = False
|
||||
self.label['title_edit'].set_text(_("Edit Task"))
|
||||
if not self.record_lock('task', taskid):
|
||||
return
|
||||
self.task.load(taskid)
|
||||
self.edit_record()
|
||||
self.topwidget.set_visible_child(self.box['task_edit'])
|
||||
@@ -195,7 +197,9 @@ class TasksView(View):
|
||||
return
|
||||
self.save_record()
|
||||
print(self.task)
|
||||
self.task.save()
|
||||
if not self.task.save():
|
||||
pass
|
||||
self.record_unlock()
|
||||
if self.newrecord:
|
||||
self.load_list()
|
||||
self.newrecord = False
|
||||
@@ -218,4 +222,5 @@ class TasksView(View):
|
||||
pass
|
||||
|
||||
def on_but_cancel_clicked(self, widget):
|
||||
self.record_unlock()
|
||||
self.topwidget.set_visible_child(self.box['tasks'])
|
||||
Reference in new issue
Block a user