Move signal filtering to generic function
This commit is contained in:
parent
09467abe7e
commit
1b08b88b2b
@ -57,11 +57,16 @@ class TabbedBrowser(TabWidget):
|
|||||||
|
|
||||||
@pyqtSlot(int)
|
@pyqtSlot(int)
|
||||||
def progress_changed(self, prog):
|
def progress_changed(self, prog):
|
||||||
|
self.filter_signals(self.cur_progress, prog)
|
||||||
|
|
||||||
|
def filter_signals(self, signal, *args):
|
||||||
|
dbgstr = "{} ({})".format(
|
||||||
|
signal.signal, ','.join([str(e) for e in args]))
|
||||||
if self.currentWidget() == self.sender():
|
if self.currentWidget() == self.sender():
|
||||||
logging.debug("progress = {}, current".format(prog))
|
logging.debug('{} - emitting'.format(dbgstr))
|
||||||
self.cur_progress.emit(prog)
|
signal.emit(*args)
|
||||||
else:
|
else:
|
||||||
logging.debug("progress = {}, non-current".format(prog))
|
logging.debug('{} - ignoring'.format(dbgstr))
|
||||||
|
|
||||||
@pyqtSlot(int)
|
@pyqtSlot(int)
|
||||||
def index_changed(self, idx):
|
def index_changed(self, idx):
|
||||||
|
Loading…
Reference in New Issue
Block a user