From fe3c587f98f1212ba0f639a4954e681743185bce Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 6 Oct 2009 12:30:50 +0200 Subject: HomePage style fixes. I'm quite sure this is going to be home page style for rekonq 0.3 --- src/homepage.cpp | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/homepage.cpp b/src/homepage.cpp index 723e670c..a9c51c9a 100644 --- a/src/homepage.cpp +++ b/src/homepage.cpp @@ -74,18 +74,31 @@ QString HomePage::rekonqHomePage(const KUrl &url) QString imagesPath = QString("file://") + KGlobal::dirs()->findResourceDir("data", "rekonq/pics/bg.png") + QString("rekonq/pics"); QString menu = homePageMenu(); - QString speed; + QString title, speed; if(url == KUrl("rekonq:lastSites")) + { + title = "

" + i18n("Last Visited Sites") + "

"; speed = lastVisitedSites(); + } if(url == KUrl("rekonq:history")) + { + title = "

" + i18n("History") + "

"; speed = fillHistory(); + } if(url == KUrl("rekonq:bookmarks")) + { + title = "

" + i18n("Bookmarks") + "

"; speed = fillBookmarks(); + } if(url == KUrl("rekonq:home") || url == KUrl("rekonq:favorites")) + { + title = "

" + i18n("Favorites") + "

"; speed = fillFavorites(); + } QString html = QString(QLatin1String(file.readAll())) .arg(imagesPath) + .arg(title) .arg(menu) .arg(speed) ; @@ -99,7 +112,7 @@ QString HomePage::fillFavorites() QStringList names = ReKonfig::previewNames(); QStringList urls = ReKonfig::previewUrls(); - QString speed = "

Favorites

"; + QString speed; for(int i=0; i<8; ++i) { QString text = names.at(i); @@ -124,7 +137,7 @@ QString HomePage::lastVisitedSites() { HistoryTreeModel *model = Application::historyManager()->historyTreeModel(); - QString last = "

Last Visited Sites

"; + QString last; int sites = 0; int i = 0; do @@ -162,11 +175,13 @@ QString HomePage::lastVisitedSites() QString HomePage::homePageMenu() { - QString menu = ""; - menu += "
Last Visited Sites
"; - menu += "
History
"; - menu += "
Bookmarks
"; - menu += "
Favorites
"; + QString menu = "
"; + menu += "

rekonq

"; + menu += "Last Visited Sites
"; + menu += "History
"; + menu += "Bookmarks
Favorites
"; + menu += "
"; return menu; } @@ -175,7 +190,7 @@ QString HomePage::fillHistory() { HistoryTreeModel *model = Application::historyManager()->historyTreeModel(); - QString history = "

History

"; + QString history; int i = 0; do { @@ -210,7 +225,7 @@ QString HomePage::fillBookmarks() return QString("Error retrieving bookmarks!"); } - QString str = "

Bookmarks

"; + QString str; KBookmark bookmark = bookGroup.first(); while (!bookmark.isNull()) { -- cgit v1.2.1