예제 #1
0
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QMessageBox
import sys

import main2

sys.path.insert(0, '../DAL')
from handler import DataHandler

dh = DataHandler('../VMES.db')

sys.path.insert(0, '../UI')
import loginPage1, loginPage2


class Main(QtWidgets.QMainWindow, loginPage1.Ui_MainWindow):
    def __init__(self):
        super(Main, self).__init__()
        self.setupUi(self)
        self.btn1.clicked.connect(self.conti)

    def conti(self):
        user = self.blank_usr.text()
        user = user.replace(" ", "")
        print(user)

        exist = dh.AuthUser(user)
        print(exist)
        if (exist is True):
            username = user
            self.close()
예제 #2
0
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import QMessageBox
import sys, os

from handler import DataHandler

dh = DataHandler('VMES.db')

import temp_admin, enroll_ui, admin


class Main(QtWidgets.QMainWindow, enroll_ui.Ui_userRegistration):
    def __init__(self):
        super(Main, self).__init__()
        self.setupUi(self)
        self.save_reg.clicked.connect(self.getInfo)

    def getInfo(self):
        newUser = self.username_reg.text()
        passWord = self.pass_reg.text()
        passWord2 = self.pass2_reg.text()
        job = self.job_combo.currentText()
        if (passWord == passWord2):
            dh.AddUser(newUser, passWord, job)
            self.msg = QMessageBox()
            self.msg.setWindowTitle("ENROLLED SUCCESSFULY!")
            self.msg.setText("Thank You!")
            x = self.msg.exec()
            app = QtWidgets.QApplication.instance()
            app.closeAllWindows()
            self.win = admin.Main()
예제 #3
0
파일: example.py 프로젝트: Ritu7031/tkinter
    for i in range(len(list_data_for_category)):
        element = list_data_for_category[i]
        label = tkinter.Label(window, text=element)
        label.grid(column=0, row=i + 1)
        category_data_labels.append(label)


def Configure(event):
    canvas.configure(scrollregion=canvas.bbox(tkinter.ALL))


window = tkinter.Tk()
window.title('book')
canvas = tkinter.Canvas(window, bg='red')

window.geometry('100x100')
handler = DataHandler("data.json")
category_list = handler.get_categories()
print(category_list)
category_data_labels = []

for i in range(len(category_list)):
    element = category_list[i]
    command = partial(open_category, element)
    button = tkinter.Button(window, text=element, command=command)
    button.grid(row=0, column=i)
    s = tkinter.Scrollbar(window, command=canvas.yview)
    canvas.configure(yscrollcommand=s.set)

window.mainloop()