LastSession
- class lib.gui.project.LastSession(config: Config)
Bases:
_GuiSessionFaceswap Last Session handling.
Faceswap
LastSessionhandles saving the state of the Faceswap GUI at close and reloading the state at launch.Last Session behavior can be configured in
config.gui.ini.- Parameters:
config (Config) – The master GUI config
Methods Summary
ask_load()Pop a message box to ask the user if they wish to load their last session.
from_dict(options)Set the
_optionsproperty based on the given options dictionary and update the GUI to use these values.load()Load the last session.
save()Save a snapshot of currently set GUI config options.
to_dict()Collect the current GUI options and place them in a dict for retrieval or storage.
Methods Documentation
- ask_load() None
Pop a message box to ask the user if they wish to load their last session.
- Return type:
None
- from_dict(options: dict[str, str | dict[str, bool | int | float | str]]) None
Set the
_optionsproperty based on the given options dictionary and update the GUI to use these values.This function is required for reloading the GUI state when the GUI has been force refreshed on a config change.
- Parameters:
options (dict[str, str | dict[str, bool | int | float | str]]) – The options to set. Should be the output of
to_dict()- Return type:
None
- load() None
Load the last session.
Loads the last saved session options. Checks if a previous project was loaded and whether there have been changes since the last saved version of the project. Sets the display and
ProjectandTaskobjects accordingly.- Return type:
None
- save() None
Save a snapshot of currently set GUI config options.
Called on Faceswap shutdown.
- Return type:
None
- to_dict() dict[str, str | dict[str, bool | int | float | str] | None] | None
Collect the current GUI options and place them in a dict for retrieval or storage.
This function is required for reloading the GUI state when the GUI has been force refreshed on a config change.
- Return type:
The current cli options ready for saving or retrieval by
from_dict()
- ask_load() None
Pop a message box to ask the user if they wish to load their last session.
- Return type:
None
- from_dict(options: dict[str, str | dict[str, bool | int | float | str]]) None
Set the
_optionsproperty based on the given options dictionary and update the GUI to use these values.This function is required for reloading the GUI state when the GUI has been force refreshed on a config change.
- Parameters:
options (dict[str, str | dict[str, bool | int | float | str]]) – The options to set. Should be the output of
to_dict()- Return type:
None
- load() None
Load the last session.
Loads the last saved session options. Checks if a previous project was loaded and whether there have been changes since the last saved version of the project. Sets the display and
ProjectandTaskobjects accordingly.- Return type:
None
- save() None
Save a snapshot of currently set GUI config options.
Called on Faceswap shutdown.
- Return type:
None
- to_dict() dict[str, str | dict[str, bool | int | float | str] | None] | None
Collect the current GUI options and place them in a dict for retrieval or storage.
This function is required for reloading the GUI state when the GUI has been force refreshed on a config change.
- Return type:
The current cli options ready for saving or retrieval by
from_dict()