1#!/usr/bin/env python
2
3
4#############################################################################
5##
6## Copyright (C) 2015 Riverbank Computing Limited.
7## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
8## All rights reserved.
9##
10## This file is part of the examples of PyQt.
11##
12## $QT_BEGIN_LICENSE:LGPL$
13## Commercial Usage
14## Licensees holding valid Qt Commercial licenses may use this file in
15## accordance with the Qt Commercial License Agreement provided with the
16## Software or, alternatively, in accordance with the terms contained in
17## a written agreement between you and Nokia.
18##
19## GNU Lesser General Public License Usage
20## Alternatively, this file may be used under the terms of the GNU Lesser
21## General Public License version 2.1 as published by the Free Software
22## Foundation and appearing in the file LICENSE.LGPL included in the
23## packaging of this file.  Please review the following information to
24## ensure the GNU Lesser General Public License version 2.1 requirements
25## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
26##
27## In addition, as a special exception, Nokia gives you certain additional
28## rights.  These rights are described in the Nokia Qt LGPL Exception
29## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
30##
31## GNU General Public License Usage
32## Alternatively, this file may be used under the terms of the GNU
33## General Public License version 3.0 as published by the Free Software
34## Foundation and appearing in the file LICENSE.GPL included in the
35## packaging of this file.  Please review the following information to
36## ensure the GNU General Public License version 3.0 requirements will be
37## met: http://www.gnu.org/copyleft/gpl.html.
38##
39## If you have questions regarding the use of this file, please contact
40## Nokia at qt-info@nokia.com.
41## $QT_END_LICENSE$
42##
43#############################################################################
44
45
46from PyQt5.QtCore import QEventLoop, QTime
47from PyQt5.QtWidgets import QApplication, QMessageBox
48
49from colors import Colors
50from mainwindow import MainWindow
51from menumanager import MenuManager
52
53
54def artisticSleep(sleepTime):
55    time = QTime()
56    time.restart()
57    while time.elapsed() < sleepTime:
58        QApplication.processEvents(QEventLoop.AllEvents, 50)
59
60
61if __name__ == '__main__':
62
63    import sys
64
65    app = QApplication(sys.argv)
66    Colors.parseArgs(sys.argv)
67
68    if sys.platform == 'win32':
69        QMessageBox.information(None, "Documentation Warning",
70                "If you are using the GPL version of PyQt from the binary "
71                "installer then you will probably see warning messages about "
72                "missing documentation.  This is because the installer does "
73                "not include a copy of the Qt documentation as it is so "
74                "large.")
75
76    mainWindow = MainWindow()
77    MenuManager.instance().init(mainWindow)
78    mainWindow.setFocus()
79
80    if Colors.fullscreen:
81        mainWindow.showFullScreen()
82    else:
83        mainWindow.enableMask(True)
84        mainWindow.show()
85
86    artisticSleep(500)
87    mainWindow.start()
88
89    sys.exit(app.exec_())
90