summaryrefslogtreecommitdiff
path: root/src/webtab/webtab.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-10-20 12:01:27 +0200
committerAndrea Diamantini <adjam7@gmail.com>2012-12-10 02:48:05 +0100
commitb204e6254bd0c2227bbbb81519a0ddcf174d2ad4 (patch)
tree0badb3885331b2d700388e96ac59532d6b7dd867 /src/webtab/webtab.cpp
parentEnable incognito mode by calling "rekonq --incognito URL" :) (diff)
downloadrekonq-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/webtab.cpp')
-rw-r--r--src/webtab/webtab.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/webtab/webtab.cpp b/src/webtab/webtab.cpp
index 036f62c0..bb616770 100644
--- a/src/webtab/webtab.cpp
+++ b/src/webtab/webtab.cpp
@@ -34,6 +34,7 @@
// Local Includes
#include "historymanager.h"
+#include "iconmanager.h"
#include "sessionmanager.h"
#include "syncmanager.h"
@@ -92,9 +93,18 @@ WebTab::WebTab(QWidget *parent)
connect(view(), SIGNAL(loadProgress(int)), this, SLOT(updateProgress(int)));
connect(view(), SIGNAL(loadStarted()), this, SLOT(resetProgress()));
- connect(view(), SIGNAL(titleChanged(QString)), this, SIGNAL(titleChanged(QString)));
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()));
}
@@ -394,3 +404,19 @@ void WebTab::zoomDefault()
emit infoToShow(i18n("Default zoom: ") + QString::number(m_zoomFactor * 10) + QL1S("%"));
}
+
+
+void WebTab::webAppTitleChanged(QString title)
+{
+
+ if (title.isEmpty())
+ setWindowTitle(i18n("rekonq"));
+ else
+ setWindowTitle(title);
+}
+
+
+void WebTab::webAppIconChanged()
+{
+ setWindowIcon(IconManager::self()->iconForUrl(url()));
+}