14 QTreeWidgetItem, QLineEdit |
14 QTreeWidgetItem, QLineEdit |
15 |
15 |
16 from E5Gui import E5MessageBox |
16 from E5Gui import E5MessageBox |
17 |
17 |
18 from .Ui_HgBookmarksListDialog import Ui_HgBookmarksListDialog |
18 from .Ui_HgBookmarksListDialog import Ui_HgBookmarksListDialog |
19 |
|
20 import Preferences |
|
21 |
19 |
22 |
20 |
23 class HgBookmarksListDialog(QDialog, Ui_HgBookmarksListDialog): |
21 class HgBookmarksListDialog(QDialog, Ui_HgBookmarksListDialog): |
24 """ |
22 """ |
25 Class implementing a dialog to show a list of bookmarks. |
23 Class implementing a dialog to show a list of bookmarks. |
92 while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)): |
90 while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)): |
93 repodir = os.path.dirname(repodir) |
91 repodir = os.path.dirname(repodir) |
94 if os.path.splitdrive(repodir)[1] == os.sep: |
92 if os.path.splitdrive(repodir)[1] == os.sep: |
95 return |
93 return |
96 |
94 |
97 args = [] |
95 args = self.vcs.initCommand("bookmarks") |
98 args.append('bookmarks') |
|
99 |
96 |
100 if self.__hgClient: |
97 if self.__hgClient: |
101 self.inputGroup.setEnabled(False) |
98 self.inputGroup.setEnabled(False) |
102 self.inputGroup.hide() |
99 self.inputGroup.hide() |
103 |
100 |
224 the contents pane. |
221 the contents pane. |
225 """ |
222 """ |
226 self.process.setReadChannel(QProcess.StandardOutput) |
223 self.process.setReadChannel(QProcess.StandardOutput) |
227 |
224 |
228 while self.process.canReadLine(): |
225 while self.process.canReadLine(): |
229 s = str(self.process.readLine(), |
226 s = str(self.process.readLine(), self.vcs.getEncoding(), |
230 Preferences.getSystem("IOEncoding"), |
|
231 'replace').strip() |
227 'replace').strip() |
232 self.__processOutputLine(s) |
228 self.__processOutputLine(s) |
233 |
229 |
234 def __processOutputLine(self, line): |
230 def __processOutputLine(self, line): |
235 """ |
231 """ |
259 It reads the error output of the process and inserts it into the |
255 It reads the error output of the process and inserts it into the |
260 error pane. |
256 error pane. |
261 """ |
257 """ |
262 if self.process is not None: |
258 if self.process is not None: |
263 s = str(self.process.readAllStandardError(), |
259 s = str(self.process.readAllStandardError(), |
264 Preferences.getSystem("IOEncoding"), |
260 self.vcs.getEncoding(), 'replace') |
265 'replace') |
|
266 self.__showError(s) |
261 self.__showError(s) |
267 |
262 |
268 def __showError(self, out): |
263 def __showError(self, out): |
269 """ |
264 """ |
270 Private slot to show some error. |
265 Private slot to show some error. |