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
|
timer = None
|
||||||
config = None
|
config = None
|
||||||
|
|
||||||
configChanged = QtCore.Signal()
|
|
||||||
|
|
||||||
def __init__(self, settingsPath, parent=None):
|
def __init__(self, settingsPath, parent=None):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
|
|
||||||
@ -51,7 +49,7 @@ class UnloaderManager(QtCore.QObject):
|
|||||||
self.timer.timeout.connect(self.onTimeout)
|
self.timer.timeout.connect(self.onTimeout)
|
||||||
self.timer.start()
|
self.timer.start()
|
||||||
|
|
||||||
self.configChanged.connect(self.onConfigChanged)
|
self.config.updateIntervalChanged.connect(self.onUpdateIntervalChanged)
|
||||||
|
|
||||||
def onMainWindowCreated(self, window):
|
def onMainWindowCreated(self, window):
|
||||||
tabs = window.tabWidget().allTabs()
|
tabs = window.tabWidget().allTabs()
|
||||||
@ -128,11 +126,10 @@ class UnloaderManager(QtCore.QObject):
|
|||||||
def showSettings(self, parent=None):
|
def showSettings(self, parent=None):
|
||||||
settings = SettingsDialog(self.config, parent)
|
settings = SettingsDialog(self.config, parent)
|
||||||
settings.accepted.connect(self.config.save)
|
settings.accepted.connect(self.config.save)
|
||||||
settings.accepted.connect(self.configChanged)
|
|
||||||
settings.exec_()
|
settings.exec_()
|
||||||
|
|
||||||
def onConfigChanged(self):
|
def onUpdateIntervalChanged(self, interval):
|
||||||
self.timer.setInterval(self.config.updateInterval * 1000)
|
self.timer.setInterval(interval * 1000)
|
||||||
|
|
||||||
def onTabRestoredChanged(self, tab, restored):
|
def onTabRestoredChanged(self, tab, restored):
|
||||||
self.tabs[tab] = 0
|
self.tabs[tab] = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user