Commits

Yuya Nishihara committed f59bf9c

workbench: rebuild urlCombo if config of current tab is changed

It shouldn't bother RepoWidget, but currently there's no good way to manage
connections between thgrepo and workbench. So it reuses the design of
repoChanged signal for now.

  • Participants
  • Parent commits 082df2c
  • Branches stable

Comments (0)

Files changed (2)

tortoisehg/hgqt/repowidget.py

     beginSuppressPrompt = pyqtSignal()
     endSuppressPrompt = pyqtSignal()
 
+    # The following signals should be exchanged directly between workbench and
+    # thgrepo. But it isn't possible because workbench cannot filter out known
+    # repo from the result of thgrepo.repository().
     repoChanged = pyqtSignal(QString)
+    repoConfigChanged = pyqtSignal(QString)
 
     revisionSelected = pyqtSignal(object)
 
             self.shortNameChanged.emit(hglib.tounicode(self.repo.root),
                                        self.shortname)
 
+        self.repoConfigChanged.emit(hglib.tounicode(self.repo.root))
+
     def updateTaskTabs(self):
         val = self.repo.ui.config('tortoisehg', 'tasktabs', 'off').lower()
         if val == 'east':

tortoisehg/hgqt/workbench.py

             else:
                 self.urlCombo.addItem(a, (a, a))
 
+    #@pyqtSlot()
+    def _setupUrlComboIfCurrent(self):
+        w = self.repoTabsWidget.currentWidget()
+        if self.sender() is w:
+            self._setupUrlCombo(w.repo)
+
     def _syncUrlFor(self, op):
         """Current URL alias for the given sync operation"""
         urlindex = self.urlCombo.currentIndex()
         tw.setTabToolTip(index, hglib.tounicode(repo.root))
         tw.setCurrentIndex(index)
         rw.titleChanged.connect(self._updateRepoTabTitle)
+        rw.repoConfigChanged.connect(self._setupUrlComboIfCurrent)
         rw.showIcon.connect(
             lambda icon: tw.setTabIcon(tw.indexOf(rw), icon))
         self.reporegistry.addRepo(hglib.tounicode(repo.root))