2022-09-05 23:13:38 +02:00
|
|
|
from controller.Frames import Frames
|
2022-08-30 21:12:04 +02:00
|
|
|
from controller.MainController import MainController
|
|
|
|
|
|
|
|
|
|
|
|
class InfoController:
|
|
|
|
"""
|
|
|
|
Controller - InfoController
|
|
|
|
|
2022-09-05 23:13:38 +02:00
|
|
|
This controller manages the display of information in the information view.
|
2022-08-30 21:12:04 +02:00
|
|
|
|
|
|
|
@author Jérémi Nihart / EndMove
|
|
|
|
@link https://git.endmove.eu/EndMove/WebPicDownloader
|
|
|
|
@version 1.0.0
|
|
|
|
@since 2022-08-30
|
|
|
|
"""
|
|
|
|
# Variables
|
2022-09-05 23:13:38 +02:00
|
|
|
__main_controller: MainController = None
|
2022-08-30 21:12:04 +02:00
|
|
|
__view = None
|
|
|
|
|
|
|
|
# Constructor
|
|
|
|
def __init__(self, controller: MainController) -> None:
|
2022-09-05 23:13:38 +02:00
|
|
|
"""
|
|
|
|
Constructor
|
|
|
|
|
|
|
|
* :controller: -> The main application cpntroller.
|
|
|
|
"""
|
|
|
|
# Setup variables
|
2022-08-30 21:12:04 +02:00
|
|
|
self.__main_controller = controller
|
|
|
|
|
|
|
|
# START View methods
|
|
|
|
def set_view(self, view) -> None:
|
|
|
|
"""
|
|
|
|
[function for view]
|
|
|
|
|
|
|
|
:view: -> The view that this controller manage.
|
|
|
|
"""
|
|
|
|
self.__view = view
|
2022-09-05 23:13:38 +02:00
|
|
|
self.__view.set_title(self.__main_controller.get_config('about_title'))
|
|
|
|
self.__view.set_content(self.__main_controller.get_config('about_content'))
|
|
|
|
self.__view.set_version(
|
|
|
|
f"version: {self.__main_controller.get_config('app_version')} - {self.__main_controller.get_config('app_version_date')}"
|
|
|
|
)
|
2022-08-30 21:12:04 +02:00
|
|
|
# END View method
|
|
|
|
|
|
|
|
# START View events
|
2022-09-05 23:13:38 +02:00
|
|
|
def on_change_view(self, frame: Frames) -> None:
|
2022-08-30 21:12:04 +02:00
|
|
|
"""
|
|
|
|
[event function for view]
|
2022-09-05 23:13:38 +02:00
|
|
|
=> Call this event method when the user requests to change the window.
|
2022-08-30 21:12:04 +02:00
|
|
|
|
2022-09-05 23:13:38 +02:00
|
|
|
* :frame: -> The frame we want to launch.
|
2022-08-30 21:12:04 +02:00
|
|
|
"""
|
|
|
|
self.__main_controller.change_frame(frame)
|
2022-08-31 12:07:43 +02:00
|
|
|
# END View events
|