summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormatgic78 <matgic78@gmail.com>2010-04-05 11:26:02 +0200
committermatgic78 <matgic78@gmail.com>2010-04-05 11:26:02 +0200
commit7f5321462a87329b0429b1c34274bef40eef510b (patch)
treeb89f09300073e160b360bcc32fac12b22305b49d /src
parentThis commit is the first implementation of a new new new urlbar (diff)
downloadrekonq-7f5321462a87329b0429b1c34274bef40eef510b.tar.xz
NewTabPage : add buttons in #actions : "Clear Private Data" for history and bookmarks, "Edit Downloads"
Diffstat (limited to 'src')
-rw-r--r--src/data/home.html4
-rw-r--r--src/newtabpage.cpp32
2 files changed, 34 insertions, 2 deletions
diff --git a/src/data/home.html b/src/data/home.html
index 4afbf2ed..97bec22d 100644
--- a/src/data/home.html
+++ b/src/data/home.html
@@ -62,12 +62,12 @@ border-width: 5px;
#navigation {
-webkit-border-image: url(%2/bg2.png) 12 12 12 12 stretch stretch;
-max-width: 75%;
+max-width: 55%;
}
#actions, #balance {
margin-top: 12px;
-width: 10%;
+width: 20%;
}
#actions {
diff --git a/src/newtabpage.cpp b/src/newtabpage.cpp
index 3e21d0fe..e2837f94 100644
--- a/src/newtabpage.cpp
+++ b/src/newtabpage.cpp
@@ -115,6 +115,17 @@ void NewTabPage::generate(const KUrl &url)
return;
}
}
+ if(url.fileName() == QString("clear"))
+ {
+ Application::instance()->mainWindow()->actionByName("clear_private_data")->trigger();
+ generate(QString("about:" + url.directory()));
+ return;
+ }
+ if(url == KUrl("about:bookmarks/edit"))
+ {
+ Application::bookmarkProvider()->bookmarkManager()->slotEditBookmarks();
+ return;
+ }
QWebPage *page = m_root.webFrame()->page();
page->mainFrame()->setHtml(m_html);
@@ -369,6 +380,13 @@ void NewTabPage::historyPage()
{
m_root.addClass("history");
+ QWebElement clearData = markup(".link");
+ clearData.findFirst("a").setAttribute("href", "about:history/clear");
+ QString iconPath = QString("file:///" + KIconLoader::global()->iconPath("edit-clear", KIconLoader::SizeSmall || KIconLoader::Small));
+ clearData.findFirst("img").setAttribute("src" , iconPath );
+ clearData.findFirst("span").appendInside(i18n("Clear Private Data"));
+ m_root.document().findFirst("#actions").appendInside(clearData);
+
HistoryTreeModel *model = Application::historyManager()->historyTreeModel();
int i = 0;
@@ -401,6 +419,13 @@ void NewTabPage::bookmarksPage()
{
m_root.addClass("bookmarks");
+ QWebElement editBookmarks = markup(".link");
+ editBookmarks.findFirst("a").setAttribute("href", "about:bookmarks/edit");
+ QString iconPath = QString("file:///" + KIconLoader::global()->iconPath("bookmarks-organize", KIconLoader::SizeSmall || KIconLoader::Small));
+ editBookmarks.findFirst("img").setAttribute("src" , iconPath);
+ editBookmarks.findFirst("span").appendInside(i18n("Edit Bookmarks"));
+ m_root.document().findFirst("#actions").appendInside(editBookmarks);
+
KBookmarkGroup bookGroup = Application::bookmarkProvider()->rootGroup();
if (bookGroup.isNull())
{
@@ -485,6 +510,13 @@ QString NewTabPage::checkTitle(const QString &title)
void NewTabPage::downloadsPage()
{
m_root.addClass("downloads");
+
+ QWebElement clearData = markup(".link");
+ clearData.findFirst("a").setAttribute("href", "about:downloads/clear");
+ QString iconPath = QString("file:///" + KIconLoader::global()->iconPath("edit-clear", KIconLoader::SizeSmall || KIconLoader::Small));
+ clearData.findFirst("img").setAttribute("src" , iconPath );
+ clearData.findFirst("span").appendInside(i18n("Clear Private Data"));
+ m_root.document().findFirst("#actions").appendInside(clearData);
DownloadList list = Application::historyManager()->downloads();