diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-01-05 19:01:56 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-01-05 19:01:56 +0100 |
commit | 38987234769f6a0b31574c387757130c64406199 (patch) | |
tree | 6d25e54dfb962df18f95165525e4dd57cdccc87e /src/webview.cpp | |
parent | javascript scheme support (diff) | |
download | rekonq-38987234769f6a0b31574c387757130c64406199.tar.xz |
"Contextual" image menu
Diffstat (limited to 'src/webview.cpp')
-rw-r--r-- | src/webview.cpp | 64 |
1 files changed, 33 insertions, 31 deletions
diff --git a/src/webview.cpp b/src/webview.cpp index a35b7143..0bd590da 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -239,47 +239,50 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) menu.addAction(mainwindow->actionByName("view_redisplay")); - menu.addSeparator(); + if( result.pixmap().isNull() ) + { + menu.addSeparator(); - menu.addAction(mainwindow->actionByName("new_tab")); - menu.addAction(mainwindow->actionByName("new_window")); + menu.addAction(mainwindow->actionByName("new_tab")); + menu.addAction(mainwindow->actionByName("new_window")); - menu.addSeparator(); + menu.addSeparator(); - //Frame - KActionMenu *frameMenu = new KActionMenu(i18n("Current Frame"), this); + //Frame + KActionMenu *frameMenu = new KActionMenu(i18n("Current Frame"), this); - frameMenu->addAction(pageAction(KWebPage::OpenFrameInNewWindow)); + frameMenu->addAction(pageAction(KWebPage::OpenFrameInNewWindow)); - a = new KAction( KIcon("document-print-frame"), i18n("Print Frame"), this); - connect(a, SIGNAL(triggered()), this, SLOT(printFrame())); - frameMenu->addAction(a); + a = new KAction( KIcon("document-print-frame"), i18n("Print Frame"), this); + connect(a, SIGNAL(triggered()), this, SLOT(printFrame())); + frameMenu->addAction(a); - menu.addAction(frameMenu); - - menu.addSeparator(); - - // Page Actions - menu.addAction(pageAction(KWebPage::SelectAll)); + menu.addAction(frameMenu); + + menu.addSeparator(); + + // Page Actions + menu.addAction(pageAction(KWebPage::SelectAll)); - menu.addAction(mainwindow->actionByName(KStandardAction::name(KStandardAction::SaveAs))); + menu.addAction(mainwindow->actionByName(KStandardAction::name(KStandardAction::SaveAs))); - if (ReKonfig::kgetList()) - { - a = new KAction(KIcon("kget"), i18n("List all links"), this); - connect(a, SIGNAL(triggered(bool)), page(), SLOT(downloadAllContentsWithKGet())); - menu.addAction(a); - } + if (ReKonfig::kgetList()) + { + a = new KAction(KIcon("kget"), i18n("List all links"), this); + connect(a, SIGNAL(triggered(bool)), page(), SLOT(downloadAllContentsWithKGet())); + menu.addAction(a); + } - menu.addAction(mainwindow->actionByName("page_source")); + menu.addAction(mainwindow->actionByName("page_source")); - QAction *addBookmarkAction = Application::bookmarkProvider()->actionByName("rekonq_add_bookmark"); - menu.addAction(addBookmarkAction); + QAction *addBookmarkAction = Application::bookmarkProvider()->actionByName("rekonq_add_bookmark"); + menu.addAction(addBookmarkAction); - if (page()->settings()->testAttribute(QWebSettings::DeveloperExtrasEnabled)) - { - // Developer Extras actions - menu.addAction(pageAction(KWebPage::InspectElement)); + if (page()->settings()->testAttribute(QWebSettings::DeveloperExtrasEnabled)) + { + // Developer Extras actions + menu.addAction(pageAction(KWebPage::InspectElement)); + } } if(mainwindow->isFullScreen()) @@ -397,4 +400,3 @@ void WebView::keyPressEvent(QKeyEvent *event) KWebView::keyPressEvent(event); } - |