Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.1, 2.1.1, and 2.1.2

sync: show busy icon in repo tab

Other task tabs should emit showBusyIcon and hideBusyIcon as well.

Changeset c4691fba95aa

Parent 4d205ef053fa

by Steve Borho

Changes to 3 files · Browse files at c4691fba95aa Showing diff from parent 4d205ef053fa Diff from another changeset...

 
50
51
52
 
 
53
54
55
 
64
65
66
 
67
68
69
 
276
277
278
 
 
279
280
281
282
 
 
 
 
 
 
 
 
 
 
 
 
 
 
283
284
285
 
50
51
52
53
54
55
56
57
 
66
67
68
69
70
71
72
 
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
@@ -50,6 +50,8 @@
  titleChanged = pyqtSignal(unicode)   """Emitted when changed the expected title for the RepoWidget tab"""   + showIcon = pyqtSignal(QIcon) +   repoLinkClicked = pyqtSignal(unicode)   """Emitted when clicked a link to open repository"""   @@ -64,6 +66,7 @@
  self.branch = ''   self.bundle = None   self.revset = [] + self.busyIcons = []   self.namedTabs = {}   self.repolen = len(repo)   self.destroyed.connect(self.repo.thginvalidate) @@ -276,10 +279,26 @@
  sw.showMessage.connect(self.showMessage)   sw.incomingBundle.connect(self.setBundle)   sw.pullCompleted.connect(self.onPullCompleted) + sw.showBusyIcon.connect(self.onShowBusyIcon) + sw.hideBusyIcon.connect(self.onHideBusyIcon)   sw.refreshTargets(self.rev)   return sw     @pyqtSlot(QString) + def onShowBusyIcon(self, iconname): + self.busyIcons.append(iconname) + self.showIcon.emit(qtlib.geticon(self.busyIcons[-1])) + + @pyqtSlot(QString) + def onHideBusyIcon(self, iconname): + if iconname in self.busyIcons: + self.busyIcons.remove(iconname) + if self.busyIcons: + self.showIcon.emit(qtlib.geticon(self.busyIcons[-1])) + else: + self.showIcon.emit(QIcon()) + + @pyqtSlot(QString)   def setBundle(self, bfile):   if self.bundle:   self.clearBundle()
 
70
71
72
 
 
73
74
75
 
576
577
578
579
 
 
 
580
581
582
583
 
584
585
586
 
70
71
72
73
74
75
76
77
 
578
579
580
 
581
582
583
584
585
586
587
588
589
590
591
@@ -70,6 +70,8 @@
  output = pyqtSignal(QString, QString)   progress = pyqtSignal(QString, object, QString, QString, object)   makeLogVisible = pyqtSignal(bool) + showBusyIcon = pyqtSignal(QString) + hideBusyIcon = pyqtSignal(QString)     def __init__(self, repo, parent, **opts):   QWidget.__init__(self, parent) @@ -576,11 +578,14 @@
  for b in self.opbuttons:   b.setEnabled(False)   self.stopAction.setEnabled(True) - if not self.embedded: + if self.embedded: + self.showBusyIcon.emit('thg-sync') + else:   self.cmd.setShowOutput(True)   self.cmd.setVisible(True)     def commandFinished(self, ret): + self.hideBusyIcon.emit('thg-sync')   self.repo.decrementBusyCount()   for b in self.opbuttons:   b.setEnabled(True)
 
494
495
496
 
 
497
498
499
 
494
495
496
497
498
499
500
501
@@ -494,6 +494,8 @@
  tw.setCurrentIndex(index)   rw.titleChanged.connect(   lambda title: tw.setTabText(tw.indexOf(rw), title)) + rw.showIcon.connect( + lambda icon: tw.setTabIcon(tw.indexOf(rw), icon))   self.reporegistry.addRepo(repo)     self.updateMenu()