forked from Wobbl/Wobuzz
Added gui-update-rate-setting.
This commit is contained in:
parent
df54239d67
commit
cdabced202
3 changed files with 43 additions and 8 deletions
|
@ -5,10 +5,6 @@ from PyQt6.QtWidgets import QDockWidget, QFileDialog
|
|||
from .ui.main_window import MainWindow
|
||||
|
||||
|
||||
GUI_UPDATE_RATE = 20
|
||||
GUI_UPDATE_INTERVAL = 1000 // GUI_UPDATE_RATE
|
||||
|
||||
|
||||
class GUI:
|
||||
def __init__(self, app):
|
||||
self.app = app
|
||||
|
@ -46,7 +42,7 @@ class GUI:
|
|||
|
||||
self.gui_update_timer = QTimer()
|
||||
self.gui_update_timer.timeout.connect(self.update_gui)
|
||||
self.gui_update_timer.start(GUI_UPDATE_INTERVAL)
|
||||
self.gui_update_timer.start(1000 // self.app.settings.gui_update_rate)
|
||||
|
||||
self.window.closeEvent = self.on_exit
|
||||
|
||||
|
@ -66,6 +62,9 @@ class GUI:
|
|||
def on_settings_change(self, key, value):
|
||||
self.settings.update_settings(key, value)
|
||||
|
||||
if key == "gui_update_rate":
|
||||
self.gui_update_timer.setInterval(1000 // value)
|
||||
|
||||
def on_track_change(self, previous_track, track):
|
||||
self.track_control.on_track_change(previous_track, track)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue