16
14
# You should have received a copy of the GNU General Public License along
17
15
# with this program. If not, see <http://www.gnu.org/licenses/>.
18
17
"""Provide the correct reactor and ui integration."""
22
# pylint: disable=C0103
21
from PyQt4 import QtGui
23
# Module used to include the resources into this file
24
# Unused import images_rc, pylint: disable=W0611
25
from ubuntuone_installer.gui.qt.ui import images_rc
26
# pylint: enable=W0611
29
# Invalid name "source", pylint: disable=C0103
25
30
if sys.platform == 'win32':
26
31
from ubuntuone_installer.gui.qt.main import windows
29
34
from ubuntuone_installer.gui.qt.main import linux
36
# pylint: enable=C0103
39
def main(installing=False):
40
"""Start the Qt reactor and open the main window."""
41
# The following cannot be imported outside this function
42
# because u1trial already provides a reactor.
44
# The main loop MUST be initialized before importing the reactor
45
app = QtGui.QApplication(sys.argv)
48
# Reimport 'qt4reactor', 'reactor', pylint: disable=W0404
52
from twisted.internet import reactor
53
from ubuntuone_installer.gui.qt.utils import check_credentials
54
# pylint: enable=W0404
56
# Module 'reactor' has no 'run'/'stop' member, pylint: disable=E1101
57
reactor.callWhenRunning(check_credentials,
58
installing=installing, stop_cb=reactor.stop)
60
# pylint: enable=E1101