# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'loging.ui'
#
# Created by: PyQt5 UI code generator 5.15.0
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again.  Do not edit this file unless you know what you are doing.


from PyQt5 import QtCore, QtGui, QtWidgets
from sign_up import Ui_Sign_up
# from main_wnd import Ui_wnd

import requests


class Ui_Loging(object):
    # from urllib.parse import urljoin
    # def show_m(self, title, message):
    #     msBox = QtWidgets.QMessageBox()
    #     msBox.setIcon(QtWidgets.QMessageBox.Warning)
    #     msBox.setWindowTitle(title)
    #     msBox.setText(message)
    #     msBox.setStandardButtons(QtWidgets.QMessageBox.Ok)
    #     msBox.exec_()

    # def loginCheck(self):
    #     username1 = self.u_line.text()
    #     password1 = self.p_line.text()
    #     # param_req = {'username':'password'}
    #     # response = requests.get('',data=param_req)
    #     # if response:
    #     if len(username1) == 0:
    #         self.show_m('Warning', 'Empty Username')
    #     if len(password1) == 0:
    #         self.show_m('Warning', 'Empty Password')
    #     if len(password1) > 0 and len(username1) > 0:
    #         Loging.close()
    #         self.windowz = QtWidgets.QDialog()
    #         self.ui = Ui_wnd()
    #         self.ui.setupUi(self.windowz)
    #         self.windowz.show()

            # param_req = {'username': 'password'}
            # response = requests.get("url", data=param_req)
            # if response:
            #     Loging.close()
            #     self.windowz = QtWidgets.QDialog()
            #     self.ui = Ui_wnd()
            #     self.ui.setupUi(self.windowz)
            #     self.windowz.show()
            # else:
            #     self.show_m('Warning', 'Wrong Params')

    # def sign(self):
    #     self.window = QtWidgets.QDialog()
    #     self.ui = Ui_Sign_up()
    #     self.ui.setupUi(self.window)
    #     self.window.show()

    def setupUi(self, Loging):
        Loging.setObjectName("Loging")
        Loging.resize(447, 219)
        font = QtGui.QFont()
        font.setPointSize(11)
        Loging.setFont(font)
        self.u_name = QtWidgets.QLabel(Loging)
        self.u_name.setGeometry(QtCore.QRect(10, 10, 91, 31))
        self.u_name.setIndent(-1)
        self.u_name.setObjectName("u_name")
        self.p_name = QtWidgets.QLabel(Loging)
        self.p_name.setGeometry(QtCore.QRect(10, 60, 91, 31))
        self.p_name.setObjectName("p_name")
        self.u_line = QtWidgets.QLineEdit(Loging)
        self.u_line.setGeometry(QtCore.QRect(110, 10, 181, 31))
        self.u_line.setObjectName("u_line")
        self.p_line = QtWidgets.QLineEdit(Loging)
        self.p_line.setGeometry(QtCore.QRect(110, 60, 181, 31))
        self.p_line.setEchoMode(QtWidgets.QLineEdit.Password)
        self.p_line.setObjectName("p_line")
        self.Login_b = QtWidgets.QPushButton(Loging)
        self.Login_b.setGeometry(QtCore.QRect(10, 160, 91, 41))
        self.Login_b.setObjectName("Login_b")
        # self.Login_b.clicked.connect(self.loginCheck)
        self.sign_b = QtWidgets.QPushButton(Loging)
        self.sign_b.setGeometry(QtCore.QRect(120, 160, 91, 41))
        self.sign_b.setObjectName("sign_b")
        # self.sign_b.clicked.connect(self.sign)

        self.retranslateUi(Loging)
        QtCore.QMetaObject.connectSlotsByName(Loging)

    def retranslateUi(self, Loging):
        _translate = QtCore.QCoreApplication.translate
        Loging.setWindowTitle(_translate("Loging", "Login Window"))
        self.u_name.setText(_translate("Loging", "Username"))
        self.p_name.setText(_translate("Loging", "Password"))
        self.Login_b.setText(_translate("Loging", "Login"))
        self.sign_b.setText(_translate("Loging", "Sign up"))


if __name__ == "__main__":
    import sys

    app = QtWidgets.QApplication(sys.argv)
    Loging = QtWidgets.QDialog()
    ui = Ui_Loging()
    ui.setupUi(Loging)
    Loging.show()
    sys.exit(app.exec_())
