from PyQt5 import QtWidgets from PyQt5.QtCore import pyqtSignal from helpers import PrimerConn from .loginGUI import Ui_login as LoginForm from ui.components.input.line_edit import Input from ui.components.button.push_button import PushButton class LoginPage(QtWidgets.QWidget, LoginForm): login_success = pyqtSignal(int) def __init__(self, parent=None): super(LoginPage, self).__init__(parent) self.setupUi(self) # User object self.user_obj = None # User email input field self.email_input = Input() self.email_input.lineEdit.setPlaceholderText("email") self.email_input.email_validation() self.loginInputEmailContainer.insertWidget(1, self.email_input) # User password input field self.pwd_input = Input() self.pwd_input.lineEdit.setPlaceholderText("password") self.pwd_input.echo_mode_pwd() self.loginInputPasswordContainer.insertWidget(1, self.pwd_input) # Login button self.login_btn = PushButton() self.login_btn.pushButton.setText("login") self.login_btn.pushButton.setMinimumSize(150, 50) self.login_btn.set_colors("#C6C6C6", "#e1e1e1") self.login_btn.set_btn_color("#585858", "#fff", "#0078D7") self.loginButtonContainer.insertWidget(1, self.login_btn) self.login_btn.pushButton.clicked.connect(self.login) # Login Method # noinspection PyCallByClass,PyTypeChecker def login(self): # email = self.email_input.lineEdit.text() # password = self.pwd_input.lineEdit.text() # login_res = PrimerConn.login(email, password) try: self.login_success.emit(3) except Exception as e: print(e)