diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2012-10-20 12:01:27 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2012-12-10 02:48:05 +0100 |
commit | b204e6254bd0c2227bbbb81519a0ddcf174d2ad4 (patch) | |
tree | 0badb3885331b2d700388e96ac59532d6b7dd867 /src/webtab/webview.cpp | |
parent | Enable incognito mode by calling "rekonq --incognito URL" :) (diff) | |
download | rekonq-b204e6254bd0c2227bbbb81519a0ddcf174d2ad4.tar.xz |
enable webapp mode by calling "rekonq --webapp URL" :D
NOTE: in my opinion, this is a great feature that needs a lot of
attention and testing. But it's really cool to see how it works... ;)
Diffstat (limited to 'src/webtab/webview.cpp')
-rw-r--r-- | src/webtab/webview.cpp | 59 |
1 files changed, 39 insertions, 20 deletions
diff --git a/src/webtab/webview.cpp b/src/webtab/webview.cpp index e8b629ec..df4af0b3 100644 --- a/src/webtab/webview.cpp +++ b/src/webtab/webview.cpp @@ -314,7 +314,7 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) menu.addAction(pageAction(KWebPage::Forward)); } - menu.addAction(webwin->actionByName("view_redisplay")); + menu.addAction(pageAction(KWebPage::Reload)); menu.addSeparator(); @@ -333,7 +333,8 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) // Page Actions menu.addAction(pageAction(KWebPage::SelectAll)); - menu.addAction(webwin->actionByName(KStandardAction::name(KStandardAction::SaveAs))); + if (webwin) + menu.addAction(webwin->actionByName(KStandardAction::name(KStandardAction::SaveAs))); if (!KStandardDirs::findExe("kget").isNull() && ReKonfig::kgetList()) { @@ -342,13 +343,19 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) menu.addAction(a); } - menu.addAction(webwin->actionByName("page_source")); - menu.addAction(inspectAction); - + if (webwin) + { + menu.addAction(webwin->actionByName("page_source")); + menu.addAction(inspectAction); + } + // we need to show everytime this because we cannot communicate with the tabwindow. // We are NOT sure it exists.. - menu.addSeparator(); - menu.addAction(webwin->actionByName(KStandardAction::name(KStandardAction::FullScreen))); + if (webwin) + { + menu.addSeparator(); + menu.addAction(webwin->actionByName(KStandardAction::name(KStandardAction::FullScreen))); + } } // LINK ACTIONS ------------------------------------------------------------------- @@ -358,21 +365,27 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) sendByMailAction->setData(m_contextMenuHitResult.linkUrl()); sendByMailAction->setText(i18n("Share link")); - a = new KAction(KIcon("tab-new"), i18n("Open in New &Tab"), this); - a->setData(m_contextMenuHitResult.linkUrl()); - connect(a, SIGNAL(triggered(bool)), this, SLOT(openLinkInNewTab())); - menu.addAction(a); - + if (webwin) + { + a = new KAction(KIcon("tab-new"), i18n("Open in New &Tab"), this); + a->setData(m_contextMenuHitResult.linkUrl()); + connect(a, SIGNAL(triggered(bool)), this, SLOT(openLinkInNewTab())); + menu.addAction(a); + } + a = new KAction(KIcon("window-new"), i18n("Open in New &Window"), this); a->setData(m_contextMenuHitResult.linkUrl()); connect(a, SIGNAL(triggered(bool)), this, SLOT(openLinkInNewWindow())); menu.addAction(a); - a = new KAction(KIcon("view-media-artist"), i18n("Open in Private &Window"), this); - a->setData(m_contextMenuHitResult.linkUrl()); - connect(a, SIGNAL(triggered(bool)), this, SLOT(openLinkInPrivateWindow())); - menu.addAction(a); - + if (webwin) + { + a = new KAction(KIcon("view-media-artist"), i18n("Open in Private &Window"), this); + a->setData(m_contextMenuHitResult.linkUrl()); + connect(a, SIGNAL(triggered(bool)), this, SLOT(openLinkInPrivateWindow())); + menu.addAction(a); + } + menu.addSeparator(); // Don't show dots if we are NOT going to ask for download path @@ -517,11 +530,17 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) } else { - a = webwin->actionByName(KStandardAction::name(KStandardAction::AddBookmark)); - menu.addAction(a); + if (webwin) + { + a = webwin->actionByName(KStandardAction::name(KStandardAction::AddBookmark)); + menu.addAction(a); + } } + menu.addAction(sendByMailAction); - menu.addAction(inspectAction); + + if (webwin) + menu.addAction(inspectAction); // SPELL CHECK Actions if (m_contextMenuHitResult.isContentEditable()) |