Skip to content
Snippets Groups Projects
Commit 1ef1a4d0 authored by stefan's avatar stefan
Browse files

Added splash dialog when starting ost for the first time

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2515 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent 5484cc7a
No related branches found
No related tags found
No related merge requests found
......@@ -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}
......
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
......@@ -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
modules/gui/share/images/logo-small.png

89.2 KiB

......@@ -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))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment