Commit Graph

601 Commits

Author SHA1 Message Date
Florian Bruhin
abdc604ead :tab-clone - restore tab zoom after history
This makes cloning the zoom work with QtWebEngine.
2016-09-06 15:15:59 +02:00
Florian Bruhin
3b8537ff26 Make webkitelem/mhtml imports optional in commands 2016-09-05 18:20:48 +02:00
Florian Bruhin
bf3cccfe56 Make QWebPage import in commands.py optional 2016-09-05 18:15:30 +02:00
Florian Bruhin
5f58ebebbf Remove needs_js for @cmdutils.register
This gets rid of a QtWebKit import in commands.py, and also makes those
checks work later when we have per-domain settings.
2016-09-05 18:11:01 +02:00
Florian Bruhin
a85ea92a21 Merge branch 'open-editor-all-modes' of https://github.com/kobezda/qutebrowser into kobezda-open-editor-all-modes 2016-09-05 10:59:53 +02:00
Florian Bruhin
366c230e0a Merge branch 'docstrings' of https://github.com/lahwaacz/qutebrowser into lahwaacz-docstrings 2016-09-05 10:58:39 +02:00
Ján Kobezda
da65f7234a Allow :open-editor in modes other than insert
':open-editor' can now be run in all modes.

Resolves #1902
2016-09-04 22:23:16 +02:00
Florian Bruhin
ea4f4e197f Handle elements which are out of view correctly
Fixes #1910
2016-09-04 21:09:15 +02:00
Jakub Klinkovský
9669aca7d9 remove random description of variables in commands' docstrings
Full description is given at the top of qute://help/commands.html,
duplicating this for some commands where it might be useful is
unmaintainable.
2016-09-02 19:52:45 +02:00
Florian Bruhin
44d6db4f45 QtWebEngine: Fix crash with userscript + selection
Fixes #1878

Unfortunately it seems impossible to implement a test for this, as
selection via javascript somehow doesn't trigger this.
2016-09-01 22:45:57 +02:00
Florian Bruhin
0557fea79e Use QApplication.sendEvent instead of postEvent
From the QApplication.postEvent docs:
http://doc.qt.io/qt-5/qcoreapplication.html#postEvent

  The event must be allocated on the heap since the post event queue
  will take ownership of the event and delete it once it has been
  posted. It is not safe to access the event after it has been posted.

