summaryrefslogtreecommitdiff
path: root/src/homepage.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-10-06 12:30:50 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-10-06 12:30:50 +0200
commitfe3c587f98f1212ba0f639a4954e681743185bce (patch)
tree27eadc8b91e065a470481e8b07f75827966a3f0e /src/homepage.cpp
parentCleaning headers and so on... (diff)
downloadrekonq-fe3c587f98f1212ba0f639a4954e681743185bce.tar.xz
HomePage style fixes.
I'm quite sure this is going to be home page style for rekonq 0.3
Diffstat (limited to 'src/homepage.cpp')
-rw-r--r--src/homepage.cpp35
1 files changed, 25 insertions, 10 deletions
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 = "<h2>" + i18n("Last Visited Sites") + "</h2>";
speed = lastVisitedSites();
+ }
if(url == KUrl("rekonq:history"))
+ {
+ title = "<h2>" + i18n("History") + "</h2>";
speed = fillHistory();
+ }
if(url == KUrl("rekonq:bookmarks"))
+ {
+ title = "<h2>" + i18n("Bookmarks") + "</h2>";
speed = fillBookmarks();
+ }
if(url == KUrl("rekonq:home") || url == KUrl("rekonq:favorites"))
+ {
+ title = "<h2>" + i18n("Favorites") + "</h2>";
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 = "<h2>Favorites</h2>";
+ 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 = "<h2>Last Visited Sites</h2>";
+ QString last;
int sites = 0;
int i = 0;
do
@@ -162,11 +175,13 @@ QString HomePage::lastVisitedSites()
QString HomePage::homePageMenu()
{
- QString menu = "";
- menu += "<div class=\"link\"><a href=\"rekonq:lastSites\">Last Visited Sites</a></div>";
- menu += "<div class=\"link\"><a href=\"rekonq:history\">History</a></div>";
- menu += "<div class=\"link\"><a href=\"rekonq:bookmarks\">Bookmarks</a></div>";
- menu += "<div class=\"link\"><a href=\"rekonq:favorites\">Favorites</a></div>";
+ QString menu = "<div class=\"link\">";
+ menu += "<h1>rekonq</h1>";
+ menu += "<a href=\"rekonq:lastSites\">Last Visited Sites</a><br />";
+ menu += "<a href=\"rekonq:history\">History</a><br />";
+ menu += "<a href=\"rekonq:bookmarks\">Bookmarks</a><br /";
+ menu += "<a href=\"rekonq:favorites\">Favorites</a><br />";
+ menu += "</div>";
return menu;
}
@@ -175,7 +190,7 @@ QString HomePage::fillHistory()
{
HistoryTreeModel *model = Application::historyManager()->historyTreeModel();
- QString history = "<h2>History</h2>";
+ QString history;
int i = 0;
do
{
@@ -210,7 +225,7 @@ QString HomePage::fillBookmarks()
return QString("Error retrieving bookmarks!");
}
- QString str = "<h2>Bookmarks</h2>";
+ QString str;
KBookmark bookmark = bookGroup.first();
while (!bookmark.isNull())
{