Skip to content

Commit

Permalink
combobox do settings
Browse files Browse the repository at this point in the history
  • Loading branch information
dittko committed May 6, 2024
1 parent 6961e3b commit 59ff871
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ def prepareInterface(self):
self.root,
text="MailBuddy",
bg="lightblue",
font=(
"Helvetica",
24))
font=("Helvetica", 24))
label.pack(pady=20)

self.email_entry = Entry(self.root, bg="white", fg="black")
self.email_entry.pack(pady=5)
example_emails = ["[email protected]", "[email protected]", "[email protected]"]

self.email_combobox = Combobox(self.root, values=example_emails)
self.email_combobox.pack(pady=5)

connect_button = Button(
self.root,
Expand All @@ -46,7 +46,7 @@ def prepareInterface(self):

change_email_button = Button(
self.root,
text="Zmień adres mailowy",
text="Dodaj nowy adres mailowy",
bg="lightblue",
fg="black",
command=self.change_email)
Expand All @@ -61,21 +61,19 @@ def prepareInterface(self):
close_button.pack(pady=5)

def connect(self):
email = self.email_entry.get()
# TODO: implementacja połączenie z mailem
messagebox.showinfo("Połączenie", f"Połączono z {email}")
email = self.email_combobox.get()
# TODO: połączenie z pocztą
messagebox.showinfo("Połączenie", f"Połączono z {email}")

def change_email(self):
new_email = simpledialog.askstring(
"Zmień adres e mail ", "Dodaj nowy adres e mail ")
"Zmień adres e-mail", "Dodaj nowy adres e-mail")
if new_email:
self.email_entry.delete(0, END)
self.email_entry.insert(0, new_email)
self.email_combobox.set(new_email)

def close(self):
self.root.destroy()


class AppUI():
def __init__(self) -> None:
self.root = Tk()
Expand Down

0 comments on commit 59ff871

Please sign in to comment.