Exemple #1
0
 def abrirlogin(self):
     self.MainWindow = login.Ui_MainWindow
     tela_login = QtGui.QMainWindow()
     ui = login.Ui_MainWindow()
     ui.setupUi(tela_login)
     tela_login.show()
     sys.exit(app.exec_())
 def click_btn_logout(self):
     import login
     MainWindow = QtWidgets.QMainWindow()
     ui = login.Ui_MainWindow()
     ui.setupUi(MainWindow)
     MainWindow.show()
     self.context.Form.hide()
Exemple #3
0
 def __init__(self, parent=None):
     super(LoginPage, self).__init__(parent)
     self.ui = login.Ui_MainWindow()
     self.ui.setupUi(self)
     self.ui.login_button.clicked.connect(self.login_click)
     self.ui.register_button.clicked.connect(self.register_click)
     self.setting = QtCore.QSettings('config', 'restaurant')
     self.ui.pass_edit.returnPressed.connect(self.login_click)
Exemple #4
0
    def initUI(self):
        ui = login.Ui_MainWindow()
        ui.setupUi(self)

        statusBarMsg = "准备\t\t\t" + time.asctime()
        self.statusBar().showMessage(statusBarMsg)

        self.show()
Exemple #5
0
 def __init__(self):
     super().__init__()
     # 创建菜单对象
     self.menu = Menu()
     # 创建登录界面UI对象
     self.logui = login.Ui_MainWindow()
     self.logui.setupUi(self)
     # 按键的信号槽连接
     self.logui.pushButton_login.clicked.connect(self.logFunc)
Exemple #6
0
    def registrarcadastro(self):
        fb = firebase.FirebaseApplication('https://caronas.firebaseio.com',
                                          None)
        cadastros = fb.get('Users', None)

        if not self.usuarioinput.text() in cadastros:

            validando_email = validate_email(self.emailinput.text())

            if self.senhainput.text() == self.confirmarsenhainput.text(
            ) and self.nomeinput.text(
            ) != '' and validando_email == True and self.celularinput.text(
            ) != '' and self.celularinput.text(
            ) != '' and self.usuarioinput.text() != '':
                dlg = QtGui.QMessageBox(None)
                dlg.setWindowTitle("Confirmação")
                dlg.setIcon(QtGui.QMessageBox.Question)
                dlg.setText("Deseja confirmar as informações?")
                dlg.setStandardButtons(QtGui.QMessageBox.Yes
                                       | QtGui.QMessageBox.No)
                dlg.setDefaultButton(QtGui.QMessageBox.Yes)
                dlg.setEscapeButton(QtGui.QMessageBox.No)
                resultado = dlg.exec_()

                if resultado == QtGui.QMessageBox.Yes:

                    fb = firebase.FirebaseApplication(
                        'https://caronas.firebaseio.com')
                    dicionario = {
                        'Nome': self.nomeinput.text(),
                        'email': self.emailinput.text(),
                        'telefone': self.celularinput.text(),
                        'senha': self.senhainput.text()
                    }
                    fb.put('Users', self.usuarioinput.text(), dicionario)
                    self.MainWindow = login.Ui_MainWindow
                    tela_login = QtGui.QMainWindow()
                    ui = login.Ui_MainWindow()
                    ui.setupUi(tela_login)
                    tela_login.show()
                    sys.exit(app.exec_())

            else:
                dlg2 = QtGui.QMessageBox(None)
                dlg2.setWindowTitle("Erro")
                dlg2.setIcon(QtGui.QMessageBox.Warning)
                dlg2.setText("Preencha os campos corretamente, por favor.")
                dlg2.exec_()
        else:
            dlg2 = QtGui.QMessageBox(None)
            dlg2.setWindowTitle("Erro")
            dlg2.setIcon(QtGui.QMessageBox.Warning)
            dlg2.setText("Usuário já existente!")
            dlg2.exec_()
Exemple #7
0
    def __init__(self):
        super().__init__()

        self.ui_log = login.Ui_MainWindow()
        self.ui_log.setupUi(self)
        self.init_Log_Ui()

        self.ui_log.login.returnPressed.connect(
            lambda: self.ui_log.password.setFocus())
        self.ui_log.password.returnPressed.connect(
            lambda: self.ui_log.password.clearFocus())
        self.ui_log.reg.clicked.connect(lambda: self.log_clicked())
