Пример #1
0
def application_start(context, view, monitor_refs_only=False):
    """Show the GUI and start the main event loop"""
    # Store the view for session management
    context.app.set_view(view)

    # Make sure that we start out on top
    view.show()
    view.raise_()

    # Scan for the first time
    runtask = qtutils.RunTask(parent=view)
    init_update_task(view, runtask, context.model)

    # Start the filesystem monitor thread
    fsmonitor.current().start(monitor_refs_only)

    msg_timer = QtCore.QTimer()
    msg_timer.setSingleShot(True)
    msg_timer.connect(msg_timer, SIGNAL('timeout()'), _send_msg)
    msg_timer.start(0)

    # Start the event loop
    result = context.app.exec_()

    # All done, cleanup
    fsmonitor.current().stop()
    QtCore.QThreadPool.globalInstance().waitForDone()

    return result
Пример #2
0
def application_start(context, view, monitor_refs_only=False):
    """Show the GUI and start the main event loop"""
    # Store the view for session management
    context.app.set_view(view)

    # Make sure that we start out on top
    view.show()
    view.raise_()

    # Scan for the first time
    runtask = qtutils.RunTask(parent=view)
    init_update_task(view, runtask, context.model)

    # Start the filesystem monitor thread
    fsmonitor.current().start(monitor_refs_only)

    msg_timer = QtCore.QTimer()
    msg_timer.setSingleShot(True)
    msg_timer.connect(msg_timer, SIGNAL('timeout()'), _send_msg)
    msg_timer.start(0)

    # Start the event loop
    result = context.app.exec_()

    # All done, cleanup
    fsmonitor.current().stop()
    QtCore.QThreadPool.globalInstance().waitForDone()

    tmpdir = utils.tmpdir()
    shutil.rmtree(tmpdir, ignore_errors=True)

    return result
Пример #3
0
    def __init__(self, argv, locale=None, gui=True):
        cfgactions.install()
        i18n.install(locale)
        qtcompat.install()
        qtutils.install()
        icons.install()

        QtCore.QObject.connect(fsmonitor.current(), SIGNAL('files_changed'),
                               self._update_files)

        if gui:
            self._app = current(tuple(argv))
            self._app.setWindowIcon(icons.cola())
        else:
            self._app = QtCore.QCoreApplication(argv)
Пример #4
0
    def __init__(self, argv, locale=None, gui=True):
        cfgactions.install()
        i18n.install(locale)
        qtcompat.install()
        qtutils.install()
        icons.install()

        QtCore.QObject.connect(fsmonitor.current(), SIGNAL('files_changed'),
                               self._update_files)

        if gui:
            self._app = current(tuple(argv))
            self._app.setWindowIcon(icons.cola())
        else:
            self._app = QtCore.QCoreApplication(argv)