Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0, 2.0.1, and 2.0.2

stable sync: set status tips for incoming/pull/outgoing/push actions

If the user hovers the mouse over the respective buttons, a string in
the status bar is shown, describing what happens and which url will
be used. Example text:

Preview incoming changesets from https://abuehl:***@hg01.codeplex.com/tortoisehg

TODO: Do the same for the respective actions in the workbench

Changeset b5ca595afd8d

Parent 99d7c1bc52d8

by Adrian Buehlmann

Changes to one file · Browse files at b5ca595afd8d Showing diff from parent 99d7c1bc52d8 Diff from another changeset...

 
86
87
88
89
90
91
92
93
94
95
96
97
98
99
 
 
100
101
102
103
104
105
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
107
108
 
244
245
246
 
 
 
 
 
 
 
247
248
249
 
391
392
393
 
394
395
396
 
86
87
88
 
 
 
 
 
 
 
 
 
 
 
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
 
252
253
254
255
256
257
258
259
260
261
262
263
264
 
406
407
408
409
410
411
412
@@ -86,23 +86,31 @@
  tb = QToolBar(self)   self.layout().addWidget(tb)   self.opbuttons = [] - for tip, icon, cb in ( - (_('Preview incoming changesets from specified URL'), - 'hg-incoming', self.inclicked), - (_('Pull incoming changesets from specified URL'), - 'hg-pull', self.pullclicked), - (_('Filter outgoing changesets to specified URL'), - 'hg-outgoing', self.outclicked), - (_('Push outgoing changesets to specified URL'), - 'hg-push', self.pushclicked), - (_('Email outgoing changesets for specified URL'), - 'mail-forward', self.emailclicked)): + + def newaction(tip, icon, cb):   a = QAction(self)   a.setToolTip(tip)   a.setIcon(qtlib.geticon(icon))   a.triggered.connect(cb)   self.opbuttons.append(a)   tb.addAction(a) + return a + + self.incomingAction = \ + newaction(_('Preview incoming changesets from specified URL'), + 'hg-incoming', self.inclicked) + self.pullAction = \ + newaction(_('Pull incoming changesets from specified URL'), + 'hg-pull', self.pullclicked) + self.outgoingAction = \ + newaction(_('Filter outgoing changesets to specified URL'), + 'hg-outgoing', self.outclicked) + self.pushAction = \ + newaction(_('Push outgoing changesets to specified URL'), + 'hg-push', self.pushclicked) + newaction(_('Email outgoing changesets for specified URL'), + 'mail-forward', self.emailclicked) +   if 'perfarce' in self.repo.extensions():   a = QAction(self)   a.setToolTip(_('Manage pending perforce changelists')) @@ -244,6 +252,13 @@
  else:   self.curalias = None   + def refreshStatusTips(self): + url = self.currentUrl(True) + self.incomingAction.setStatusTip(_('Preview incoming changesets from %s') % url) + self.pullAction.setStatusTip(_('Pull incoming changesets from %s') % url) + self.outgoingAction.setStatusTip(_('Filter outgoing changesets to %s') % url) + self.pushAction.setStatusTip(_('Push outgoing changesets to %s') % url) +   def loadTargets(self, rev):   self.targetcombo.clear()   self.targetcombo.addItem(_('rev: ') + str(rev), str(rev)) @@ -391,6 +406,7 @@
  self.curpw = passwd   self.updateInProgress = False   self.refreshUrl() + self.refreshStatusTips()     def dragEnterEvent(self, event):   event.acceptProposedAction()