summaryrefslogtreecommitdiff
path: root/src/newtabpage.cpp
diff options
context:
space:
mode:
authormatgic78 <matgic78@gmail.com>2010-04-19 12:29:55 +0200
committermatgic78 <matgic78@gmail.com>2010-04-19 12:29:55 +0200
commit01ba6c12f56b3ce87be9cc654d2e5336d7697fe0 (patch)
tree866ab39559fcf1b8875326972cb794a4ab26b4ba /src/newtabpage.cpp
parentMerge commit 'refs/merge-requests/2244' of git://gitorious.org/rekonq/mainline (diff)
downloadrekonq-01ba6c12f56b3ce87be9cc654d2e5336d7697fe0.tar.xz
Add some text when a newtabpage is empty for users to know that this isn't a bug
Diffstat (limited to 'src/newtabpage.cpp')
-rw-r--r--src/newtabpage.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/newtabpage.cpp b/src/newtabpage.cpp
index d7671937..b709375a 100644
--- a/src/newtabpage.cpp
+++ b/src/newtabpage.cpp
@@ -180,6 +180,13 @@ void NewTabPage::favoritesPage()
QStringList names = ReKonfig::previewNames();
QStringList urls = ReKonfig::previewUrls();
+ if(urls.isEmpty())
+ {
+ m_root.addClass("empty");
+ m_root.setPlainText(i18n("You can add a preview by clicking the \"Add Preview\" button in the top-right corner of this page"));
+ return;
+ }
+
for(int i=0; i < urls.count() ; ++i)
{
KUrl url = urls.at(i);
@@ -396,6 +403,13 @@ void NewTabPage::historyPage()
HistoryTreeModel *model = Application::historyManager()->historyTreeModel();
+ if(model->rowCount() == 0)
+ {
+ m_root.addClass("empty");
+ m_root.setPlainText(i18n("Your browsing history is empty"));
+ return;
+ }
+
int i = 0;
do
{
@@ -436,6 +450,8 @@ void NewTabPage::bookmarksPage()
KBookmarkGroup bookGroup = Application::bookmarkProvider()->rootGroup();
if (bookGroup.isNull())
{
+ m_root.addClass("empty");
+ m_root.setPlainText(i18n("You have no bookmarks"));
return;
}
@@ -483,6 +499,13 @@ void NewTabPage::closedTabsPage()
QList<HistoryItem> links = Application::instance()->mainWindow()->mainView()->recentlyClosedTabs();
+ if(links.isEmpty())
+ {
+ m_root.addClass("empty");
+ m_root.setPlainText(i18n("There are no recently closed tabs"));
+ return;
+ }
+
for(int i=0; i < links.count(); ++i)
{
HistoryItem item = links.at(i);
@@ -527,6 +550,13 @@ void NewTabPage::downloadsPage()
DownloadList list = Application::historyManager()->downloads();
+ if(list.isEmpty())
+ {
+ m_root.addClass("empty");
+ m_root.setPlainText(i18n("There are no recently downloaded files to show"));
+ return;
+ }
+
foreach(const DownloadItem &item, list)
{
m_root.prependInside(markup("div"));