added a splash screen

This commit is contained in:
Sebastian Wehling-Benatelli 2015-07-07 12:14:18 +02:00
parent cf944358dd
commit 6078338757
4 changed files with 12 additions and 5 deletions

View File

@ -33,7 +33,7 @@ from PySide.QtCore import QCoreApplication, QSettings, Signal, QFile, \
QFileInfo, Qt QFileInfo, Qt
from PySide.QtGui import QMainWindow, QInputDialog, QIcon, QFileDialog, \ from PySide.QtGui import QMainWindow, QInputDialog, QIcon, QFileDialog, \
QWidget, QHBoxLayout, QStyle, QKeySequence, QLabel, QFrame, QAction, \ QWidget, QHBoxLayout, QStyle, QKeySequence, QLabel, QFrame, QAction, \
QDialog, QErrorMessage, QApplication, QPixmap, QMessageBox QDialog, QErrorMessage, QApplication, QPixmap, QMessageBox, QSplashScreen
import numpy as np import numpy as np
from obspy.core import UTCDateTime from obspy.core import UTCDateTime
@ -627,6 +627,9 @@ class MainWindow(QMainWindow):
def main(): def main():
# create the Qt application # create the Qt application
pylot_app = QApplication(sys.argv) pylot_app = QApplication(sys.argv)
pixmap = QPixmap(":/splash/splash.png")
splash = QSplashScreen(pixmap)
splash.show()
app_icon = QIcon() app_icon = QIcon()
app_icon.addPixmap(QPixmap(':/icons/pylot.png')) app_icon.addPixmap(QPixmap(':/icons/pylot.png'))
@ -639,9 +642,12 @@ def main():
# create the main window # create the main window
pylot_form = MainWindow() pylot_form = MainWindow()
splash.showMessage('Loading. Please wait ...')
pylot_app.processEvents()
# Show main window and run the app # Show main window and run the app
pylot_form.showMaximized() pylot_form.showMaximized()
splash.finish(pylot_form)
pylot_app.exec_() pylot_app.exec_()

View File

@ -17,6 +17,7 @@
<file>icons/filter.png</file> <file>icons/filter.png</file>
<file>icons/zoom_in.png</file> <file>icons/zoom_in.png</file>
<file>icons/zoom_out.png</file> <file>icons/zoom_out.png</file>
<file>splash/splash.png</file>
</qresource> </qresource>
<qresource prefix="/help"> <qresource prefix="/help">
<file>help/index.html</file> <file>help/index.html</file>

File diff suppressed because one or more lines are too long

BIN
splash/splash.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB