From 8c5f265d22bd4590612b426ebb9d984b8e49f24c Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 28 May 2009 01:55:25 +0200 Subject: working on error messages & openLinkInNewTab slot --- src/webview.cpp | 42 ++++++------------------------------------ 1 file changed, 6 insertions(+), 36 deletions(-) (limited to 'src/webview.cpp') diff --git a/src/webview.cpp b/src/webview.cpp index 16f7b6e5..4f6ba097 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -75,7 +75,7 @@ WebView::WebView(QWidget* parent) connect(this, SIGNAL(loadProgress(int)), this, SLOT(setProgress(int))); connect(this, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished())); - connect(this, SIGNAL(openUrlInNewTab(const KUrl &)), this, SLOT(load(const KUrl &))); + connect(this, SIGNAL(openUrlInNewTab(const KUrl &)), this, SLOT(openLinkInNewTab(const KUrl &))); } @@ -218,10 +218,11 @@ void WebView::contextMenuEvent(QContextMenuEvent *event) } -// void WebView::openLinkInNewTab() -// { -// pageAction(QWebPage::OpenLinkInNewWindow)->trigger(); -// } +void WebView::openLinkInNewTab(const KUrl &url) +{ + Application::instance()->newWebView(); + load(url); +} void WebView::loadFinished() @@ -235,37 +236,6 @@ void WebView::loadFinished() } -// void WebView::mousePressEvent(QMouseEvent *event) -// { -// m_page->m_pressedButtons = event->buttons(); -// m_page->m_keyboardModifiers = event->modifiers(); -// QWebView::mousePressEvent(event); -// } -// -// -// void WebView::mouseReleaseEvent(QMouseEvent *event) -// { -// QWebView::mouseReleaseEvent(event); -// if (!event->isAccepted() && (m_page->m_pressedButtons & Qt::MidButton)) -// { -// KUrl url(QApplication::clipboard()->text(QClipboard::Selection)); -// if (!url.isEmpty() && url.isValid() && !url.scheme().isEmpty()) -// { -// setUrl(url); -// } -// } -// } - - -// void WebView::downloadRequested(const QNetworkRequest &request) -// { -// KUrl srcUrl = request.url(); -// QString path = ReKonfig::downloadDir() + QString("/") + srcUrl.fileName(); -// KUrl destUrl = KUrl(path); -// Application::downloadManager()->newDownload(srcUrl); -// } - - void WebView::keyPressEvent(QKeyEvent *event) { if ((event->modifiers() == Qt::ControlModifier) && (event->key() == Qt::Key_Tab)) -- cgit v1.2.1