page: remove load_once and update others

This commit is contained in:
Peter Eisenmann
2024-06-04 22:33:36 +02:00
parent f0b803a991
commit 8daea935b4

View File

@@ -7,8 +7,6 @@ class Page:
image: Union[str, Path, None] = None
can_reload: bool = False
loaded: bool = False
def id(self):
return self.__gtype_name__
@@ -17,22 +15,14 @@ class Page:
def load(self):
'''
Called before the page is shown.
Pages can overwrite this to receive call every time.
Returning True means the page can be skipped.
Pages can overwrite this to receive a call every time.
Specialld handled return values are:
"load_next", "load_prev", "prevent_back_navigation".
'''
if not self.loaded:
self.loaded = True
return self.load_once()
def load_once(self):
'''
Called once on first page construction. Used for e.g. filling lists.
Special return values: "load_next" (skips page), "prevent_back_navigation"
'''
return
pass
def unload(self):
'''
Called before the page is no longer shown. Used for e.g. storing current enrty values.
'''
return
pass