Merge prev-page/next-page into a navigate command.
This commit is contained in:
parent
42826a2214
commit
51413094bf
@ -308,27 +308,23 @@ class CommandDispatcher:
|
|||||||
self._current_widget().hintmanager.follow_hint()
|
self._current_widget().hintmanager.follow_hint()
|
||||||
|
|
||||||
@cmdutils.register(instance='mainwindow.tabs.cmd')
|
@cmdutils.register(instance='mainwindow.tabs.cmd')
|
||||||
def prev_page(self, tab=False):
|
def navigate(self, where : ('prev', 'next'), tab=False):
|
||||||
"""Open a "previous" link.
|
"""Open typical prev/next links.
|
||||||
|
|
||||||
This tries to automatically click on typical _Previous Page_ links
|
This tries to automatically click on typical _Previous Page_ or
|
||||||
using some heuristics.
|
_Next Page_ links using some heuristics.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
where: What to open.
|
||||||
|
|
||||||
|
- `prev`: Open a _previous_ link.
|
||||||
|
- `next`: Open a _next_ link.
|
||||||
|
|
||||||
tab: Open in a new tab.
|
tab: Open in a new tab.
|
||||||
"""
|
"""
|
||||||
|
if where == 'prev':
|
||||||
self._prevnext(prev=True, newtab=tab)
|
self._prevnext(prev=True, newtab=tab)
|
||||||
|
elif where == 'next':
|
||||||
@cmdutils.register(instance='mainwindow.tabs.cmd')
|
|
||||||
def next_page(self, tab=False):
|
|
||||||
"""Open a "next" link.
|
|
||||||
|
|
||||||
This tries to automatically click on typical _Next Page_ links using
|
|
||||||
some heuristics.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
tab: Open in a new tab.
|
|
||||||
"""
|
|
||||||
self._prevnext(prev=False, newtab=tab)
|
self._prevnext(prev=False, newtab=tab)
|
||||||
|
|
||||||
@cmdutils.register(instance='mainwindow.tabs.cmd', hide=True)
|
@cmdutils.register(instance='mainwindow.tabs.cmd', hide=True)
|
||||||
|
@ -927,10 +927,10 @@ KEY_DATA = collections.OrderedDict([
|
|||||||
('zoom-out', ['-']),
|
('zoom-out', ['-']),
|
||||||
('zoom-in', ['+']),
|
('zoom-in', ['+']),
|
||||||
('zoom', ['=']),
|
('zoom', ['=']),
|
||||||
('prev-page', ['[[']),
|
('navigate prev', ['[[']),
|
||||||
('next-page', [']]']),
|
('navigate next', [']]']),
|
||||||
('prev-page -t', ['{{']),
|
('navigate prev -t', ['{{']),
|
||||||
('next-page -t', ['}}']),
|
('navigate next -t', ['}}']),
|
||||||
('inspector', ['wi']),
|
('inspector', ['wi']),
|
||||||
('download-page', ['gd']),
|
('download-page', ['gd']),
|
||||||
('cancel-download', ['ad']),
|
('cancel-download', ['ad']),
|
||||||
|
Loading…
Reference in New Issue
Block a user