From 56bda55f2d9dfcfd658874af66a94f459412248c Mon Sep 17 00:00:00 2001 From: Kai Hang Chen <40642739+Kaihchen1230@users.noreply.github.com> Date: Sun, 11 Nov 2018 23:21:40 -0500 Subject: [PATCH 01/13] login window --- database.py | 21 ++++++++++++ login.py | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++ signup.py | 81 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 199 insertions(+) create mode 100644 database.py create mode 100644 login.py create mode 100644 signup.py diff --git a/database.py b/database.py new file mode 100644 index 0000000..4222833 --- /dev/null +++ b/database.py @@ -0,0 +1,21 @@ +import sqlite3 + +def createTable(): + connection = sqlite3.connect("login.db") + + connection.execute("CREATE TABLE USERS(username TEXT NOT NULL, email TEXT, password TEXT)") + + connection.execute("INSERT INTO USERS VALUES(?,?,?)",('abc','abc@gmail.com','abc123')) + + connection.commit() + result = connection.execute("SELECT * FROM USERS") + + for data in result: + print("Username: ", data[0]) + print("Email: ", data[1]) + print("Password: ", data[2]) + + connection.close() + + +createTable() diff --git a/login.py b/login.py new file mode 100644 index 0000000..bd52707 --- /dev/null +++ b/login.py @@ -0,0 +1,97 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'login.ui' +# +# Created by: PyQt5 UI code generator 5.9.2 +# +# WARNING! All changes made in this file will be lost! +import sqlite3 + +from PyQt5 import QtCore, QtGui, QtWidgets + +class Ui_Dialog(object): + def setupUi(self, Dialog): + Dialog.setObjectName("Dialog") + Dialog.resize(637, 477) + self.label_2 = QtWidgets.QLabel(Dialog) + self.label_2.setGeometry(QtCore.QRect(160, 170, 91, 21)) + self.label_2.setObjectName("label_2") + self.label_3 = QtWidgets.QLabel(Dialog) + self.label_3.setGeometry(QtCore.QRect(160, 220, 91, 21)) + self.label_3.setObjectName("label_3") + self.username_field = QtWidgets.QLineEdit(Dialog) + self.username_field.setGeometry(QtCore.QRect(240, 170, 201, 22)) + self.username_field.setText("") + self.username_field.setObjectName("username_field") + self.password_field = QtWidgets.QLineEdit(Dialog) + self.password_field.setGeometry(QtCore.QRect(240, 220, 201, 22)) + self.password_field.setObjectName("password_field") + self.login_button = QtWidgets.QPushButton(Dialog) + self.login_button.setGeometry(QtCore.QRect(290, 280, 93, 28)) + self.login_button.setObjectName("login_button") + ################################## Login_button event ########################### + self.login_button.clicked.connect(self.loginCheck) + ################################################################################# + + self.signup_button = QtWidgets.QPushButton(Dialog) + self.signup_button.setGeometry(QtCore.QRect(290, 320, 93, 28)) + self.signup_button.setObjectName("signup_button") + ################################## signup_button event ########################### + #self.signup_button.clicked.connect(self.signupCheck) + ################################################################################# + self.label = QtWidgets.QLabel(Dialog) + self.label.setGeometry(QtCore.QRect(210, 60, 211, 91)) + self.label.setMinimumSize(QtCore.QSize(5, 0)) + self.label.setBaseSize(QtCore.QSize(40, 16)) + font = QtGui.QFont() + font.setPointSize(20) + font.setBold(False) + font.setItalic(False) + font.setUnderline(False) + font.setWeight(50) + font.setStrikeOut(False) + font.setStyleStrategy(QtGui.QFont.PreferAntialias) + self.label.setFont(font) + self.label.setFocusPolicy(QtCore.Qt.NoFocus) + self.label.setContextMenuPolicy(QtCore.Qt.NoContextMenu) + self.label.setTextFormat(QtCore.Qt.AutoText) + self.label.setAlignment(QtCore.Qt.AlignCenter) + self.label.setObjectName("label") + + self.retranslateUi(Dialog) + QtCore.QMetaObject.connectSlotsByName(Dialog) + + + def loginCheck(self): + username = self.username_field.text() + password = self.password_field.text() + + connection = sqlite3.connect("login.db") + result = connection.execute("SELECT * FROM USERS WHERE username = ? AND password = ?", (username, password)) + + if len(result.fetchall()) > 0: + print("User Found!") + else: + print("User Not Found!") + + def signupCheck(self): + print("Signup button clicked") + + def retranslateUi(self, Dialog): + _translate = QtCore.QCoreApplication.translate + Dialog.setWindowTitle(_translate("Dialog", "Dialog")) + self.label_2.setText(_translate("Dialog", "Username: ")) + self.label_3.setText(_translate("Dialog", "Password: ")) + self.login_button.setText(_translate("Dialog", "Login")) + self.signup_button.setText(_translate("Dialog", "Sign Up")) + self.label.setText(_translate("Dialog", "Login Page")) + + +if __name__ == "__main__": + import sys + app = QtWidgets.QApplication(sys.argv) + Dialog = QtWidgets.QDialog() + ui = Ui_Dialog() + ui.setupUi(Dialog) + Dialog.show() + sys.exit(app.exec_()) diff --git a/signup.py b/signup.py new file mode 100644 index 0000000..33516dc --- /dev/null +++ b/signup.py @@ -0,0 +1,81 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'signup.ui' +# +# Created by: PyQt5 UI code generator 5.9.2 +# +# WARNING! All changes made in this file will be lost! + +from PyQt5 import QtCore, QtGui, QtWidgets + +class Ui_Dialog(object): + def setupUi(self, Dialog): + Dialog.setObjectName("Dialog") + Dialog.resize(639, 466) + self.password_label = QtWidgets.QLabel(Dialog) + self.password_label.setGeometry(QtCore.QRect(160, 180, 91, 21)) + self.password_label.setObjectName("password_label") + self.email_field = QtWidgets.QLineEdit(Dialog) + self.email_field.setGeometry(QtCore.QRect(240, 180, 201, 22)) + self.email_field.setObjectName("email_field") + self.username_label = QtWidgets.QLabel(Dialog) + self.username_label.setGeometry(QtCore.QRect(160, 130, 91, 21)) + self.username_label.setObjectName("username_label") + self.username_field = QtWidgets.QLineEdit(Dialog) + self.username_field.setGeometry(QtCore.QRect(240, 130, 201, 22)) + self.username_field.setText("") + self.username_field.setObjectName("username_field") + self.password_field = QtWidgets.QLineEdit(Dialog) + self.password_field.setGeometry(QtCore.QRect(240, 230, 201, 22)) + self.password_field.setStatusTip("") + self.password_field.setInputMask("") + self.password_field.setText("") + self.password_field.setPlaceholderText("") + self.password_field.setObjectName("password_field") + self.password_label_2 = QtWidgets.QLabel(Dialog) + self.password_label_2.setGeometry(QtCore.QRect(160, 230, 91, 21)) + self.password_label_2.setObjectName("password_label_2") + self.signup_button = QtWidgets.QPushButton(Dialog) + self.signup_button.setGeometry(QtCore.QRect(280, 290, 93, 28)) + self.signup_button.setObjectName("signup_button") + self.label = QtWidgets.QLabel(Dialog) + self.label.setGeometry(QtCore.QRect(180, 30, 271, 91)) + self.label.setMinimumSize(QtCore.QSize(5, 0)) + self.label.setBaseSize(QtCore.QSize(40, 16)) + font = QtGui.QFont() + font.setPointSize(20) + font.setBold(False) + font.setItalic(False) + font.setUnderline(False) + font.setWeight(50) + font.setStrikeOut(False) + font.setStyleStrategy(QtGui.QFont.PreferAntialias) + self.label.setFont(font) + self.label.setFocusPolicy(QtCore.Qt.NoFocus) + self.label.setContextMenuPolicy(QtCore.Qt.NoContextMenu) + self.label.setTextFormat(QtCore.Qt.AutoText) + self.label.setAlignment(QtCore.Qt.AlignCenter) + self.label.setObjectName("label") + + self.retranslateUi(Dialog) + QtCore.QMetaObject.connectSlotsByName(Dialog) + + def retranslateUi(self, Dialog): + _translate = QtCore.QCoreApplication.translate + Dialog.setWindowTitle(_translate("Dialog", "Dialog")) + self.password_label.setText(_translate("Dialog", "Email: ")) + self.username_label.setText(_translate("Dialog", "Username: ")) + self.password_label_2.setText(_translate("Dialog", "Password: ")) + self.signup_button.setText(_translate("Dialog", "Sign Up")) + self.label.setText(_translate("Dialog", "Create Account")) + + +if __name__ == "__main__": + import sys + app = QtWidgets.QApplication(sys.argv) + Dialog = QtWidgets.QDialog() + ui = Ui_Dialog() + ui.setupUi(Dialog) + Dialog.show() + sys.exit(app.exec_()) + From 1494cb2f4c7ce58eb3d8588f52d5411383533ed2 Mon Sep 17 00:00:00 2001 From: Kai Hang Chen <40642739+Kaihchen1230@users.noreply.github.com> Date: Mon, 12 Nov 2018 10:46:10 -0500 Subject: [PATCH 02/13] Delete login.py --- login.py | 97 -------------------------------------------------------- 1 file changed, 97 deletions(-) delete mode 100644 login.py diff --git a/login.py b/login.py deleted file mode 100644 index bd52707..0000000 --- a/login.py +++ /dev/null @@ -1,97 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'login.ui' -# -# Created by: PyQt5 UI code generator 5.9.2 -# -# WARNING! All changes made in this file will be lost! -import sqlite3 - -from PyQt5 import QtCore, QtGui, QtWidgets - -class Ui_Dialog(object): - def setupUi(self, Dialog): - Dialog.setObjectName("Dialog") - Dialog.resize(637, 477) - self.label_2 = QtWidgets.QLabel(Dialog) - self.label_2.setGeometry(QtCore.QRect(160, 170, 91, 21)) - self.label_2.setObjectName("label_2") - self.label_3 = QtWidgets.QLabel(Dialog) - self.label_3.setGeometry(QtCore.QRect(160, 220, 91, 21)) - self.label_3.setObjectName("label_3") - self.username_field = QtWidgets.QLineEdit(Dialog) - self.username_field.setGeometry(QtCore.QRect(240, 170, 201, 22)) - self.username_field.setText("") - self.username_field.setObjectName("username_field") - self.password_field = QtWidgets.QLineEdit(Dialog) - self.password_field.setGeometry(QtCore.QRect(240, 220, 201, 22)) - self.password_field.setObjectName("password_field") - self.login_button = QtWidgets.QPushButton(Dialog) - self.login_button.setGeometry(QtCore.QRect(290, 280, 93, 28)) - self.login_button.setObjectName("login_button") - ################################## Login_button event ########################### - self.login_button.clicked.connect(self.loginCheck) - ################################################################################# - - self.signup_button = QtWidgets.QPushButton(Dialog) - self.signup_button.setGeometry(QtCore.QRect(290, 320, 93, 28)) - self.signup_button.setObjectName("signup_button") - ################################## signup_button event ########################### - #self.signup_button.clicked.connect(self.signupCheck) - ################################################################################# - self.label = QtWidgets.QLabel(Dialog) - self.label.setGeometry(QtCore.QRect(210, 60, 211, 91)) - self.label.setMinimumSize(QtCore.QSize(5, 0)) - self.label.setBaseSize(QtCore.QSize(40, 16)) - font = QtGui.QFont() - font.setPointSize(20) - font.setBold(False) - font.setItalic(False) - font.setUnderline(False) - font.setWeight(50) - font.setStrikeOut(False) - font.setStyleStrategy(QtGui.QFont.PreferAntialias) - self.label.setFont(font) - self.label.setFocusPolicy(QtCore.Qt.NoFocus) - self.label.setContextMenuPolicy(QtCore.Qt.NoContextMenu) - self.label.setTextFormat(QtCore.Qt.AutoText) - self.label.setAlignment(QtCore.Qt.AlignCenter) - self.label.setObjectName("label") - - self.retranslateUi(Dialog) - QtCore.QMetaObject.connectSlotsByName(Dialog) - - - def loginCheck(self): - username = self.username_field.text() - password = self.password_field.text() - - connection = sqlite3.connect("login.db") - result = connection.execute("SELECT * FROM USERS WHERE username = ? AND password = ?", (username, password)) - - if len(result.fetchall()) > 0: - print("User Found!") - else: - print("User Not Found!") - - def signupCheck(self): - print("Signup button clicked") - - def retranslateUi(self, Dialog): - _translate = QtCore.QCoreApplication.translate - Dialog.setWindowTitle(_translate("Dialog", "Dialog")) - self.label_2.setText(_translate("Dialog", "Username: ")) - self.label_3.setText(_translate("Dialog", "Password: ")) - self.login_button.setText(_translate("Dialog", "Login")) - self.signup_button.setText(_translate("Dialog", "Sign Up")) - self.label.setText(_translate("Dialog", "Login Page")) - - -if __name__ == "__main__": - import sys - app = QtWidgets.QApplication(sys.argv) - Dialog = QtWidgets.QDialog() - ui = Ui_Dialog() - ui.setupUi(Dialog) - Dialog.show() - sys.exit(app.exec_()) From 2ffd045786509fd7f0cb16b408a0e1a98acf626d Mon Sep 17 00:00:00 2001 From: Kai Hang Chen <40642739+Kaihchen1230@users.noreply.github.com> Date: Mon, 12 Nov 2018 10:49:35 -0500 Subject: [PATCH 03/13] Add files via upload --- login.py | 116 ++++++++++++++++++++++++++++++++++++++++++ login.ui | 151 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 267 insertions(+) create mode 100644 login.py create mode 100644 login.ui diff --git a/login.py b/login.py new file mode 100644 index 0000000..7b439b8 --- /dev/null +++ b/login.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'login.ui' +# +# Created by: PyQt5 UI code generator 5.9.2 +# +# WARNING! All changes made in this file will be lost! + +from PyQt5 import QtCore, QtGui, QtWidgets +from welcome import Ui_MainWindow +import sqlite3 + +class Ui_Dialog(object): + def setupUi(self, Dialog): + Dialog.setObjectName("Dialog") + Dialog.resize(637, 477) + Dialog.setStyleSheet("QDialog{\n" +" background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(255, 170, 0, 255), stop:1 rgba(255, 255, 255, 255))\n" +"}\n" +"QPushButton{\n" +" background-color:rgb(255, 255, 255)\n" +" border: none;\n" +"}") + self.label_2 = QtWidgets.QLabel(Dialog) + self.label_2.setGeometry(QtCore.QRect(160, 170, 91, 21)) + self.label_2.setObjectName("label_2") + self.label_3 = QtWidgets.QLabel(Dialog) + self.label_3.setGeometry(QtCore.QRect(160, 220, 91, 21)) + self.label_3.setObjectName("label_3") + self.username_field = QtWidgets.QLineEdit(Dialog) + self.username_field.setGeometry(QtCore.QRect(240, 170, 201, 22)) + self.username_field.setText("") + self.username_field.setObjectName("username_field") + self.password_field = QtWidgets.QLineEdit(Dialog) + self.password_field.setGeometry(QtCore.QRect(240, 220, 201, 22)) + self.password_field.setObjectName("password_field") + ################################################################### + + self.login_button = QtWidgets.QPushButton(Dialog) + self.login_button.setGeometry(QtCore.QRect(290, 280, 93, 28)) + self.login_button.setObjectName("login_button") + ###########################3 Login button event ######################## + self.login_button.clicked.connect(self.login_check) + ######################################################################## + self.signup_button = QtWidgets.QPushButton(Dialog) + self.signup_button.setGeometry(QtCore.QRect(290, 320, 93, 28)) + self.signup_button.setObjectName("signup_button") + #########################3 Signup button event ######################## + self.signup_button.clicked.connect(self.signup_check) + ####################################################################### + self.login_page_label = QtWidgets.QLabel(Dialog) + self.login_page_label.setGeometry(QtCore.QRect(210, 60, 211, 91)) + self.login_page_label.setMinimumSize(QtCore.QSize(5, 0)) + self.login_page_label.setBaseSize(QtCore.QSize(40, 16)) + font = QtGui.QFont() + font.setPointSize(20) + font.setBold(False) + font.setItalic(False) + font.setUnderline(False) + font.setWeight(50) + font.setStrikeOut(False) + font.setStyleStrategy(QtGui.QFont.PreferAntialias) + self.login_page_label.setFont(font) + self.login_page_label.setFocusPolicy(QtCore.Qt.NoFocus) + self.login_page_label.setContextMenuPolicy(QtCore.Qt.NoContextMenu) + self.login_page_label.setTextFormat(QtCore.Qt.AutoText) + self.login_page_label.setAlignment(QtCore.Qt.AlignCenter) + self.login_page_label.setObjectName("login_page_label") + + self.retranslateUi(Dialog) + QtCore.QMetaObject.connectSlotsByName(Dialog) + + + def login_check(self): + username = self.username_field.text() + password = self.password_field.text() + + connection = sqlite3.connect("login.db") + result = connection.execute("SELECT * FROM USERS WHERE username = ? AND password = ?", (username, password)) + if result.fetchall(): + print("USER FOUND!") + self.welcomeWindowShow() + else: + print("USER NOT FOUND") + + connection.close() + + def welcomeWindowShow(self): + self.welcomeWindow = QtWidgets.QMainWindow() + self.ui = Ui_MainWindow() + self.ui.setupUi(self.welcomeWindow) + Dialog.hide() + self.welcomeWindow.show() + + def signup_check(self): + print("signup button is clicked") + + + def retranslateUi(self, Dialog): + _translate = QtCore.QCoreApplication.translate + Dialog.setWindowTitle(_translate("Dialog", "Dialog")) + self.label_2.setText(_translate("Dialog", "Username: ")) + self.label_3.setText(_translate("Dialog", "Password: ")) + self.login_button.setText(_translate("Dialog", "Login")) + self.signup_button.setText(_translate("Dialog", "Sign Up")) + self.login_page_label.setText(_translate("Dialog", "Login Page")) + + +if __name__ == "__main__": + import sys + app = QtWidgets.QApplication(sys.argv) + Dialog = QtWidgets.QDialog() + ui = Ui_Dialog() + ui.setupUi(Dialog) + Dialog.show() + sys.exit(app.exec_()) diff --git a/login.ui b/login.ui new file mode 100644 index 0000000..d241e97 --- /dev/null +++ b/login.ui @@ -0,0 +1,151 @@ + + + Dialog + + + + 0 + 0 + 637 + 477 + + + + Dialog + + + QDialog{ + background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(255, 170, 0, 255), stop:1 rgba(255, 255, 255, 255)) +} +QPushButton{ + background-color:rgb(255, 255, 255) + border: none; +} + + + + + 160 + 170 + 91 + 21 + + + + Username: + + + + + + 160 + 220 + 91 + 21 + + + + Password: + + + + + + 240 + 170 + 201 + 22 + + + + + + + + + + 240 + 220 + 201 + 22 + + + + + + + 290 + 280 + 93 + 28 + + + + Login + + + + + + 290 + 320 + 93 + 28 + + + + Sign Up + + + + + + 210 + 60 + 211 + 91 + + + + + 5 + 0 + + + + + 40 + 16 + + + + + 20 + 50 + false + false + false + false + PreferAntialias + + + + Qt::NoFocus + + + Qt::NoContextMenu + + + Login Page + + + Qt::AutoText + + + Qt::AlignCenter + + + + + + From 989e29bbd960d13196cf1fd3eaecb13624cd6794 Mon Sep 17 00:00:00 2001 From: Kai Hang Chen <40642739+Kaihchen1230@users.noreply.github.com> Date: Mon, 12 Nov 2018 19:52:29 -0500 Subject: [PATCH 04/13] Add files via upload --- login.db | Bin 0 -> 8192 bytes welcome.py | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 login.db create mode 100644 welcome.py diff --git a/login.db b/login.db new file mode 100644 index 0000000000000000000000000000000000000000..6358daa6f6d9d931b90abb38f1e498bf444dc598 GIT binary patch literal 8192 zcmeI$y$ZrG5C`x}5u8N9q3U#-3L>a4;0M`?qHV#!C2ADGT4^iJzKT!dgZLn((NS;~ z{zr1j9f81aOZ>Ta$TaWbBvKg|>TtBp4xd$;UgKnI%l7+i{-pBr>*Z)d00Izz00bZa0SG_< i0uX=z1R(Gy0u529HtTA=F=M#TzXH0OI5I`AKX?J4k1j0$ literal 0 HcmV?d00001 diff --git a/welcome.py b/welcome.py new file mode 100644 index 0000000..7530168 --- /dev/null +++ b/welcome.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'welcome.ui' +# +# Created by: PyQt5 UI code generator 5.9.2 +# +# WARNING! All changes made in this file will be lost! + +from PyQt5 import QtCore, QtGui, QtWidgets + +class Ui_MainWindow(object): + def setupUi(self, MainWindow): + MainWindow.setObjectName("MainWindow") + MainWindow.resize(562, 368) + self.centralwidget = QtWidgets.QWidget(MainWindow) + self.centralwidget.setObjectName("centralwidget") + self.label = QtWidgets.QLabel(self.centralwidget) + self.label.setGeometry(QtCore.QRect(150, 110, 271, 91)) + self.label.setMinimumSize(QtCore.QSize(5, 0)) + self.label.setBaseSize(QtCore.QSize(40, 16)) + font = QtGui.QFont() + font.setPointSize(20) + font.setBold(False) + font.setItalic(False) + font.setUnderline(False) + font.setWeight(50) + font.setStrikeOut(False) + font.setStyleStrategy(QtGui.QFont.PreferAntialias) + self.label.setFont(font) + self.label.setFocusPolicy(QtCore.Qt.NoFocus) + self.label.setContextMenuPolicy(QtCore.Qt.NoContextMenu) + self.label.setTextFormat(QtCore.Qt.AutoText) + self.label.setAlignment(QtCore.Qt.AlignCenter) + self.label.setObjectName("label") + MainWindow.setCentralWidget(self.centralwidget) + + self.retranslateUi(MainWindow) + QtCore.QMetaObject.connectSlotsByName(MainWindow) + + def retranslateUi(self, MainWindow): + _translate = QtCore.QCoreApplication.translate + MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow")) + self.label.setText(_translate("MainWindow", "WELCOME!!!")) + + +if __name__ == "__main__": + import sys + app = QtWidgets.QApplication(sys.argv) + MainWindow = QtWidgets.QMainWindow() + ui = Ui_MainWindow() + ui.setupUi(MainWindow) + MainWindow.show() + sys.exit(app.exec_()) + From 0128e7c3bdad480a7326cc333d7f40f5ff0db981 Mon Sep 17 00:00:00 2001 From: Kai Hang Chen <40642739+Kaihchen1230@users.noreply.github.com> Date: Tue, 13 Nov 2018 23:46:28 -0500 Subject: [PATCH 05/13] Delete login.py --- login.py | 116 ------------------------------------------------------- 1 file changed, 116 deletions(-) delete mode 100644 login.py diff --git a/login.py b/login.py deleted file mode 100644 index 7b439b8..0000000 --- a/login.py +++ /dev/null @@ -1,116 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'login.ui' -# -# Created by: PyQt5 UI code generator 5.9.2 -# -# WARNING! All changes made in this file will be lost! - -from PyQt5 import QtCore, QtGui, QtWidgets -from welcome import Ui_MainWindow -import sqlite3 - -class Ui_Dialog(object): - def setupUi(self, Dialog): - Dialog.setObjectName("Dialog") - Dialog.resize(637, 477) - Dialog.setStyleSheet("QDialog{\n" -" background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(255, 170, 0, 255), stop:1 rgba(255, 255, 255, 255))\n" -"}\n" -"QPushButton{\n" -" background-color:rgb(255, 255, 255)\n" -" border: none;\n" -"}") - self.label_2 = QtWidgets.QLabel(Dialog) - self.label_2.setGeometry(QtCore.QRect(160, 170, 91, 21)) - self.label_2.setObjectName("label_2") - self.label_3 = QtWidgets.QLabel(Dialog) - self.label_3.setGeometry(QtCore.QRect(160, 220, 91, 21)) - self.label_3.setObjectName("label_3") - self.username_field = QtWidgets.QLineEdit(Dialog) - self.username_field.setGeometry(QtCore.QRect(240, 170, 201, 22)) - self.username_field.setText("") - self.username_field.setObjectName("username_field") - self.password_field = QtWidgets.QLineEdit(Dialog) - self.password_field.setGeometry(QtCore.QRect(240, 220, 201, 22)) - self.password_field.setObjectName("password_field") - ################################################################### - - self.login_button = QtWidgets.QPushButton(Dialog) - self.login_button.setGeometry(QtCore.QRect(290, 280, 93, 28)) - self.login_button.setObjectName("login_button") - ###########################3 Login button event ######################## - self.login_button.clicked.connect(self.login_check) - ######################################################################## - self.signup_button = QtWidgets.QPushButton(Dialog) - self.signup_button.setGeometry(QtCore.QRect(290, 320, 93, 28)) - self.signup_button.setObjectName("signup_button") - #########################3 Signup button event ######################## - self.signup_button.clicked.connect(self.signup_check) - ####################################################################### - self.login_page_label = QtWidgets.QLabel(Dialog) - self.login_page_label.setGeometry(QtCore.QRect(210, 60, 211, 91)) - self.login_page_label.setMinimumSize(QtCore.QSize(5, 0)) - self.login_page_label.setBaseSize(QtCore.QSize(40, 16)) - font = QtGui.QFont() - font.setPointSize(20) - font.setBold(False) - font.setItalic(False) - font.setUnderline(False) - font.setWeight(50) - font.setStrikeOut(False) - font.setStyleStrategy(QtGui.QFont.PreferAntialias) - self.login_page_label.setFont(font) - self.login_page_label.setFocusPolicy(QtCore.Qt.NoFocus) - self.login_page_label.setContextMenuPolicy(QtCore.Qt.NoContextMenu) - self.login_page_label.setTextFormat(QtCore.Qt.AutoText) - self.login_page_label.setAlignment(QtCore.Qt.AlignCenter) - self.login_page_label.setObjectName("login_page_label") - - self.retranslateUi(Dialog) - QtCore.QMetaObject.connectSlotsByName(Dialog) - - - def login_check(self): - username = self.username_field.text() - password = self.password_field.text() - - connection = sqlite3.connect("login.db") - result = connection.execute("SELECT * FROM USERS WHERE username = ? AND password = ?", (username, password)) - if result.fetchall(): - print("USER FOUND!") - self.welcomeWindowShow() - else: - print("USER NOT FOUND") - - connection.close() - - def welcomeWindowShow(self): - self.welcomeWindow = QtWidgets.QMainWindow() - self.ui = Ui_MainWindow() - self.ui.setupUi(self.welcomeWindow) - Dialog.hide() - self.welcomeWindow.show() - - def signup_check(self): - print("signup button is clicked") - - - def retranslateUi(self, Dialog): - _translate = QtCore.QCoreApplication.translate - Dialog.setWindowTitle(_translate("Dialog", "Dialog")) - self.label_2.setText(_translate("Dialog", "Username: ")) - self.label_3.setText(_translate("Dialog", "Password: ")) - self.login_button.setText(_translate("Dialog", "Login")) - self.signup_button.setText(_translate("Dialog", "Sign Up")) - self.login_page_label.setText(_translate("Dialog", "Login Page")) - - -if __name__ == "__main__": - import sys - app = QtWidgets.QApplication(sys.argv) - Dialog = QtWidgets.QDialog() - ui = Ui_Dialog() - ui.setupUi(Dialog) - Dialog.show() - sys.exit(app.exec_()) From f47c71fd0f65a8a5940f56cab132c557513fdb9e Mon Sep 17 00:00:00 2001 From: Kai Hang Chen <40642739+Kaihchen1230@users.noreply.github.com> Date: Tue, 13 Nov 2018 23:46:49 -0500 Subject: [PATCH 06/13] Delete login.db --- login.db | Bin 8192 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 login.db diff --git a/login.db b/login.db deleted file mode 100644 index 6358daa6f6d9d931b90abb38f1e498bf444dc598..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8192 zcmeI$y$ZrG5C`x}5u8N9q3U#-3L>a4;0M`?qHV#!C2ADGT4^iJzKT!dgZLn((NS;~ z{zr1j9f81aOZ>Ta$TaWbBvKg|>TtBp4xd$;UgKnI%l7+i{-pBr>*Z)d00Izz00bZa0SG_< i0uX=z1R(Gy0u529HtTA=F=M#TzXH0OI5I`AKX?J4k1j0$ From 3750ad69990a9ec22f924a4a194935827e7e1d11 Mon Sep 17 00:00:00 2001 From: Kai Hang Chen <40642739+Kaihchen1230@users.noreply.github.com> Date: Tue, 13 Nov 2018 23:46:58 -0500 Subject: [PATCH 07/13] Delete signup.py --- signup.py | 81 ------------------------------------------------------- 1 file changed, 81 deletions(-) delete mode 100644 signup.py diff --git a/signup.py b/signup.py deleted file mode 100644 index 33516dc..0000000 --- a/signup.py +++ /dev/null @@ -1,81 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'signup.ui' -# -# Created by: PyQt5 UI code generator 5.9.2 -# -# WARNING! All changes made in this file will be lost! - -from PyQt5 import QtCore, QtGui, QtWidgets - -class Ui_Dialog(object): - def setupUi(self, Dialog): - Dialog.setObjectName("Dialog") - Dialog.resize(639, 466) - self.password_label = QtWidgets.QLabel(Dialog) - self.password_label.setGeometry(QtCore.QRect(160, 180, 91, 21)) - self.password_label.setObjectName("password_label") - self.email_field = QtWidgets.QLineEdit(Dialog) - self.email_field.setGeometry(QtCore.QRect(240, 180, 201, 22)) - self.email_field.setObjectName("email_field") - self.username_label = QtWidgets.QLabel(Dialog) - self.username_label.setGeometry(QtCore.QRect(160, 130, 91, 21)) - self.username_label.setObjectName("username_label") - self.username_field = QtWidgets.QLineEdit(Dialog) - self.username_field.setGeometry(QtCore.QRect(240, 130, 201, 22)) - self.username_field.setText("") - self.username_field.setObjectName("username_field") - self.password_field = QtWidgets.QLineEdit(Dialog) - self.password_field.setGeometry(QtCore.QRect(240, 230, 201, 22)) - self.password_field.setStatusTip("") - self.password_field.setInputMask("") - self.password_field.setText("") - self.password_field.setPlaceholderText("") - self.password_field.setObjectName("password_field") - self.password_label_2 = QtWidgets.QLabel(Dialog) - self.password_label_2.setGeometry(QtCore.QRect(160, 230, 91, 21)) - self.password_label_2.setObjectName("password_label_2") - self.signup_button = QtWidgets.QPushButton(Dialog) - self.signup_button.setGeometry(QtCore.QRect(280, 290, 93, 28)) - self.signup_button.setObjectName("signup_button") - self.label = QtWidgets.QLabel(Dialog) - self.label.setGeometry(QtCore.QRect(180, 30, 271, 91)) - self.label.setMinimumSize(QtCore.QSize(5, 0)) - self.label.setBaseSize(QtCore.QSize(40, 16)) - font = QtGui.QFont() - font.setPointSize(20) - font.setBold(False) - font.setItalic(False) - font.setUnderline(False) - font.setWeight(50) - font.setStrikeOut(False) - font.setStyleStrategy(QtGui.QFont.PreferAntialias) - self.label.setFont(font) - self.label.setFocusPolicy(QtCore.Qt.NoFocus) - self.label.setContextMenuPolicy(QtCore.Qt.NoContextMenu) - self.label.setTextFormat(QtCore.Qt.AutoText) - self.label.setAlignment(QtCore.Qt.AlignCenter) - self.label.setObjectName("label") - - self.retranslateUi(Dialog) - QtCore.QMetaObject.connectSlotsByName(Dialog) - - def retranslateUi(self, Dialog): - _translate = QtCore.QCoreApplication.translate - Dialog.setWindowTitle(_translate("Dialog", "Dialog")) - self.password_label.setText(_translate("Dialog", "Email: ")) - self.username_label.setText(_translate("Dialog", "Username: ")) - self.password_label_2.setText(_translate("Dialog", "Password: ")) - self.signup_button.setText(_translate("Dialog", "Sign Up")) - self.label.setText(_translate("Dialog", "Create Account")) - - -if __name__ == "__main__": - import sys - app = QtWidgets.QApplication(sys.argv) - Dialog = QtWidgets.QDialog() - ui = Ui_Dialog() - ui.setupUi(Dialog) - Dialog.show() - sys.exit(app.exec_()) - From 5e9cf5b8c16c16540e0286ec8f1ffc543b16b331 Mon Sep 17 00:00:00 2001 From: Kai Hang Chen <40642739+Kaihchen1230@users.noreply.github.com> Date: Tue, 13 Nov 2018 23:47:34 -0500 Subject: [PATCH 08/13] Delete welcome.py --- welcome.py | 54 ------------------------------------------------------ 1 file changed, 54 deletions(-) delete mode 100644 welcome.py diff --git a/welcome.py b/welcome.py deleted file mode 100644 index 7530168..0000000 --- a/welcome.py +++ /dev/null @@ -1,54 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'welcome.ui' -# -# Created by: PyQt5 UI code generator 5.9.2 -# -# WARNING! All changes made in this file will be lost! - -from PyQt5 import QtCore, QtGui, QtWidgets - -class Ui_MainWindow(object): - def setupUi(self, MainWindow): - MainWindow.setObjectName("MainWindow") - MainWindow.resize(562, 368) - self.centralwidget = QtWidgets.QWidget(MainWindow) - self.centralwidget.setObjectName("centralwidget") - self.label = QtWidgets.QLabel(self.centralwidget) - self.label.setGeometry(QtCore.QRect(150, 110, 271, 91)) - self.label.setMinimumSize(QtCore.QSize(5, 0)) - self.label.setBaseSize(QtCore.QSize(40, 16)) - font = QtGui.QFont() - font.setPointSize(20) - font.setBold(False) - font.setItalic(False) - font.setUnderline(False) - font.setWeight(50) - font.setStrikeOut(False) - font.setStyleStrategy(QtGui.QFont.PreferAntialias) - self.label.setFont(font) - self.label.setFocusPolicy(QtCore.Qt.NoFocus) - self.label.setContextMenuPolicy(QtCore.Qt.NoContextMenu) - self.label.setTextFormat(QtCore.Qt.AutoText) - self.label.setAlignment(QtCore.Qt.AlignCenter) - self.label.setObjectName("label") - MainWindow.setCentralWidget(self.centralwidget) - - self.retranslateUi(MainWindow) - QtCore.QMetaObject.connectSlotsByName(MainWindow) - - def retranslateUi(self, MainWindow): - _translate = QtCore.QCoreApplication.translate - MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow")) - self.label.setText(_translate("MainWindow", "WELCOME!!!")) - - -if __name__ == "__main__": - import sys - app = QtWidgets.QApplication(sys.argv) - MainWindow = QtWidgets.QMainWindow() - ui = Ui_MainWindow() - ui.setupUi(MainWindow) - MainWindow.show() - sys.exit(app.exec_()) - From 863e23a6b9478ec03f907bc57edf7a1f19436f7d Mon Sep 17 00:00:00 2001 From: Kai Hang Chen <40642739+Kaihchen1230@users.noreply.github.com> Date: Tue, 13 Nov 2018 23:47:46 -0500 Subject: [PATCH 09/13] Delete login.ui --- login.ui | 151 ------------------------------------------------------- 1 file changed, 151 deletions(-) delete mode 100644 login.ui diff --git a/login.ui b/login.ui deleted file mode 100644 index d241e97..0000000 --- a/login.ui +++ /dev/null @@ -1,151 +0,0 @@ - - - Dialog - - - - 0 - 0 - 637 - 477 - - - - Dialog - - - QDialog{ - background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(255, 170, 0, 255), stop:1 rgba(255, 255, 255, 255)) -} -QPushButton{ - background-color:rgb(255, 255, 255) - border: none; -} - - - - - 160 - 170 - 91 - 21 - - - - Username: - - - - - - 160 - 220 - 91 - 21 - - - - Password: - - - - - - 240 - 170 - 201 - 22 - - - - - - - - - - 240 - 220 - 201 - 22 - - - - - - - 290 - 280 - 93 - 28 - - - - Login - - - - - - 290 - 320 - 93 - 28 - - - - Sign Up - - - - - - 210 - 60 - 211 - 91 - - - - - 5 - 0 - - - - - 40 - 16 - - - - - 20 - 50 - false - false - false - false - PreferAntialias - - - - Qt::NoFocus - - - Qt::NoContextMenu - - - Login Page - - - Qt::AutoText - - - Qt::AlignCenter - - - - - - From d97e889b0538116aaffc79d83d4faca6dda4a548 Mon Sep 17 00:00:00 2001 From: Kai Hang Chen <40642739+Kaihchen1230@users.noreply.github.com> Date: Tue, 13 Nov 2018 23:49:30 -0500 Subject: [PATCH 10/13] Add files via upload --- ...on-firebase-adminsdk-s87xq-87f7f802b7.json | 12 ++ database/firebase.py | 7 + login.py | 97 +++++++++++ login.ui | 154 ++++++++++++++++++ signup.py | 77 +++++++++ signup.ui | 141 ++++++++++++++++ 6 files changed, 488 insertions(+) create mode 100644 database/documentsharingapplication-firebase-adminsdk-s87xq-87f7f802b7.json create mode 100644 database/firebase.py create mode 100644 login.py create mode 100644 login.ui create mode 100644 signup.py create mode 100644 signup.ui diff --git a/database/documentsharingapplication-firebase-adminsdk-s87xq-87f7f802b7.json b/database/documentsharingapplication-firebase-adminsdk-s87xq-87f7f802b7.json new file mode 100644 index 0000000..21d7f61 --- /dev/null +++ b/database/documentsharingapplication-firebase-adminsdk-s87xq-87f7f802b7.json @@ -0,0 +1,12 @@ +{ + "type": "service_account", + "project_id": "documentsharingapplication", + "private_key_id": "87f7f802b79d9d0fdcc705475a1a6a47b1a2e536", + "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQD3Bw55gpPMfS+6\nWq3Hr3tZx2gz2/gSswF0op7bEZcDUevShvWpyw6ZDH13UQQAg3aDGXlRu8DTGtMb\n4Qnt5WqygQWudLO67PFRpEtOUSnWE3FvsHh0yj52cUOzDpjpvWWhoE4Jw0NNjq2r\ngjdwoS5ChgVusRzQ1OWUqrPXkW9DUUrpcOEXCuIl5IqNHd78jbhAQz+iOwxK0fc+\nsJypsYQevhMiDQjxODsv7JbpEtae4trqZrHoIPU6CwXor/mZ7q3mU7FaTgjzvMm4\npXxt67Yrri2FJrH+k4b5AeA/OtoV8j2jFDaGBJVaRb5/cXaZFwy0q0hNQca0XzPm\n+UpyCwd9AgMBAAECggEAHIebG1uCWF6o8XvhkCtrMp4+IacpCnfUFjVl5WUtrLt8\nYe8mVjrWb8SqhOo9bRXBzThW86KcjYUOlqyx6eDSJtWR42klDNSqtkQkUmI7U7ch\nJcYa01o8Ro+kQvzPmkc+gqEyAhykHEP7ONCsOHzVC+fQns0jx9aewUHJzX7Fe9+g\nkA0LOvT/4OTw9XeCwNNfZ/i086C+BK7qOolicmCQ1fN+TnOGVFkw4Gn6hB/+LMLn\nFNHYJxkW28vIPo8FE4kdxJK/FlaZ/pOTom3v0xxWDY4lwGYVS+lsuP/sI+AcPI15\nwbHTGFbzrcUDZTcib+oHdEnqZf4/6NNECshzX2dj/QKBgQD/d5h7dakU3CFSe6Mh\nI3TBn6CyYDWxZ/VVm5YUCdo3oZJrINmEkCGd7E1LXwDVzVYdZnqHPPKuXbPT14/a\nrf0Qqk6IDkmJpo2TVZdsGFC3EZ1msdbbcFk3a3mghmQy4g0UmsMBXNV+e8aTruIO\nV9XvIcmRnQ5YvCBs2NHXrOi/bwKBgQD3ivRkaatNlEdmqVM61+jTnCH/DuRj76Yc\n7/6Y3fjPMbO/eqmQW0mCUj0CnYA4MZojokN2bqorO1v2j+p1FO4EzvXIoVyGbpTX\nR157/R8IX22TBnTiOXHtQFQF00dplxJNa1zZf0spPnXtn2YN8rQZMy+vLs8mbuvZ\nnzwKbv8x0wKBgQCQ1RnirKMuS1qs66FhcTuJZllxp2/pYznIzgt40tkffv+Gsrn/\nGMOmR8jOeU7854vx4R6IO3qOdls0N9q7rLZzU0pwgkEYxA8xv224f9SK5XaqORrJ\nj9lUvR7YbjiyTEwEKXVy+VGkgsHjClvoq82C5FHltvfiQM3VR9s3/jR6CwKBgG4C\nZcv+He/zNqwMEf3zl/f6yiz0rFExXow7p9S9yOYje3NcCuEpgIiXDaAM6L+QY6T0\nZrDKS3u8/Iidup9ftsuSQi5wb5Mar7Dgeb/2ZIUvC54sX2NuDhBW50BTfcgSKEMZ\ntIDADmH87SG2Ff+a3ajZU5ax4cN9xfjHyEIGxAibAoGBAJBDvWKIKMGawmMqBE09\nDhVZB7iU5rRVrytri4rBAo6Z0VcbQLXzYR9jjQtk2O6o8imvxmnR1uoW/E7tov2F\nMKAfi+HrI5HSWuYQY/S1v/oJPkiyx76vGk8q6RSk9kjphbj+7TAIKsf7PMIdRk7M\nVFOnlAB6jf7basy/M07tPuFS\n-----END PRIVATE KEY-----\n", + "client_email": "firebase-adminsdk-s87xq@documentsharingapplication.iam.gserviceaccount.com", + "client_id": "106688117451794988068", + "auth_uri": "https://accounts.google.com/o/oauth2/auth", + "token_uri": "https://oauth2.googleapis.com/token", + "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", + "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-s87xq%40documentsharingapplication.iam.gserviceaccount.com" +} diff --git a/database/firebase.py b/database/firebase.py new file mode 100644 index 0000000..fc1902f --- /dev/null +++ b/database/firebase.py @@ -0,0 +1,7 @@ +import firebase_admin +from firebase_admin import credentials + +def initial(){ + cred = credentials.Certificate("path/to/serviceAccountKey.json") + firebase_admin.initialize_app(cred) +} diff --git a/login.py b/login.py new file mode 100644 index 0000000..0eadda0 --- /dev/null +++ b/login.py @@ -0,0 +1,97 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'login.ui' +# +# Created by: PyQt5 UI code generator 5.11.3 +# +# WARNING! All changes made in this file will be lost! + +from PyQt5 import QtCore, QtGui, QtWidgets +from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QMessageBox +from signup import Ui_Signup + +class Ui_Dialog(object): + + # event handler for signup button + def signup_check(self): + print("signup button is clicked") + + self.signupWindow = QtWidgets.QDialog() + self.ui = Ui_Signup() + self.ui.setupUi(self.signupWindow) + self.signupWindow.show() + + def setupUi(self, Dialog): + Dialog.setObjectName("Dialog") + Dialog.resize(637, 477) + Dialog.setStyleSheet("QDialog{\n" +" background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(255, 170, 0, 255), stop:1 rgba(255, 255, 255, 255))\n" +"}\n" +"QPushButton{\n" +" background-color:rgb(255, 255, 255)\n" +" border: none;\n" +"}") + self.label_2 = QtWidgets.QLabel(Dialog) + self.label_2.setGeometry(QtCore.QRect(160, 170, 91, 21)) + self.label_2.setObjectName("label_2") + self.label_3 = QtWidgets.QLabel(Dialog) + self.label_3.setGeometry(QtCore.QRect(160, 220, 91, 21)) + self.label_3.setObjectName("label_3") + self.email_field = QtWidgets.QLineEdit(Dialog) + self.email_field.setGeometry(QtCore.QRect(240, 170, 201, 22)) + self.email_field.setText("") + self.email_field.setObjectName("email_field") + self.password_field = QtWidgets.QLineEdit(Dialog) + self.password_field.setGeometry(QtCore.QRect(240, 220, 201, 22)) + self.password_field.setEchoMode(QtWidgets.QLineEdit.PasswordEchoOnEdit) + self.password_field.setObjectName("password_field") + self.login_button = QtWidgets.QPushButton(Dialog) + self.login_button.setGeometry(QtCore.QRect(290, 280, 93, 28)) + self.login_button.setObjectName("login_button") + self.signup_button = QtWidgets.QPushButton(Dialog) + self.signup_button.setGeometry(QtCore.QRect(290, 320, 93, 28)) + self.signup_button.setObjectName("signup_button") + #########################3 Signup button event ######################## + self.signup_button.clicked.connect(self.signup_check) + ####################################################################### + self.login_page_label = QtWidgets.QLabel(Dialog) + self.login_page_label.setGeometry(QtCore.QRect(220, 70, 211, 91)) + self.login_page_label.setMinimumSize(QtCore.QSize(5, 0)) + self.login_page_label.setBaseSize(QtCore.QSize(40, 16)) + font = QtGui.QFont() + font.setPointSize(41) + font.setBold(False) + font.setItalic(False) + font.setUnderline(False) + font.setWeight(50) + font.setStrikeOut(False) + font.setStyleStrategy(QtGui.QFont.PreferAntialias) + self.login_page_label.setFont(font) + self.login_page_label.setFocusPolicy(QtCore.Qt.NoFocus) + self.login_page_label.setContextMenuPolicy(QtCore.Qt.NoContextMenu) + self.login_page_label.setTextFormat(QtCore.Qt.AutoText) + self.login_page_label.setAlignment(QtCore.Qt.AlignCenter) + self.login_page_label.setObjectName("login_page_label") + + self.retranslateUi(Dialog) + QtCore.QMetaObject.connectSlotsByName(Dialog) + + def retranslateUi(self, Dialog): + _translate = QtCore.QCoreApplication.translate + Dialog.setWindowTitle(_translate("Dialog", "Dialog")) + self.label_2.setText(_translate("Dialog", "Email:")) + self.label_3.setText(_translate("Dialog", "Password: ")) + self.login_button.setText(_translate("Dialog", "Login")) + self.signup_button.setText(_translate("Dialog", "Sign Up")) + self.login_page_label.setText(_translate("Dialog", "Login Page")) + + + +if __name__ == "__main__": + import sys + app = QtWidgets.QApplication(sys.argv) + Dialog = QtWidgets.QDialog() + ui = Ui_Dialog() + ui.setupUi(Dialog) + Dialog.show() + sys.exit(app.exec_()) diff --git a/login.ui b/login.ui new file mode 100644 index 0000000..3607156 --- /dev/null +++ b/login.ui @@ -0,0 +1,154 @@ + + + Dialog + + + + 0 + 0 + 637 + 477 + + + + Dialog + + + QDialog{ + background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(255, 170, 0, 255), stop:1 rgba(255, 255, 255, 255)) +} +QPushButton{ + background-color:rgb(255, 255, 255) + border: none; +} + + + + + 160 + 170 + 91 + 21 + + + + Email: + + + + + + 160 + 220 + 91 + 21 + + + + Password: + + + + + + 240 + 170 + 201 + 22 + + + + + + + + + + 240 + 220 + 201 + 22 + + + + QLineEdit::PasswordEchoOnEdit + + + + + + 290 + 280 + 93 + 28 + + + + Login + + + + + + 290 + 320 + 93 + 28 + + + + Sign Up + + + + + + 220 + 70 + 211 + 91 + + + + + 5 + 0 + + + + + 40 + 16 + + + + + 41 + 50 + false + false + false + false + PreferAntialias + + + + Qt::NoFocus + + + Qt::NoContextMenu + + + Login Page + + + Qt::AutoText + + + Qt::AlignCenter + + + + + + diff --git a/signup.py b/signup.py new file mode 100644 index 0000000..2218c01 --- /dev/null +++ b/signup.py @@ -0,0 +1,77 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'signup.ui' +# +# Created by: PyQt5 UI code generator 5.11.3 +# +# WARNING! All changes made in this file will be lost! + +from PyQt5 import QtCore, QtGui, QtWidgets + +class Ui_Signup(object): + def setupUi(self, Dialog): + Dialog.setObjectName("Dialog") + Dialog.resize(629, 446) + Dialog.setStyleSheet("QDialog{\n" +" background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(255, 170, 0, 255), stop:1 rgba(255, 255, 255, 255))\n" +"}\n" +"QPushButton{\n" +" background-color:rgb(255, 255, 255)\n" +" border: none;\n" +"}") + self.email_field = QtWidgets.QLineEdit(Dialog) + self.email_field.setGeometry(QtCore.QRect(240, 150, 201, 22)) + self.email_field.setText("") + self.email_field.setObjectName("email_field") + self.label_3 = QtWidgets.QLabel(Dialog) + self.label_3.setGeometry(QtCore.QRect(160, 200, 91, 21)) + self.label_3.setObjectName("label_3") + self.signup_button = QtWidgets.QPushButton(Dialog) + self.signup_button.setGeometry(QtCore.QRect(290, 260, 93, 28)) + self.signup_button.setObjectName("signup_button") + self.label_2 = QtWidgets.QLabel(Dialog) + self.label_2.setGeometry(QtCore.QRect(160, 150, 91, 21)) + self.label_2.setObjectName("label_2") + self.password_field = QtWidgets.QLineEdit(Dialog) + self.password_field.setGeometry(QtCore.QRect(240, 200, 201, 22)) + self.password_field.setEchoMode(QtWidgets.QLineEdit.PasswordEchoOnEdit) + self.password_field.setObjectName("password_field") + self.login_page_label = QtWidgets.QLabel(Dialog) + self.login_page_label.setGeometry(QtCore.QRect(190, 30, 251, 91)) + self.login_page_label.setMinimumSize(QtCore.QSize(5, 0)) + self.login_page_label.setBaseSize(QtCore.QSize(40, 16)) + font = QtGui.QFont() + font.setPointSize(41) + font.setBold(False) + font.setItalic(False) + font.setUnderline(False) + font.setWeight(50) + font.setStrikeOut(False) + font.setStyleStrategy(QtGui.QFont.PreferAntialias) + self.login_page_label.setFont(font) + self.login_page_label.setFocusPolicy(QtCore.Qt.NoFocus) + self.login_page_label.setContextMenuPolicy(QtCore.Qt.NoContextMenu) + self.login_page_label.setTextFormat(QtCore.Qt.AutoText) + self.login_page_label.setAlignment(QtCore.Qt.AlignCenter) + self.login_page_label.setObjectName("login_page_label") + + self.retranslateUi(Dialog) + QtCore.QMetaObject.connectSlotsByName(Dialog) + + def retranslateUi(self, Dialog): + _translate = QtCore.QCoreApplication.translate + Dialog.setWindowTitle(_translate("Dialog", "Dialog")) + self.label_3.setText(_translate("Dialog", "Password: ")) + self.signup_button.setText(_translate("Dialog", "Sign Up")) + self.label_2.setText(_translate("Dialog", "Email:")) + self.login_page_label.setText(_translate("Dialog", "Sign Up Page")) + + +if __name__ == "__main__": + import sys + app = QtWidgets.QApplication(sys.argv) + Dialog = QtWidgets.QDialog() + ui = Ui_Signup() + ui.setupUi(Dialog) + Dialog.show() + sys.exit(app.exec_()) diff --git a/signup.ui b/signup.ui new file mode 100644 index 0000000..d768ab5 --- /dev/null +++ b/signup.ui @@ -0,0 +1,141 @@ + + + Dialog + + + + 0 + 0 + 629 + 446 + + + + Dialog + + + QDialog{ + background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(255, 170, 0, 255), stop:1 rgba(255, 255, 255, 255)) +} +QPushButton{ + background-color:rgb(255, 255, 255) + border: none; +} + + + + + 240 + 150 + 201 + 22 + + + + + + + + + + 160 + 200 + 91 + 21 + + + + Password: + + + + + + 290 + 260 + 93 + 28 + + + + Sign Up + + + + + + 160 + 150 + 91 + 21 + + + + Email: + + + + + + 240 + 200 + 201 + 22 + + + + QLineEdit::PasswordEchoOnEdit + + + + + + 190 + 30 + 251 + 91 + + + + + 5 + 0 + + + + + 40 + 16 + + + + + 41 + 50 + false + false + false + false + PreferAntialias + + + + Qt::NoFocus + + + Qt::NoContextMenu + + + Sign Up Page + + + Qt::AutoText + + + Qt::AlignCenter + + + + + + From 71897f0b4411154a6e9bb4f21853a23eb78d7048 Mon Sep 17 00:00:00 2001 From: Haoran He <41132644+hrGuTou@users.noreply.github.com> Date: Wed, 14 Nov 2018 01:10:49 -0500 Subject: [PATCH 11/13] Delete documentsharingapplication-firebase-adminsdk-s87xq-87f7f802b7.json --- ...plication-firebase-adminsdk-s87xq-87f7f802b7.json | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 database/documentsharingapplication-firebase-adminsdk-s87xq-87f7f802b7.json diff --git a/database/documentsharingapplication-firebase-adminsdk-s87xq-87f7f802b7.json b/database/documentsharingapplication-firebase-adminsdk-s87xq-87f7f802b7.json deleted file mode 100644 index 21d7f61..0000000 --- a/database/documentsharingapplication-firebase-adminsdk-s87xq-87f7f802b7.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "service_account", - "project_id": "documentsharingapplication", - "private_key_id": "87f7f802b79d9d0fdcc705475a1a6a47b1a2e536", - "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQD3Bw55gpPMfS+6\nWq3Hr3tZx2gz2/gSswF0op7bEZcDUevShvWpyw6ZDH13UQQAg3aDGXlRu8DTGtMb\n4Qnt5WqygQWudLO67PFRpEtOUSnWE3FvsHh0yj52cUOzDpjpvWWhoE4Jw0NNjq2r\ngjdwoS5ChgVusRzQ1OWUqrPXkW9DUUrpcOEXCuIl5IqNHd78jbhAQz+iOwxK0fc+\nsJypsYQevhMiDQjxODsv7JbpEtae4trqZrHoIPU6CwXor/mZ7q3mU7FaTgjzvMm4\npXxt67Yrri2FJrH+k4b5AeA/OtoV8j2jFDaGBJVaRb5/cXaZFwy0q0hNQca0XzPm\n+UpyCwd9AgMBAAECggEAHIebG1uCWF6o8XvhkCtrMp4+IacpCnfUFjVl5WUtrLt8\nYe8mVjrWb8SqhOo9bRXBzThW86KcjYUOlqyx6eDSJtWR42klDNSqtkQkUmI7U7ch\nJcYa01o8Ro+kQvzPmkc+gqEyAhykHEP7ONCsOHzVC+fQns0jx9aewUHJzX7Fe9+g\nkA0LOvT/4OTw9XeCwNNfZ/i086C+BK7qOolicmCQ1fN+TnOGVFkw4Gn6hB/+LMLn\nFNHYJxkW28vIPo8FE4kdxJK/FlaZ/pOTom3v0xxWDY4lwGYVS+lsuP/sI+AcPI15\nwbHTGFbzrcUDZTcib+oHdEnqZf4/6NNECshzX2dj/QKBgQD/d5h7dakU3CFSe6Mh\nI3TBn6CyYDWxZ/VVm5YUCdo3oZJrINmEkCGd7E1LXwDVzVYdZnqHPPKuXbPT14/a\nrf0Qqk6IDkmJpo2TVZdsGFC3EZ1msdbbcFk3a3mghmQy4g0UmsMBXNV+e8aTruIO\nV9XvIcmRnQ5YvCBs2NHXrOi/bwKBgQD3ivRkaatNlEdmqVM61+jTnCH/DuRj76Yc\n7/6Y3fjPMbO/eqmQW0mCUj0CnYA4MZojokN2bqorO1v2j+p1FO4EzvXIoVyGbpTX\nR157/R8IX22TBnTiOXHtQFQF00dplxJNa1zZf0spPnXtn2YN8rQZMy+vLs8mbuvZ\nnzwKbv8x0wKBgQCQ1RnirKMuS1qs66FhcTuJZllxp2/pYznIzgt40tkffv+Gsrn/\nGMOmR8jOeU7854vx4R6IO3qOdls0N9q7rLZzU0pwgkEYxA8xv224f9SK5XaqORrJ\nj9lUvR7YbjiyTEwEKXVy+VGkgsHjClvoq82C5FHltvfiQM3VR9s3/jR6CwKBgG4C\nZcv+He/zNqwMEf3zl/f6yiz0rFExXow7p9S9yOYje3NcCuEpgIiXDaAM6L+QY6T0\nZrDKS3u8/Iidup9ftsuSQi5wb5Mar7Dgeb/2ZIUvC54sX2NuDhBW50BTfcgSKEMZ\ntIDADmH87SG2Ff+a3ajZU5ax4cN9xfjHyEIGxAibAoGBAJBDvWKIKMGawmMqBE09\nDhVZB7iU5rRVrytri4rBAo6Z0VcbQLXzYR9jjQtk2O6o8imvxmnR1uoW/E7tov2F\nMKAfi+HrI5HSWuYQY/S1v/oJPkiyx76vGk8q6RSk9kjphbj+7TAIKsf7PMIdRk7M\nVFOnlAB6jf7basy/M07tPuFS\n-----END PRIVATE KEY-----\n", - "client_email": "firebase-adminsdk-s87xq@documentsharingapplication.iam.gserviceaccount.com", - "client_id": "106688117451794988068", - "auth_uri": "https://accounts.google.com/o/oauth2/auth", - "token_uri": "https://oauth2.googleapis.com/token", - "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", - "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-s87xq%40documentsharingapplication.iam.gserviceaccount.com" -} From d504640fef574dada2bda7655b1bcefb5e2599a3 Mon Sep 17 00:00:00 2001 From: Haoran He <41132644+hrGuTou@users.noreply.github.com> Date: Wed, 14 Nov 2018 01:11:07 -0500 Subject: [PATCH 12/13] Delete firebase.py --- database/firebase.py | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 database/firebase.py diff --git a/database/firebase.py b/database/firebase.py deleted file mode 100644 index fc1902f..0000000 --- a/database/firebase.py +++ /dev/null @@ -1,7 +0,0 @@ -import firebase_admin -from firebase_admin import credentials - -def initial(){ - cred = credentials.Certificate("path/to/serviceAccountKey.json") - firebase_admin.initialize_app(cred) -} From dc05467dfec3b927cc3cb01cca8fa831a84a5d35 Mon Sep 17 00:00:00 2001 From: Haoran He <41132644+hrGuTou@users.noreply.github.com> Date: Wed, 14 Nov 2018 01:14:39 -0500 Subject: [PATCH 13/13] Delete database.py --- database.py | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 database.py diff --git a/database.py b/database.py deleted file mode 100644 index 4222833..0000000 --- a/database.py +++ /dev/null @@ -1,21 +0,0 @@ -import sqlite3 - -def createTable(): - connection = sqlite3.connect("login.db") - - connection.execute("CREATE TABLE USERS(username TEXT NOT NULL, email TEXT, password TEXT)") - - connection.execute("INSERT INTO USERS VALUES(?,?,?)",('abc','abc@gmail.com','abc123')) - - connection.commit() - result = connection.execute("SELECT * FROM USERS") - - for data in result: - print("Username: ", data[0]) - print("Email: ", data[1]) - print("Password: ", data[2]) - - connection.close() - - -createTable()