def on_makePatchButton_clicked(self): project = self.getCurrentProject() package = self.currentPackage() if project is None or package is None: return dialog = QInputDialog(self.mainWindow) dialog.setInputMode(QInputDialog.TextInput) dialog.setLabelText(u"Patch name (should end with <i>.patch</i>):") dialog.setWindowTitle(u"Choose patch name...") le = dialog.findChildren(QLineEdit) if len(le) > 0: validator = QRegExpValidator(PATCH_NAME_REGEXP, le[0]) le[0].setText(u".patch") le[0].setValidator(validator) dialog.textValueSelected.connect(self.__createPatch) dialog.show()