Move audible strings into class variables

This commit is contained in:
Jay Kamat 2018-07-21 12:50:45 -07:00
parent 3b6c4d4b85
commit 2b8068f6da
No known key found for this signature in database
GPG Key ID: 5D2E399600F4F7B5

View File

@ -54,6 +54,10 @@ class TabWidget(QTabWidget):
tab_index_changed = pyqtSignal(int, int)
new_tab_requested = pyqtSignal('QUrl', bool, bool)
# Strings for controlling the mute/audible text
MUTE_STRING = '[M] '
AUDIBLE_STRING = '[A] '
def __init__(self, win_id, parent=None):
super().__init__(parent)
bar = TabBar(win_id, self)
@ -175,9 +179,9 @@ class TabWidget(QTabWidget):
fields['private'] = ' [Private Mode] ' if tab.private else ''
try:
if tab.audio.is_muted():
fields['audio'] = '[M] '
fields['audio'] = TabWidget.MUTE_STRING
elif tab.audio.is_recently_audible():
fields['audio'] = '[A] '
fields['audio'] = TabWidget.AUDIBLE_STRING
else:
fields['audio'] = ''
except browsertab.WebTabError: