Add restart button to snackbar on Settings page
This commit is contained in:
parent
ed6d3f1df4
commit
50a52ce311
2 changed files with 17 additions and 3 deletions
10
src/utils.py
10
src/utils.py
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue