diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/data/home.html | 14 | ||||
-rw-r--r-- | src/newtabpage.cpp | 40 |
2 files changed, 38 insertions, 16 deletions
diff --git a/src/data/home.html b/src/data/home.html index 50564d55..96c0bd06 100644 --- a/src/data/home.html +++ b/src/data/home.html @@ -143,6 +143,18 @@ margin-bottom: 0.5em; } /* -------------------------------------------------------- */ +/* Downloads page */ + +.download{ +margin: 1.5em 0; +} + +.download img{ +float: left; +margin-right: 5px; +} + +/* -------------------------------------------------------- */ </style> </head> @@ -155,6 +167,7 @@ margin-bottom: 0.5em; </div> <div id="models" style="display:none"> + <div></div> <div class="link"> <a href=""> <img src="" /> @@ -177,6 +190,7 @@ margin-bottom: 0.5em; <h3></h3> <a></a> <br /> + <img /> <p class="bookfolder"></p> </div> 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");*/ } } |