Commits

Yuya Nishihara committed 4c7aace

sync: update URL when current selection changed by keyboard or programmatically

Comments (0)

Files changed (1)

tortoisehg/hgqt/sync.py

         self.urlentry.textChanged.connect(self.urlChanged)
         tbar.addWidget(self.urlentry)
 
+        # even though currentRowChanged fires pathSelected, clicked signal is
+        # also connected to it. otherwise urlentry won't be updated when the
+        # selection moves between hgrctv and reltv.
+
         hbox = QHBoxLayout()
         hbox.setContentsMargins(0, 0, 0, 0)
         self.hgrctv = PathsTree(self, True)
                 self.paths[ alias ] = cfg['paths'][ alias ]
         tm = PathsModel(self.paths.items(), self)
         self.hgrctv.setModel(tm)
+        sm = self.hgrctv.selectionModel()
+        sm.currentRowChanged.connect(self.pathSelected)
 
         # Refresh post-pull
         self.cachedpp = self.repo.postpull
         pairs = [(alias, path) for path, alias in related.items()]
         tm = PathsModel(pairs, self)
         self.reltv.setModel(tm)
+        sm = self.reltv.selectionModel()
+        sm.currentRowChanged.connect(self.pathSelected)
 
     def currentUrl(self):
         return unicode(self.urlentry.text())