summaryrefslogtreecommitdiff
path: root/src/webtab.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-11-19 01:32:04 +0100
committerAndrea Diamantini <adjam7@gmail.com>2010-11-19 01:32:04 +0100
commitfe21365ffafb922a6b24959f3d1096e4c6171427 (patch)
tree7380e1486a65ab57e39a663442876ff1912715d3 /src/webtab.cpp
parentAPI clean up (diff)
downloadrekonq-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/webtab.cpp')
-rw-r--r--src/webtab.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/webtab.cpp b/src/webtab.cpp
index 0a55060b..b4f070a9 100644
--- a/src/webtab.cpp
+++ b/src/webtab.cpp
@@ -51,6 +51,7 @@ WebTab::WebTab(QWidget *parent)
, _view(new WebView(this))
, _bar(new UrlBar(this))
, _progress(0)
+ , _part(0)
{
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
@@ -74,6 +75,7 @@ WebTab::WebTab(QWidget *parent)
connect(_view, SIGNAL(loadProgress(int)), this, SLOT(updateProgress(int)));
connect(_view, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool)));
+ connect(_view, SIGNAL(titleChanged(const QString &)), this, SIGNAL(titleChanged(const QString &)));
}
@@ -81,13 +83,18 @@ WebTab::~WebTab()
{
_walletBar.clear();
_previewSelectorBar.clear();
+
+ delete _part;
}
KUrl WebTab::url()
{
if(page() && page()->isOnRekonqPage())
+ {
+ kDebug() << "REKONQ PAGE. URL = " << page()->loadingUrl();
return page()->loadingUrl();
+ }
return view()->url();
}
@@ -203,3 +210,28 @@ void WebTab::showRSSInfo(QPoint pos)
RSSWidget *widget = new RSSWidget(map, window());
widget->showAt(pos);
}
+
+
+void WebTab::setPart(KParts::ReadOnlyPart *p, const KUrl &u)
+{
+ if(p)
+ {
+ // Ok, part exists. Insert & show it..
+ _part = p;
+ qobject_cast<QVBoxLayout *>(layout())->insertWidget(1, p->widget());
+ p->openUrl(u);
+ _view->hide();
+
+ emit titleChanged(u.url());
+ return;
+ }
+
+ if(!_part)
+ return;
+
+ // Part NO more exists. Let's clean up from webtab
+ _view->show();
+ qobject_cast<QVBoxLayout *>(layout())->removeWidget(_part->widget());
+ delete _part;
+ _part = 0;
+}