Skip to content

Commit

Permalink
ref: remove the splash stuff (we use the one from pyinstaller)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Nov 16, 2023
1 parent 4ae76c1 commit 08d1f9a
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 19 deletions.
2 changes: 1 addition & 1 deletion build-recipes/hook-mpl-data-cast.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

# Data files
datas = collect_data_files("mpl_data_cast", include_py_files=True)
datas += collect_data_files("mpl_data_cast", subdir="img")
datas += collect_data_files("mpl_data_cast", subdir="gui/img")

# Add the Zstandard library used by dclab
datas += collect_data_files("hdf5plugin", includes=["plugins/libh5zstd.*"])
16 changes: 2 additions & 14 deletions mpl_data_cast/gui/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
def main(splash=True):
def main():
import os
import pkg_resources
import sys
Expand All @@ -8,27 +8,15 @@ def main(splash=True):
app = QApplication(sys.argv)
imdir = pkg_resources.resource_filename("mpl_data_cast", "img")

if splash:
from PyQt6.QtWidgets import QSplashScreen
from PyQt6.QtGui import QPixmap
splash_path = os.path.join(imdir, "splash.png")
splash_pix = QPixmap(splash_path)
splash = QSplashScreen(splash_pix)
splash.setMask(splash_pix.mask())
splash.show()

from PyQt6 import QtGui
from mpl_data_cast.gui import MPLDataCast

# Set Application Icon
icon_path = os.path.join(imdir, "icon.png")
icon_path = os.path.join(imdir, "mpldc_icon.png")
app.setWindowIcon(QtGui.QIcon(icon_path))

window = MPLDataCast()

if splash:
splash.finish(window)

sys.exit(app.exec())


Expand Down
File renamed without changes.
Binary file added mpl_data_cast/gui/img/mpldc_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 9 additions & 4 deletions mpl_data_cast/gui/splash.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
try:
import pyi_splash
except (ImportError, KeyError):
pyi_splash = None
import platform

pyi_splash = None
if platform.system() in ["Linux", "Windows"]:
# Don't even try this on macOS.
try:
import pyi_splash
except (ImportError, KeyError):
pass


def splash_close():
Expand Down
Binary file removed mpl_data_cast/img/icon.png
Binary file not shown.
Binary file removed mpl_data_cast/img/splash.png
Binary file not shown.

0 comments on commit 08d1f9a

Please sign in to comment.