We can't reliably guarantee that from Python, so we need to use
sendEvent instead.
2016-08-18 21:36:43 +02:00
Florian Bruhin
ccc676c04f Handle CommandError in show_source_cb 2016-08-18 19:32:16 +02:00
Florian Bruhin
c0ffcfc585 QtWebEngine: Make :fake-key work 2016-08-18 18:44:33 +02:00
Florian Bruhin
205c12c530 Fix docs for :click-element 2016-08-18 16:58:56 +02:00
Florian Bruhin
d9d14d4a4c Fix lint 2016-08-18 15:58:46 +02:00
Florian Bruhin
e0af03db80 Add a default target for :click-element 2016-08-18 15:58:46 +02:00
Florian Bruhin
0cef4ac2db Add a :click-element command 2016-08-18 15:30:04 +02:00
Florian Bruhin
d3084dd690 Add a separate tab.elements object 2016-08-18 14:01:27 +02:00
Florian Bruhin
8d6b905f95 Merge branch 'insert-text' of https://github.com/blyxxyz/qutebrowser into blyxxyz-insert-text 2016-08-16 13:29:42 +02:00
Florian Bruhin
91db564e1a Fix lint 2016-08-16 11:36:55 +02:00
Florian Bruhin
d1138fa342 Update docs 2016-08-16 11:22:29 +02:00
Florian Bruhin
380856bcb2 Merge branch 'navigate-count' of https://github.com/pvsr/qutebrowser into pvsr-navigate-count 2016-08-16 11:21:07 +02:00
Peter Rice
060305279c update navigate-related help and function docs 2016-08-15 22:28:25 -04:00
Peter Rice
d3e4d62d14 make navigate take counts for inc, dec, and up 2016-08-15 21:13:52 -04:00
Michael Hoang
c0ab474b21 Give error when trying to detach a single tab 2016-08-16 07:36:39 +10:00
Michael Hoang
af97f9efae Add add_undo parameter for closing tabs
By default, closed tabs should be undoable, but when a tab is detached
:undo should not reopen that tab in the old window.
2016-08-11 07:44:11 +10:00
Jan Verbeek
d2d92c9f2e Fix docstring 2016-08-10 22:29:19 +02:00
Jan Verbeek
4966debd61 Deprecate :paste-primary to :insert-text {primary} 2016-08-10 21:55:16 +02:00
Jan Verbeek
db0f8fffcd Merge https://github.com/The-Compiler/qutebrowser into insert-text 2016-08-10 20:54:54 +02:00
Florian Bruhin
57896dc00e Merge branch 'clip' of https://github.com/blyxxyz/qutebrowser into blyxxyz-clip 2016-08-10 20:38:54 +02:00
Jan Verbeek
63b9b61e75 Add ClipboardError superexception 2016-08-10 12:33:01 +02:00
Jan Verbeek
7d0064ff86 Fix docstrings 2016-08-09 19:23:38 +02:00
Florian Bruhin
fb3da578c5 Fix lint 2016-08-09 17:28:14 +02:00
Jan Verbeek
7e634a1e52 Make vars declarative, new function for URL lists 2016-08-09 16:20:02 +02:00
Florian Bruhin
fefea4944a QtWebEngine: Make :open-editor work 2016-08-09 16:00:59 +02:00
Jan Verbeek
8e4733f483 Merge https://github.com/The-Compiler/qutebrowser into clip 2016-08-09 14:36:01 +02:00
Florian Bruhin
9a17591fb7 Start getting :open-editor to work with WebEngine
It doesn't actually work yet (as it claims the field is not editable),
but at least does not crash when the backend limitation for the command
is removed.
2016-08-08 16:24:34 +02:00
Florian Bruhin
9bcce37ff3 WebEngine: Allow :navigate up/decrement/increment 2016-08-08 14:09:28 +02:00
Florian Bruhin
dfbadaf7c2 Split WebElementWrapper into abstract/webkit parts 2016-08-08 13:04:53 +02:00
Jan Verbeek
864c95007f Unhide :insert-text and allow outside insert mode
:insert-text works if a text element is focused, even outside insert
mode.
2016-08-07 14:29:52 +02:00
Jan Verbeek
ebfe23c376 Merge https://github.com/The-Compiler/qutebrowser into clip
Also make it possible to use multiple variables in one argument.
2016-08-07 13:14:46 +02:00
Florian Bruhin
96087bd554 Fix up pretty URL yanking 2016-08-07 11:40:26 +02:00
Florian Bruhin
b6fbd3ce3a Merge branch 'better-variables' of https://github.com/blyxxyz/qutebrowser into blyxxyz-better-variables 2016-08-07 11:33:01 +02:00
Florian Bruhin
88d3e86259 Use "what != 'url-pretty'" 2016-08-07 11:02:50 +02:00
Jan Verbeek
dc69a90e69 Add :insert-text command
See #1790.
:paste-primary now calls :insert-text and can be deprecated by
:insert-text {primary} after #1791 is merged.
2016-08-07 02:46:10 +02:00
Marshall Lochbaum
47969362e1 Fix minor conditional issues in yank 2016-08-06 20:15:51 -04:00
Marshall Lochbaum
a90662ef83 Fix combined yank documentation 2016-08-06 20:13:50 -04:00
Jan Verbeek
38508274e0 Improve clipboard exceptions, migrate bindings 2016-08-07 00:46:23 +02:00
Jan Verbeek
96146c55af Remove useless clipboard target information 2016-08-06 22:25:08 +02:00
Jan Verbeek
0177dafbd0 Add {clipboard} and {primary} to replace :paste
:paste is deprecated and replaced by equivalents using :open and the
new variables, and :open supports opening newline-separated lists of
URLs.
2016-08-06 22:03:50 +02:00
Marshall Lochbaum
54ba27cf77 Merge :yank-selected into :yank (fixes #820)
Changes :yank's flag arguments to a positional "what" argument
specifying the object to be yanked. Including "selection" as a
possibility allows for the replacement of :yank-selected with
:yank selection.
2016-08-05 22:01:17 -04:00
Jan Verbeek
1e97247c63 Revert spawn's splitting, blacklist from doc
Blacklist spawn from getting the no_replace_variables doc note.
2016-08-05 18:04:14 +02:00
Florian Bruhin
778ccad39f Move most :navigate code to browser.navigate 2016-08-05 17:28:48 +02:00
Jan Verbeek
8a527b5faf Make :spawn parse normally without maxsplit 2016-08-05 16:52:47 +02:00
Florian Bruhin
08b70f0f4c Add qutebrowser.utils.javascript
webelem.javascript_escape got renamed to javascript.string_escape, and a
new javascript.assemble got added to make it easier to call a function
inside a .js file.
2016-08-04 17:53:13 +02:00
Florian Bruhin
764c232033 Split inspector into web{engine,kit}inspector 2016-08-04 12:44:46 +02:00
Jan Verbeek
c7c5a98506 Allow {url} and {url:pretty} as parts of arguments
This makes commands like `:open web.archive.org/web/{url}` possible.
This commit also adds a no_replace_variables command register argument
that stops the replacement from happening, which is important for
commands like `:bind` and `:spawn` that take a command as an argument.
2016-08-04 02:43:02 +02:00
Florian Bruhin
614893bdd6 Initial broken inspector support for QtWebEngine 2016-08-03 15:23:32 +02:00
Florian Bruhin
1fb4aa3532 Merge branch 'tab-open-implicit' of https://github.com/mlochbaum/qutebrowser into mlochbaum-tab-open-implicit 2016-08-03 09:16:49 +02:00
Florian Bruhin
79d2116b18 Remove unneeded 'return' 2016-08-03 09:07:12 +02:00
Florian Bruhin
77dd2a105f Add cmdutils.check_overflow in _set_current_index 2016-08-03 08:57:05 +02:00
Marshall Lochbaum
299d4865d0 Move --implicit flag argument to the end of _open 2016-08-02 15:26:49 -04:00
Marshall Lochbaum
66adbc9323 Add --implicit flag to :open 2016-08-02 13:49:25 -04:00
Marshall Lochbaum
d30da4f905 Update tab_focus docstring 2016-08-02 11:50:21 -04:00
Marshall Lochbaum
8a127f2839 Remove cmdutils.arg_or_count 2016-08-02 11:31:03 -04:00
Florian Bruhin
4414f5fea9 Merge branch 'tab-move-index' of https://github.com/mlochbaum/qutebrowser into mlochbaum-tab-move-index 2016-08-01 16:17:09 +02:00
Florian Bruhin
13269ef388 Wrap long lines 2016-08-01 12:46:47 +02:00
Florian Bruhin
a772e8a2c3 Mark :set-mark/:jump-mark as hidden
Fixes #1708.
2016-08-01 12:21:18 +02:00
Marshall Lochbaum
a7438f4f15 Extend tab-move's direction argument to take an index (fixes #1701) 2016-07-29 23:06:51 -04:00
Florian Bruhin
af704439d9 Remove trailing newline 2016-07-29 09:05:25 +02:00
Claire Cavanaugh
3d258df23a Heil PEP8 :P 2016-07-28 23:24:34 -07:00
Claire Cavanaugh
bf44636a24 :open opens quickmark when given a quckmark name 2016-07-28 22:50:10 -07:00
Florian Bruhin
5eca6e11a5 Fix editor/paste-primary 2016-07-28 12:36:09 +02:00
Florian Bruhin
4318604c57 Don't use javascript in webelem.set_text for hints 2016-07-28 12:36:09 +02:00
Florian Bruhin
193c755637 Refactor WebElement API, part 2
Now we don't get a crash, but not any hints either...
2016-07-28 12:35:59 +02:00
Florian Bruhin
c764733472 Refactor QWebElement API, part 1 2016-07-28 12:35:49 +02:00
Marshall Lochbaum
b2c2d5a4f4 Add --delete option to bookmark-load 2016-07-26 13:49:17 -04:00
Marshall Lochbaum
d9247c15a4 Coding style fixes 2016-07-26 09:48:35 -04:00
Marshall Lochbaum
28842c90b6 Add --toggle flag to bookmark-add (fixes #1667) 2016-07-26 09:07:21 -04:00
Florian Bruhin
3ccb691e9f tab API: Rename scroll to scroller
The scroll attribute did overwrite QWidget.scroll which is unfortunate.
2016-07-26 13:19:07 +02:00
Florian Bruhin
f4f6a3dac1 Merge branch 'open-download' of https://github.com/Kingdread/qutebrowser into Kingdread-open-download 2016-07-26 10:32:34 +02:00
Florian Bruhin
da64db853e Update docs 2016-07-26 08:36:16 +02:00
Marshall Lochbaum
3ffb726b98 Merge branch 'master' into mark-del-no-args 2016-07-23 12:12:19 -04:00
Marshall Lochbaum
1781d0fba3 Use DoesNotExistError rather than CommandError in get_by_qurl 2016-07-23 12:05:21 -04:00
Marshall Lochbaum
9758b52d91 Assume _current_url is valid (remove try/except) 2016-07-23 12:05:21 -04:00
Marshall Lochbaum
cba25d2bbb Remove quickmark_del and bookmark_del from the urlmark classes (use delete instead) 2016-07-23 10:55:57 -04:00
David Vogt
1f320b8686 Various fixes after code review.
* Move documentation changes of bookmark / quickmarks to docstrings, as the
  asciidoc is autogenerated from those
* Fix some whitespaces in the BDD test cases
* Improved docstring in qute_bookmarks handler
2016-07-23 14:50:28 +02:00
Marshall Lochbaum
19949101c6 Make quickmark_del with no argument delete the current page's mark (fixes #1661) 2016-07-21 22:32:04 -04:00
Marshall Lochbaum
83005bc072 Make bookmark_del with no argument delete the current page's mark 2016-07-21 21:14:54 -04:00
Jan Verbeek
bbc46d28ff Use lists instead of tuples for comparing
Per one of the diff comments on #1597:
> I used to use a tuple for constant things, but nowadays I'd actually
> prefer a list as a tuple is something more heterogeneous (i.e. it
> makes sense to have a `(x, y)` point as a tuple, but a list of points
> would be a list).
> At some point I should probably change it to a list everywhere 😉
2016-07-12 22:05:32 +02:00
Daniel Schadt
a088f238e5 usertypes: remove Frankenstein's enum
This approach is not as weird in Python and still works.

DownloadTarget.OpenDownload has been renamed to OpenFileDownloadTarget,
since OpenDownloadDownloadTarget didn't look as nice.
2016-07-12 17:10:36 +02:00
Daniel Schadt
d42d980dda downloads: introduce target= param for .get/.fetch
This parameter replaces the filename and fileobj parameters. This makes
it easier to add more download targets, since only one may be "chosen".
With the OPEN_DOWNLOAD special case added, handling of filename got a
bit ugly, since it may be either None, OPEN_DOWNLOAD or a str with the
file path, and we had to make sure only one target was chosen.

With the new target enum, this handling can be simplified and we
automatically get the guarantee that only one target is chosen.
2016-07-12 17:06:40 +02:00
Florian Bruhin
64b32ec87d Remove general -> wrap-search 2016-07-12 16:47:57 +02:00
Florian Bruhin
f0da508c21 Move searching out of WebView subclass
This also makes it work for QtWebEngine.
It also seems to fix #1050 though I'm not 100% sure why.
2016-07-12 16:29:50 +02:00
Florian Bruhin
cd4eff364a Add printing to tab API
This fixes printing for QtWebKit, and hopefully will make printing to
PDF work with QtWebEngine with Qt >= 5.7
2016-07-12 12:54:11 +02:00
Florian Bruhin
7a39021d41 Merge branch 'issues/1630' of https://github.com/jdkaplan/qutebrowser into jdkaplan-issues/1630 2016-07-12 10:07:59 +02:00
Jeremy Kaplan
6b2b096f3c Add test for :print --pdf 2016-07-11 20:08:24 -04:00
Jeremy Kaplan
62ae793a24 Generate docs 2016-07-11 20:07:54 -04:00
Florian Bruhin
4f9be56d7d Merge branch 'add-bookmark-by-url' of https://github.com/ismail-s/qutebrowser into ismail-s-add-bookmark-by-url 2016-07-11 20:54:09 +02:00
Jeremy Kaplan
a6a030e92f Add :print --pdf flag to skip printing dialog 2016-07-10 21:58:54 -04:00