-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5fe03b8
commit 4a91545
Showing
2 changed files
with
76 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,10 @@ | |
from tkcalendar import * | ||
import Modules.SignIn_Module.SignIn_page as SignIn | ||
import Modules.DeleteAccount.AccountDelete as Acc_delete | ||
import Modules.UserProfile.profile as profile | ||
from PIL import Image, ImageTk | ||
from tkinter import messagebox | ||
from tkinter import simpledialog | ||
|
||
|
||
con=sqlite3.Connection("My_database") | ||
cur=con.cursor() | ||
|
@@ -1071,7 +1074,78 @@ def change_theme(): | |
buttonTheme = Button(f1, text="Theme", command=change_theme,width=35).pack(anchor=S) | ||
|
||
def show_profile(): | ||
profile_window = profile.Profile() | ||
|
||
def exit_profile(): | ||
root1.destroy() | ||
messagebox.showinfo("Exited", "Close this Window") | ||
|
||
def show_password(): | ||
with open('BufferData\\CurrentUser\\password.txt', 'r') as f_password: | ||
stored_passwords = f_password.read().splitlines() | ||
|
||
messagebox.showinfo("Show Password", "Your password is: "+ str(stored_passwords)) | ||
|
||
def rename(): | ||
new_name = simpledialog.askstring("Rename", "Enter new name:") | ||
if new_name: | ||
name_label.config(text=new_name) | ||
|
||
def add_bio(): | ||
new_bio = simpledialog.askstring("Add Bio", "Enter your bio:") | ||
if new_bio: | ||
bio_label.config(text="Bio: " + new_bio) | ||
|
||
root1 = Toplevel(root) | ||
root1.title("User Profile") | ||
width = 520 | ||
height = 720 | ||
root1.geometry("%dx%d" % (width, height)) | ||
root1.configure(bg="#fbf3db") | ||
|
||
image = Image.open("Image\\userprofile.jpg") | ||
image = image.resize((200, 200)) | ||
profile_image = ImageTk.PhotoImage(image) | ||
|
||
# Create a Label widget to display the image | ||
label = Label(root1, image=profile_image) | ||
label.grid(row=0, column=0, padx=10, pady=10, sticky="nw") | ||
|
||
# Create a Label widget for the user's name | ||
name_label = Label(root1, text="Harsh", font=("Arial", 28), fg="black", bg="#fbf3db") | ||
name_label.grid(row=0, column=1, padx=10, sticky="sw") | ||
|
||
# Create a Label widget for the Date of Birth | ||
dob_label = Label(root1, text="Date of Birth: 05/06/2003", font=("Arial", 14), fg="black", bg="#fbf3db") | ||
dob_label.grid(row=1, column=1, padx=10, sticky="w") | ||
|
||
# Create a Label widget for the phone number | ||
phone_label = Label(root1, text="Phone: 1234567890", font=("Arial", 14), fg="black", bg="#fbf3db") | ||
phone_label.grid(row=2, column=1, padx=10, sticky="w") | ||
|
||
# Create a Label widget for the email address | ||
email_label = Label(root1, text="Email: [email protected]", font=("Arial", 14), fg="black", bg="#fbf3db", wraplength=400) | ||
email_label.grid(row=3, column=1, padx=10, sticky="w") | ||
|
||
# Create a yellow line using Canvas widget | ||
line_canvas = Canvas(root1, width=width, height=2, bg="#f7c92e", highlightthickness=0) | ||
line_canvas.grid(row=4, column=0, columnspan=2, pady=10) | ||
|
||
# Create a Label widget for the bio | ||
bio_label = Label(root1, text="Bio: you can add your bio here from add bio and after integration your bio from database will come here.", font=("Arial", 16), fg="black", bg="#fbf3db", wraplength=400) | ||
bio_label.grid(row=5, column=0, columnspan=2, padx=10, pady=10) | ||
|
||
# Create buttons | ||
delete_button = Button(root1, text="Exit", bg="#f7c92e", command=exit_profile) | ||
show_password_button = Button(root1, text="Show Password", bg="#f7c92e", command=show_password) | ||
rename_button = Button(root1, text="Rename", bg="#f7c92e", command=rename) | ||
add_bio_button = Button(root1, text="Add Bio", bg="#f7c92e", command=add_bio) | ||
|
||
# Position the buttons using the grid layout | ||
delete_button.grid(row=6, column=0, padx=10, pady=10, sticky="ew") | ||
show_password_button.grid(row=6, column=1, padx=10, pady=10, sticky="ew") | ||
rename_button.grid(row=7, column=0, padx=10, pady=10, sticky="ew") | ||
add_bio_button.grid(row=7, column=1, padx=10, pady=10, sticky="ew") | ||
|
||
|
||
buttonprofile = Button(f1, text="show profile", command=show_profile, width=35) | ||
buttonprofile.pack(anchor=W, padx=(20,0),pady=(100,0)) | ||
|
This file was deleted.
Oops, something went wrong.