class MainWindow(QMainWindow): spanishButtonLabel = str('Español') spanishSpecialCharacters = ['ñ', 'ó', 'á', 'ú', 'é', 'í'] mode = {'es', 'en'} englishButtonLabel = str('English') def __init__(self): super(MainWindow, self).__init__() def initUI(self, onAddWordModel, closeConnection, onStartTestModel, onCheckAnswerModel, onNextTestWordModel, onContinueWithTest): self.onAddWordModel = onAddWordModel self.closeConnection = closeConnection self.onStartTestModel = onStartTestModel self.onCheckAnswerModel = onCheckAnswerModel self.onNextTestWordModel = onNextTestWordModel self.continueWithTest = onContinueWithTest self.ui = Ui_ChooseLanguageWindow() self.ui.setupUi(self) self.ui.spanishButton.clicked.connect(self.onSpanishDict) self.ui.englishButton.clicked.connect(self.onEnglishDict) self.setWindowTitle('Words Memory') self.show()
def initUI(self, onAddWordModel, closeConnection, onStartTestModel, onCheckAnswerModel, onNextTestWordModel, onContinueWithTest): self.onAddWordModel = onAddWordModel self.closeConnection = closeConnection self.onStartTestModel = onStartTestModel self.onCheckAnswerModel = onCheckAnswerModel self.onNextTestWordModel = onNextTestWordModel self.continueWithTest = onContinueWithTest self.ui = Ui_ChooseLanguageWindow() self.ui.setupUi(self) self.ui.spanishButton.clicked.connect(self.onSpanishDict) self.ui.englishButton.clicked.connect(self.onEnglishDict) self.setWindowTitle('Words Memory') self.show()