Commits

Yuya Nishihara committed 0998cde

filedialogs: set window title and icon by itself

Comments (0)

Files changed (3)

tortoisehg/hgqt/filectxactions.py

         if self.parent() and isinstance(self.parent().window(),
                                         workbench.Workbench):
             repoviewer = self.parent().window()
-        dlg = dlgclass(repo, filename, repoviewer=repoviewer)
-        ufname = hglib.tounicode(filename)
-        dlg.setWindowTitle(_('Hg file log viewer - %s') % ufname)
-        dlg.setWindowIcon(qtlib.geticon('hg-log'))
-        return dlg
+        return dlgclass(repo, filename, repoviewer=repoviewer)
 
     def _gennavdialogkey(self, dlgclass, repo, filename):
         return dlgclass, repo.wjoin(filename)

tortoisehg/hgqt/filedialogs.py

         assert not isinstance(filename, (unicode, QString))
         self.filename = filename
 
+        self.setWindowTitle(_('Hg file log viewer [%s] - %s')
+                            % (repo.displayname, hglib.tounicode(filename)))
+        self.setWindowIcon(qtlib.geticon('hg-log'))
+
         self.createActions()
         self.setupToolbars()
 

tortoisehg/hgqt/workbench.py

         if len(pats) == 1 and os.path.isfile(repo.wjoin(pats[0])):
             from tortoisehg.hgqt.filedialogs import FileLogDialog
             fname = pats[0]
-            ufname = hglib.tounicode(fname)
-            dlg = FileLogDialog(repo, fname, None)
-            dlg.setWindowTitle(_('Hg file log viewer [%s] - %s') % (
-                repo.displayname, ufname))
-            return dlg
+            return FileLogDialog(repo, fname)
 
     # Before starting the workbench, we must check if we must try to reuse an
     # existing workbench window (we don't by default)