Commits

Steve Borho committed d2fe94c

hggtk: use configured repository name in window titles

Comments (0)

Files changed (3)

             self.defport = '8000'
 
         # set dialog title
-        title = "hg serve"
-        title += " - %s" % (os.getcwd())
-        self.set_title(title)
+        name = self.repo.ui.config('web', 'name') or os.path.basename(root)
+        self.set_title("hg serve - " + name)
         self.queue = Queue.Queue()
         
         self.set_default_size(500, 300)
 class SynchDialog(gtk.Dialog):
     def __init__(self, cwd='', root = '', repos=[]):
         """ Initialize the Dialog. """
-        rootbase = os.path.basename(cwd)
-        gtk.Dialog.__init__(self, title="TortoiseHg Synchronize - %s" % rootbase,
-                                  parent=None,
+        gtk.Dialog.__init__(self, parent=None,
                                   flags=0,
                                   buttons=())
 
 
         self.set_default_size(600, 400)
 
+        self.paths = self._get_paths()
+        name = self.repo.ui.config('web', 'name') or os.path.basename(root)
+        self.set_title("TortoiseHg Synchronize - " + name)
+
         #self.connect('delete-event', lambda x, y: True)
         self.connect('delete-event', self._delete)
         self.connect('response', self._response)
         self._pathbox = gtk.ComboBoxEntry(self.revlist, 0)
         self._pathtext = self._pathbox.get_child()
         
-        self.paths = self._get_paths()
         defrow = None
         defpushrow = None
         for row, (name, path) in enumerate(self.paths):
     def _get_paths(self):
         """ retrieve repo revisions """
         try:
-            repo = hg.repository(ui.ui(), path=self.root)
-            return repo.ui.configitems('paths')
+            self.repo = hg.repository(ui.ui(), path=self.root)
+            return self.repo.ui.configitems('paths')
         except hg.RepoError:
             return None
 

hggtk/thgconfig.py

 
         if configrepo:
             self.ui = repo.ui
+            name = repo.ui.config('web', 'name') or os.path.basename(repo.root)
             self.rcpath = [os.sep.join([repo.root, '.hg', 'hgrc'])]
-            self.set_title('TortoiseHg Configure Repository - ' + repo.root)
+            self.set_title('TortoiseHg Configure Repository - ' + name)
         else:
             self.rcpath = util.user_rcpath()
             self.set_title('TortoiseHg Configure User-Global Settings')