1
0
Fork 0
forked from Fuji/Fuji

Add restart button to snackbar on Settings page

This commit is contained in:
mily 2025-03-07 21:35:57 +01:00
parent ed6d3f1df4
commit 50a52ce311
2 changed files with 17 additions and 3 deletions

View file

@ -2,6 +2,9 @@ import keyring
import os
from pathlib import Path
import configparser
import subprocess
import sys
import flet as ft
def saveauth(service, username, data, chunk_size=1000):
chunks = [data[i:i+chunk_size] for i in range(0, len(data), chunk_size)]
@ -55,4 +58,9 @@ def setlanguage(lang):
config["Settings"]["language"] = "en"
with open(f"{getconfigpath()}/config.ini", "w") as file:
config.write(file)
config.write(file)
def restart(page: ft.Page):
python = sys.executable
subprocess.Popen([python] + sys.argv)
page.window.destroy()