Plugins/VcsPlugins/vcsMercurial/HgSummaryDialog.py

changeset 4126
c28d0cf3b639
parent 4021
195a471c327b
child 4631
5c1a96925da4
equal deleted inserted replaced
4125:056d98a54dd4 4126:c28d0cf3b639
45 self.tr("Refresh"), QDialogButtonBox.ActionRole) 45 self.tr("Refresh"), QDialogButtonBox.ActionRole)
46 self.refreshButton.setToolTip( 46 self.refreshButton.setToolTip(
47 self.tr("Press to refresh the summary display")) 47 self.tr("Press to refresh the summary display"))
48 self.refreshButton.setEnabled(False) 48 self.refreshButton.setEnabled(False)
49 49
50 self.process = None
51 self.vcs = vcs 50 self.vcs = vcs
52 self.vcs.committed.connect(self.__committed) 51 self.vcs.committed.connect(self.__committed)
52
53 self.process = QProcess()
54 prepareProcess(self.process, language="C")
55 self.process.finished.connect(self.__procFinished)
56 self.process.readyReadStandardOutput.connect(self.__readStdout)
57 self.process.readyReadStandardError.connect(self.__readStderr)
53 58
54 def closeEvent(self, e): 59 def closeEvent(self, e):
55 """ 60 """
56 Protected slot implementing a close event handler. 61 Protected slot implementing a close event handler.
57 62
73 @param mq flag indicating to show the queue status as well (boolean) 78 @param mq flag indicating to show the queue status as well (boolean)
74 @param largefiles flag indicating to show the largefiles status as 79 @param largefiles flag indicating to show the largefiles status as
75 well (boolean) 80 well (boolean)
76 """ 81 """
77 self.errorGroup.hide() 82 self.errorGroup.hide()
83 self.refreshButton.setEnabled(False)
84 self.summary.clear()
85
78 self.__path = path 86 self.__path = path
79 self.__mq = mq 87 self.__mq = mq
80 self.__largefiles = largefiles 88 self.__largefiles = largefiles
81 89
82 args = self.vcs.initCommand("summary") 90 args = self.vcs.initCommand("summary")
94 if os.path.splitdrive(repodir)[1] == os.sep: 102 if os.path.splitdrive(repodir)[1] == os.sep:
95 return 103 return
96 104
97 if self.process: 105 if self.process:
98 self.process.kill() 106 self.process.kill()
99 else:
100 self.process = QProcess()
101 prepareProcess(self.process, language="C")
102 self.process.finished.connect(self.__procFinished)
103 self.process.readyReadStandardOutput.connect(self.__readStdout)
104 self.process.readyReadStandardError.connect(self.__readStderr)
105 107
106 self.process.setWorkingDirectory(repodir) 108 self.process.setWorkingDirectory(repodir)
107 109
108 self.__buffer = [] 110 self.__buffer = []
109 111
128 self.process.terminate() 130 self.process.terminate()
129 QTimer.singleShot(2000, self.process.kill) 131 QTimer.singleShot(2000, self.process.kill)
130 self.process.waitForFinished(3000) 132 self.process.waitForFinished(3000)
131 133
132 self.refreshButton.setEnabled(True) 134 self.refreshButton.setEnabled(True)
133 self.process = None
134 135
135 def on_buttonBox_clicked(self, button): 136 def on_buttonBox_clicked(self, button):
136 """ 137 """
137 Private slot called by a button of the button box clicked. 138 Private slot called by a button of the button box clicked.
138 139
193 @pyqtSlot() 194 @pyqtSlot()
194 def on_refreshButton_clicked(self): 195 def on_refreshButton_clicked(self):
195 """ 196 """
196 Private slot to refresh the status display. 197 Private slot to refresh the status display.
197 """ 198 """
198 self.refreshButton.setEnabled(False)
199 self.summary.clear()
200
201 self.start(self.__path, mq=self.__mq) 199 self.start(self.__path, mq=self.__mq)
202 200
203 def __committed(self): 201 def __committed(self):
204 """ 202 """
205 Private slot called after the commit has finished. 203 Private slot called after the commit has finished.

eric ide

mercurial