I'm writing a solution using Python, Qt and MySQL, I create the login screen and set all the errors...<br><br>The problem is: When the user do the correct login in MySQL, I want the login screen to close, and the whole application show.<br>
<br>The code when the button "Enter" is pressed:<br>---------------------------<br> def on_pushButton_enter_clicked(self):<br> user = self.lineEdit_user.text()<br> passw = self.lineEdit_passw.text()<br>
if user == "" or passw == "":<br> QMessageBox.information(self, "ERRO", u"Por favor, entre com o usuário e senha.", "OK")<br> else:<br> try: ############ If the login is made, the application is launch and the login screen is closed.<br>
p2db = Pro2db(str(user), str(passw))<br> mainWnd = Pro2MainWindow()<br> mainWnd.showMaximized()<br> self.close()<br> ###########################################<br>
except MySQLdb.Error, error_code:<br> if error_code[0] == 1045:<br> message = u"Acesso negado para o usuário: %s" %user<br> elif error_code[0] == 2003:<br>
message = u"Não foi possível realizar a conexão."<br> else:<br> message = u"Erro desconhecido.\nCódigo administrativo: %s - %s." %(error_code[0], error_code[1])<br>
QMessageBox.information(self, "Falha no acesso", u"O servidor informa:\n%s" %message, "OK")<br>---------------------------<br><br>Anyone can help?<br><br>Thanks in advance,<br>
Sandro Dutra,<br>Brazil.<br>