Passwortschutz eingeführt.
This commit is contained in:
24
main.py
24
main.py
@@ -1,5 +1,5 @@
|
|||||||
import tkinter as tk
|
import tkinter as tk
|
||||||
from tkinter import ttk, messagebox, PhotoImage
|
from tkinter import ttk, messagebox, PhotoImage, simpledialog
|
||||||
import customtkinter
|
import customtkinter
|
||||||
customtkinter.set_appearance_mode("light")
|
customtkinter.set_appearance_mode("light")
|
||||||
customtkinter.set_default_color_theme("blue")
|
customtkinter.set_default_color_theme("blue")
|
||||||
@@ -509,14 +509,20 @@ class ArduinoGUI:
|
|||||||
messagebox.showerror("Fehler", "Ausgewählte PID Konfiguration nicht gefunden.")
|
messagebox.showerror("Fehler", "Ausgewählte PID Konfiguration nicht gefunden.")
|
||||||
|
|
||||||
def on_closing(self):
|
def on_closing(self):
|
||||||
self.running = False
|
userInput = simpledialog.askstring("Masterpasswort eingeben", "Zum Ausführen dieses Befehls ist das Masterpasswort notwendig.\n")
|
||||||
if self.arduino:
|
if userInput == "changeme":
|
||||||
self.arduino.close()
|
self.running = False
|
||||||
self.communication_thread = None
|
if self.arduino:
|
||||||
if self.ser:
|
self.arduino.close()
|
||||||
self.ser.close()
|
self.communication_thread = None
|
||||||
self.root.quit()
|
if self.ser:
|
||||||
self.root.destroy()
|
self.ser.close()
|
||||||
|
self.root.quit()
|
||||||
|
self.root.destroy()
|
||||||
|
elif userInput == None:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
messagebox.showerror("Fehler", "Es wurde ein falsches Passwort eingegeben.")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
root = customtkinter.CTk()
|
root = customtkinter.CTk()
|
||||||
|
|||||||
Reference in New Issue
Block a user