E-book viewer: When opening consecutive documents in the same viewer, show the correct title in the titlebar

This commit is contained in:
Kovid Goyal 2010-08-13 10:36:01 -06:00
parent a558775b2e
commit fee01926b2

View File

@ -166,6 +166,7 @@ class EbookViewer(MainWindow, Ui_EbookViewer):
def __init__(self, pathtoebook=None, debug_javascript=False): def __init__(self, pathtoebook=None, debug_javascript=False):
MainWindow.__init__(self, None) MainWindow.__init__(self, None)
self.setupUi(self) self.setupUi(self)
self.base_window_title = unicode(self.windowTitle())
self.iterator = None self.iterator = None
self.current_page = None self.current_page = None
self.pending_search = None self.pending_search = None
@ -602,7 +603,7 @@ class EbookViewer(MainWindow, Ui_EbookViewer):
self.toc_model = TOC(self.iterator.toc) self.toc_model = TOC(self.iterator.toc)
self.toc.setModel(self.toc_model) self.toc.setModel(self.toc_model)
self.current_title = title self.current_title = title
self.setWindowTitle(unicode(self.windowTitle())+' - '+title) self.setWindowTitle(self.base_window_title+' - '+title)
self.pos.setMaximum(sum(self.iterator.pages)) self.pos.setMaximum(sum(self.iterator.pages))
self.pos.setSuffix(' / %d'%sum(self.iterator.pages)) self.pos.setSuffix(' / %d'%sum(self.iterator.pages))
self.vertical_scrollbar.setMinimum(100) self.vertical_scrollbar.setMinimum(100)