mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Implement #2654 (RFE: Ebook Viewer Should Display Format)
This commit is contained in:
commit
d395d6bf67
@ -138,9 +138,11 @@ class Metadata(QLabel):
|
|||||||
self.setWordWrap(True)
|
self.setWordWrap(True)
|
||||||
self.setVisible(False)
|
self.setVisible(False)
|
||||||
|
|
||||||
def show_opf(self, opf):
|
def show_opf(self, opf, ext=''):
|
||||||
mi = MetaInformation(opf)
|
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>%s:</b> %s'\
|
||||||
|
%(_('Metadata'), u''.join(mi.to_html()),
|
||||||
|
_('Book format'), ext.upper())
|
||||||
self.setText(html)
|
self.setText(html)
|
||||||
|
|
||||||
def setVisible(self, x):
|
def setVisible(self, x):
|
||||||
@ -550,7 +552,7 @@ class EbookViewer(MainWindow, Ui_EbookViewer):
|
|||||||
unicode(r), det_msg=worker.traceback, show=True)
|
unicode(r), det_msg=worker.traceback, show=True)
|
||||||
self.close_progress_indicator()
|
self.close_progress_indicator()
|
||||||
else:
|
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
|
title = self.iterator.opf.title
|
||||||
if not title:
|
if not title:
|
||||||
title = os.path.splitext(os.path.basename(pathtoebook))[0]
|
title = os.path.splitext(os.path.basename(pathtoebook))[0]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user