camelot.camelot.empty_project.main

Package camelot :: Package camelot :: Package empty_project :: Module main |
[hide private]
[frames] | no frames]

# Source Code for Module camelot.camelot.empty_project.main

     1  import logging
     2  import settings
     3

     4  logger = logging.getLogger('camelot.main')
     5  from PyQt4 import QtGui, QtCore
     6  QT_MAJOR_VERSION = float('.'.join(str(QtCore.QT_VERSION_STR).split('.')[0:2]))
     7

     8  import camelot.view.art as art
     9

    10 -def main():
    11    logger.debug('qt version %s, pyqt version %s' % (QtCore.QT_VERSION_STR,

    12                                                     QtCore.PYQT_VERSION_STR))
    13

    14    logger.debug('qt major version %f' % QT_MAJOR_VERSION)
    15    import sys
    16    app = QtGui.QApplication(sys.argv)
    17    app.setOrganizationName('My organization')
    18    app.setOrganizationDomain('example.com')
    19    app.setApplicationName('Camelot')
    20    app.setWindowIcon(QtGui.QIcon(art.icon32('apps/system-users')))
    21

    22    from camelot.view.controls.appscheme import scheme
    23    style = """

    24    QMainWindow::separator {

    25      border-right: 1px solid rgb%(BorderColor)s;

    26    }

    27    """ % scheme.styledict
    28    app.setStyleSheet(style)
    29

    30    logger.debug('loading splashscreen')
    31    splash = QtGui.QSplashScreen(QtGui.QPixmap(art.file_('camelot-proposal.png')))
    32    splash.show()
    33    app.processEvents()
    34

    35    #

    36    # Start the model thread

    37    #

    38    from camelot.view.model_thread import get_model_thread, construct_model_thread
    39    from camelot.view.response_handler import ResponseHandler
    40    from camelot.view.remote_signals import construct_signal_handler
    41    rh = ResponseHandler()
    42

    43    construct_model_thread(rh)
    44    construct_signal_handler()
    45    get_model_thread().start()
    46

    47    from application_admin import MyApplicationAdmin
    48    from camelot.view.mainwindow import MainWindow
    49    admin = MyApplicationAdmin()
    50    mainwindow = MainWindow(admin)
    51    mainwindow.show()
    52    splash.finish(mainwindow)
    53    sys.exit(app.exec_())
    54

    55  if __name__ == '__main__':
    56    main()
    57