saved preview picture
This commit is contained in:
29
screens/login_screen.py
Normal file
29
screens/login_screen.py
Normal file
@@ -0,0 +1,29 @@
|
||||
from kivy.uix.screenmanager import Screen
|
||||
from kivy.uix.boxlayout import BoxLayout
|
||||
from kivy.uix.label import Label
|
||||
from kivy.uix.button import Button
|
||||
from kivy.uix.popup import Popup
|
||||
from kivy.uix.image import Image
|
||||
from kivy.uix.behaviors import ButtonBehavior
|
||||
from kivy.clock import Clock
|
||||
import os
|
||||
import json
|
||||
from config import RESOURCES_FOLDER, CREDENTIALS_FILE
|
||||
from utils import encrypt_data, decrypt_data, check_server_settings, save_server_settings, test_connection
|
||||
|
||||
|
||||
class LoginScreen(Screen):
|
||||
def login(self):
|
||||
username = self.ids.username_input.text.strip()
|
||||
password = self.ids.username_input.text.strip()
|
||||
|
||||
if not username or not password:
|
||||
self.manager.get_screen("home").ids.result_label.text = "Please fill in all fields."
|
||||
return
|
||||
|
||||
credentials = {"username": username, "password": password}
|
||||
encrypted_data = encrypt_data(json.dumps(credentials))
|
||||
with open(CREDENTIALS_FILE, "wb") as file:
|
||||
file.write(encrypted_data)
|
||||
|
||||
self.manager.current = "home"
|
||||
Reference in New Issue
Block a user