From 95f295033551b0378de5de3ca765c3d047c399e6 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 9 May 2014 13:11:47 +0200 Subject: [PATCH] Add stop command (ctrl-s) --- TODO | 3 --- qutebrowser/browser/curcommand.py | 6 ++++++ qutebrowser/config/configdata.py | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/TODO b/TODO index 42e8b1f6b..682340bfa 100644 --- a/TODO +++ b/TODO @@ -383,9 +383,6 @@ Find backward, ignore case (command find_backward_ic, alias ibfind). [n]R Reload tab n or current tab if n is omitted without using any cached data (command reload_bypass_cache, aliases: refull). -[n]C-s -Stop loading of tab n or of current tab is [n] is omitted (command stop_loading, aliases: stop, st). - [n]= Zoom to n percent or to 100% if n is omitted(command zoom, aliases: z). diff --git a/qutebrowser/browser/curcommand.py b/qutebrowser/browser/curcommand.py index 39562622b..1358bbb56 100644 --- a/qutebrowser/browser/curcommand.py +++ b/qutebrowser/browser/curcommand.py @@ -183,6 +183,12 @@ class CurCommandDispatcher(QObject): printdiag = QPrintDialog(tab) printdiag.open(lambda: tab.print(printdiag.printer())) + @cmdutils.register(instance='mainwindow.tabs.cur') + def stop(self, count=None): + """Stop loading of tab [n] or of current tab.""" + tab = self._tabs.cntwidget(count) + tab.stop() + @cmdutils.register(instance='mainwindow.tabs.cur') def back(self, count=1): """Go back in the history of the current tab. diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index 95c6acf99..1267ecb24 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -624,6 +624,7 @@ DATA = OrderedDict([ ('', '${}'), ('', '${}'), ('', 'home'), + ('', 'stop'), )), ('keybind.insert', sect.ValueList(