Exemplo n.º 1
0
    def _init_modules(self):
        """Initialize all 'modules' which need to be initialized."""
        log.init.debug("Initializing readline-bridge...")
        readline_bridge = readline.ReadlineBridge()
        objreg.register('readline-bridge', readline_bridge)

        log.init.debug("Initializing directories...")
        standarddir.init()
        log.init.debug("Initializing config...")
        config.init(self._args)
        log.init.debug("Initializing crashlog...")
        self._handle_segfault()
        log.init.debug("Initializing websettings...")
        websettings.init()
        log.init.debug("Initializing quickmarks...")
        quickmark_manager = quickmarks.QuickmarkManager()
        objreg.register('quickmark-manager', quickmark_manager)
        log.init.debug("Initializing proxy...")
        proxy.init()
        log.init.debug("Initializing cookies...")
        cookie_jar = cookies.CookieJar(self)
        objreg.register('cookie-jar', cookie_jar)
        log.init.debug("Initializing cache...")
        diskcache = cache.DiskCache(self)
        objreg.register('cache', diskcache)
        log.init.debug("Initializing main window...")
        win_id = mainwindow.MainWindow.spawn(
            False if self._args.nowindow else True)
        main_window = objreg.get('main-window', scope='window', window=win_id)
        self.setActiveWindow(main_window)
Exemplo n.º 2
0
def _init_modules(args, crash_handler):
    """Initialize all 'modules' which need to be initialized.

    Args:
        args: The argparse namespace.
        crash_handler: The CrashHandler instance.
    """
    # pylint: disable=too-many-statements
    log.init.debug("Initializing save manager...")
    save_manager = savemanager.SaveManager(qApp)
    objreg.register('save-manager', save_manager)
    save_manager.add_saveable('version', _save_version)
    log.init.debug("Initializing network...")
    networkmanager.init()
    log.init.debug("Initializing readline-bridge...")
    readline_bridge = readline.ReadlineBridge()
    objreg.register('readline-bridge', readline_bridge)
    log.init.debug("Initializing directories...")
    standarddir.init(args)
    log.init.debug("Initializing config...")
    config.init(qApp)
    save_manager.init_autosave()
    log.init.debug("Initializing web history...")
    history.init(qApp)
    log.init.debug("Initializing crashlog...")
    crash_handler.handle_segfault()
    log.init.debug("Initializing sessions...")
    sessions.init(qApp)
    log.init.debug("Initializing js-bridge...")
    js_bridge = qutescheme.JSBridge(qApp)
    objreg.register('js-bridge', js_bridge)
    log.init.debug("Initializing websettings...")
    websettings.init()
    log.init.debug("Initializing adblock...")
    host_blocker = adblock.HostBlocker()
    host_blocker.read_hosts()
    objreg.register('host-blocker', host_blocker)
    log.init.debug("Initializing quickmarks...")
    quickmark_manager = quickmarks.QuickmarkManager(qApp)
    objreg.register('quickmark-manager', quickmark_manager)
    log.init.debug("Initializing proxy...")
    proxy.init()
    log.init.debug("Initializing cookies...")
    cookie_jar = cookies.CookieJar(qApp)
    objreg.register('cookie-jar', cookie_jar)
    log.init.debug("Initializing cache...")
    diskcache = cache.DiskCache(qApp)
    objreg.register('cache', diskcache)
    log.init.debug("Initializing completions...")
    completionmodels.init()
    log.init.debug("Misc initialization...")
    _maybe_hide_mouse_cursor()
    objreg.get('config').changed.connect(_maybe_hide_mouse_cursor)