debug login & barre outils + ajout nouvelles images
|
@ -3,12 +3,14 @@
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
from PIL import Image,ImageTk
|
||||||
|
from tkinter import *
|
||||||
DOSSIER_COURRANT = os.path.dirname(os.path.abspath(__file__))
|
DOSSIER_COURRANT = os.path.dirname(os.path.abspath(__file__))
|
||||||
DOSSIER_PARENT = os.path.dirname(DOSSIER_COURRANT)
|
DOSSIER_PARENT = os.path.dirname(DOSSIER_COURRANT)
|
||||||
sys.path.append(DOSSIER_PARENT)
|
sys.path.append(DOSSIER_PARENT)
|
||||||
from tkinter import *
|
|
||||||
import Auth.authentification as auth
|
import Auth.authentication as auth
|
||||||
from PIL import Image,ImageTk
|
|
||||||
|
|
||||||
class Login():
|
class Login():
|
||||||
"""Classe gérant l'affichage de la fenêtre de login"""
|
"""Classe gérant l'affichage de la fenêtre de login"""
|
||||||
|
@ -17,13 +19,9 @@ class Login():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
||||||
self.fenetre = Tk()
|
self.fenetre = Tk()
|
||||||
|
|
||||||
self.fenetre.title('login')
|
self.fenetre.title('login')
|
||||||
try:
|
|
||||||
self.fenetre.iconbitmap("..\\icon.ico")
|
|
||||||
except Exception:
|
|
||||||
self.fenetre.iconbitmap("icon.ico")
|
|
||||||
|
|
||||||
# Création de nos widgets
|
# Création de nos widgets
|
||||||
self.message = Label(self.fenetre, text="Merci de vous identifier")
|
self.message = Label(self.fenetre, text="Merci de vous identifier")
|
||||||
self.message.pack()
|
self.message.pack()
|
||||||
|
@ -49,4 +47,3 @@ class Login():
|
||||||
|
|
||||||
if auth.Auth.access == True:
|
if auth.Auth.access == True:
|
||||||
self.fenetre.destroy()
|
self.fenetre.destroy()
|
||||||
|
|
||||||
|
|
BIN
Images/Icone.ico
Normal file
After Width: | Height: | Size: 3.9 KiB |
BIN
Images/Logo.png
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
Images/add.png
Normal file
After Width: | Height: | Size: 744 B |
BIN
Images/browse.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
Images/quicktask.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
Images/quit.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
Images/stats.png
Normal file
After Width: | Height: | Size: 927 B |
|
@ -1,12 +1,13 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
DOSSIER_COURRANT = os.path.dirname(os.path.abspath(__file__))
|
|
||||||
DOSSIER_PARENT = os.path.dirname(DOSSIER_COURRANT)
|
|
||||||
sys.path.append(DOSSIER_PARENT)
|
|
||||||
from tkinter import *
|
from tkinter import *
|
||||||
from tkinter.messagebox import *
|
from tkinter.messagebox import *
|
||||||
from PIL import Image, ImageTk
|
from PIL import Image, ImageTk
|
||||||
|
DOSSIER_COURRANT = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
DOSSIER_PARENT = os.path.dirname(DOSSIER_COURRANT)
|
||||||
|
sys.path.append(DOSSIER_PARENT)
|
||||||
|
from Views.quickTask import QuickTask
|
||||||
|
|
||||||
|
|
||||||
class BarreOutils():
|
class BarreOutils():
|
||||||
|
@ -17,12 +18,7 @@ class BarreOutils():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
# céation de la fenetre
|
# céation de la fenetre
|
||||||
self.fenetre = Tk()
|
self.fenetre = Tk()
|
||||||
# icone fenetre
|
|
||||||
try:
|
|
||||||
self.fenetre.iconbitmap("..\icon.ico")
|
|
||||||
except Exception:
|
|
||||||
self.fenetre.iconbitmap("icon.ico")
|
|
||||||
|
|
||||||
# Booleen fermer : devient true quand on appuie sur le bouton deconnexion
|
# Booleen fermer : devient true quand on appuie sur le bouton deconnexion
|
||||||
self.fermer = False
|
self.fermer = False
|
||||||
# Dimension et position fenetre
|
# Dimension et position fenetre
|
||||||
|
@ -66,13 +62,13 @@ class BarreOutils():
|
||||||
graphe2 = "Menu\\graphe.png"
|
graphe2 = "Menu\\graphe.png"
|
||||||
loupe2 = "Menu\\loupe.jpg"
|
loupe2 = "Menu\\loupe.jpg"
|
||||||
plus2 = "Menu\\plus4.png"
|
plus2 = "Menu\\plus4.png"
|
||||||
|
|
||||||
################################################################################################################
|
################################################################################################################
|
||||||
try:
|
try:
|
||||||
image = Image.open(fleche)
|
image = Image.open("./Images/quicktask.png")
|
||||||
except Exception:
|
except Exception:
|
||||||
image = Image.open(fleche2)
|
image = Image.open(fleche2)
|
||||||
|
|
||||||
photo = ImageTk.PhotoImage(image)
|
photo = ImageTk.PhotoImage(image)
|
||||||
self.bouton_tache_rapide = Button(self.fenetre, image=photo,width=self.largeurBoutons,height=self.hauteurBoutons, command=self.open_taches_rapides)
|
self.bouton_tache_rapide = Button(self.fenetre, image=photo,width=self.largeurBoutons,height=self.hauteurBoutons, command=self.open_taches_rapides)
|
||||||
self.bouton_tache_rapide.grid(row=3,column=1, padx = self.largeur * 0.02)
|
self.bouton_tache_rapide.grid(row=3,column=1, padx = self.largeur * 0.02)
|
||||||
|
@ -80,7 +76,7 @@ class BarreOutils():
|
||||||
################################################################################################################
|
################################################################################################################
|
||||||
# Bouton Nouveau Projet
|
# Bouton Nouveau Projet
|
||||||
try:
|
try:
|
||||||
image = Image.open(plus)
|
image = Image.open("./Images/add.png")
|
||||||
except Exception:
|
except Exception:
|
||||||
image = Image.open(plus2)
|
image = Image.open(plus2)
|
||||||
photo = ImageTk.PhotoImage(image)
|
photo = ImageTk.PhotoImage(image)
|
||||||
|
@ -90,7 +86,7 @@ class BarreOutils():
|
||||||
################################################################################################################
|
################################################################################################################
|
||||||
# Bouton Rapports
|
# Bouton Rapports
|
||||||
try:
|
try:
|
||||||
image = Image.open(graphe)
|
image = Image.open("./Images/stats.png")
|
||||||
except Exception:
|
except Exception:
|
||||||
image = Image.open(graphe2)
|
image = Image.open(graphe2)
|
||||||
photo = ImageTk.PhotoImage(image)
|
photo = ImageTk.PhotoImage(image)
|
||||||
|
@ -100,7 +96,7 @@ class BarreOutils():
|
||||||
################################################################################################################
|
################################################################################################################
|
||||||
# Bouton Naviguer
|
# Bouton Naviguer
|
||||||
try:
|
try:
|
||||||
image = Image.open(loupe)
|
image = Image.open("./Images/browse.png")
|
||||||
except Exception:
|
except Exception:
|
||||||
image = Image.open(loupe2)
|
image = Image.open(loupe2)
|
||||||
photo = ImageTk.PhotoImage(image)
|
photo = ImageTk.PhotoImage(image)
|
||||||
|
@ -110,7 +106,7 @@ class BarreOutils():
|
||||||
################################################################################################################
|
################################################################################################################
|
||||||
# Bouton Deconnexion
|
# Bouton Deconnexion
|
||||||
try:
|
try:
|
||||||
image = Image.open(deco)
|
image = Image.open("./Images/quit.png")
|
||||||
except Exception:
|
except Exception:
|
||||||
image = Image.open(deco2)
|
image = Image.open(deco2)
|
||||||
photo = ImageTk.PhotoImage(image)
|
photo = ImageTk.PhotoImage(image)
|
||||||
|
@ -118,38 +114,35 @@ class BarreOutils():
|
||||||
self.bouton_deconnexion.grid(row=7,column=1)
|
self.bouton_deconnexion.grid(row=7,column=1)
|
||||||
self.bouton_deconnexion.image = photo
|
self.bouton_deconnexion.image = photo
|
||||||
################################################################################################################
|
################################################################################################################
|
||||||
def deconnexion(self,*args):
|
def deconnexion(self):
|
||||||
"""L'utilisateur veut fermer le programme et se deconnecter"""
|
"""L'utilisateur veut fermer le programme et se deconnecter"""
|
||||||
self.callback()
|
self.callback()
|
||||||
if self.fermer == True:
|
if self.fermer == True:
|
||||||
self.fenetre.destroy()
|
self.fenetre.destroy()
|
||||||
def open_taches_rapides(self,*args):
|
def open_taches_rapides(self):
|
||||||
"""L'utilisateur veut ouvrir la fenetre des taches rapides"""
|
"""L'utilisateur veut ouvrir la fenetre des taches rapides"""
|
||||||
toplevel = Toplevel(self.fenetre)
|
QuickTask(mother=self.fenetre)
|
||||||
toplevel.title('Subroot')
|
|
||||||
# TODO : ouvrir la fenetre des taches rapides
|
# TODO : ouvrir la fenetre des taches rapides
|
||||||
def open_nouveau_projet(self,*args):
|
def open_nouveau_projet(self):
|
||||||
"""L'utilisateur veut ouvrir la fenetre des nouveaux projets"""
|
"""L'utilisateur veut ouvrir la fenetre des nouveaux projets"""
|
||||||
# TODO : ouvrir la fenetre des nouveaux projets
|
# TODO : ouvrir la fenetre des nouveaux projets
|
||||||
def open_rapports(self,*args):
|
def open_rapports(self):
|
||||||
"""L'utilisateur veut ouvrir la fenetre des rapports"""
|
"""L'utilisateur veut ouvrir la fenetre des rapports"""
|
||||||
# TODO : ouvrir la fenetre des rapports
|
# TODO : ouvrir la fenetre des rapports
|
||||||
def naviguer(self,*args):
|
def naviguer(self):
|
||||||
"""L'utilisateur veut ouvrir la fenetre des rapports"""
|
"""L'utilisateur veut ouvrir la fenetre des rapports"""
|
||||||
# TODO : ouvrir la fenetre de navigation
|
# TODO : ouvrir la fenetre de navigation
|
||||||
self.fenetre.state('iconic')
|
self.fenetre.state('iconic')
|
||||||
|
|
||||||
def geoliste(self,g):
|
def geoliste(self, g):
|
||||||
r=[i for i in range(0,len(g)) if not g[i].isdigit()]
|
r=[i for i in range(0,len(g)) if not g[i].isdigit()]
|
||||||
return [int(g[0:r[0]]),int(g[r[0]+1:r[1]]),int(g[r[1]+1:r[2]]),int(g[r[2]+1:])]
|
return [int(g[0:r[0]]),int(g[r[0]+1:r[1]]),int(g[r[1]+1:r[2]]),int(g[r[2]+1:])]
|
||||||
|
|
||||||
def callback(self):
|
def callback(self):
|
||||||
if askyesno('Deconnexion', 'Êtes-vous sûr de vouloir vous deconnecter ?'):
|
self.fermer = askyesno('Deconnexion', 'Êtes-vous sûr de vouloir vous deconnecter ?')
|
||||||
self.fermer = True
|
|
||||||
else:
|
|
||||||
#showinfo('Titre 3', 'Vous avez peur!')
|
#showinfo('Titre 3', 'Vous avez peur!')
|
||||||
#showerror("Titre 4", "Aha")
|
#showerror("Titre 4", "Aha")
|
||||||
self.fermer = False
|
|
||||||
def resource_path(self, relative_path):
|
def resource_path(self, relative_path):
|
||||||
""" Get absolute path to resource, works for dev and for PyInstaller """
|
""" Get absolute path to resource, works for dev and for PyInstaller """
|
||||||
try:
|
try:
|
||||||
|
|
BIN
Menu/deco.jpg
Before Width: | Height: | Size: 9.3 KiB |
BIN
Menu/fleche.png
Before Width: | Height: | Size: 6.4 KiB |
BIN
Menu/graphe.png
Before Width: | Height: | Size: 8.3 KiB |
BIN
Menu/loupe.jpg
Before Width: | Height: | Size: 9.5 KiB |
BIN
Menu/plus4.png
Before Width: | Height: | Size: 42 KiB |