Only leave insert/hint mode if loading started in current tab

This commit is contained in:
Florian Bruhin 2014-07-04 17:32:17 +02:00
parent f173583605
commit cea3cb4712
3 changed files with 7 additions and 4 deletions

View File

@ -1,8 +1,6 @@
Bugs
====
- Rapid hinting exits hinting mode
- Concept of "current URL" should work better before urlChanged is emitted,
e.g. loading a page and immediately yanking the (non-resolved) URL should
work.

View File

@ -167,6 +167,7 @@ class TabbedBrowser(TabWidget):
tab.hintmanager.hint_strings_updated.connect(self.hint_strings_updated)
tab.hintmanager.download_get.connect(self.download_get)
tab.hintmanager.openurl.connect(self.openurl)
self.cur_load_started.connect(self.on_cur_load_started)
# downloads
tab.page().unsupportedContent.connect(self.start_download)
tab.page().start_download.connect(self.start_download)
@ -357,6 +358,12 @@ class TabbedBrowser(TabWidget):
return
self.setTabIcon(idx, EmptyTabIcon())
@pyqtSlot()
def on_cur_load_started(self):
"""Leave insert/hint mode when loading started."""
for mode in ('insert', 'hint'):
modeman.maybe_leave(mode, 'load started')
@pyqtSlot(WebView, str)
def on_title_changed(self, tab, text):
"""Set the title of a tab.

View File

@ -367,8 +367,6 @@ class WebView(QWebView):
@pyqtSlot()
def on_load_started(self):
"""Leave insert/hint mode and set vars when a new page is loading."""
for mode in ('insert', 'hint'):
modeman.maybe_leave(mode, 'load started')
self.progress = 0
self._has_ssl_errors = False
self.load_status = LoadStatus.loading