OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
init_splash.py
Go to the documentation of this file.
1 from PyQt4 import QtCore, QtGui
2 
3 import os
4 import ost
5 from ost import gui
6 
7 LOGO_PATH = os.path.join(ost.GetSharedDataPath(), "gui", "images", "logo-small.png")
8 
9 
10 SPLASH_TEXT=""""Welcome to <b>Openstructure</b>!<br/><br/>
11 You are running version %s<br /><br />If you are new to OpenStructure, we
12 invite you to run the demos from the examples directory. Scripts can be
13 displayed by right clicking on the file and selecting 'Show source'.<br/><br/>
14 Feel free visit our website at:<br />
15 <a href='http://www.openstructure.org'>http://www.openstructure.org</a>
16 """ % ost.VERSION
17 
18 class SplashDialog(QtGui.QDialog):
19  def __init__(self, parent=None):
20  QtGui.QDialog.__init__(self, parent)
21  layout = QtGui.QHBoxLayout(self)
22  self.setLayout(layout)
23  imageLabel = QtGui.QLabel();
24  self.pix_map = QtGui.QPixmap(LOGO_PATH);
25  imageLabel.setPixmap(self.pix_map);
26  layout.addWidget(imageLabel)
27  self.label = QtGui.QTextBrowser()
28  self.label.setReadOnly(True)
29  self.label.setOpenExternalLinks(True)
30  self.label.setHtml(SPLASH_TEXT)
31  layout.addWidget(self.label)
32 
33 def _InitSplash():
34  splash = SplashDialog(gui.GostyApp.Instance().perspective.main_area.qobject)
35  splash.exec_()
36 
37  #QtCore.QTimer.singleShot(30000, splash.close);
38 
39 
40 __all__=('SplashDialog',)
String DLLEXPORT_OST_BASE GetSharedDataPath()