summaryrefslogtreecommitdiff
path: root/src/tabwindow
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-07-25 17:30:12 +0200
committerAndrea Diamantini <adjam7@gmail.com>2012-12-10 02:48:04 +0100
commit8f52ab1cea858345f2f68c3905db3ae1223d3734 (patch)
tree3348d12d696e9093647235ba1365a5ab2bc1d48b /src/tabwindow
parentRe-add WebSnap class & included API in WebWindow for tab preview (diff)
downloadrekonq-8f52ab1cea858345f2f68c3905db3ae1223d3734.tar.xz
Set window icon & title
Diffstat (limited to 'src/tabwindow')
-rw-r--r--src/tabwindow/tabwindow.cpp33
-rw-r--r--src/tabwindow/tabwindow.h1
2 files changed, 19 insertions, 15 deletions
diff --git a/src/tabwindow/tabwindow.cpp b/src/tabwindow/tabwindow.cpp
index a211f63e..9e2a17ce 100644
--- a/src/tabwindow/tabwindow.cpp
+++ b/src/tabwindow/tabwindow.cpp
@@ -139,7 +139,6 @@ WebWindow *TabWindow::prepareNewTab(WebPage *page)
connect(tab, SIGNAL(titleChanged(QString)), this, SLOT(tabTitleChanged(QString)));
connect(tab, SIGNAL(loadStarted()), this, SLOT(tabLoadStarted()));
- connect(tab, SIGNAL(loadProgress(int)), this, SLOT(tabLoadProgress(int)));
connect(tab, SIGNAL(loadFinished(bool)), this, SLOT(tabLoadFinished(bool)));
connect(tab, SIGNAL(pageCreated(WebPage *)), this, SLOT(pageCreated(WebPage *)));
@@ -192,6 +191,14 @@ void TabWindow::currentChanged(int newIndex)
_openedTabsCounter = 0;
tabBar()->setTabHighlighted(newIndex, false);
+
+ // update window title & icon
+ WebWindow* tab = webWindow(newIndex);
+ if (!tab)
+ return;
+
+ setWindowTitle(tab->title() + QLatin1String(" - rekonq"));
+ setWindowIcon(tab->icon());
}
@@ -251,8 +258,12 @@ void TabWindow::tabTitleChanged(const QString &title)
if (tabTitle != i18n("(Untitled)"))
tabBar()->setTabHighlighted(index, true);
}
+ else
+ {
+ setWindowTitle(title + QLatin1String(" - rekonq"));
+ }
- // TODO: What about window title?
+ // TODO: What about window title? Is this enough?
}
@@ -286,18 +297,6 @@ void TabWindow::tabLoadStarted()
}
-void TabWindow::tabLoadProgress(int p)
-{
- // FIXME: is this needed?
- WebWindow *tab = qobject_cast<WebWindow *>(sender());
- if (!tab)
- return;
-
- int index = indexOf(tab);
- kDebug() << "LOADING TAB: " << index << ", PROGRESS: " << p;
-}
-
-
void TabWindow::tabLoadFinished(bool ok)
{
Q_UNUSED(ok);
@@ -319,6 +318,12 @@ void TabWindow::tabLoadFinished(bool ok)
label->setMovie(0);
label->setPixmap(tab->icon().pixmap(16, 16));
}
+
+ if (currentIndex() == index)
+ {
+ setWindowIcon(tab->icon());
+ }
+
}
diff --git a/src/tabwindow/tabwindow.h b/src/tabwindow/tabwindow.h
index 65746fe7..f8cb759f 100644
--- a/src/tabwindow/tabwindow.h
+++ b/src/tabwindow/tabwindow.h
@@ -70,7 +70,6 @@ private Q_SLOTS:
void tabTitleChanged(const QString &);
void tabLoadStarted();
- void tabLoadProgress(int);
void tabLoadFinished(bool);
void pageCreated(WebPage *);