def __init__(self, parent=None): """ constructer for vocabulary dialog objects """ super(VocabularyDialog, self).__init__(parent) self.interface = ui.Ui_vocabulary.Ui_vocabularyDialog() self.interface.setupUi(self) self.center_on_screen() self.connect(self.interface.cevap1Button, QtCore.SIGNAL("clicked()"), self.button_clicked) self.connect(self.interface.cevap2Button, QtCore.SIGNAL("clicked()"), self.button_clicked) self.connect(self.interface.cevap3Button, QtCore.SIGNAL("clicked()"), self.button_clicked) self.connect(self.interface.cevap4Button, QtCore.SIGNAL("clicked()"), self.button_clicked) self.dictionary_array = dictionary.load_array("data.dat") self.word_arr = random.choice(self.dictionary_array) self.correct_answer = "" self.syllable_ver = "" self.char_set = "" self.meaning_of_word = "" self.pic_array = [] self.labels = [] self.len_of_word = 0 self.response_of_user = "" self.ask_new_word()
def set_the_word(self): """ sets the word """ self.word_arr = random.choice(dictionary.load_array("data.dat")) self.correct_answer = str(self.word_arr[0]) self.syllable_ver = str(self.word_arr[1]) self.char_set = str(self.word_arr[2]) self.meaning_of_word = str(self.word_arr[3]) self.pic_array = dictionary.get_picture_array(self.syllable_ver)
def __init__(self, parent=None): """ Constructer """ super(AddWord, self).__init__(parent) self.interface = ui.Ui_addDict.Ui_Dialog() self.interface.setupUi(self) self.interface.lineEdit.selectAll() self.connect(self.interface.addButton, QtCore.SIGNAL("clicked()"), self.add_clicked) self.center_on_screen() self.dictionary_array = dictionary.load_array("data.dat")