Skip to content

Commit

Permalink
Ajout connection rapide ( Front End )
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxenceR26 committed Feb 28, 2022
1 parent 32dc002 commit 9d4b1a6
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 9 deletions.
8 changes: 6 additions & 2 deletions data/users.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{
"Alban": {
"id": "Alban",
"email": "alban@gmail.com",
"email": "albanurt@gmail.com",
"mdp": "000000",
"money": "20"
},

"Admin": {
"id": "",
"mdp": ""
"email": "[email protected]",
"mdp": "",
"money": "20"
}

}
15 changes: 9 additions & 6 deletions source/app/BasePage/homeframe.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
import tkinter as tk

from source.app.Sys import set_color


class HomeFrame(tk.Frame):

def __init__(self, window):
super().__init__(window, width=599, height=584)
super().__init__(window, width=853, height=584)
self.window = window

self.history_canvas = tk.Canvas(self, height=853, width=853, background=set_color('lightgreen'),
highlightthickness=0)

self.history_canvas.create_rectangle(100, 50, 500, 504, fill=set_color('green'), width=5)

self.history_canvas.create_text(300, 50, text="Historique des transactions", font=('Roboto', 20, 'bold'),
self.history_canvas.create_text(555, 50, text="Historique des transactions", font=('Roboto', 20, 'bold'),
fill=set_color("darkgreen"))

self.left_widgets()
self.history_canvas.place(x=254, y=0)
self.history_canvas.pack()

def left_widgets(self):
canvas = tk.Canvas(self, width=257, height=585, bg=set_color("entrycolor"), highlightthickness=0)
canvas.create_line(1000, 0, -10, 0, fill=set_color("lightgreen"))
canvas.create_line(1000, 520, -10, 520, fill=set_color("lightgreen"))
canvas.place(x=0, y=0)

canvas.create_text(128.5, 555, text=self.window.user_connected, font=('Roboto', 13),
fill="white")

canvas.place(x=0,y=0)
34 changes: 33 additions & 1 deletion source/app/OnConnexion/connexion.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import json
import tkinter as tk
from source.app.Sys import set_color
from source.app.Sys import set_color, select_image


class ConnectionFrame(tk.Frame):
Expand Down Expand Up @@ -55,6 +55,37 @@ def __init__(self, window):
command=lambda: self.window.switch_frame('InscriptionFrame'), cursor='hand2')
inscription_button.place(x=474, y=245, width=122, height=30)

# Rapid connection

rapid_connect_text = tk.Label(self, text="Reconnecte-toi rapidement...", background=set_color("lightgreen"),
foreground=set_color("darkgreen"), font=('Roboto', 11, 'bold'))
rapid_connect_text.place(x=20, y=245)

profile_img = tk.PhotoImage(file=select_image("profile-base.png")).subsample(16)

# One

profile_one = tk.Button(self, image=profile_img, background=set_color('lightgreen'), cursor='hand2', bd=0,
activebackground=set_color('lightgreen'), command= lambda: print("1"))
profile_one.photo = profile_img
profile_one.place(x=20, y=280)

# Two

profile_two = tk.Button(self, image=profile_img, background=set_color('lightgreen'), cursor='hand2', bd=0,
activebackground=set_color('lightgreen'), command=lambda: print("2"))
profile_two.photo = profile_img
profile_two.place(x=105, y=280)

# Three

profile_three = tk.Button(self, image=profile_img, background=set_color('lightgreen'), cursor='hand2', bd=0,
activebackground=set_color('lightgreen'), command=lambda: print("3"))
profile_three.photo = profile_img
profile_three.place(x=190, y=280)



# Copyright

copyright_text = tk.Label(self, text="© 2022 GestMoney", background=set_color("lightgreen"),
Expand Down Expand Up @@ -82,6 +113,7 @@ def connect(self):

for user in users.values():
if user['id'] == entry_id and user['mdp'] == mdp:
self.window.user_connected = user['email']
self.window.switch_frame('BasePage')
return

Expand Down
1 change: 1 addition & 0 deletions source/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def __init__(self, window):
self.wm_overrideredirect(True)
self.x, self.y = None, None
self.title_frame = None
self.user_connected = None
self.main_frame = None
self.active_frame = None

Expand Down

0 comments on commit 9d4b1a6

Please sign in to comment.