13 from PyQt4.QtGui import QDialog, QDialogButtonBox |
13 from PyQt4.QtGui import QDialog, QDialogButtonBox |
14 |
14 |
15 from E5Gui import E5MessageBox |
15 from E5Gui import E5MessageBox |
16 |
16 |
17 from .Ui_HgQueuesHeaderDialog import Ui_HgQueuesHeaderDialog |
17 from .Ui_HgQueuesHeaderDialog import Ui_HgQueuesHeaderDialog |
18 |
|
19 import Preferences |
|
20 |
18 |
21 |
19 |
22 class HgQueuesHeaderDialog(QDialog, Ui_HgQueuesHeaderDialog): |
20 class HgQueuesHeaderDialog(QDialog, Ui_HgQueuesHeaderDialog): |
23 """ |
21 """ |
24 Class implementing a dialog to show the commit message of the current |
22 Class implementing a dialog to show the commit message of the current |
81 while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)): |
79 while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)): |
82 repodir = os.path.dirname(repodir) |
80 repodir = os.path.dirname(repodir) |
83 if os.path.splitdrive(repodir)[1] == os.sep: |
81 if os.path.splitdrive(repodir)[1] == os.sep: |
84 return |
82 return |
85 |
83 |
86 args = [] |
84 args = self.vcs.initCommand("qheader") |
87 args.append('qheader') |
|
88 |
85 |
89 if self.__hgClient: |
86 if self.__hgClient: |
90 self.inputGroup.setEnabled(False) |
87 self.inputGroup.setEnabled(False) |
91 self.inputGroup.hide() |
88 self.inputGroup.hide() |
92 |
89 |
161 It reads the output of the process, formats it and inserts it into |
158 It reads the output of the process, formats it and inserts it into |
162 the contents pane. |
159 the contents pane. |
163 """ |
160 """ |
164 if self.process is not None: |
161 if self.process is not None: |
165 s = str(self.process.readAllStandardOutput(), |
162 s = str(self.process.readAllStandardOutput(), |
166 Preferences.getSystem("IOEncoding"), |
163 self.vcs.getEncoding(), 'replace') |
167 'replace') |
|
168 self.__showOutput(s) |
164 self.__showOutput(s) |
169 |
165 |
170 def __showOutput(self, out): |
166 def __showOutput(self, out): |
171 """ |
167 """ |
172 Private slot to show some output. |
168 Private slot to show some output. |
182 It reads the error output of the process and inserts it into the |
178 It reads the error output of the process and inserts it into the |
183 error pane. |
179 error pane. |
184 """ |
180 """ |
185 if self.process is not None: |
181 if self.process is not None: |
186 s = str(self.process.readAllStandardError(), |
182 s = str(self.process.readAllStandardError(), |
187 Preferences.getSystem("IOEncoding"), |
183 self.vcs.getEncoding(), 'replace') |
188 'replace') |
|
189 self.__showError(s) |
184 self.__showError(s) |
190 |
185 |
191 def __showError(self, out): |
186 def __showError(self, out): |
192 """ |
187 """ |
193 Private slot to show some error. |
188 Private slot to show some error. |