Minor advance
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import time
|
||||
from controller.MainController import MainController
|
||||
|
||||
|
||||
@@ -30,6 +31,7 @@ class HomeController:
|
||||
:view: -> The view that this controller manage.
|
||||
"""
|
||||
self.__view = view
|
||||
self.__webpic.set_messenger_callback(view.add_log)
|
||||
# END View method
|
||||
|
||||
# START View events
|
||||
@@ -54,6 +56,16 @@ class HomeController:
|
||||
if url.strip() and name.strip() :
|
||||
# TODO use webpic here to download files
|
||||
print(f"url : {url} -- name : {name}")
|
||||
|
||||
self.__view.clear_logs() # BUG this process must be asynchrone ...
|
||||
if self.__webpic.download(url, name):
|
||||
self.__view.show_success_message("The download has been successfully completed.")
|
||||
else:
|
||||
self.__view.show_error_message("A critical error preventing the download occurred, check the logs.")
|
||||
else:
|
||||
self.__view.show_error_message("Opss, the url or folder name are not valid!")
|
||||
# END View events
|
||||
|
||||
# START Controller methods
|
||||
|
||||
# END Controller methods
|
||||
|
||||
Reference in New Issue
Block a user