Exemple #8
0
    def __init__(self):
        # configurações para importação de telas
        self.login_Window = QtWidgets.QMainWindow()
        self.login_ui = login.Ui_MainWindow()
        self.login_ui.setupUi(self.login_Window)
        # ao clicar no botão "btnLogin" leva para função verificar_login
        self.login_ui.btnLogin.clicked.connect(self.verificar_login)
        # ao clicar no botão "btnCadastrar" leva para função show_cadastrar
        self.login_ui.btnCadastrar.clicked.connect(self.show_cadastrar)
        self.login_ui.btnCadastrar.clicked.connect(self.login_Window.close)

        self.cadastro_Window = QtWidgets.QMainWindow()
        self.cadastro_ui = cadastro.Ui_MainWindow()
        self.cadastro_ui.setupUi(self.cadastro_Window)
        self.cadastro_ui.btnCadastrar.clicked.connect(self.cadastrar)
        self.cadastro_ui.btnVoltar.clicked.connect(self.show_login)
        self.cadastro_ui.btnVoltar.clicked.connect(self.cadastro_Window.close)

        self.treino_Window = QtWidgets.QMainWindow()
        self.treino_ui = treino.Ui_MainWindow()
        self.treino_ui.setupUi(self.treino_Window)
        self.treino_ui.btnComecar.clicked.connect(self.show_treinoAtual)
        self.treino_ui.btnComecar.clicked.connect(self.treino_Window.close)
        self.treino_ui.btnLogout.clicked.connect(self.Logout)
        self.treino_ui.btnLogout.clicked.connect(self.treino_Window.close)

        self.treinoatual_Window = QtWidgets.QMainWindow()
        self.treinoatual_ui = treinoatual.Ui_MainWindow()
        self.treinoatual_ui.setupUi(self.treinoatual_Window)
        self.treinoatual_ui.pushButton.clicked.connect(self.show_treino)
        self.treinoatual_ui.pushButton.clicked.connect(
            self.treinoatual_Window.close)
        self.treinoatual_ui.btnProximo.clicked.connect(self.ProxExercicio)
        self.treinoatual_ui.pushButton_2.clicked.connect(self.VoltaExercicio)
        self.treinoatual_ui.btnPause.clicked.connect(self.playStop)
        self.treinoatual_ui.btnLogout.clicked.connect(self.Logout)
        self.treinoatual_ui.btnLogout.clicked.connect(
            self.treinoatual_Window.close)

        self.timer = QtCore.QTimer()
        self.timer.timeout.connect(self.showTime)
Exemple #9
0
def loginFunc(ui):
    # 从页面获取用户名和密码
    userNameIn = ui.lineEdit_userName.text()
    pwdIn = ui.lineEdit_pwd.text()
    # 从存贮用户名和密码的文件读取用户名和密码
    with open("userInfo.txt", "r") as f:
        infoList = f.readlines()
        for info in infoList:
            userName = info.split(",")[0]
            pwd = info.split(",")[1].strip()
            # 如果想户名和密码都相同则登录成功,否则登录失败
            if pwd == pwdIn and userNameIn == userName:
                print("登录成功!")
                return 1
        box = QMessageBox(QMessageBox.Information, '登录失败', '密码或用户名错误')
        yes = box.addButton('Ok', QMessageBox.YesRole)
        box.show()
        if box.exec() == 0:
            return 0


if __name__ == '__main__':
    app = QApplication(sys.argv)
    MainWindow = QMainWindow()
    ui = login.Ui_MainWindow()
    ui.setupUi(MainWindow)
    MainWindow.show()
    ui.pushButton_login.clicked.connect(partial(loginFunc, ui))
    sys.exit(app.exec_())

Exemple #10
0
import image
import sys
import login
from PyQt5.QtWidgets import QApplication, QMainWindow
if __name__ == '__main__':
    myapp = QApplication(sys.argv)
    myDlg = QMainWindow()
    myUI = login.Ui_MainWindow()
    myUI.setupUi(myDlg)
    myDlg.show()
    sys.exit(myapp.exec_())