Native gui: ongoing work, cables and fuses
This commit is contained in:
@@ -45,6 +45,8 @@ from yms.view.inventory import InventoryView
|
||||
from yms.view.provisions import ProvisionsView
|
||||
from yms.view.maintenance import MaintenanceView
|
||||
from yms.view.projects import ProjectsView
|
||||
from yms.view.cables import CablesView
|
||||
from yms.view.fuses import FusesView
|
||||
from yms.view.documents import DocumentsView
|
||||
from yms.view.status import StatusView
|
||||
|
||||
@@ -107,12 +109,15 @@ class AppContext:
|
||||
class Frontend:
|
||||
|
||||
def __init__(self, context):
|
||||
self.db = context.db
|
||||
self.modules = {
|
||||
"base": BaseView(context),
|
||||
"storage": StorageView(context),
|
||||
"equipment": EquipmentView(context),
|
||||
"inventory": InventoryView(context),
|
||||
"provisions": ProvisionsView(context),
|
||||
"cables": CablesView(context),
|
||||
"fuses": FusesView(context),
|
||||
"maintenance": MaintenanceView(context),
|
||||
"projects": ProjectsView(context),
|
||||
"documents": DocumentsView(context),
|
||||
@@ -127,6 +132,10 @@ class Frontend:
|
||||
self.notebook = builder.get_object("ntb_modules")
|
||||
for module in self.modules.values():
|
||||
self.notebook.append_page(module.topwidget, Gtk.Label(label=module.title))
|
||||
|
||||
self.db_poll_ts = context.db.get_timestamp()
|
||||
GLib.timeout_add_seconds(30, self.db_change_poller)
|
||||
|
||||
print("Frontend initialized.")
|
||||
|
||||
def run(self):
|
||||
@@ -134,6 +143,13 @@ class Frontend:
|
||||
self.window.show_all()
|
||||
Gtk.main()
|
||||
|
||||
def db_change_poller(self):
|
||||
# get all list ids which changes since last query
|
||||
print("db list change poller")
|
||||
#sql = "SELECT revid FROM revision WHERE changed>%s"
|
||||
self.db_poll_ts = self.db.get_timestamp()
|
||||
return True
|
||||
|
||||
def on_ntb_modules_switch_page(self, notebook, page, page_num):
|
||||
print("Neue Seite:", page_num)
|
||||
# TODO here re-load lists
|
||||
|
||||
Reference in New Issue
Block a user