Manager: Use signals provided by Config
Signed-off-by: Juraj Oravec <sgd.orava@gmail.com>
This commit is contained in:
parent
97db403adc
commit
34f2a78fbe
@ -30,8 +30,6 @@ class UnloaderManager(QtCore.QObject):
|
||||
timer = None
|
||||
config = None
|
||||
|
||||
configChanged = QtCore.Signal()
|
||||
|
||||
def __init__(self, settingsPath, parent=None):
|
||||
super().__init__(parent)
|
||||
|
||||
@ -51,7 +49,7 @@ class UnloaderManager(QtCore.QObject):
|
||||
self.timer.timeout.connect(self.onTimeout)
|
||||
self.timer.start()
|
||||
|
||||
self.configChanged.connect(self.onConfigChanged)
|
||||
self.config.updateIntervalChanged.connect(self.onUpdateIntervalChanged)
|
||||
|
||||
def onMainWindowCreated(self, window):
|
||||
tabs = window.tabWidget().allTabs()
|
||||
@ -128,11 +126,10 @@ class UnloaderManager(QtCore.QObject):
|
||||
def showSettings(self, parent=None):
|
||||
settings = SettingsDialog(self.config, parent)
|
||||
settings.accepted.connect(self.config.save)
|
||||
settings.accepted.connect(self.configChanged)
|
||||
settings.exec_()
|
||||
|
||||
def onConfigChanged(self):
|
||||
self.timer.setInterval(self.config.updateInterval * 1000)
|
||||
def onUpdateIntervalChanged(self, interval):
|
||||
self.timer.setInterval(interval * 1000)
|
||||
|
||||
def onTabRestoredChanged(self, tab, restored):
|
||||
self.tabs[tab] = 0
|
||||
|
Loading…
Reference in New Issue
Block a user