2020-05-23 22:14:09 +00:00
|
|
|
import typing
|
2020-10-18 00:43:24 +00:00
|
|
|
|
2020-10-18 00:54:48 +00:00
|
|
|
from fishy.helper import helper
|
2020-05-23 22:14:09 +00:00
|
|
|
|
|
|
|
from fishy import web
|
|
|
|
from fishy.gui.notification import _give_notification_link
|
|
|
|
|
|
|
|
from tkinter import *
|
|
|
|
from tkinter.ttk import *
|
|
|
|
|
2020-10-17 19:06:07 +00:00
|
|
|
from fishy.helper.config import config
|
2020-05-23 22:14:09 +00:00
|
|
|
from fishy.helper.popup import PopUp
|
|
|
|
|
|
|
|
if typing.TYPE_CHECKING:
|
|
|
|
from fishy.gui import GUI
|
|
|
|
|
|
|
|
|
2020-06-25 01:22:39 +00:00
|
|
|
def start_fullfisher_config(gui: 'GUI'):
|
2020-10-18 00:54:48 +00:00
|
|
|
top = PopUp(helper.empty_function, gui._root, background=gui._root["background"])
|
2020-06-25 01:22:39 +00:00
|
|
|
controls_frame = Frame(top)
|
|
|
|
top.title("Config")
|
|
|
|
|
2020-10-18 00:54:48 +00:00
|
|
|
Label(controls_frame, text="Use semi-fisher engine config").grid(row=0, column=0)
|
2020-06-25 01:22:39 +00:00
|
|
|
|
|
|
|
controls_frame.pack(padx=(5, 5), pady=(5, 5))
|
|
|
|
top.start()
|
|
|
|
|
|
|
|
|
2020-05-23 22:14:09 +00:00
|
|
|
def start_semifisher_config(gui: 'GUI'):
|
|
|
|
def save():
|
2020-10-17 19:06:07 +00:00
|
|
|
gui.config.set("action_key", action_key_entry.get(), False)
|
|
|
|
gui.config.set("borderless", borderless.instate(['selected']), False)
|
|
|
|
gui.config.set("sound_notification", sound.instate(['selected']), False)
|
|
|
|
gui.config.save_config()
|
2020-05-23 22:14:09 +00:00
|
|
|
|
|
|
|
top = PopUp(save, gui._root, background=gui._root["background"])
|
|
|
|
controls_frame = Frame(top)
|
|
|
|
top.title("Config")
|
|
|
|
|
|
|
|
Label(controls_frame, text="Notification:").grid(row=0, column=0)
|
|
|
|
|
|
|
|
gui._notify = IntVar(0)
|
|
|
|
gui._notify_check = Checkbutton(controls_frame, command=lambda: _give_notification_link(gui),
|
|
|
|
variable=gui._notify)
|
|
|
|
gui._notify_check.grid(row=0, column=1)
|
|
|
|
gui._notify_check['state'] = DISABLED
|
2020-10-17 19:06:07 +00:00
|
|
|
is_subbed = web.is_subbed(config.get('uid'))
|
2020-05-23 22:14:09 +00:00
|
|
|
if is_subbed[1]:
|
|
|
|
gui._notify_check['state'] = NORMAL
|
|
|
|
gui._notify.set(is_subbed[0])
|
|
|
|
|
|
|
|
Label(controls_frame, text="Fullscreen: ").grid(row=1, column=0, pady=(5, 5))
|
2020-10-17 19:06:07 +00:00
|
|
|
borderless = Checkbutton(controls_frame, var=BooleanVar(value=config.get("borderless")))
|
2020-05-23 22:14:09 +00:00
|
|
|
borderless.grid(row=1, column=1)
|
|
|
|
|
|
|
|
Label(controls_frame, text="Action Key:").grid(row=2, column=0)
|
|
|
|
action_key_entry = Entry(controls_frame, justify=CENTER)
|
|
|
|
action_key_entry.grid(row=2, column=1)
|
2020-10-17 19:06:07 +00:00
|
|
|
action_key_entry.insert(0, config.get("action_key", "e"))
|
2020-05-23 22:14:09 +00:00
|
|
|
|
2020-10-13 13:49:39 +00:00
|
|
|
Label(controls_frame, text="Sound Notification: ").grid(row=3, column=0, pady=(5, 5))
|
2020-10-17 19:06:07 +00:00
|
|
|
sound = Checkbutton(controls_frame, var=BooleanVar(value=config.get("sound_notification")))
|
2020-10-13 13:49:39 +00:00
|
|
|
sound.grid(row=3, column=1)
|
|
|
|
|
2020-05-23 22:14:09 +00:00
|
|
|
controls_frame.pack(padx=(5, 5), pady=(5, 5))
|
|
|
|
top.start()
|