#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Main file launching the project.
"""

import sys

from PyQt5.QtWidgets import QApplication

from .main_controller import mainController

from .utils.view.stylesheet import get_stylesheet

__author__ = "Lemahieu Antoine"
__copyright__ = "Copyright 2022"
__credits__ = ["Lemahieu Antoine"]
__license__ = "GNU General Public License v3.0"
__maintainer__ = "Lemahieu Antoine"
__email__ = "Antoine.Lemahieu@ulb.be"
__status__ = "Dev"
    

def main():
    print("mne-vision loaded.")
    try:
        app = QApplication(sys.argv)
        app.setStyleSheet(get_stylesheet())

        # splash_screen = splashScreen()
        # splash_screen.show()
        # app.processEvents()     # Allow the splash screen to be displayed while loading the main window

        screen_size = app.primaryScreen().size()
        main_controller = mainController(screen_size)
        main_controller.show()
        sys.exit(app.exec())
    except Exception as e:
        print(e)
        print(type(e))
