def __loginYoudao(self): username = self.youdaoUsername.text() password = self.youdaoPassword.text() remember = self.youdaoRemember.isChecked() self.youdaoLoginButton.setEnabled(False) self.youdaoLoginButton.setText("Logging...") if Youdao().login(username, password, remember): showInfo("Login Success!") self.youdaoLoginButton.setText("Logged") self.__saveAccount(username,password,remember,'youdao') else: self.youdaoLoginButton.setEnabled(True) self.youdaoLoginButton.setText("Login") showInfo("Login Failed!")
def __getCurrentWordList(self): if self.dictThread: self.dictThread.terminate() if self.dictionary.currentIndex(): self.dictThread = Youdao() else: self.dictThread = Eudict() self.connect(self.dictThread,QtCore.SIGNAL('updateProgressBar_dict(int,int)'),self.updateProgressBar) self.dictThread.start() while not self.dictThread.isFinished(): mw.app.processEvents() self.dictThread.wait(1) results = self.dictThread.results self.currentWordDescList = self.dictThread.descresults self.dictThread = None return results