11 from PyQt4.QtGui import QPixmap |
11 from PyQt4.QtGui import QPixmap |
12 from PyQt4.QtNetwork import QNetworkReply, QNetworkRequest |
12 from PyQt4.QtNetwork import QNetworkReply, QNetworkRequest |
13 from PyQt4.QtWebKit import QWebSettings |
13 from PyQt4.QtWebKit import QWebSettings |
14 |
14 |
15 import UI.PixmapCache |
15 import UI.PixmapCache |
|
16 |
|
17 import Utilities |
16 |
18 |
17 |
19 |
18 dirListPage_html = """\ |
20 dirListPage_html = """\ |
19 <?xml version="1.0" encoding="UTF-8" ?> |
21 <?xml version="1.0" encoding="UTF-8" ?> |
20 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
22 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
253 self.__cssLinkClass(icon, iconSize).format(linkClass) |
255 self.__cssLinkClass(icon, iconSize).format(linkClass) |
254 table += row.format( |
256 table += row.format( |
255 i == 0 and "odd" or "even", |
257 i == 0 and "odd" or "even", |
256 linkClass, |
258 linkClass, |
257 child.toString(), |
259 child.toString(), |
258 Qt.escape(item.fileName()), |
260 Utilities.html_encode(item.fileName()), |
259 sizeStr, |
261 sizeStr, |
260 item.lastModified().toString("yyyy-MM-dd hh:mm"), |
262 item.lastModified().toString("yyyy-MM-dd hh:mm"), |
261 ) |
263 ) |
262 i = 1 - i |
264 i = 1 - i |
263 |
265 |
264 content = dirListPage_html.format( |
266 content = dirListPage_html.format( |
265 Qt.escape(baseUrl), |
267 Utilities.html_encode(baseUrl), |
266 "".join(linkClasses.values()), |
268 "".join(linkClasses.values()), |
267 self.trUtf8("Listing of {0}").format(basePath), |
269 self.trUtf8("Listing of {0}").format(basePath), |
268 parentStr, |
270 parentStr, |
269 table |
271 table |
270 ) |
272 ) |