Implement record locking for native gui

This commit is contained in:
thooge committed 2026-11-04 17:21:39 +01:00
1 parent 1a6674c819
commit 669c15109a
16 files changed
+162 -66

No files matched your search

+13 -2
View File
@@ -225,6 +225,12 @@ class Frontend:
def run(self):
self.window.show_all()
Gtk.main()
# cleanup code for all modules
for module in self.modules.values():
method = getattr(module, "record_unlock", None)
if callable(method):
# remove all pending record locks
method()
def db_change_poller(self):
# dynamic combobox data refresh
@@ -339,8 +345,13 @@ if __name__ == "__main__":
errno, errtxt = context.db.last_error()
gtkutils.messagebox(
_("Database connection cannot be established.\n\n"
"Server: {}\nDatabase: {}\n"
"Error: {} ({})").format(context.cfg['host'], context.cfg['db'], errtxt, errno),
"Server: %(host)s\nDatabase: %(db)s\n"
"Error: %(errtxt)s (%(errno)d)") % {
'host': context.cfg['host'],
'db': context.cfg['db'],
'errtxt': errtxt,
'errno': errno
},
title="YMS")
# Another fine product of the sirius cybernetics corporation