--- a/src/eric7/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesListGuardsDialog.py Wed Jul 13 11:16:20 2022 +0200 +++ b/src/eric7/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesListGuardsDialog.py Wed Jul 13 14:55:47 2022 +0200 @@ -19,10 +19,11 @@ """ Class implementing a dialog to show the guards of a selected patch. """ + def __init__(self, vcs, patchesList, parent=None): """ Constructor - + @param vcs reference to the vcs object @param patchesList list of patches (list of strings) @param parent reference to the parent widget (QWidget) @@ -30,50 +31,50 @@ super().__init__(parent) self.setupUi(self) self.setWindowFlags(Qt.WindowType.Window) - + self.vcs = vcs self.__hgClient = vcs.getClient() - + self.patchSelector.addItems([""] + patchesList) - + self.show() QCoreApplication.processEvents() - + def closeEvent(self, e): """ Protected slot implementing a close event handler. - + @param e close event (QCloseEvent) """ if self.__hgClient.isExecuting(): self.__hgClient.cancel() - + e.accept() - + def start(self): """ Public slot to start the list command. """ self.on_patchSelector_activated(0) - + @pyqtSlot(int) def on_patchSelector_activated(self, index): """ Private slot to get the list of guards for the given patch name. - + @param index index of the selected entry @type int """ patch = self.patchSelector.itemText(index) self.guardsList.clear() self.patchNameLabel.setText("") - + args = self.vcs.initCommand("qguard") if patch: args.append(patch) - + output = self.__hgClient.runcommand(args)[0].strip() - + if output: patchName, guards = output.split(":", 1) self.patchNameLabel.setText(patchName)