-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
98 lines (87 loc) · 3.83 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'main.ui'
#
# Created by: PyQt5 UI code generator 5.15.2
#
# 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 welcome import Ui_Welcome
class Ui_Form(object):
def showMessageBox(self, title, message):
msgBox = QtWidgets.QMessageBox()
msgBox.setIcon(QtWidgets.QMessageBox.Warning)
msgBox.setWindowTitle(title)
msgBox.setText(message)
msgBox.setStandardButtons(QtWidgets.QMessageBox.Ok)
msgBox.exec_()
def WelcomeWindow(self):
self.welcomewindow = QtWidgets.QWidget()
self.ui = Ui_Welcome()
self.ui.setupUi(self.welcomewindow)
self.welcomewindow.show()
def login(self):
if(self.Username.text() == "admin" and self.Password.text() == "12345"):
Form.hide()
self.WelcomeWindow()
else:
self.showMessageBox("WARNING", "Invalid Username and Password")
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(593, 388)
Form.setStyleSheet("#Form{\n"
" background-color: qconicalgradient(cx:0.045, cy:0, angle:135, stop:0 rgba(30, 0, 255, 255), stop:0.375 rgba(0, 195, 255, 252), stop:0.423533 rgba(37, 0, 255, 255), stop:0.45 rgba(0, 130, 255, 255), stop:0.477581 rgba(0, 56, 255, 252), stop:0.518717 rgba(71, 171, 255, 255), stop:0.542289 rgba(71, 171, 255, 255), stop:0.547264 rgba(68, 134, 249, 255), stop:0.55 rgba(0, 74, 255, 255), stop:0.552239 rgba(21, 93, 243, 255), stop:0.57754 rgba(102, 0, 255, 255), stop:0.625 rgba(0, 185, 255, 247), stop:1 rgba(255, 255, 0, 69));\n"
"}\n"
"QGroupBox{\n"
" \n"
" font: 75 14pt \"MS Sans Serif\";\n"
" text-decoration: underline;\n"
"\n"
"}\n"
"QLineEdit{\n"
"border-radius:10px;\n"
"border-bottom:3px solid green;\n"
"color:#000000;\n"
"}\n"
"QPushButton{\n"
"border-radius:10px;\n"
"border:3px solid green;\n"
"color:#000000;\n"
"}")
self.groupBox = QtWidgets.QGroupBox(Form)
self.groupBox.setGeometry(QtCore.QRect(130, 90, 331, 211))
self.groupBox.setObjectName("groupBox")
self.label = QtWidgets.QLabel(self.groupBox)
self.label.setGeometry(QtCore.QRect(30, 50, 81, 21))
self.label.setObjectName("label")
self.label_2 = QtWidgets.QLabel(self.groupBox)
self.label_2.setGeometry(QtCore.QRect(30, 110, 91, 21))
self.label_2.setObjectName("label_2")
self.Login_btn = QtWidgets.QPushButton(self.groupBox)
self.Login_btn.setGeometry(QtCore.QRect(210, 160, 93, 28))
self.Login_btn.setObjectName("Login_btn")
self.Login_btn.clicked.connect(self.login)
self.Username = QtWidgets.QLineEdit(self.groupBox)
self.Username.setGeometry(QtCore.QRect(140, 50, 151, 22))
self.Username.setObjectName("Username")
self.Password = QtWidgets.QLineEdit(self.groupBox)
self.Password.setGeometry(QtCore.QRect(140, 110, 151, 22))
self.Password.setEchoMode(QtWidgets.QLineEdit.Password)
self.Password.setObjectName("Password")
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "Password Management System"))
self.groupBox.setTitle(_translate("Form", "Login"))
self.label.setText(_translate("Form", "USERNAME :"))
self.label_2.setText(_translate("Form", "PASSWORD :"))
self.Login_btn.setText(_translate("Form", "LOGIN"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
Form = QtWidgets.QWidget()
ui = Ui_Form()
ui.setupUi(Form)
Form.show()
sys.exit(app.exec_())