diff --git a/pyproject.toml b/pyproject.toml index a6c1b86..542a2c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "electricalsim" -version = "0.0.8.7.dev9" +version = "0.0.8.7.dev10" author = "Dr. Ing. Ariel S. Loyarte" authors = [ { name="Dr. Ing. Ariel S. Loyarte", email="aloyarte@frsf.utn.edu.ar" }, diff --git a/src/electricalsim/Electrical_Grid_Simulator.py b/src/electricalsim/Electrical_Grid_Simulator.py index a4e3ec2..ab9aac4 100644 --- a/src/electricalsim/Electrical_Grid_Simulator.py +++ b/src/electricalsim/Electrical_Grid_Simulator.py @@ -15,6 +15,7 @@ from lib.auxiliary import QVLine, QMainWindow2, return_config from lib.calculations import Run_PF from icons import rc_icons +from version import VERSION if sys.version_info < (3, 10): from importlib_metadata import entry_points @@ -47,6 +48,22 @@ def main(): qdarktheme.enable_hi_dpi() app = QtWidgets.QApplication(sys.argv) + + icon_splash_svg = os.path.join(directory, 'icons', 'splash_screen.svg') + data_splash = None + with open(icon_splash_svg, 'r') as banner: + data_splash = banner.read().replace('<VERSION>', VERSION) + directory_splash2, _ = os.path.split(config_file_path) + icon_splash_svg2 = os.path.join(directory_splash2, 'egs_splash_screen.svg') + banner2 = open(icon_splash_svg2, 'w') + banner2.write(data_splash) + banner2.close() + + pixmap_splash = QtGui.QPixmap(icon_splash_svg2) + splash = QtWidgets.QSplashScreen(pixmap_splash) + splash.show() + app.processEvents() + theme = config['general']['theme'] if theme in ('dark', 'light', 'auto'): qdarktheme.setup_theme(theme, additional_qss="QToolTip { border: 0px; }") @@ -503,7 +520,9 @@ def page_changed_on_toolbox(index): # Show main window: # main_window.show() window.show() - + # splash.finish(window) + if data_splash is not None: + QtCore.QTimer.singleShot(2000, splash, splash.close) sys.exit(app.exec()) diff --git a/src/electricalsim/icons/splash_screen.svg b/src/electricalsim/icons/splash_screen.svg new file mode 100644 index 0000000..bffc35f --- /dev/null +++ b/src/electricalsim/icons/splash_screen.svg @@ -0,0 +1,307 @@ + + + +Version: <VERSION> diff --git a/src/electricalsim/lib/__pycache__/auxiliary.cpython-311.pyc b/src/electricalsim/lib/__pycache__/auxiliary.cpython-311.pyc index 56f072e..0a79b2b 100644 Binary files a/src/electricalsim/lib/__pycache__/auxiliary.cpython-311.pyc and b/src/electricalsim/lib/__pycache__/auxiliary.cpython-311.pyc differ diff --git a/src/electricalsim/lib/auxiliary.py b/src/electricalsim/lib/auxiliary.py index cc5e0ef..891005f 100644 --- a/src/electricalsim/lib/auxiliary.py +++ b/src/electricalsim/lib/auxiliary.py @@ -592,14 +592,14 @@ def return_config(app_root_dir): the config file exists, but it doesn't have the proper sections and options. - Rertuns the confif file path as a second argument. + Rertuns the config file path as a second argument. * app_root_dir: Root directory of the applications Returns: - First output: the configparser - - Second aoutput: the config file path + - Second output: the config file path """ config_dir = user_config_dir('electricalsim') config_file_path = os.path.join(config_dir, 'config.ini')