def __init__(self, parent): QDialog.__init__(self, parent) self.ui = Ui_addTopic() self.ui.setupUi(self) self.parent = parent self.connect(self.ui.btnCancel, SIGNAL('clicked()'), SLOT('close()')) self.connect(self.ui.btnAdd, SIGNAL('clicked()'), self.addTopic)
class AddTopicDialog(QDialog): def __init__(self, parent): QDialog.__init__(self, parent) self.ui = Ui_addTopic() self.ui.setupUi(self) self.parent = parent self.connect(self.ui.btnCancel, SIGNAL('clicked()'), SLOT('close()')) self.connect(self.ui.btnAdd, SIGNAL('clicked()'), self.addTopic) def addTopic(self): topic = unicode(self.ui.addTopicLinedit.text()) topic = purify.cleanText(topic) classifier.addTopic(topic) self.close()
class AddTopicDialog(QDialog): def __init__(self, parent): QDialog.__init__(self, parent) self.ui = Ui_addTopic() self.ui.setupUi(self) self.parent = parent self.connect(self.ui.btnCancel, SIGNAL('clicked()'), SLOT('close()')) self.connect(self.ui.btnAdd, SIGNAL('clicked()'), self.addTopic) def addTopic(self): topic = unicode(self.ui.addTopicLinedit.text()) #topic = purify.cleanText(topic) # gave an error when adding classifier.addTopic(topic) #Set the refreshDisplay status to true. self.parent.parent.refreshDisplay = True self.close()