Implement bug 2654: Show source file type in ebook-viewer with metadata.

This commit is contained in:
John Schember 2009-06-18 07:25:16 -04:00
parent 353e12842d
commit eb95f16c46

View File

@ -138,9 +138,9 @@ class Metadata(QLabel):
self.setWordWrap(True)
self.setVisible(False)
def show_opf(self, opf):
def show_opf(self, opf, ext=''):
mi = MetaInformation(opf)
html = '<h2 align="center">%s</h2>%s'%(_('Metadata'), u''.join(mi.to_html()))
html = '<h2 align="center">%s</h2>%s\n<b>Source Type</b> %s'%(_('Metadata'), u''.join(mi.to_html()), ext)
self.setText(html)
def setVisible(self, x):
@ -550,7 +550,7 @@ class EbookViewer(MainWindow, Ui_EbookViewer):
unicode(r), det_msg=worker.traceback, show=True)
self.close_progress_indicator()
else:
self.metadata.show_opf(self.iterator.opf)
self.metadata.show_opf(self.iterator.opf, os.path.splitext(pathtoebook)[1][1:])
title = self.iterator.opf.title
if not title:
title = os.path.splitext(os.path.basename(pathtoebook))[0]