summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2013-01-27 01:47:55 +0100
committerAndrea Diamantini <adjam7@gmail.com>2013-01-27 01:47:55 +0100
commita0b27fd9c8cec145c8c16d0ab5f99d030ced7fb8 (patch)
tree4dd3f661648366b6899ad055f3061f154cc7aef6
parentFix kpart window half shown (diff)
downloadrekonq-a0b27fd9c8cec145c8c16d0ab5f99d030ced7fb8.tar.xz
Fix tab when showing a kpart. Let also see title where needed
-rw-r--r--src/application.cpp2
-rw-r--r--src/tabwindow/tabwindow.cpp1
-rw-r--r--src/urlbar/urlbar.cpp9
-rw-r--r--src/webtab/protocolhandler.cpp2
-rw-r--r--src/webtab/webtab.cpp49
-rw-r--r--src/webtab/webtab.h14
-rw-r--r--src/webwindow/findbar.cpp4
-rw-r--r--src/webwindow/webwindow.cpp14
-rw-r--r--src/webwindow/webwindow.h2
9 files changed, 64 insertions, 33 deletions
diff --git a/src/application.cpp b/src/application.cpp
index 8fb15b5a..4b5d492c 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -320,7 +320,7 @@ int Application::newInstance()
}
if (ReKonfig::checkDefaultSearchEngine() && !hasToBeRecoveredFromCrash && SearchEngine::defaultEngine().isNull())
- QTimer::singleShot(2000, tabWindow()->currentWebWindow()->view(), SLOT(showSearchEngineBar()));
+ QTimer::singleShot(2000, tabWindow()->currentWebWindow()->tabView(), SLOT(showSearchEngineBar()));
// updating rekonq configuration
updateConfiguration();
diff --git a/src/tabwindow/tabwindow.cpp b/src/tabwindow/tabwindow.cpp
index 4f58ce3e..d0e6dbce 100644
--- a/src/tabwindow/tabwindow.cpp
+++ b/src/tabwindow/tabwindow.cpp
@@ -394,6 +394,7 @@ void TabWindow::tabTitleChanged(const QString &title)
tabTitle.replace('&', "&&");
int index = indexOf(tab);
+
if (-1 != index && !tabBar()->tabData(index).toBool())
{
setTabText(index, tabTitle);
diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp
index cd6a5605..f8d9f2ff 100644
--- a/src/urlbar/urlbar.cpp
+++ b/src/urlbar/urlbar.cpp
@@ -52,7 +52,6 @@
#include "webtab.h"
#include "webpage.h"
-#include "webview.h"
#include "searchengine.h"
#include "websnap.h"
@@ -151,10 +150,10 @@ UrlBar::UrlBar(QWidget *parent)
connect(_tab, SIGNAL(loadProgressing()), this, SLOT(update()));
- connect(_tab->view(), SIGNAL(urlChanged(QUrl)), this, SLOT(setQUrl(QUrl)));
- connect(_tab->view(), SIGNAL(loadFinished(bool)), this, SLOT(loadFinished()));
- connect(_tab->view(), SIGNAL(loadStarted()), this, SLOT(clearRightIcons()));
- connect(_tab->view(), SIGNAL(iconChanged()), this, SLOT(refreshFavicon()));
+ connect(_tab, SIGNAL(urlChanged(QUrl)), this, SLOT(setQUrl(QUrl)));
+ connect(_tab, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished()));
+ connect(_tab, SIGNAL(loadStarted()), this, SLOT(clearRightIcons()));
+ connect(_tab, SIGNAL(iconChanged()), this, SLOT(refreshFavicon()));
// bookmark icon
connect(BookmarkManager::self(), SIGNAL(bookmarksUpdated()), this, SLOT(updateRightIcons()));
diff --git a/src/webtab/protocolhandler.cpp b/src/webtab/protocolhandler.cpp
index 69583284..4f2e765e 100644
--- a/src/webtab/protocolhandler.cpp
+++ b/src/webtab/protocolhandler.cpp
@@ -283,7 +283,7 @@ void ProtocolHandler::showResults(const KFileItemList &list)
if (ww)
{
ww->urlBar()->setQUrl(_url);
- ww->view()->setFocus();
+ ww->tabView()->setFocus();
}
if (_frame->page()->settings()->testAttribute(QWebSettings::PrivateBrowsingEnabled))
diff --git a/src/webtab/webtab.cpp b/src/webtab/webtab.cpp
index 74fe720f..2060ddab 100644
--- a/src/webtab/webtab.cpp
+++ b/src/webtab/webtab.cpp
@@ -102,20 +102,24 @@ WebTab::WebTab(QWidget *parent, bool isPrivateBrowsing)
this, SLOT(createWalletBar(QString,QUrl)));
}
+ // Connect webview signals with related webtab ones
+ connect(view(), SIGNAL(loadFinished(bool)), this, SIGNAL(loadFinished(bool)));
+ connect(view(), SIGNAL(loadProgress(int)), this, SIGNAL(loadProgress (int)));
+ connect(view(), SIGNAL(loadStarted()), this, SIGNAL(loadStarted()));
+ connect(view(), SIGNAL(urlChanged(QUrl)), this, SIGNAL(urlChanged(QUrl)));
+ connect(view(), SIGNAL(titleChanged(QString)), this, SIGNAL(titleChanged(QString)));
+ connect(view(), SIGNAL(iconChanged()), this, SIGNAL(iconChanged()));
+
+ if (!parent)
+ {
+ connect(this, SIGNAL(titleChanged(QString)), this, SLOT(webAppTitleChanged(QString)));
+ connect(this, SIGNAL(iconChanged()), this, SLOT(webAppIconChanged()));
+ }
+
connect(view(), SIGNAL(loadProgress(int)), this, SLOT(updateProgress(int)));
connect(view(), SIGNAL(loadStarted()), this, SLOT(resetProgress()));
connect(view(), SIGNAL(loadFinished(bool)), this, SLOT(loadFinished()));
- if (parent)
- {
- connect(view(), SIGNAL(titleChanged(QString)), this, SIGNAL(titleChanged(QString)));
- }
- else
- {
- connect(view(), SIGNAL(titleChanged(QString)), this, SLOT(webAppTitleChanged(QString)));
- connect(view(), SIGNAL(iconChanged()), this, SLOT(webAppIconChanged()));
- }
-
// Session Manager
connect(view(), SIGNAL(loadFinished(bool)), SessionManager::self(), SLOT(saveSession()));
}
@@ -172,6 +176,22 @@ KUrl WebTab::url()
}
+QString WebTab::title()
+{
+ if (page() && page()->isOnRekonqPage())
+ {
+ return url().url();
+ }
+
+ if (view())
+ return view()->title();
+
+ kDebug() << "OOPS... NO web classes survived! Returning an empty title...";
+ return QString();
+
+}
+
+
void WebTab::updateProgress(int p)
{
m_progress = p;
@@ -258,10 +278,10 @@ void WebTab::createPreviewSelectorBar(int index)
m_previewSelectorBar.data()->animatedHide();
}
- connect(page(), SIGNAL(loadStarted()), m_previewSelectorBar.data(), SLOT(loadProgress()), Qt::UniqueConnection);
- connect(page(), SIGNAL(loadProgress(int)), m_previewSelectorBar.data(), SLOT(loadProgress()), Qt::UniqueConnection);
- connect(page(), SIGNAL(loadFinished(bool)), m_previewSelectorBar.data(), SLOT(loadFinished()), Qt::UniqueConnection);
- connect(page()->mainFrame(), SIGNAL(urlChanged(QUrl)), m_previewSelectorBar.data(), SLOT(verifyUrl()), Qt::UniqueConnection);
+ connect(this, SIGNAL(loadStarted()), m_previewSelectorBar.data(), SLOT(loadProgress()), Qt::UniqueConnection);
+ connect(this, SIGNAL(loadProgress(int)), m_previewSelectorBar.data(), SLOT(loadProgress()), Qt::UniqueConnection);
+ connect(this, SIGNAL(loadFinished(bool)), m_previewSelectorBar.data(), SLOT(loadFinished()), Qt::UniqueConnection);
+ connect(this, SIGNAL(urlChanged(QUrl)), m_previewSelectorBar.data(), SLOT(verifyUrl()), Qt::UniqueConnection);
}
@@ -288,6 +308,7 @@ void WebTab::setPart(KParts::ReadOnlyPart *p, const KUrl &u)
view()->hide();
m_splitter->hide();
emit titleChanged(u.url());
+ emit urlChanged(u.url());
return;
}
diff --git a/src/webtab/webtab.h b/src/webtab/webtab.h
index a168e55d..5fc06994 100644
--- a/src/webtab/webtab.h
+++ b/src/webtab/webtab.h
@@ -71,7 +71,8 @@ public:
}
KUrl url();
-
+ QString title();
+
bool hasRSSInfo();
void createPreviewSelectorBar(int index);
@@ -107,9 +108,18 @@ private Q_SLOTS:
void toggleInspector(bool);
Q_SIGNALS:
- void loadProgressing();
+ // NOTE: These signals are here to NOT expose webview directly and let
+ // others use webtab instead. This will give us the ability to generate
+ // our own signals when needed.
+ void iconChanged();
+ void loadFinished(bool);
+ void loadProgress (int);
+ void loadStarted();
+ void urlChanged(const QUrl &);
void titleChanged(const QString &);
+ void loadProgressing();
+
void triggerPartPrint();
void infoToShow(QString);
diff --git a/src/webwindow/findbar.cpp b/src/webwindow/findbar.cpp
index 5f7d36e2..6bf9ac0d 100644
--- a/src/webwindow/findbar.cpp
+++ b/src/webwindow/findbar.cpp
@@ -150,7 +150,7 @@ void FindBar::setVisible(bool visible)
if (visible
&& w->page()->isOnRekonqPage()
- && w->view()->part() != 0)
+ && w->tabView()->part() != 0)
{
// findNext is the slot containing part integration code
findNext();
@@ -230,7 +230,7 @@ void FindBar::findNext()
if (w->page()->isOnRekonqPage())
{
// trigger part find action
- KParts::ReadOnlyPart *p = w->view()->part();
+ KParts::ReadOnlyPart *p = w->tabView()->part();
if (p)
{
// connect(this, SIGNAL(triggerPartFind()), p, SLOT(slotFind()));
diff --git a/src/webwindow/webwindow.cpp b/src/webwindow/webwindow.cpp
index 73543374..59c87571 100644
--- a/src/webwindow/webwindow.cpp
+++ b/src/webwindow/webwindow.cpp
@@ -121,13 +121,13 @@ WebWindow::WebWindow(QWidget *parent, bool isPrivateBrowsing, WebPage *pg)
connect(rApp, SIGNAL(toggleBookmarksToolbar(bool)), this, SLOT(toggleBookmarksToolbar(bool)));
// things changed signals
- connect(_tab->view(), SIGNAL(titleChanged(QString)), this, SIGNAL(titleChanged(QString)));
- connect(_tab->view(), SIGNAL(iconChanged()), this, SIGNAL(iconChanged()));
+ connect(_tab, SIGNAL(titleChanged(QString)), this, SIGNAL(titleChanged(QString)));
+ connect(_tab, SIGNAL(iconChanged()), this, SIGNAL(iconChanged()));
// check view signals
- connect(_tab->view(), SIGNAL(loadStarted()), this, SLOT(webLoadStarted()));
- connect(_tab->view(), SIGNAL(loadFinished(bool)), this, SLOT(webLoadFinished(bool)));
- connect(_tab->view(), SIGNAL(loadProgress(int)), this, SLOT(webLoadProgress(int)));
+ connect(_tab, SIGNAL(loadStarted()), this, SLOT(webLoadStarted()));
+ connect(_tab, SIGNAL(loadFinished(bool)), this, SLOT(webLoadFinished(bool)));
+ connect(_tab, SIGNAL(loadProgress(int)), this, SLOT(webLoadProgress(int)));
connect(_bar, SIGNAL(focusIn()), this, SLOT(urlbarFocused()));
@@ -668,7 +668,7 @@ KUrl WebWindow::url() const
QString WebWindow::title() const
{
- QString t = _tab->view()->title();
+ QString t = _tab->title();
if (t.isEmpty())
{
if (url().isLocalFile())
@@ -687,7 +687,7 @@ UrlBar *WebWindow::urlBar()
}
-WebTab *WebWindow::view()
+WebTab *WebWindow::tabView()
{
return _tab;
}
diff --git a/src/webwindow/webwindow.h b/src/webwindow/webwindow.h
index de927305..032da94f 100644
--- a/src/webwindow/webwindow.h
+++ b/src/webwindow/webwindow.h
@@ -73,7 +73,7 @@ public:
QString title() const;
UrlBar *urlBar();
- WebTab *view();
+ WebTab *tabView();
QPixmap tabPreview(int width, int height);