diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-11-19 01:32:04 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-11-19 01:32:04 +0100 |
commit | fe21365ffafb922a6b24959f3d1096e4c6171427 (patch) | |
tree | 7380e1486a65ab57e39a663442876ff1912715d3 /src/webpage.cpp | |
parent | API clean up (diff) | |
download | rekonq-fe21365ffafb922a6b24959f3d1096e4c6171427.tar.xz |
Print && Find actions for the parts :)
- handle print & find with different signals in mainwindow
- show right tab title (moving titleChanged signal from view to tab)
Diffstat (limited to 'src/webpage.cpp')
-rw-r--r-- | src/webpage.cpp | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/src/webpage.cpp b/src/webpage.cpp index f08aebd6..67a33047 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -229,7 +229,13 @@ WebPage::~WebPage() bool WebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, NavigationType type) { - _isOnRekonqPage = false; + if(_isOnRekonqPage) + { + WebView *view = qobject_cast<WebView *>(parent()); + WebTab *tab = qobject_cast<WebTab *>(view->parent()); + _isOnRekonqPage = false; + tab->setPart(0, KUrl()); // re-enable the view page + } _loadingUrl = request.url(); KIO::AccessManager *manager = qobject_cast<KIO::AccessManager*>(networkAccessManager()); @@ -439,32 +445,15 @@ void WebPage::handleUnsupportedContent(QNetworkReply *reply) } // case KParts::BrowserRun::Embed - KService::List partServices = KMimeTypeTrader::self()->query(mimeType, QL1S("KParts/ReadOnlyPart")); - if (partServices.count() > 0) + KParts::ReadOnlyPart *pa = KMimeTypeTrader::createPartInstanceFromQuery<KParts::ReadOnlyPart>(mimeType, view(), this, QString()); + if (pa) { - QString p = replyUrl.pathOrUrl(); - - // A part can handle this. Embed it! - QString html; - html += "<html>"; - html += "<head>"; - html += "<title>"; - html += p; - html += "</title>"; - html += "<style type=\"text/css\">"; - html += "* { border: 0; padding: 0; margin: 0; }"; - html += "</style>"; - html += "</head>"; - html += "<body>"; - html += "<object type=\"" + mimeType + "\" data=\"" + p + "\" width=\"100%\" height=\"100%\" />"; - html += "</body>"; - html += "</html>"; - - mainFrame()->setHtml(html); _isOnRekonqPage = true; - + WebView *view = qobject_cast<WebView *>(parent()); WebTab *tab = qobject_cast<WebTab *>(view->parent()); + tab->setPart(pa,replyUrl); + UrlBar *bar = tab->urlBar(); bar->setQUrl(replyUrl); |