diff --git a/modules/gui/pymod/CMakeLists.txt b/modules/gui/pymod/CMakeLists.txt index c56b7807dbfafecf79249569b476c0e599b7f578..077545a9a8f01e93d364dd29ec79f4ef2a661425 100644 --- a/modules/gui/pymod/CMakeLists.txt +++ b/modules/gui/pymod/CMakeLists.txt @@ -80,6 +80,7 @@ set(OST_GUI_PYMOD_MODULES init_context_menu.py init_menubar.py init_spacenav.py + init_splash.py ) pymod(NAME gui CPP ${OST_GUI_PYMOD_SOURCES} diff --git a/modules/gui/pymod/init_splash.py b/modules/gui/pymod/init_splash.py new file mode 100644 index 0000000000000000000000000000000000000000..369f640dc90a22c1c9648071ba7c1a9527dff2bc --- /dev/null +++ b/modules/gui/pymod/init_splash.py @@ -0,0 +1,29 @@ +from PyQt4 import QtCore, QtGui + +import os +import ost +from ost import gui + +LOGO_PATH = os.path.join(ost.GetSharedDataPath(), "gui", "images", "logo-small.png") + +class SplashDialog(QtGui.QDialog): + def __init__(self, parent=None): + QtGui.QDialog.__init__(self, parent) + layout = QtGui.QHBoxLayout(self) + self.setLayout(layout) + imageLabel = QtGui.QLabel(); + self.pix_map = QtGui.QPixmap(LOGO_PATH); + imageLabel.setPixmap(self.pix_map); + layout.addWidget(imageLabel) + self.label = QtGui.QTextEdit() + self.label.setReadOnly(True) + self.label.setHtml("Welcome to <b>Openstructure</b><br /><br />You are running version 1.0.0a<br /><br />If you are new to OpenStructure, you might want to run the demos from the examples directory. To see, how the demos work, right click on the file and click 'show source'.<br /><br />Lean more on the official website:<br /> http://www.openstructure.org") + layout.addWidget(self.label) + +def _InitSplash(app): + splash = SplashDialog(app.perspective.main_area.qobject) + #print dir(splash) + + splash.showNormal() + + #QtCore.QTimer.singleShot(30000, splash.close); \ No newline at end of file diff --git a/modules/gui/share/CMakeLists.txt b/modules/gui/share/CMakeLists.txt index 6b08487687699784398223b61eb72e95b34290dd..23601130fe186234cb81d4daa21d8e2107f84a99 100644 --- a/modules/gui/share/CMakeLists.txt +++ b/modules/gui/share/CMakeLists.txt @@ -12,7 +12,17 @@ set(GUI_ICONS icons/site_icon.png icons/split_icon.png ) + +set(GUI_IMAGES + images/logo-small.png +) + add_custom_target(scene_icons ALL) copy_if_different("./" "${STAGE_DIR}/share/openstructure/gui/icons" "${GUI_ICONS}" "ICONS_FOR_GUI" scene_icons) install(FILES ${GUI_ICONS} DESTINATION "share/openstructure/gui/icons") + +add_custom_target(gui_images ALL) +copy_if_different("./" "${STAGE_DIR}/share/openstructure/gui/images" + "${GUI_IMAGES}" "IMAGES_FOR_GUI" gui_images) +install(FILES ${GUI_IMAGES} DESTINATION "share/openstructure/gui/images") \ No newline at end of file diff --git a/modules/gui/share/images/logo-small.png b/modules/gui/share/images/logo-small.png new file mode 100644 index 0000000000000000000000000000000000000000..37bfaf42f21d3e6a5b68c05fb4dfe7186b603d4f Binary files /dev/null and b/modules/gui/share/images/logo-small.png differ diff --git a/scripts/init.py b/scripts/init.py index 3a776c459daa2d00435cbb6668906999ac067c00..b5f87d0b15d4e754011ca0db7c7a9a84288bb981 100644 --- a/scripts/init.py +++ b/scripts/init.py @@ -17,6 +17,7 @@ from ost.gui.scene.init_inspector import _InitInspector from ost.gui.init_menubar import _InitMenuBar from ost.gui.init_spacenav import _InitSpaceNav from ost.gui.init_context_menu import _InitContextMenu +from ost.gui.init_splash import _InitSplash def _InitRuleBasedBuilder(): compound_lib_path=os.path.join(ost.GetSharedDataPath(), 'compounds.chemlib') @@ -44,13 +45,16 @@ def _InitPanels(app): 'ost.gui.RemoteLoader', False) panels.AddWidget(gui.PanelPosition.BOTTOM_PANEL, app.seq_viewer) panels.AddWidget(gui.PanelPosition.BOTTOM_PANEL, app.py_shell) + return False + return True def _InitFrontEnd(): app=gui.GostyApp.Instance() app.SetAppTitle("DNG") main_area=app.perspective.main_area _InitMenuBar(app) - _InitPanels(app) + if not _InitPanels(app): + _InitSplash(app) _InitSpaceNav(app) _InitContextMenu(app) main_area.AddPersistentWidget("3D Scene", "gl_win" , app.gl_win, int(QtCore.Qt.WindowMaximized))