예제 #1
0
 def login_button_click(self, event=None):
     con = connect('mycontacts.db')
     cur = con.cursor()
     cur.execute("select * from Login where Username = ? and Password = ?",
                 (self.username_entry.get(), self.password_entry.get()))
     row = cur.fetchone()
     if row is not None:
         self.destroy()
         home.HomeWindow()
     else:
         messagebox.showerror('Error Message', 'Invalid username/password')
예제 #2
0
 def login_button_click(self, event=None):
     con = connect('mycontact.db')
     cur = con.cursor()
     cur.execute("select *from Login where Username=? and Password=?",
                 (self.e1.get(), self.e2.get()))
     row = cur.fetchone()
     if row is not None:
         self.destroy()
         home.HomeWindow()
     else:
         messagebox.showerror("Error message", "Inavlid username/password")
예제 #3
0
 def login_button_click(self, event=None):
     con = connect('contacts.db')
     cur = con.cursor()
     cur.execute("""select * from Login 
     where username = '******' and Password = '******'""".format(
         self.username_entry.get(), self.password_entry.get()))
     row = cur.fetchone()
     if row is not None:
         self.destroy()
         home.HomeWindow()
     else:
         messagebox.showerror("Error Message",
                              "Incorrect username/password")
예제 #4
0
    app = PyQt5.QtWidgets.QApplication([])
    app_icon = PyQt5.QtGui.QIcon()

    bdd = BDD()
    translation = Lang()
    server = server.Server(bdd.get_param('sync/ip'),
                           int(float(bdd.get_param('sync/port'))),
                           bdd.get_param('sync/user'),
                           bdd.get_param('sync/password'), bdd)

    for icon_index in app_icons:
        icon_size = int(float(icon_index.replace('x', '')))
        app_icon.addFile(app_directory + os.sep + app_icons[icon_index],
                         QtCore.QSize(icon_size, icon_size))

    app.setWindowIcon(app_icon)
    if os.name == 'nt':
        myappid = app_id + '.library'
        ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)

    Home = home.HomeWindow(bdd, translation, sys.argv, env_vars)
    Home.exec_()
    ret = 0
    try:
        server.Close()
        ret = app.exec_()
    except Exception as err:
        traceback.print_exc()
    print("The End")
    sys.exit(ret)