Beispiel #1
0
def login_gui(username, password):
    def get_login(evt=None):
        temp_username = username_holder.get()
        temp_password = password_holder.get()
        if remember_login_holder.get():
            logon_file = open("dep.dat", "w")
            logon_file.write(encodestring(temp_username+" "+temp_password))
            logon_file.close()
        elif os.path.isfile("dep.dat"):
            os.remove("dep.dat")
        login_tk.destroy()
        wrap.login(temp_username, temp_password)
        overview_gui()
        return

    def on_checkbox_flip():
        if remember_login_holder.get():
            logon_file = open("dep.dat", "w")
            logon_file.write(encodestring(username_holder.get()+" "+password_holder.get()))
            logon_file.close()
        else:
            if os.path.isfile("dep.dat"):
                os.remove("dep.dat")
        return

    login_tk = Tk()
    login_tk.title("Login Window")
    Label(login_tk, text="Login to GradeSpeed").pack(padx=50, pady=(10, 5))
    Label(login_tk, text="Username:"******"<Key-Return>", get_login)
    Label(login_tk, text="Password:"******"*")
    password_field.pack(padx=50, pady=(0, 5))
    password_field.bind("<Key-Return>", get_login)

    remember_login_holder = BooleanVar()
    remember_login_holder.set(len(username) > 0)
    login_frame = Frame(login_tk)
    Checkbutton(login_frame, text="Remember Logon", var=remember_login_holder, command=on_checkbox_flip).pack()
    login_frame.pack(pady=5)

    Button(text="Login", command=get_login).pack(padx=50, pady=(5, 10))
    center_gui(login_tk)

    login_tk.mainloop()
Beispiel #2
0
def specific_gui(link):
    gui = Tk()
    overview_frame(gui)
    specific_frame(gui, link)
    center_gui(gui)
    gui.mainloop()
Beispiel #3
0
def overview_gui():
    gui = Tk()
    overview_frame(gui)
    center_gui(gui)
    gui.mainloop()