35 @param parent parent widget (QWidget) |
35 @param parent parent widget (QWidget) |
36 """ |
36 """ |
37 super().__init__(parent) |
37 super().__init__(parent) |
38 self.setupUi(self) |
38 self.setupUi(self) |
39 |
39 |
40 self.refreshButton = \ |
40 self.refreshButton = self.buttonBox.addButton( |
41 self.buttonBox.addButton(self.trUtf8("Refresh"), QDialogButtonBox.ActionRole) |
41 self.trUtf8("Refresh"), QDialogButtonBox.ActionRole) |
42 self.refreshButton.setToolTip(self.trUtf8("Press to refresh the summary display")) |
42 self.refreshButton.setToolTip( |
|
43 self.trUtf8("Press to refresh the summary display")) |
43 self.refreshButton.setEnabled(False) |
44 self.refreshButton.setEnabled(False) |
44 |
45 |
45 self.process = None |
46 self.process = None |
46 self.vcs = vcs |
47 self.vcs = vcs |
47 self.vcs.committed.connect(self.__committed) |
48 self.vcs.committed.connect(self.__committed) |
87 |
88 |
88 if self.process: |
89 if self.process: |
89 self.process.kill() |
90 self.process.kill() |
90 else: |
91 else: |
91 self.process = QProcess() |
92 self.process = QProcess() |
92 prepareProcess(self.process, Preferences.getSystem("IOEncoding"), "C") |
93 prepareProcess(self.process, Preferences.getSystem("IOEncoding"), |
|
94 "C") |
93 self.process.finished.connect(self.__procFinished) |
95 self.process.finished.connect(self.__procFinished) |
94 self.process.readyReadStandardOutput.connect(self.__readStdout) |
96 self.process.readyReadStandardOutput.connect(self.__readStdout) |
95 self.process.readyReadStandardError.connect(self.__readStderr) |
97 self.process.readyReadStandardError.connect(self.__readStderr) |
96 |
98 |
97 self.process.setWorkingDirectory(repodir) |
99 self.process.setWorkingDirectory(repodir) |
311 pindex = 0 |
314 pindex = 0 |
312 for rev, node, tags, message, remarks in infoDict["parent"]: |
315 for rev, node, tags, message, remarks in infoDict["parent"]: |
313 pindex += 1 |
316 pindex += 1 |
314 changeset = "{0}:{1}".format(rev, node) |
317 changeset = "{0}:{1}".format(rev, node) |
315 if len(infoDict["parent"]) > 1: |
318 if len(infoDict["parent"]) > 1: |
316 info.append( |
319 info.append(self.trUtf8( |
317 self.trUtf8("<tr><td><b>Parent #{0}</b></td><td>{1}</td></tr>") |
320 "<tr><td><b>Parent #{0}</b></td><td>{1}</td></tr>") |
318 .format(pindex, changeset)) |
321 .format(pindex, changeset)) |
319 else: |
322 else: |
320 info.append( |
323 info.append(self.trUtf8( |
321 self.trUtf8("<tr><td><b>Parent</b></td><td>{0}</td></tr>") |
324 "<tr><td><b>Parent</b></td><td>{0}</td></tr>") |
322 .format(changeset)) |
325 .format(changeset)) |
323 if tags: |
326 if tags: |
324 info.append(self.trUtf8("<tr><td><b>Tags</b></td><td>{0}</td></tr>") |
327 info.append(self.trUtf8( |
325 .format('<br/>'.join(tags.split()))) |
328 "<tr><td><b>Tags</b></td><td>{0}</td></tr>") |
|
329 .format('<br/>'.join(tags.split()))) |
326 if message: |
330 if message: |
327 info.append( |
331 info.append(self.trUtf8( |
328 self.trUtf8("<tr><td><b>Commit Message</b></td><td>{0}</td></tr>") |
332 "<tr><td><b>Commit Message</b></td><td>{0}</td></tr>") |
329 .format(message)) |
333 .format(message)) |
330 if remarks: |
334 if remarks: |
331 rem = [] |
335 rem = [] |
332 if "@EMPTY@" in remarks: |
336 if "@EMPTY@" in remarks: |
333 rem.append(self.trUtf8("empty repository")) |
337 rem.append(self.trUtf8("empty repository")) |
334 if "@NO_REVISION@" in remarks: |
338 if "@NO_REVISION@" in remarks: |
335 rem.append(self.trUtf8("no revision checked out")) |
339 rem.append(self.trUtf8("no revision checked out")) |
336 info.append( |
340 info.append(self.trUtf8( |
337 self.trUtf8("<tr><td><b>Remarks</b></td><td>{0}</td></tr>") |
341 "<tr><td><b>Remarks</b></td><td>{0}</td></tr>") |
338 .format(", ".join(rem))) |
342 .format(", ".join(rem))) |
339 if "branch" in infoDict: |
343 if "branch" in infoDict: |
340 info.append(self.trUtf8("<tr><td><b>Branch</b></td><td>{0}</td></tr>") |
344 info.append(self.trUtf8( |
341 .format(infoDict["branch"])) |
345 "<tr><td><b>Branch</b></td><td>{0}</td></tr>") |
|
346 .format(infoDict["branch"])) |
342 if "bookmarks" in infoDict: |
347 if "bookmarks" in infoDict: |
343 bookmarks = infoDict["bookmarks"].split() |
348 bookmarks = infoDict["bookmarks"].split() |
344 for i in range(len(bookmarks)): |
349 for i in range(len(bookmarks)): |
345 if bookmarks[i].startswith("*"): |
350 if bookmarks[i].startswith("*"): |
346 bookmarks[i] = "<b>{0}</b>".format(bookmarks[i]) |
351 bookmarks[i] = "<b>{0}</b>".format(bookmarks[i]) |
347 info.append(self.trUtf8("<tr><td><b>Bookmarks</b></td><td>{0}</td></tr>") |
352 info.append(self.trUtf8( |
348 .format('<br/>'.join(bookmarks))) |
353 "<tr><td><b>Bookmarks</b></td><td>{0}</td></tr>") |
|
354 .format('<br/>'.join(bookmarks))) |
349 if "commit" in infoDict: |
355 if "commit" in infoDict: |
350 cinfo = [] |
356 cinfo = [] |
351 for category, count in infoDict["commit"][0].items(): |
357 for category, count in infoDict["commit"][0].items(): |
352 if category == "modified": |
358 if category == "modified": |
353 cinfo.append(self.trUtf8("{0} modified").format(count)) |
359 cinfo.append(self.trUtf8("{0} modified").format(count)) |
364 elif category == "unknown": |
370 elif category == "unknown": |
365 cinfo.append(self.trUtf8("{0} unknown").format(count)) |
371 cinfo.append(self.trUtf8("{0} unknown").format(count)) |
366 elif category == "ignored": |
372 elif category == "ignored": |
367 cinfo.append(self.trUtf8("{0} ignored").format(count)) |
373 cinfo.append(self.trUtf8("{0} ignored").format(count)) |
368 elif category == "unresolved": |
374 elif category == "unresolved": |
369 cinfo.append(self.trUtf8("{0} unresolved").format(count)) |
375 cinfo.append( |
|
376 self.trUtf8("{0} unresolved").format(count)) |
370 elif category == "subrepos": |
377 elif category == "subrepos": |
371 cinfo.append(self.trUtf8("{0} subrepos").format(count)) |
378 cinfo.append(self.trUtf8("{0} subrepos").format(count)) |
372 remark = infoDict["commit"][1] |
379 remark = infoDict["commit"][1] |
373 if remark == "merge": |
380 if remark == "merge": |
374 cinfo.append(self.trUtf8("Merge needed")) |
381 cinfo.append(self.trUtf8("Merge needed")) |
378 cinfo.append(self.trUtf8("Head is closed")) |
385 cinfo.append(self.trUtf8("Head is closed")) |
379 elif remark == "clean": |
386 elif remark == "clean": |
380 cinfo.append(self.trUtf8("No commit required")) |
387 cinfo.append(self.trUtf8("No commit required")) |
381 elif remark == "new branch head": |
388 elif remark == "new branch head": |
382 cinfo.append(self.trUtf8("New Branch Head")) |
389 cinfo.append(self.trUtf8("New Branch Head")) |
383 info.append( |
390 info.append(self.trUtf8( |
384 self.trUtf8("<tr><td><b>Commit Status</b></td><td>{0}</td></tr>") |
391 "<tr><td><b>Commit Status</b></td><td>{0}</td></tr>") |
385 .format("<br/>".join(cinfo))) |
392 .format("<br/>".join(cinfo))) |
386 if "update" in infoDict: |
393 if "update" in infoDict: |
387 if infoDict["update"][0] == "@CURRENT@": |
394 if infoDict["update"][0] == "@CURRENT@": |
388 uinfo = self.trUtf8("current") |
395 uinfo = self.trUtf8("current") |
389 elif infoDict["update"][0] == "@UPDATE@": |
396 elif infoDict["update"][0] == "@UPDATE@": |
390 uinfo = self.trUtf8("%n new changeset(s)<br/>Update required", "", |
397 uinfo = self.trUtf8( |
|
398 "%n new changeset(s)<br/>Update required", "", |
391 infoDict["update"][1]) |
399 infoDict["update"][1]) |
392 elif infoDict["update"][0] == "@MERGE@": |
400 elif infoDict["update"][0] == "@MERGE@": |
393 uinfo1 = self.trUtf8("%n new changeset(s)", "", infoDict["update"][1]) |
401 uinfo1 = self.trUtf8( |
394 uinfo2 = self.trUtf8("%n branch head(s)", "", infoDict["update"][2]) |
402 "%n new changeset(s)", "", infoDict["update"][1]) |
395 uinfo = self.trUtf8("{0}<br/>{1}<br/>Merge required", |
403 uinfo2 = self.trUtf8( |
|
404 "%n branch head(s)", "", infoDict["update"][2]) |
|
405 uinfo = self.trUtf8( |
|
406 "{0}<br/>{1}<br/>Merge required", |
396 "0 is changesets, 1 is branch heads")\ |
407 "0 is changesets, 1 is branch heads")\ |
397 .format(uinfo1, uinfo2) |
408 .format(uinfo1, uinfo2) |
398 else: |
409 else: |
399 uinfo = self.trUtf8("unknown status") |
410 uinfo = self.trUtf8("unknown status") |
400 info.append( |
411 info.append(self.trUtf8( |
401 self.trUtf8("<tr><td><b>Update Status</b></td><td>{0}</td></tr>") |
412 "<tr><td><b>Update Status</b></td><td>{0}</td></tr>") |
402 .format(uinfo)) |
413 .format(uinfo)) |
403 if "remote" in infoDict: |
414 if "remote" in infoDict: |
404 if infoDict["remote"] == (0, 0, 0, 0): |
415 if infoDict["remote"] == (0, 0, 0, 0): |
405 rinfo = self.trUtf8("synched") |
416 rinfo = self.trUtf8("synched") |
406 else: |
417 else: |
415 infoDict["remote"][2])) |
426 infoDict["remote"][2])) |
416 if infoDict["remote"][3]: |
427 if infoDict["remote"][3]: |
417 l.append(self.trUtf8("%n outgoing bookmark(s)", "", |
428 l.append(self.trUtf8("%n outgoing bookmark(s)", "", |
418 infoDict["remote"][3])) |
429 infoDict["remote"][3])) |
419 rinfo = "<br/>".join(l) |
430 rinfo = "<br/>".join(l) |
420 info.append( |
431 info.append(self.trUtf8( |
421 self.trUtf8("<tr><td><b>Remote Status</b></td><td>{0}</td></tr>") |
432 "<tr><td><b>Remote Status</b></td><td>{0}</td></tr>") |
422 .format(rinfo)) |
433 .format(rinfo)) |
423 if "mq" in infoDict: |
434 if "mq" in infoDict: |
424 if infoDict["mq"] == (0, 0): |
435 if infoDict["mq"] == (0, 0): |
425 qinfo = self.trUtf8("empty queue") |
436 qinfo = self.trUtf8("empty queue") |
426 else: |
437 else: |
427 l = [] |
438 l = [] |
428 if infoDict["mq"][0]: |
439 if infoDict["mq"][0]: |
429 l.append(self.trUtf8("{0} applied").format(infoDict["mq"][0])) |
440 l.append(self.trUtf8("{0} applied") |
|
441 .format(infoDict["mq"][0])) |
430 if infoDict["mq"][1]: |
442 if infoDict["mq"][1]: |
431 l.append(self.trUtf8("{0} unapplied").format(infoDict["mq"][1])) |
443 l.append(self.trUtf8("{0} unapplied") |
|
444 .format(infoDict["mq"][1])) |
432 qinfo = "<br/>".join(l) |
445 qinfo = "<br/>".join(l) |
433 info.append( |
446 info.append(self.trUtf8( |
434 self.trUtf8("<tr><td><b>Queues Status</b></td><td>{0}</td></tr>") |
447 "<tr><td><b>Queues Status</b></td><td>{0}</td></tr>") |
435 .format(qinfo)) |
448 .format(qinfo)) |
436 info.append("</table>") |
449 info.append("</table>") |
437 else: |
450 else: |
438 info = [self.trUtf8("<p>No status information available.</p>")] |
451 info = [self.trUtf8("<p>No status information available.</p>")] |
439 |
452 |