This repository has been archived on 2023-11-29. You can view files and clone it, but cannot push or open issues or pull requests.
WebPicDownloader/webpicdownloader/controller/InfoController.py

55 lines
1.7 KiB
Python
Raw Permalink Normal View History

2022-09-11 11:52:41 +02:00
from webpicdownloader.controller.Frames import Frames
from webpicdownloader.controller.MainController import MainController
2022-08-30 21:12:04 +02:00
class InfoController:
"""
Controller - InfoController
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
__main_controller: MainController = None
2022-08-30 21:12:04 +02:00
__view = None
# Constructor
def __init__(self, controller: MainController) -> None:
"""
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
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
def on_change_view(self, frame: Frames) -> None:
2022-08-30 21:12:04 +02:00
"""
[event function for view]
=> Call this event method when the user requests to change the window.
2022-08-30 21:12:04 +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