void UIMachineLogicFullscreen::prepareActionGroups()
{
    /* Call to base-class: */
    UIMachineLogic::prepareActionGroups();

    /* Adjust-window action isn't allowed in fullscreen: */
    gActionPool->action(UIActionIndexRuntime_Simple_AdjustWindow)->setVisible(false);

    /* Add the view menu: */
    QMenu *pMenu = gActionPool->action(UIActionIndexRuntime_Menu_View)->menu();
    m_pScreenLayout->initialize(pMenu);
    pMenu->setVisible(true);
}
Example #2
0
void webview::contextMenuEvent(QContextMenuEvent * event)
{
    QMenu * menu = new QMenu();
    menu->setVisible(true);
    QWebHitTestResult element = this->page()->mainFrame()->hitTestContent(event->pos());
    if(!element.linkUrl().isEmpty())
    {
        QAction * newtab = this->pageAction(QWebPage::OpenLinkInNewWindow);
        newtab->setText(tr("open link in new tab"));
        menu->addAction(newtab);
        menu->addAction(this->pageAction(QWebPage::DownloadLinkToDisk));
        menu->addAction(this->pageAction(QWebPage::CopyLinkToClipboard));
    }
    if(!element.imageUrl().isEmpty())
    {
        menu->addAction(this->pageAction(QWebPage::DownloadImageToDisk));
        menu->addAction(this->pageAction(QWebPage::CopyImageToClipboard));
        menu->addAction(this->pageAction(QWebPage::CopyImageUrlToClipboard));
        QAction * newimage = this->pageAction(QWebPage::OpenImageInNewWindow);
        newimage->setText(tr("open image in new tab"));
        menu->addAction(newimage);
    }
    if(!page()->selectedText().isEmpty())
    {
        menu->addAction(this->pageAction(QWebPage::Copy));
        menu->addAction(this->pageAction(QWebPage::Cut));
        menu->addAction(this->pageAction(QWebPage::Paste));
        menu->addAction(this->pageAction(QWebPage::Undo));
        menu->addAction(this->pageAction(QWebPage::Redo));
        menu->addAction(this->pageAction(QWebPage::SelectAll));
    }
    if(element.element().tagName().toLower() == "input" && element.element().attribute(QLatin1String("type")).toLower() == "text")
    {
        menu->addAction(this->pageAction(QWebPage::SelectAll));
        menu->addAction(this->pageAction(QWebPage::Paste));
        menu->addAction(this->pageAction(QWebPage::SetTextDirectionLeftToRight));
        menu->addAction(this->pageAction(QWebPage::SetTextDirectionRightToLeft));
        menu->addAction(this->pageAction(QWebPage::SetTextDirectionDefault));
        menu->addAction(this->pageAction(QWebPage::MoveToNextWord));
    }
    if(!element.isNull())
    {
        menu->addAction(this->pageAction(QWebPage::Back));
        menu->addAction(this->pageAction(QWebPage::Forward));
        menu->addAction(this->pageAction(QWebPage::Reload));
        menu->addAction(this->pageAction(QWebPage::Stop));
        menu->addAction(this->pageAction(QWebPage::InspectElement));
    }
    menu->exec(event->globalPos());
}
Example #3
0
void UIMachineLogicSeamless::prepareActionGroups()
{
    /* Call to base-class: */
    UIMachineLogic::prepareActionGroups();

    /* Guest auto-resize isn't allowed in seamless: */
    gActionPool->action(UIActionIndexRuntime_Toggle_GuestAutoresize)->setVisible(false);

    /* Adjust-window isn't allowed in seamless: */
    gActionPool->action(UIActionIndexRuntime_Simple_AdjustWindow)->setVisible(false);

    /* Disable mouse-integration isn't allowed in seamless: */
    gActionPool->action(UIActionIndexRuntime_Toggle_MouseIntegration)->setVisible(false);

    /* Add the view menu: */
    QMenu *pMenu = gActionPool->action(UIActionIndexRuntime_Menu_View)->menu();
    m_pScreenLayout->setViewMenu(pMenu);
    pMenu->setVisible(true);
}