Commit 4f6d0fd6 authored by Thorfin89's avatar Thorfin89

Codage WIFI opérationnel

parent 296e1c54
......@@ -6,6 +6,7 @@ C'est en faite une interface graphique pour qrcode sous python.
## Paquets à installer :
- qrcode
- pillow
- tk-tools
## Codage d'un accès Wifi :
WIFI:T:*cryptage(nopass, WEP, WAPA)*;S:ssid;P:*motdepasse*;H:*caché(true)*
......
......@@ -5,6 +5,7 @@
from tkinter import *
from tkinter import messagebox
from tkinter.colorchooser import askcolor
from tk_tools import SmartSpinBox
import qrcode
from qrcode.constants import ERROR_CORRECT_M
......@@ -46,24 +47,33 @@ def set_fg_color():
create_qrcode()
def no_password(value):
if value == "Aucun":
titre_saisie_pass.config(state=DISABLED)
saisie_pass.delete(0, 'end')
saisie_pass.config(state=DISABLED)
else:
titre_saisie_pass.config(state=NORMAL)
saisie_pass.config(state=NORMAL)
def transfert():
if saisie_ssid.get() != "":
ssid = saisie_ssid.get()
crypt = choix_crypt.get()
password = saisie_pass.get()
# à remplacer par une checkbox avec commande de masquage du code
# SSID caché OUI/NON
if choix_cache.get() == "OUI":
cache = "True"
else:
cache = ""
texte_a_coder.delete(0, 'end')
code_wifi = "WIFI:T:" + crypt + ";S:" + ssid + ";P:" + password + ";H:" + cache
texte_a_coder.insert(0, code_wifi)
create_qrcode()
else :
else:
messagebox.showerror("Erreur", "Saisissez un SSID")
......@@ -183,15 +193,16 @@ titre_saisie_ssid.place(x=30, y=200)
saisie_ssid = Entry(left_frame, width=40)
saisie_ssid.place(x=30, y=225)
# Password
titre_saisie_pass = Label(left_frame, text='Mot de passe :', bg="#CCCCCC", state=DISABLED)
titre_saisie_pass = Label(left_frame, text='Mot de passe :', bg="#CCCCCC")
titre_saisie_pass.place(x=30, y=250)
saisie_pass = Entry(left_frame, width=40, state=DISABLED)
saisie_pass = Entry(left_frame, width=40)
saisie_pass.place(x=30, y=275)
# Cryptage
titre_choix_crypt = Label(left_frame, text='Cryptage :', bg="#CCCCCC")
titre_choix_crypt.place(x=300, y=200)
crypt_list = ["WPA", "WEP", "Aucun"]
choix_crypt = Spinbox(left_frame, values=crypt_list, width=8, justify=CENTER)
choix_crypt = SmartSpinBox(root, entry_type='str', width=8, justify=CENTER,
values=crypt_list, callback=no_password)
choix_crypt.place(x=300, y=225)
# Caché
titre_cache = Label(left_frame, text='Caché :', bg="#CCCCCC")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment