summaryrefslogtreecommitdiff
path: root/src/newtabpage.cpp
diff options
context:
space:
mode:
authormatgic78 <matgic78@gmail.com>2010-03-27 15:25:38 +0100
committermatgic78 <matgic78@gmail.com>2010-03-29 16:20:46 +0200
commitd9796c992638d4c4d740415e29a0766a92d2e101 (patch)
tree01d553cd63f6037a14d1bb6b98b8473ffd2b66ce /src/newtabpage.cpp
parentrekonq 0.4.57 (diff)
downloadrekonq-d9796c992638d4c4d740415e29a0766a92d2e101.tar.xz
Improve Downloads page appearance :
the downloads info are shown on 3 lines with the icon of the file
Diffstat (limited to 'src/newtabpage.cpp')
-rw-r--r--src/newtabpage.cpp40
1 files changed, 24 insertions, 16 deletions
diff --git a/src/newtabpage.cpp b/src/newtabpage.cpp
index 36ddafed..c61eb60d 100644
--- a/src/newtabpage.cpp
+++ b/src/newtabpage.cpp
@@ -467,29 +467,37 @@ void NewTabPage::downloadsPage()
foreach(const DownloadItem &item, list)
{
- m_root.appendInside(markup("h3"));
- m_root.lastChild().setPlainText("");
+ m_root.prependInside(markup("div"));
+
+ QWebElement div = m_root.firstChild();
+ div.addClass("download");
KUrl u = KUrl(item.destUrlString);
QString fName = u.fileName();
QString dir = QL1S("file://") + u.directory();
- m_root.appendInside( item.dateTime.toString("dddd") );
- m_root.appendInside("<br/>");
- m_root.appendInside( item.dateTime.toString("dd MMMM yyyy") );
- m_root.appendInside(", ");
- m_root.appendInside( item.dateTime.toString("hh:mm:ss") );
- m_root.appendInside("<br/>");
+ KIconLoader *loader = KIconLoader::global();
+ QString iconPath = "file://" + loader->iconPath(KMimeType::iconNameForUrl(u), KIconLoader::Desktop);
+
+ div.appendInside(markup("img"));
+ div.lastChild().setAttribute("src", iconPath );
- m_root.appendInside(fName);
- m_root.appendInside("<br/>");
+ div.appendInside("<strong>" + fName + "</strong>");
+ div.appendInside(" - ");
+ div.appendInside( item.dateTime.toString("'<em>'dd MMMM yyyy hh:mm'</em>'") );
+ div.appendInside("<br/>");
- m_root.appendInside(item.srcUrlString);
- m_root.appendInside("<br/>");
+ div.appendInside(item.srcUrlString);
+ div.appendInside("<br/>");
- m_root.appendInside(markup("a"));
- m_root.lastChild().setAttribute("href" , dir);
- m_root.lastChild().setPlainText("browse dir");
- m_root.appendInside("<br/>");
+ div.appendInside(markup("a"));
+ div.lastChild().setAttribute("href" , dir);
+ div.lastChild().setPlainText("Browse dir");
+
+ /* TODO : make this link work
+ div.appendInside(" - ");
+ div.appendInside(markup("a"));
+ div.lastChild().setAttribute("href" , u.toMimeDataString());
+ div.lastChild().setPlainText("Open file");*/
}
}