Skip to content

Commit

Permalink
add splash screen
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiCheng45 committed Mar 15, 2024
1 parent 658d5a9 commit 7cb274e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions MDANSE_GUI/Src/MDANSE_GUI/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
# @authors Research Software Group at ISIS (see AUTHORS)
#
# **************************************************************************

import sys
import os
import time

from qtpy.QtWidgets import QApplication
from qtpy.QtWidgets import QApplication, QSplashScreen
from qtpy.QtCore import QSettings
from qtpy.QtGui import QPixmap

from MDANSE_GUI.TabbedWindow import TabbedWindow
from MDANSE_GUI.BackEnd import BackEnd


def startGUI(some_args):
Expand All @@ -28,8 +29,19 @@ def startGUI(some_args):
settings = QSettings(
"ISIS Neutron and Muon Source", "MDANSE for Python 3", parent=app
)

path = os.path.dirname(os.path.abspath(__file__))
splash_img = QPixmap(os.path.join(path, "splash.png"))
splash = QSplashScreen(splash_img)
splash.show()
# show the splash screen for at least 1 sec
time.sleep(1)

root = TabbedWindow(parent=None, title="MDANSE for Python 3", settings=settings)
root.show()

splash.finish(root)

app.exec() # once this is done, the GUI has its event loop running.
# no more Python scripting now, we are in the event loop.

Expand Down
Binary file added MDANSE_GUI/Src/MDANSE_GUI/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7cb274e

Please sign in to comment.