forked from Wobbl/Wobuzz
OOPing it more: Removed gui_communication/settings.py
This commit is contained in:
parent
3685f25882
commit
d2c74438cb
5 changed files with 24 additions and 35 deletions
|
@ -2,7 +2,6 @@
|
|||
|
||||
from .menu_bar import MenuBar
|
||||
from .track_control import TrackControl
|
||||
from .settings import Settings
|
||||
|
||||
|
||||
class GUICommunication:
|
||||
|
@ -15,9 +14,6 @@ class GUICommunication:
|
|||
|
||||
self.menu_bar = MenuBar(self.app)
|
||||
self.track_control = TrackControl(self.app)
|
||||
self.settings = Settings(self.app)
|
||||
|
||||
self.settings.update_all()
|
||||
|
||||
def on_track_change(self, previous_track=None, track=None):
|
||||
self.track_control.on_track_change(previous_track, track)
|
||||
|
@ -26,6 +22,3 @@ class GUICommunication:
|
|||
def on_playstate_update(self):
|
||||
self.track_control.on_playstate_update()
|
||||
|
||||
def on_settings_change(self, key, value):
|
||||
self.settings.update_settings(key, value)
|
||||
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
|
||||
class Settings:
|
||||
def __init__(self, app):
|
||||
self.app = app
|
||||
|
||||
self.settings = self.app.gui.window.settings
|
||||
|
||||
self.connect()
|
||||
|
||||
def connect(self):
|
||||
self.settings.visibilityChanged.connect(self.update_all)
|
||||
self.settings.save_button.pressed.connect(self.write_settings)
|
||||
|
||||
def update_all(self, _=True): # ignore visible parameter passed by visibilityChanged event
|
||||
self.settings.file_settings.library_path_input.setText(self.app.settings.library_path)
|
||||
|
||||
def update_settings(self, key, value):
|
||||
match key:
|
||||
case "library_path":
|
||||
self.settings.file_settings.library_path_input.setText(value)
|
||||
|
||||
def write_settings(self):
|
||||
self.app.settings.library_path = self.settings.file_settings.library_path_input.text()
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue