page: remove load_once and update others
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user