Commits

Yuya Nishihara committed 69ba30e

workbench: rebuild URL combo by refresh action

This provides the last option to keep the url combo sync with the sync widget.

Tested compatibility with PyQt 4.6.2 (CentOS 6).

  • Participants
  • Parent commits dc35732

Comments (0)

Files changed (1)

tortoisehg/hgqt/workbench.py

 
         newseparator(menu='view')
 
-        newaction(_("&Refresh"), self._repofwd('reload'), icon='view-refresh',
+        newaction(_("&Refresh"), self.refresh, icon='view-refresh',
                   shortcut='Refresh', enabled='repoopen',
                   menu='view', toolbar='edit',
                   tooltip=_('Refresh current repository'))
 
         return forwarder
 
+    # no @pyqtSlot(); as of PyQt 4.9.3, it makes self.sender() wrong through
+    # the following path: reload -> titleChanged -> _updateRepoTabTitle,
+    # if _updateRepoTabTitle is not decorated as @pyqtSlot.
+    def refresh(self):
+        w = self.repoTabsWidget.currentWidget()
+        if w:
+            getattr(w, 'reload')()
+            self._setupUrlCombo(w.repo)
+
     @pyqtSlot(QAction)
     def _runSyncAction(self, action):
         w = self.repoTabsWidget.currentWidget()