bool WebKitHtmlWidgetPlugin::load(LiteApi::IApplication *app)
{
    m_liteApp = app;
    LiteApi::IHtmlWidgetFactory *factory = new WebViewHtmlWidgetFactory(this);
    app->htmlWidgetManager()->addFactory(factory);
    app->htmlWidgetManager()->setDefaultClassName(factory->className());
    /*
    WebKitBrowser *wb = new WebKitBrowser(app,this);
    app->toolWindowManager()->addToolWindow(Qt::RightDockWidgetArea,
                                            wb->widget(),"WebKitBrowser",tr("WebKitBrowser"),
                                            false);
    */
    m_browser = new WebKitBrowser(app,this);
    m_browserAct = app->editorManager()->registerBrowser(m_browser);
    app->actionManager()->insertViewMenu(LiteApi::ViewMenuBrowserPos,m_browserAct);
    //
//    QMenu *fileMenu = app->actionManager()->loadMenu("menu/file");
//    IActionContext *actionContext =  app->actionManager()->getActionContext(app,"App");
//    LiteApi::ActionInfo *info = actionContext->actionInfo("AddFolder");
//    if (fileMenu && info && info->action) {
//        QAction *openUrl = new QAction(tr("Open File With WebKit ..."),this);
//        connect(openUrl,SIGNAL(triggered()),this,SLOT(openHtmlWithWebkit()));
//        fileMenu->insertAction(info->action,openUrl);
//    }
    return true;
}
Exemplo n.º 2
0
bool WebKitHtmlWidgetPlugin::load(LiteApi::IApplication *app)
{
    LiteApi::IHtmlWidgetFactory *factory = new WebViewHtmlWidgetFactory(this);
    app->htmlWidgetManager()->addFactory(factory);
    app->htmlWidgetManager()->setDefaultClassName(factory->className());

    return true;
}
Exemplo n.º 3
0
bool WebKitHtmlWidgetPlugin::initWithApp(LiteApi::IApplication *app)
{
    if (!LiteApi::IPlugin::initWithApp(app)) {
        return false;
    }

    LiteApi::IHtmlWidgetFactory *factory = new WebViewHtmlWidgetFactory(this);
    m_liteApp->htmlWidgetManager()->addFactory(factory);
    m_liteApp->htmlWidgetManager()->setDefaultClassName(factory->className());

    return true;
}