Make tabbedbrowser.now_focused private

This commit is contained in:
Florian Bruhin 2014-07-29 22:44:14 +02:00
parent cf8a8ad3b4
commit 0091b4729a

View File

@ -54,10 +54,10 @@ class TabbedBrowser(TabWidget):
Attributes: Attributes:
_tabs: A list of open tabs. _tabs: A list of open tabs.
_filter: A SignalFilter instance. _filter: A SignalFilter instance.
_now_focused: The tab which is focused now.
url_stack: Stack of URLs of closed tabs. url_stack: Stack of URLs of closed tabs.
cmd: A TabCommandDispatcher instance. cmd: A TabCommandDispatcher instance.
last_focused: The tab which was focused last. last_focused: The tab which was focused last.
now_focused: The tab which is focused now.
Signals: Signals:
cur_progress: Progress of the current tab changed (loadProgress). cur_progress: Progress of the current tab changed (loadProgress).
@ -114,7 +114,7 @@ class TabbedBrowser(TabWidget):
self._filter = SignalFilter(self) self._filter = SignalFilter(self)
self.cmd = CommandDispatcher(self) self.cmd = CommandDispatcher(self)
self.last_focused = None self.last_focused = None
self.now_focused = None self._now_focused = None
# FIXME adjust this to font size # FIXME adjust this to font size
self.setIconSize(QSize(12, 12)) self.setIconSize(QSize(12, 12))
@ -268,8 +268,8 @@ class TabbedBrowser(TabWidget):
tab = self.widget(idx) tab = self.widget(idx)
if tab is None: if tab is None:
raise ValueError("invalid index {}!".format(idx)) raise ValueError("invalid index {}!".format(idx))
if tab is self.now_focused: if tab is self._now_focused:
self.now_focused = None self._now_focused = None
if tab is self.last_focused: if tab is self.last_focused:
self.last_focused = None self.last_focused = None
last_close = config.get('tabbar', 'last-close') last_close = config.get('tabbar', 'last-close')
@ -468,8 +468,8 @@ class TabbedBrowser(TabWidget):
tab = self.widget(idx) tab = self.widget(idx)
tab.setFocus() tab.setFocus()
modeman.maybe_leave(KeyMode.hint, 'tab changed') modeman.maybe_leave(KeyMode.hint, 'tab changed')
self.last_focused = self.now_focused self.last_focused = self._now_focused
self.now_focused = tab self._now_focused = tab
self.current_tab_changed.emit(tab) self.current_tab_changed.emit(tab)
self.title_changed.emit('{} - qutebrowser'.format(self.tabText(idx))) self.title_changed.emit('{} - qutebrowser'.format(self.tabText(idx)))