Commit Graph

8352 Commits

Author SHA1 Message Date
Florian Bruhin
763d035ee3 Add environment variables to skip backendproblem checks
This is usually a bad idea, but might be useful in some special situations.
2017-10-04 22:25:14 +02:00
Michal Siedlaczek
c5d695b59e Remove spellcheck.enabled option. 2017-10-04 09:54:59 -04:00
Michał Siedlaczek
e20ad95666 Merge branch 'master' into spell 2017-10-04 09:47:42 -04:00
Michal Siedlaczek
6a486058c5 Review fixes 2017-10-04 09:22:35 -04:00
Florian Bruhin
36857d9250 Remove valid values for Bool from docs 2017-10-04 11:46:42 +02:00
Florian Bruhin
6fa001481d Add some comments to generated config.py 2017-10-04 11:43:14 +02:00
Florian Bruhin
7fc5e42cca Initial :config-write-py implementation 2017-10-04 11:14:24 +02:00
Florian Bruhin
f0c0fea281 Merge branch 'pr/3025' 2017-10-04 09:28:40 +02:00
Florian Bruhin
208b4d1cbc Make configfiles.YamlConfig iteration deterministic 2017-10-04 08:47:10 +02:00
Florian Bruhin
42550cd2e6 Merge remote-tracking branch 'origin/pr/3048' 2017-10-04 06:47:48 +02:00
Florian Bruhin
ae4d5153b9 Add missing docstring 2017-10-04 06:47:08 +02:00
Florian Bruhin
cdf0cf56fa Merge remote-tracking branch 'origin/pr/3056' 2017-10-04 06:45:08 +02:00
Florian Bruhin
8c660d1bf4 Add a :version command 2017-10-04 06:23:15 +02:00
Ryan Roden-Corrent
4a9e22163b Filter keyhints based on count prefix.
If a count prefix is given, only hint commands that can take a count.
2017-10-03 22:15:21 -04:00
Ryan Roden-Corrent
5d787c84ea Show keyhint even with count prefix.
The keyhintwidget was not showing up when a keychain was prefixed with a
count. For example, 'g' would show a keyhint but '5g' would not. Now
keyhints are shown even when a count is given.

Resolves #3045.
2017-10-03 22:04:53 -04:00
Michal Siedlaczek
932e7a9ab9 Review fixes 2017-10-03 20:07:06 -04:00
Florian Bruhin
feaccb3083 Rename :scroll-perc to :scroll-to-perc
Closes #2819
2017-10-03 22:59:32 +02:00
Florian Bruhin
7f28097f55 Be explicit about constraints instead 2017-10-03 22:17:29 +02:00
Florian Bruhin
d70bdb5552 Honour --no-err-windows in more places
Fixes #3053
2017-10-03 21:28:55 +02:00
Florian Bruhin
6c2958b646 Set star_args_optional for :config-cycle 2017-10-03 20:49:16 +02:00
Florian Bruhin
22088d9f7b Remove --force for :bind and config.bind(...)
Turns out --force is just in the way for most people, and at least for default
bindings it's easy to reset them.

Also, it makes :config-source fail when config.py contains keybindings.

Closes #3049
2017-10-03 20:43:38 +02:00
Florian Bruhin
727580d1f4 Add a :config-edit command
See #2794
2017-10-03 20:43:38 +02:00
Florian Bruhin
555930791f Refactor ExternalEditor to be able to edit an existing file 2017-10-03 19:24:04 +02:00
Michael Hoang
8506e1f4f2 Add arg to run when count given for :set-cmd-text 2017-10-04 03:57:23 +11:00
Florian Bruhin
8edaad51c3 Add a :config-source command
See #2794
2017-10-03 16:28:11 +02:00
Florian Bruhin
ed8c3f4aa2 Add :config-clear and :config-unset
See #2794
2017-10-03 12:45:39 +02:00
Florian Bruhin
31f49afdb2 Fix incorrect docstring 2017-10-03 10:28:36 +02:00
Florian Bruhin
1603b15cfd Default to NOT NULL for table constraints
Ideally, we'd update all existing tables to add the new constraints, but sqlite
doesn't offer an easy way to do so: https://www.sqlite.org/lang_altertable.html

Since that migration really isn't worth the effort, we only set the constraint
for new tables...
2017-10-03 10:28:36 +02:00
Florian Bruhin
b06a38ce7e Reorder methods
(cherry picked from commit ba9bd292dbc43bf0ad382a1ef060c87ee651b5d7)
2017-10-03 10:28:19 +02:00
Florian Bruhin
ad867a3b90 Merge branch 'pr/3024' 2017-10-03 10:17:01 +02:00
Florian Bruhin
58bef6ba97 Regenerate docs 2017-10-03 10:16:41 +02:00
Florian Bruhin
f533e3b751 Move config toggling to :config-cycle
This removes :set option! and allows :config-cycle option instead.
2017-10-03 07:38:10 +02:00
Florian Bruhin
81993a70a2 Split off :config-cycle from :set
Before, we allowed :set to take multiple values, which often lead to confusing
error messages when a user forgot to quote the value.

Now, we instead have a dedicated :config-cycle command for that.

See #1840, #2794
2017-10-03 07:37:55 +02:00
Michael Hoang
138ce60c1d Add count support to buffer command 2017-10-02 23:44:04 +11:00
Florian Bruhin
5af8a95c82 Refactor SQL error handling
This renames SqlException to SqlError (to be more consistent with how Python
names exceptions), and adds an utility function which logs a few more useful
details about errors.

See #3004
2017-10-02 09:48:15 +02:00
Florian Bruhin
85532248fa Merge remote-tracking branch 'origin/pr/2879' 2017-10-02 09:05:01 +02:00
Florian Bruhin
14dacbaa92 Fix typo 2017-10-02 07:49:31 +02:00
Florian Bruhin
0df4569502 Merge remote-tracking branch 'origin/pr/2847' 2017-10-02 07:49:20 +02:00
Florian Bruhin
a8fc561707 Split config commands off to their own file. 2017-10-02 07:08:30 +02:00
Florian Bruhin
a273baf8a0 Make sure :bind/unbind works properly when bindings.commands is None
To make this work, we should never return None when trying to get bindings to
modify.

Fixes #3026
2017-10-01 21:43:00 +02:00
Florian Bruhin
0fbd914432 Fix completion for empty config values
If we have an empty string in the completion, that already gets completed as ''.
If we return "", we'd have '""' in the completion.

Fixes #3027
2017-10-01 20:14:49 +02:00
Anton S
ab6bfe61b8 [osx] first step to become default browser 2017-10-01 00:39:13 +03:00
Florian Bruhin
1a381bf0a5 eslint: Report unused disables 2017-09-29 22:29:18 +02:00
Florian Bruhin
0b5af757ec Clarify settings which need a restart
[ci skip]
2017-09-28 21:51:07 +02:00
Florian Bruhin
322d97c3fa Only show warning message stack with --debug 2017-09-28 21:30:32 +02:00
Florian Bruhin
5c181a23ab Fix default prompt color
The former value was interpreted as a comment in the YAML...
2017-09-28 21:24:12 +02:00
Florian Bruhin
02bcec37f4 Darken default prompt color a bit more 2017-09-28 19:20:29 +02:00
Florian Bruhin
9d963d55f5 Fix :debug-cache-stats with QtWebEngine
When we use --backend webengine, the QtWebKit stuff might be importable, but the
history still isn't initialized because of that.
2017-09-28 17:42:21 +02:00
Florian Bruhin
6c25e96621 Remove unused imports 2017-09-28 11:38:52 +02:00
Florian Bruhin
865fc2e0de Handle -s argument earlier
This makes sure we can e.g. set software_rendering via -s
2017-09-28 10:10:14 +02:00
Florian Bruhin
6770a474c4 Force software rendering earlier
We need to do this before a QApplication exists
2017-09-28 09:52:56 +02:00
Florian Bruhin
35beb84e85 Fix tests and lint 2017-09-28 09:38:57 +02:00
Florian Bruhin
f077f52997 Add asserts for the backend 2017-09-28 08:57:48 +02:00
Florian Bruhin
c77cff3fcb Also fail with DISPLAY with wayland platform plugin
QtWebEngine spews errors at us, and while it seems to work with Weston for some
reason (despite errors logged), it doesn't with sway.
2017-09-28 08:56:05 +02:00
Florian Bruhin
b906c862bb Remove ipc-server from objreg 2017-09-28 08:52:32 +02:00
Florian Bruhin
ce0622e38a Document how initialization roughly works 2017-09-28 08:41:10 +02:00
Florian Bruhin
e5958e6061 Override --backend argument from backend problem dialog 2017-09-28 08:41:10 +02:00
Florian Bruhin
defcf5394a Move SSL backend checking to backendproblem.py 2017-09-28 08:41:10 +02:00
Florian Bruhin
fa902c5d82 Improve error dialogs when QtWebKit/QtWebEngine was not found 2017-09-28 08:41:10 +02:00
Florian Bruhin
093f34183c Add improved checks for Nouveau/Wayland for QtWebEngine
Closes #2368
Closes #2932
See #2335
2017-09-28 08:41:10 +02:00
Florian Bruhin
ca4a997559 Update settings for QtWebEngine by default
See #2335
2017-09-28 08:41:10 +02:00
Jay Kamat
bb8d41cedc
Add indicator padding to minimumTabSizeHint
Previously, indicator_padding was not taken into account, causing
problems when using a indicator_padding too small

Also removed icon padding to width calculation (seemed to be overestimating)
2017-09-27 21:04:06 -04:00
Florian Bruhin
e1f3829383 Cache the completion delegate stylesheet
We removed various caches in b5eac744b5 but the
completion delegate stylesheet gets rendered a lot, causing things to slow down.

The rendering takes around 1ms, but it gets done ~10k times with a simple
profiling run, so that adds up quickly.

We don't use a functools.lru_cache here as the stylesheet template never
changes.

Thanks a lot to gilbertw1 for tracking this down!

See #2812 - there's probably more possible, but this should fix the performance
regression some people saw with the new config.
2017-09-27 23:16:40 +02:00
Florian Bruhin
fac322058e Improve crashdialog result codes 2017-09-27 11:46:51 +02:00
Florian Bruhin
6573888dc6 Fix :bind completion with invalid commands
Now that Command doesn't validate things anymore, we can't rely on parsing to
work.
2017-09-27 11:10:25 +02:00
Florian Bruhin
fef1a65247 Fix ListOrValue.to_doc signature 2017-09-27 10:37:42 +02:00
Florian Bruhin
9607f3de59 Improve type documentation of settings
Use .get_name() for the docs
2017-09-27 08:25:52 +02:00
Florian Bruhin
c694bff902 Allow direct values for url.start_pages and content.user_stylesheets 2017-09-27 08:21:03 +02:00
Jay Kamat
cc84c1722d
Merge remote-tracking branch 'upstream/master' into jay/remote-pintab-width 2017-09-26 18:07:10 -04:00
Jay Kamat
59c6555537
Remove the tabs.width.pinned setting 2017-09-26 18:06:23 -04:00
Florian Bruhin
2dfcf9c506 Remove unused imports 2017-09-26 21:37:20 +02:00
Florian Bruhin
b879f5e648 Slightly re-style prompts
See #2104
2017-09-26 21:28:01 +02:00
Florian Bruhin
6af879887f Drop --relaxed-config 2017-09-26 20:12:21 +02:00
Florian Bruhin
8e000dfe54 Make qute://configdiff usable with the new config too
Closes #2983
2017-09-26 19:39:47 +02:00
Florian Bruhin
1704438777 Reintroduce crash dialogs for QtWebKit 2017-09-26 19:25:53 +02:00
Florian Bruhin
6b5d34c7fb Fix updating of stylesheet when scrolling.bar is set
Fixes #2981
2017-09-26 11:28:40 +02:00
Florian Bruhin
277beae399 Merge branch 'pr/2984' 2017-09-26 08:48:45 +02:00
Florian Bruhin
38449e3e2b Make sure the autoconfig.yml is saved periodically
Fixes #2982
2017-09-26 06:41:55 +02:00
Florian Bruhin
38038df703 Compare objects with :set with multiple values 2017-09-25 21:24:12 +02:00
Florian Bruhin
6aed6bca93 Make loading autoconfig.yml opt-in when a config.py exists
This lets the user control the precedence those files should have, and also
simplifies the code quite a bit.

Fixes #2975
2017-09-25 21:24:12 +02:00
Ian Walker
ad2bb45446 Allow user to cancel proxy authentication request 2017-09-25 15:00:17 +09:00
Ian Walker
78bddaefe6 Move _on_proxy_authentication_required to WebEngineTab 2017-09-25 14:47:54 +09:00
Florian Bruhin
07862ce52e Merge branch 'pr/3029' 2017-09-25 06:57:02 +02:00
Florian Bruhin
8408d6ed9b Fix emacs syntax highlighting in configdata.yml 2017-09-25 06:56:33 +02:00
Florian Bruhin
40f0f75ad5 Improve error message for duplicate keys in config.py 2017-09-24 19:43:30 +02:00
arza
cb68e4b6b2 Remove extra backslashes in configdata.yml 2017-09-23 22:58:30 +03:00
arza
1784dc777d Add table headers and widen input fields in qute://settings 2017-09-23 22:24:17 +03:00
Ryan Roden-Corrent
888a1b8c57 Append multiple history backups on import.
Previously, a successful import of the text history into sqlite would
move 'history' to 'history.bak'. If history.bak already existed, this
would overwrite it on unix and fail on windows.

With this patch, the most recently imported history is appended to
history.bak to avoid data loss.

Resolves #3005.

A few other options I considered:

1. os.replace:
    - fast, simple, no error on Windows
    - potential data loss
2. numbered backups (.bak.1, .bak.2, ...):
    - fast, no data loss, but more complex
3. append each line to the backup as it is read:
    - more efficient than current patch (no need to read history twice)
    - potentially duplicate data if backup fails
2017-09-23 13:06:11 -04:00
Ian Walker
e2e9bbacce Move _on_proxy_authentication_required to WebEngineTab 2017-09-23 17:26:41 +09:00
Florian Bruhin
b8389e4496 Revert "Fix NUL byte error handling on Python 3.4"
This reverts commit a7d5a98cc4.
Not needed anymore now that we dropped support.
2017-09-22 22:30:02 +02:00
Florian Bruhin
5be44756e3 Remove unused imports 2017-09-22 17:29:01 +02:00
Michal Siedlaczek
b840b8066b Spell only when pyqt>=5.8 2017-09-22 11:16:59 -04:00
Florian Bruhin
1e2015be65 Make bindings win over mappings
Fixes #2995
2017-09-22 17:13:17 +02:00
Florian Bruhin
d5a1fff637 Move init stuff from config.py to configinit.py
Closes #2997
2017-09-22 14:11:54 +02:00
Florian Bruhin
d1a4a028cd Use more idiomatic comparison 2017-09-22 13:24:26 +02:00
Florian Bruhin
501764d1cb Fix documented default values for falsey non-strings
Fixes #3015.
2017-09-22 13:18:27 +02:00
Florian Bruhin
7f8ae531aa Add config.configdir and config.datadir to config API.
Fixes #1419
2017-09-22 09:59:46 +02:00
Florian Bruhin
9b22480b07 Raise config.py errors happening in tests 2017-09-22 09:09:45 +02:00
Jay Kamat
43ce10efc3
Simplify and reorganize configfile tests
Also make save/load of sys.path a little more robust
2017-09-22 02:05:55 -04:00
Jay Kamat
4e22b4666d
Convert save-restore of sys to a context-manager
Also improve and simplify tests for save/load of sys.module and sys.path
2017-09-22 02:05:55 -04:00
Jay Kamat
7ddde334da
Add tests for module/path isolation 2017-09-22 02:05:55 -04:00
Jay Kamat
333c0d848b
Restructure save/load of state to be more extensible
Also save/load sys.modules as well
- This is a little rough, but I can't find a better way...
2017-09-22 02:05:54 -04:00
Jay Kamat
0332dce458
Get config path from config.py location, rather than standarddir 2017-09-22 02:05:54 -04:00
Jay Kamat
a2952e13a8
Add qutebrowser config directory to python path
This is done so config.py can import other python files in the config
directory. For example, config.py can 'import theme' which would load
a theme.py.

The previous path is restored at the end of this function, to avoid
tainting qutebrowser's path
2017-09-22 02:05:52 -04:00
Florian Bruhin
f4017eb5b6 Ignore more Python warnings when importing in earlyinit
With a17c4767d6 we moved the first time
pkg_resources is imported to earlyinit.py, which means less warnings were
suppressed.

Fixes #2990
2017-09-21 23:24:22 +02:00
Florian Bruhin
599a5b9648 Remove windows/pip instructions from earlyinit
Windows: The instructions are outdated and not really relevant anymore with the
standalone packages;

pip: Let's recommend tox/virtualenv by just linking to the install docs.

Closes #2998
2017-09-21 22:48:15 +02:00
Florian Bruhin
1c76a51c1e Improve configtypes.Command docs 2017-09-21 22:31:11 +02:00
Michal Siedlaczek
396f82d474 Valid dictionaries 2017-09-21 16:30:58 -04:00
Florian Bruhin
64b783d9c0 Do not validate commands in the config and with :bind
There are just way too many gotchas related to valid modes, aliases, and
circular dependencies when validating aliases/bindings in the config.

Let's just remove this and let invalid commands fail late, when they're actually
used.
2017-09-21 22:30:48 +02:00
Florian Bruhin
f97f427100 Add an assertion for Completer._partition 2017-09-21 21:50:33 +02:00
Michal Siedlaczek
9e620ce6e9 Fix spell with new config 2017-09-21 12:09:55 -04:00
Florian Bruhin
7cad8f41f2 Remove unknown YAML data from config
I considered introducing another list of deleted options (or a "deleted: True"
in configdata.yml), similar to what we had with the old config.

However, let's take the easier route and just delete everything we don't know
from configdata.yml. If someone edits it by hand, it's their fault :P

See #2772, #2847
2017-09-21 16:29:40 +02:00
Michal Siedlaczek
132b1f705e Revert requirements changes 2017-09-21 09:56:38 -04:00
Michal Siedlaczek
329cfa5756 End2end tests for spell checking 2017-09-21 09:56:33 -04:00
Michal Siedlaczek
cf229cb9c8 Dictionary path bug fix & added warning whenever a selected dictionary isn't installed 2017-09-21 09:56:27 -04:00
Michal Siedlaczek
e61e6b124e Check if spelling supported by QWebEngineProfile (version 5.8 or higher) 2017-09-21 09:56:27 -04:00
Michal Siedlaczek
95592770a7 Fixing test dependencies and other test issues 2017-09-21 09:53:51 -04:00
Michal Siedlaczek
fac0e44a7e Test all available languages and getting installed langs when the dir doesn't exist 2017-09-21 09:52:31 -04:00
Michal Siedlaczek
82433e04ad Set default value for spelling settings and limit number of installed languages for testing 2017-09-21 09:52:09 -04:00
Michal Siedlaczek
d923ab9ae5 Moved and renamed the language list file 2017-09-21 09:51:52 -04:00
Michal Siedlaczek
c2197102a3 Enable spell checking and installing dictionaries for QtWebEngine 2017-09-21 09:51:52 -04:00
Florian Bruhin
a559477028 Merge remote-tracking branch 'origin/pr/2953' 2017-09-21 13:43:01 +02:00
Florian Bruhin
53b1ffe953 Merge remote-tracking branch 'origin/pr/2965' 2017-09-21 09:12:56 +02:00
Florian Bruhin
fb33985f07 Merge remote-tracking branch 'origin/pr/2992' 2017-09-21 09:12:03 +02:00
Florian Bruhin
106edc953a Merge branch 'is-os' 2017-09-21 08:57:32 +02:00
Jay Kamat
d5c2f2855a
Clean up pinned_tab width implementation
Misc fixes from PR
2017-09-20 20:48:48 -04:00
Jay Kamat
e49aa35c75
Remove pinned_width variables
Now it calculates the number of pinned tabs directly, instead of
keeping track of a variable. Potentially slower though.
2017-09-20 11:31:05 -04:00
Jay Kamat
da57d21f0c
Remove pinned-width from config 2017-09-20 11:31:05 -04:00
Jay Kamat
b46f116075
Switch pinned tabs to use their title width
Previously, their width was determined by a config setting
Closes #2845
2017-09-20 11:31:03 -04:00
Florian Bruhin
9d360f80cf Use __attrs_post_init__ to validate ArgInfo
This makes qutebrowser compatible with attrs < 17.1.0, such as attrs 16.3.0
coming with Debian Stretch.
2017-09-20 17:27:28 +02:00
Penaz91
6132a3d7ca Made _handle_auto_insert_mode public 2017-09-20 15:52:07 +02:00
Penaz91
7f03b0d0d5 Deleted a commented-out line 2017-09-20 13:37:40 +02:00
Penaz91
ccba76f757 Fix for Issue #2879 2017-09-20 13:31:44 +02:00
Ryan Roden-Corrent
5cd00f699e Resolve KeyError when deleting URL with space.
Resolves #2963.
2017-09-20 07:15:59 -04:00
Ryan Roden-Corrent
f9440b8026 Use CommandParser for configmodel.bind.
The parsing bind() did manually is now available through CommandParser.
Resolves #2952.

This also adds a unit test for the case when there is no current
binding, as I broke that while working on this and there was no test to
catch it :)
2017-09-20 07:05:38 -04:00
Florian Bruhin
ef1c83862b Use utils.is_* for platform checks everywhere 2017-09-20 11:10:24 +02:00
Florian Bruhin
e4594bd688 Use attributes for utils.is_* 2017-09-20 11:10:23 +02:00
Florian Bruhin
9ddc59e8e5 Also add utils.is_posix() 2017-09-20 11:10:23 +02:00
Florian Bruhin
e50ab3f72c Merge remote-tracking branch 'origin/pr/2972' 2017-09-20 10:08:08 +02:00
Felix Van der Jeugt
285b534384
make changed dirty and save on duplicate write 2017-09-20 10:04:34 +02:00
Florian Bruhin
31bd4d7ffe Make sure ProxyId is hashable
Fixes proxy auth with QtWebEngine
2017-09-20 09:30:58 +02:00
Florian Bruhin
10c84dfb90 Use unpacking to access config mutables 2017-09-20 08:52:11 +02:00
Florian Bruhin
55cbb39127 Merge remote-tracking branch 'origin/pr/2999' 2017-09-20 08:48:22 +02:00
Florian Bruhin
50b19462f4 Bring back accidentally deleted hunk 2017-09-20 08:17:04 +02:00
Florian Bruhin
ba1cf06be6 Reintroduce handling for typing.Union.__union_params__
Looks like Python 3.5.2 doesn't have typing.Union.__args__.
2017-09-20 08:17:04 +02:00
Florian Bruhin
1d2d31d0f9 Remove duplicate key mapping 2017-09-20 08:17:04 +02:00
Ian Walker
a3456c41e4 Mark url argument as unused 2017-09-20 12:51:38 +09:00
Ryan Farley
dd4294de03 fix #2979: use dictionary for mutable tracking
Using a dictionary instead of a list keeps only one working copy,
allowing consistency in between calls of update_mutables()
2017-09-19 16:26:02 -05:00
Florian Bruhin
3a5241b642 Start using attrs
Closes #1073
2017-09-19 22:21:45 +02:00
Ryan Farley
a530b0cc95 fixed iteration 2017-09-19 14:19:28 -05:00
Ryan Farley
cc540bb166 Merge branch 'master' into mutable-dict 2017-09-19 14:07:46 -05:00
Felix Van der Jeugt
8e14d1b7e6
remove unused import 2017-09-19 17:47:38 +02:00
Felix Van der Jeugt
8db630d358
don't copy values but set dirty 2017-09-19 17:26:03 +02:00
Felix Van der Jeugt
7b192d426e
add unit test and fix issues with it 2017-09-19 15:30:28 +02:00
Felix Van der Jeugt
0e743f0e09
save only a changed autoconfig file 2017-09-19 14:33:34 +02:00
Florian Bruhin
1a1a6ebf79 Improve bind documentation
[ci skip]
2017-09-19 13:56:29 +02:00
Florian Bruhin
248afde21e configapi: Also allow mode as posarg 2017-09-19 13:18:44 +02:00
Florian Bruhin
7d1549aaeb Make mode optionally in ConfigAPI.bind and .unbind 2017-09-19 13:14:41 +02:00
Florian Bruhin
40b26d7492 Always require QtOpenGL
It makes it a bit easier to explain things, and it makes the transition to
QtWebEngine smoother.
2017-09-19 08:16:26 +02:00
Florian Bruhin
43ff79be0b Merge branch 'drop-legacy' 2017-09-18 23:07:58 +02:00
Florian Bruhin
8ae87bbde2 Remove typing module from version.py
It comes with python now
2017-09-18 23:06:49 +02:00
Florian Bruhin
b1b6c462c1 Add a backend setting
See #2589
2017-09-18 23:02:08 +02:00
Florian Bruhin
61e183d9bb Fix indent 2017-09-18 23:01:18 +02:00
Florian Bruhin
cd701e95fa Reintroduce __hash__ for CertificateErrorWrapper 2017-09-18 23:01:18 +02:00
Florian Bruhin
5c0ebc1f94 Fix lint 2017-09-18 23:01:18 +02:00
Florian Bruhin
3772dc5930 Drop legacy QtWebKit support
See #2742
2017-09-18 23:01:17 +02:00
Florian Bruhin
3e70bf5af9 Make sure we never compare against an uninit'ed backend 2017-09-18 23:01:17 +02:00
Florian Bruhin
5298d14084 Move backend initialization to config.py 2017-09-18 23:01:17 +02:00
Florian Bruhin
01da144a03 Revert ipc.py socket opts handling 2017-09-18 23:01:17 +02:00
Florian Bruhin
a17c4767d6 Check libraries before Qt version
Importing qtutils for version_check needs pkg_resources, so we need to check
that's available earlier.

Also, import pkg_resources also shows warnings on older setuptools versions
because of invalid escapes, so we need to import it with warnings suppressed.
2017-09-18 23:01:17 +02:00
Florian Bruhin
db807a1bbc Reintroduce downloadview workaround
This still seems to be an issue on AppVeyor
2017-09-18 23:01:17 +02:00
Florian Bruhin
cf07bfc5c5 Make sure the :set-cmd-text command is registered 2017-09-18 23:01:17 +02:00
Florian Bruhin
505321c336 Drop support for Python 3.4
See #2742
2017-09-18 23:01:17 +02:00
Florian Bruhin
852baaa8c3 Drop support for Qt < 5.7.1
See #2742
2017-09-18 23:01:17 +02:00
Florian Bruhin
ee4d92364e Fix off-by-one issue for odd/even tabs 2017-09-18 14:29:14 +02:00
Ian Walker
9867200c38 Change username/password prompt for proxyAuthenticationRequired
Update webview.py to more closely follow the webkit/networkmanager.py
on_proxy_authentication_required().
2017-09-18 15:55:44 +09:00
Florian Bruhin
8e2b2d113b Improve explanations for dicts in the config 2017-09-18 06:25:39 +02:00
Ryan Farley
c6ea0f8372 Use dictionary for configuration mutable storage
Includes a test for persistence of intermediate mutations in a
configuration file (i.e. more than one update) and a switch of the
_mutable attribute in configurations to a dictionary of (old, new)
values rather than (name, old, new). get_obj() now checks for an
existing mutable value and returns a reference to that value, only
making an initial copy; this preserves changes between update_mutables()
2017-09-17 16:07:52 -05:00
Florian Bruhin
66e4c3286a Fix lint 2017-09-17 22:53:32 +02:00
Florian Bruhin
fe05947b54 Add a new qt_args setting
See #2589
2017-09-17 22:53:27 +02:00
Florian Bruhin
34042522f1 Set default hints font in pt and not px 2017-09-17 22:13:13 +02:00
Florian Bruhin
2398a58526 Fix more file move issues 2017-09-17 21:54:42 +02:00
Florian Bruhin
4c616a5733 Move all documentation files to doc/ 2017-09-17 21:27:38 +02:00
Florian Bruhin
3e0ca5d94d Stop using objreg for state-config 2017-09-17 21:04:34 +02:00
Florian Bruhin
70b8585e95 Move qtutils.unset_organization to standarddir 2017-09-17 20:44:08 +02:00
Florian Bruhin
6f1b8bd1d9 Make sure the config is available before the QApplication
See #2589
2017-09-17 20:06:35 +02:00
Florian Bruhin
e4d05e3fec Log error information when config init fails 2017-09-17 14:13:36 +02:00
Florian Bruhin
f85f4630ff Turn off SQL history writing during end2end tests
This hopefully makes them a bit faster, and also should help with weird hangs we
had in tests.
2017-09-17 10:58:30 +02:00
Florian Bruhin
7ed64efa08 Fix standarddir.cache() on Windows 2017-09-17 10:35:05 +02:00
Florian Bruhin
df9726a152 Fix standarddir without AppDataLocation 2017-09-17 09:49:06 +02:00
Lakshay Kalbhor
813a7b2c3a Removed if statements 2017-09-17 10:56:53 +05:30
Lakshay Kalbhor
476ca6d42f Added 'startswith()' to each OS 2017-09-17 10:27:21 +05:30
Florian Bruhin
9706dcbda5 Fix lint 2017-09-16 23:48:02 +02:00
Florian Bruhin
a1fa40f067 Remove the ability to migrate old QtWebEngine data
Versions before v0.9.0 (which didn't even support hinting with QtWebEngine!)
used to write QtWebEngine data to:

~/.local/share/qutebrowser/qutebrowser/QtWebEngine/Default
~/.cache/qutebrowser/qutebrowser/QtWebEngine/Default

In v0.9.0 this was changed to:

~/.local/share/qutebrowser/webengine
~/.cache/qutebrowser/webengine

Now we don't try to migrate data from the old location anymore.
2017-09-16 23:48:02 +02:00
Florian Bruhin
a85e19a5e1 Add initial support for early standarddir init
See #2589, #2791
2017-09-16 23:47:22 +02:00
Florian Bruhin
046a16f924 Bind <Ctrl-Shift-N> and <Ctrl-Shift-W> by default
See #2954
2017-09-16 22:22:36 +02:00
Lakshay Kalbhor
c5ceb6b880 Added functions to check OS/Platform 2017-09-16 19:23:05 +05:30
Florian Bruhin
0ae1f5909d Strip the old text for configdiff
This means we don't report an unneeded whitespace hunk anymore.
2017-09-16 14:41:37 +02:00
Florian Bruhin
2afd7549bc Encode Unicode in old config as escapes
This seems to fix #2971.
2017-09-16 14:39:37 +02:00
Florian Bruhin
714c18db0e Fix \b escapes in old config file 2017-09-16 14:20:08 +02:00
Florian Bruhin
3179e8c7b9 Always autoescape jinja environments unless overridden
We were only rendering .html files before, so the old _guess_autoescape function
had the effect of always autoescaping .render() (from a file) but never
autoescaping .from_string(). However, most places using .from_string() actually
render (Qt-)HTML via jinja, so they should escape stuff!

Now, we always autoescape, except when the caller uses the
jinja.environment.no_autoescape() context manager, which places rendering
stylesheets now do.

This impacted:

- Confirm quit texts (no HTML here)
- config.py loading errors
  (where this was found because of an error containing - a <keybinding>)
- Certificate error prompts
  (should be fine from what I can tell, as the only user-controllable output is
  the hostname, which cannot contain HTML)
2017-09-16 10:43:59 +02:00
Florian Bruhin
337d57b940 Be more clever about missing qute://help pages 2017-09-16 10:43:59 +02:00
Ian Walker
eaa1bdcddb Show error page when user cancels proxy authentication dialog 2017-09-16 17:13:16 +09:00
Ian Walker
9face7567c Removed QAuthenticator import 2017-09-16 17:01:18 +09:00
Florian Bruhin
c8f3743008 Remove auto_save.config setting
This is not needed anymore now that we have config.load_autoconfig=False and
wasn't even read anywhere.
2017-09-15 22:22:09 +02:00
Florian Bruhin
1bcc66b5b9 Add documentation for new config
This also changes qute://help to show the documentation generation error if a
help page wasn't found. This way, people who pull from git but not re-generate
the documentation hopefully get the idea.
2017-09-15 22:22:09 +02:00
Florian Bruhin
4f6e085be8 Quote a completed value if it contains " 2017-09-15 22:17:38 +02:00
Florian Bruhin
a7d5a98cc4 Fix NUL byte error handling on Python 3.4
Looks like Python 3.4 raises TypeError and not ValueError...
2017-09-15 22:17:38 +02:00
Florian Bruhin
543bc3bcaa Fix default :open keybindings
:open -i (--implicit) is now -r (--related).
2017-09-15 22:17:38 +02:00
Florian Bruhin
42039eee99 Fully remove ConfigAPI.val 2017-09-15 19:01:03 +02:00
Florian Bruhin
3be7299cb4 Fix completions for FlagList 2017-09-15 18:41:08 +02:00
Florian Bruhin
54c417391d Add a qute://configdiff page 2017-09-15 18:26:33 +02:00
Florian Bruhin
2e8419db27 Fix lint 2017-09-15 17:24:39 +02:00
Florian Bruhin
c9625cb311 Add more tests for YAML error handling 2017-09-15 17:21:11 +02:00
Florian Bruhin
3f8817cc2d Use blocking message boxes for config errors 2017-09-15 17:21:11 +02:00
Florian Bruhin
745ef63451 Start implementing autoconfig.yml error handling 2017-09-15 17:21:11 +02:00
Florian Bruhin
a92ffd9770 Improve NoOptionError traceback 2017-09-15 17:21:11 +02:00
Florian Bruhin
413c7ec1ac Add config type docstrings to settings.asciidoc 2017-09-15 17:21:11 +02:00
Florian Bruhin
d7d8d191c0 Remove FIXMEs
backend validation: I decided not to do this, as it is quite annoying when
switching between backends.
2017-09-15 17:20:58 +02:00
Florian Bruhin
e87a782411 Move command-history init to cmdhistory.py 2017-09-15 14:27:15 +02:00
Florian Bruhin
ee5dd7fad2 Remove interpolation FIXME and DEFAULT_FONT_SIZE
This is just not going to happen, and with the new config we have no good way of
supporting a DEFAULT_FONT_SIZE.
2017-09-15 14:11:10 +02:00
Florian Bruhin
e0621c6eda Fix initializing without a config.py 2017-09-15 14:08:37 +02:00
Florian Bruhin
7c39600508 Change default bindings for Up/Down in command mode
Those now look at the history again.
Looking at the behavior in different applications:

- vim: History
- spacemacs: Completion if open, else history
- luakit: Completion if open, else history
- dwb: Always completion (has no history?)
- vimb: Nothing if completion open, else history
- vimperator: Always history

So this is consistent with at least some of them - the much more important
factor is that <Tab> is probably intuitively easy to discover if up/down doesn't
do what's expected, but <ctrl-p>/<ctrl-n> are not.
2017-09-15 14:08:37 +02:00
Florian Bruhin
f406e8d9ca Remove config.val support for config.py 2017-09-15 14:08:37 +02:00
Florian Bruhin
bb648b62f3 Make sure we honour config_api.load_autoconfig even with errors
We don't raise ConfigFileErrors inside read_config_py so we can get back the
config_api object. Instead we raise it in config.init().
2017-09-15 12:07:54 +02:00
Florian Bruhin
5efce10c2c Add initial tests for config.py error handling 2017-09-15 12:07:54 +02:00
Florian Bruhin
bbffda669a Fix lint 2017-09-15 12:07:54 +02:00
Florian Bruhin
c031a7ab3d Fix another Python 3.4 circular import 2017-09-15 12:07:54 +02:00
Florian Bruhin
b8fb88f4c2 Improve config error handling
- Errors are now combined if possible
- Rich text output in message boxes
- ConfigContainer errors are collected properly
2017-09-15 12:07:54 +02:00
Ian Walker
506ee571b1 Add handler for proxyAuthenticationRequired() 2017-09-15 08:36:59 +09:00
Florian Bruhin
490de32b49 Initial attempt at error handling for config.py 2017-09-14 21:51:29 +02:00
Florian Bruhin
b3734b151b Handle mutations in config.py correctly 2017-09-14 17:38:33 +02:00
Florian Bruhin
cb806aefa3 Initial config.py support
See #2795
2017-09-14 17:38:33 +02:00
Florian Bruhin
6618c3a6e8 Don't use shlex for configtypes.ShellCommand
We accidentally did show the command as a list in to_str(). However, after
correcting that to use shlex.escape, we got ugly qutebrowser command lines
when tabbing to the default value, because of how shlex handles double-escaping:

>>> print(shlex.quote("gvim -f '{}'"))
'gvim -f '"'"'{}'"'"''

While in this case, outputting "gvim -f '{}'" would be much more appropriate, it
doesn't look like we can teach shlex.quote to do that.

Instead, we now only accept a list as input for ShellCommand, at the price that
the user needs to do
  :set editor.command '["gvim", "-f", "{}"]'
instead of
  :set editor.command 'gvim -f {}'

Fixes #2962.
2017-09-14 14:44:24 +02:00
Florian Bruhin
12260e068a Don't move cache directory on Windows 2017-09-14 13:35:42 +02:00
Florian Bruhin
0de7b2eb83 Skip standarddir migrations when a basedir is given 2017-09-14 00:37:54 +02:00
Florian Bruhin
3dc67df180 Fix minor standarddir migration issues 2017-09-14 00:37:54 +02:00
Florian Bruhin
cee51df4fb Refactor JS log handling and use a dict for javascript.log
Fixes #2828
2017-09-14 00:37:01 +02:00
Florian Bruhin
1fc9817cd4 Remove support for ambiguous keybindings 2017-09-14 00:37:01 +02:00
Florian Bruhin
bf9d401198 Reorder statusbar settings in configdata.yml 2017-09-13 21:32:36 +02:00
Florian Bruhin
13f49738d7 Fix typo in content.user_stylesheets 2017-09-13 21:32:36 +02:00
Florian Bruhin
8537e92d39 Add backend: QtWebKit for hints.find_implementation 2017-09-13 21:32:36 +02:00
Florian Bruhin
9d95dec5ea Handle standarddir.config() correctly on macOS
With auto=False we should get ~/.qutebrowser
2017-09-13 21:32:36 +02:00
Florian Bruhin
718dd21573 Handle auto-config location properly with --basedir 2017-09-13 21:32:36 +02:00
Florian Bruhin
f7d17c4c55 Allow existing empty dir when migrating files
Remove old empty directory if it exists - otherwise, we move old/data to
new/data/data.
2017-09-13 21:32:22 +02:00
Florian Bruhin
2a9441dfbf Make moving data in standarddir more generic 2017-09-13 21:32:22 +02:00
Florian Bruhin
8c4bc76de6 Stabilize hint test which failed on macOS 2017-09-13 17:26:56 +02:00
Florian Bruhin
ad2598b475 Add initial support for standarddir.config(auto=True)
This doesn't actually migrate things yet.
See #2791, #383.
2017-09-13 17:26:56 +02:00
Florian Bruhin
a2f16dbecd Merge standarddir.system_data() into standarddir.data(system=True)
See #2791
2017-09-13 17:26:56 +02:00
Florian Bruhin
2d500d4efa Also don't create ~/Downloads in standarddir.downloads()
This means we need to create it in downloads.py instead.

Fixes #2418
2017-09-13 17:26:56 +02:00
Florian Bruhin
91f5e72f02 Remove download dir from path info
This always returns the default Qt path (e.g. ~/Downloads) and also creates it
each time.

See #2418
2017-09-13 17:26:56 +02:00
Florian Bruhin
1fe1cd45f5 Remove dead code
This code is not called/needed anymore with the changes done in the new-config
branch.
2017-09-13 17:26:56 +02:00
Florian Bruhin
56bbd73622 Introduce standarddir caching
This makes things a bit more complicated, but is needed to make standarddir (and
thus the config) work without a QApplication.
2017-09-13 17:26:56 +02:00
Florian Bruhin
b04a233e8d Adjust :unbind signature to match :bind 2017-09-12 22:51:52 +02:00
Florian Bruhin
f70c5968a9 Improve documentation for command modes 2017-09-12 22:12:37 +02:00
Florian Bruhin
07079664a6 Don't use alias in default binding
See #2957
2017-09-12 22:12:37 +02:00
Florian Bruhin
fe8ffcc5c3 Quote default xos4 Terminus font properly 2017-09-11 21:50:35 +02:00
Florian Bruhin
f6a0500bd3 Merge branch 'master' into new-config
This pulls the travis changes to drop the old Qt 5.2 environment.
2017-09-11 18:39:41 +02:00
Florian Bruhin
b4f30f6df2 Move coverage to QtWebEngine environment with PyPI-PyQt 2017-09-11 18:30:23 +02:00
Florian Bruhin
1d66aacb36 Remove old :wq handler 2017-09-09 11:05:15 +02:00
Florian Bruhin
a283a1bb65 Merge branch 'master' into new-config 2017-09-09 10:52:02 +02:00
Ryan Roden-Corrent
a8b0a42791 Remove extra blank line from utilcmds 2017-09-08 08:00:29 -04:00
Ryan Roden-Corrent
deb6cccff9 Fix merge resolution in messageview.
Remove a line that was acidentally re-added while merging master into
new-config.
2017-09-07 12:08:26 -04:00
Ryan Roden-Corrent
a6d14ad7dc Fix two new-config/master merge resolutions.
Remove icon from jinja.render call (removed in master).
Add 'When the unwritable dir is unwritable' to download feature file.
2017-09-07 08:58:55 -04:00
Ryan Roden-Corrent
607c64742c Fix configmodel nitpicks 2017-09-07 08:56:11 -04:00
Ryan Roden-Corrent
f0509d1c26 Fix web_history_max_items default value.
Should default to -1, not 1000 as the new history completion is better
able to handle large numbers of entries. I believe this was acidentally
reset to 1000 while fixing a merge conflict.

Also re-run src2asciidoc.
2017-09-07 08:45:05 -04:00
Ryan Roden-Corrent
aec736439c Restore history cache stats.
Acidentally removed in merge.
2017-09-07 07:32:51 -04:00
Ryan Roden-Corrent
3726502017 Fix bad merge from master to newconfig. 2017-09-05 07:44:36 -04:00
Ryan Roden-Corrent
0d78c72018 Remove config dependency from get_cmd_completions.
In order to really resolve the python3.4 circular import, this should
take the completion info as an argument and not depend on the config
module.
2017-09-04 15:00:35 -04:00
Ryan Roden-Corrent
3bfa01f0d0 Pass CompletionInfo to completion functions.
In python3.4, there is a circular dependency between the config module
and configmodel.bind. This is resolved by dependency injection. The
config/keyconfig instances are embedded in a struct passed to every
completion function, so the functions no longer depend on the modules.

This will also enable completion functions to access other previously
inaccessible info, such as the window id.
See #2814.
2017-09-04 14:01:48 -04:00
Florian Bruhin
1938520878 eslint: Turn off function-paren-newline 2017-09-04 15:48:33 +02:00
Florian Bruhin
79d3c49f26 Merge pull request #2909 from jgkamat/jay/fix-2900
Fix saving a session with --only-active-window
2017-08-28 07:58:25 +02:00
Florian Bruhin
25780eb2bc Merge pull request #2905 from rcorre/urlencode
Consistently format urls in history.
2017-08-28 07:56:45 +02:00
Ryan Roden-Corrent
37ba256900 Ensure web-history-max-items has int64 as maxval.
See #2779.
2017-08-27 22:29:01 -04:00
Ryan Roden-Corrent
d2d55531e6 Remove double-registration of proxy factory.
Due to a bad merge, proxy.init() was called twice.
2017-08-27 22:27:34 -04:00
Ryan Roden-Corrent
b89caf0458 Use REPLACE when rebuilding completion table.
When upgrading from an old table that used different url formatting, two
entries might map to the same key, so we'll need to replace the previous
entry to avoid a primary key conflict.
2017-08-23 21:26:27 -04:00
Ryan Roden-Corrent
d35b47c9d8 Regenerate history completion on version change.
Incrementing _USER_VERSION in the source will cause the
HistoryCompletion table to regenerate when users update.

This is currently necessary to support some recent formatting fixes, but
could be incremented again in the future for other changes.
2017-08-21 08:45:40 -04:00
Ryan Roden-Corrent
111846a909 Merge remote-tracking branch 'upstream/master' into configmerge 2017-08-20 21:18:47 -04:00
Ryan Roden-Corrent
b5a6583559 Fix pylint/flake8/vulture errors. 2017-08-20 21:12:38 -04:00
Ryan Roden-Corrent
90c49b3fe7 Move bind completion to configmodels.
When in miscmodels, the config module was unable to find the function.
It appears to be some sort of circular import issue:

```
  File "/home/rcorre/projects/contrib/qutebrowser/qutebrowser/app.py", line 44, in <module>
    from qutebrowser.completion.models import miscmodels
  File "/home/rcorre/projects/contrib/qutebrowser/qutebrowser/completion/models/miscmodels.py", line 24, in <module>
    from qutebrowser.completion.models import completionmodel, listcategory, util
  File "/home/rcorre/projects/contrib/qutebrowser/qutebrowser/completion/models/util.py", line 24, in <module>
    from qutebrowser.config import config
  File "/home/rcorre/projects/contrib/qutebrowser/qutebrowser/config/config.py", line 223, in <module>
    class ConfigCommands:
  File "/home/rcorre/projects/contrib/qutebrowser/qutebrowser/config/config.py", line 314, in ConfigCommands
    @cmdutils.argument('command', completion=miscmodels.bind)
AttributeError: module 'qutebrowser.completion.models.miscmodels' has no attribute 'bind'
```

As configmodel imports util (and thereby config as well) it is unclear
to me why moving bind() to configmodel actually fixes this, but it does.
2017-08-20 21:12:38 -04:00
Ryan Roden-Corrent
0286e9ddf2 Fix completion tests after config merge. 2017-08-20 21:12:38 -04:00
Ryan Roden-Corrent
5f45b9b40e Fix pylint and coverage for history. 2017-08-20 20:59:48 -04:00
Ryan Roden-Corrent
8c6133e29d Regenerate history completion table if needed.
If the HistoryCompletion table is removed, regenerate it from the
History table. This allows users to manually edit History, then remove
HistoryCompletion to prompt regeneration.

See #2903.
2017-08-18 07:39:36 -04:00
Ryan Roden-Corrent
c607537319 Consistently format urls in history.
Encode urls that are inserted into the history, but do not encode urls
for completion (other than removing passwords).
Also ensure that urls read from the history text file are formatted
consistenly with those added while browsing.

Fixes #2903.
2017-08-14 21:37:43 -04:00
cryzed
085d1e9c10 :save-session --only-active-window implies --with-private for private windows 2017-08-14 00:30:45 +02:00
cryzed
6ef53c814c Expand ~ to user's home on Linux 2017-08-13 02:34:50 +02:00
Ryan Roden-Corrent
5ea420b49b Fix startup crashes after config merge.
Get qutebrowser to the point where it can at least start

- Declare _messages earlier in MessageView.__init__ so it is set before
  the config trigger tries to access it.
- Remove unused configmodel completion functions
- Move bind completion to configmodel to avoid a circular import with
  the config module
- Fix some config accesses (forgot to use .val)
- Fix old Completion.CompletionKind references
2017-08-09 07:28:22 -04:00
Florian Bruhin
3a2d64ba46 version.distribution(): Handle Funtoo 2017-08-08 20:19:33 +02:00
Florian Bruhin
a20f017c7a Sort sessions in SessionMnager.list_sessions() 2017-08-08 07:56:10 +02:00
Ryan Roden-Corrent
71b71dbc58 Merge remote-tracking branch 'upstream/master' into HEAD 2017-08-06 18:13:49 -04:00
Ryan Roden-Corrent
6e025c1bb0 Don't perform alphabetical sort in listcategory.
Instead, expect the data to be given in the desired order. Completion
functions should sort their data _if_ they want it sorted in the
completion. This has a few implications:

- {book,quick}marks appear in the same order they do in the text file.
  This means users can rearrange their mark files for custom sorting.
  Fixes #2354
- Sessions are sorted as they appear in the session manager
- Tabs are sorted numerically, not alphabetically (Fixes #2883)

Note that prefix-based filter sorting is still performed, so items
starting with the filter pattern come first.
2017-08-06 10:00:18 -04:00
Florian Bruhin
49b858e359 Add more variants of fake apple URL to ignored ones 2017-08-01 16:00:53 +02:00
Florian Bruhin
695769d1b4 Merge pull request #2875 from rcorre/obsolete-signals
Remove obsolete signals.
2017-07-29 20:30:25 +02:00
Florian Bruhin
ba92ea9fb4 Merge pull request #2873 from rcorre/completion-del-marks
Support delete from :{quick,book}mark-load.
2017-07-29 19:27:25 +02:00
Ryan Roden-Corrent
8e34b54cd7 Remove obsolete signals.
The added/removed signals for the urlmark managers are no longer used as
the completion models are generated on-the-fly. The changed signal is
still needed so the save-manager knows when to trigger a write to disk.

Also removes session_manager.update_completion, which is no longer
needed for the same reason as above.

keyconf.changed cannot be removed, as it is still wired up to
basekeyparser.

Resolves #2874.
2017-07-29 13:09:10 -04:00
Ryan Roden-Corrent
1ab7bb83cc Support delete from :{quick,book}mark-load.
Pressing ctrl-d in the completion menu for
:quickmark-load/:bookmark-load  will now delete the selected
quickmark/bookmark.

Resolves #2840.
2017-07-29 12:49:20 -04:00
Ryan Roden-Corrent
c6cb6ccd07 Fix fetch/delete sql category bug.
Fixes #2868, where pressing <shift-tab> then <ctrl-d> in history
completion (with > 256 items) would cause later items to disappear (and
cause a crash if you try to delete again).

Cause:
Scrolling to the bottom would fetch an additional 256 items (in addition
to the 256 that are fetched at first). Deleting causes the query to
re-run, but it only fetches the initial 256 items, so the current index
is now invalid.

Fix:
After deleting from the history category, call fetchMore until it has
enough rows populated that the current index is valid.
2017-07-28 09:07:30 -04:00
Florian Bruhin
8f63bb1edc Merge pull request #2853 from rcorre/fix-completionview
Expand history completion results if on last index.
2017-07-27 12:31:01 +02:00
Florian Bruhin
629f6a6876 Remove unused import 2017-07-27 09:56:34 +02:00
Florian Bruhin
a942613d7f Use ctypes instead of PyOpenGL for QtWebEngine Nvidia workaround
Fixes #2821
2017-07-27 09:22:12 +02:00
Ryan Roden-Corrent
32fa1ff1e9 Expand history completion results if on last index.
When tabbing to the last index of history completion, call expandAll
which will call fetchMore to retrieve more query results, if available.

Calling fetchMore directly will not update the view, and for some
reason self.expand(idx.parent()) and
self.expand(self.model().index(idx.row(), 0)) did not work, so I'm using
expandAll.

Fixes #2841.
2017-07-26 07:46:12 -04:00
Ryan Roden-Corrent
1929883485 Fix bind completion for bindings with arguments.
When a key is bound to a command line that includes one or more
arguments to a command, bind completion should show the whole command
for the "Current" category, and use only the command name to look up the
description.

Fixes #2859, where a crash was caused by looking up the description by
the full command text rather than just the name.
2017-07-25 12:55:44 -04:00
Florian Bruhin
5ecda25fdb Fix renderer process test for older Qt versions 2017-07-25 17:35:42 +02:00
Florian Bruhin
792a01ba6d Try to stabilize renderer process test 2017-07-25 16:56:38 +02:00
Florian Bruhin
3de0b15073 Delay showing the "renderer process killed" error page a bit
Sometimes, we get another error with "Renderer process was killed" and the data:
URL for the error page. This is probably because the renderer process wasn't
restarted yet. This hopefully helps.
2017-07-25 16:00:52 +02:00
Ryan Roden-Corrent
f09423efe5 Abort resizeEvent if model is None.
Some reports came in that a resizeEvent was causing a crash due to the
model being none in the CompletionView.

Fixes #2854.
2017-07-24 08:16:14 -04:00
Florian Bruhin
df3ba278e9 Merge pull request #2852 from rcorre/fix-max-items
Fix web-history-max-items-crash.
2017-07-24 07:29:15 +02:00
Florian Bruhin
837ee5c626 Merge pull request #2846 from rcorre/completion-fixes
Completion fixes
2017-07-24 07:27:11 +02:00
Ryan Roden-Corrent
2ad4cdd729 Fix web-history-max-items-crash.
Fixes #2849, where pressing 'o' with web-history-max-items set and no
history items would cause a crash as the query result is empty.
2017-07-23 21:17:22 -04:00
Ryan Roden-Corrent
ff9efe22ae Fix unused imports and removeRow override.
Override removeRows instead of removeRow.

> removeRow is not virtual in C++, so if this gets called by Qt
> internally for some reason, it wouldn't use the overloaded version -
> so I think it'd be better to implement removeRows and then use
> removeRow without overloading that

- The-Compiler
2017-07-23 17:30:09 -04:00
Florian Bruhin
e402e37f12 Work around segfault when using pdb 2017-07-23 22:45:13 +02:00
Florian Bruhin
56b4989f44 Fix tests for QProcess changes 2017-07-23 22:10:50 +02:00
Florian Bruhin
a08fd0fcb1 Fix error message with :spawn -d 2017-07-23 21:38:10 +02:00
Florian Bruhin
353f86488a Disallow :spawn -u -d 2017-07-23 21:38:10 +02:00
Ryan Roden-Corrent
00be9e3c7f Remove obsolete TODO.
New aliases will now show up without a signal, as completions are
generated on-demand.
2017-07-22 18:09:10 -04:00
Ryan Roden-Corrent
b61691684e Clear selection when setting completion pattern.
It doesn't make sense to have an active selection while you are
filtering by entering text. You should be in one of two states:

1. Tabbing through completions (valid selection)
2. Entering a filter pattern (invalid selection)

Fixes #2843, where a crash would occur after the following:

1. tab to an item other than the first
2. <backspace>
3. re-type last character
4. <ctrl-d>

This would try to delete an out of range index.
2017-07-22 18:06:16 -04:00
Ryan Roden-Corrent
bc21904fef Fix completion-item-del on undeletable item.
Even though no item was deleted, it was manipulating the completion
model because beginRemoveRows was called before the exception was
raised.

This fixes that problem by moving the removal logic (and delete_func
check) into the parent model, so it can check whether deletion is
possible before calling beginRemoveRows.

Fixes #2839.
2017-07-22 17:16:35 -04:00
Florian Bruhin
a00548ec4d Merge pull request #2827 from jgkamat/jay/fix-small-crash
Enforce a minimum size for non-pinned tabs
2017-07-22 22:07:31 +02:00
Jay Kamat
27dfc72012
Restructure minimum tab size behavior 2017-07-22 10:55:08 -07:00
Florian Bruhin
118a7942a5 Add maximum bound for web-history-max-items
sqlite can't handle values bigger than uint64_t for LIMIT.
2017-07-21 18:30:12 +02:00
Florian Bruhin
544094ba72 Use simpler way of preventing History completion 2017-07-21 17:55:47 +02:00
Florian Bruhin
6660297871 Fix new completion with web-history-max-items set to 0
We get no last_atime limit at all otherwise:

qutebrowser.misc.sql.SqlException: Failed to prepare query "SELECT url, title,
strftime('%Y-%m-%d', last_atime, 'unixepoch', 'localtime') FROM
CompletionHistory WHERE (url LIKE :pat escape '\' or title LIKE :pat escape '\')
AND last_atime >= ORDER BY last_atime DESC": "near "ORDER": syntax error Unable
to execute statement"
2017-07-21 17:11:38 +02:00
Florian Bruhin
fba25338be Merge pull request #2295 from rcorre/really_complete
Completion refactor V3
2017-07-21 15:05:43 +02:00
Ryan Roden-Corrent
1175543ce1 Fix qutescheme timestamp error.
A date object doesn't have a timestamp property. Go back to using
mktime.
2017-07-20 22:07:37 -04:00
Ryan Roden-Corrent
0eb347186c Add 'localtime' to sql history query.
We need to tell sqlite to convert the timestamps to localtime during
formatting, otherwise it formats them as though you are in UTC.

Also fix up a few uses of mktime.
2017-07-20 09:06:29 -04:00
Jay Kamat
8dbb61e9e3
Enforce a minimum size for non-pinned tabs
Closes #2826
2017-07-19 21:37:48 -07:00
Florian Bruhin
fafa063bcd Remove unused import 2017-07-19 12:55:51 +02:00
Florian Bruhin
a26fc89f49 Simplify setting the size for background tabs
We can simply look at the size of the existing open tab.
2017-07-19 11:59:44 +02:00
Florian Bruhin
0f85898137 Add a config version to the YAML file 2017-07-19 08:22:00 +02:00
Florian Bruhin
4a7fe25f66 Only clear search with :search if one is displayed
For some reason, calling search.clear() while no search is displayed causes the
backends to un-focus inputs, and with QtWebKit, even hinting can't focus them
again after that.
2017-07-17 15:00:18 +02:00
Ryan Roden-Corrent
c32d452786 Add LIMIT to history query.
For performance, re-introduce web-history-max-items.
As the history query has now become a very specific multi-part query and
history completion was the only consumer of SqlCategory, SqlCategory is
now replaced by a HistoryCategory class.
2017-07-16 18:13:51 -04:00
Florian Bruhin
ee1707c4d4 Update back/forward indicator on tab switches 2017-07-16 20:20:33 +02:00
Florian Bruhin
cbf9da0b7e Set window.navigator.languages correctly 2017-07-13 21:24:17 +02:00
Florian Bruhin
5c367e7ab2 Fix the "try again" button on error pages
Fixes #2810
2017-07-13 17:26:58 +02:00
Ryan Roden-Corrent
8745f80d90 Fix qute://history SQL bug.
The javascript history page was requesting the new start_time in ms, but
the python code was expecting seconds. This is fixed by removing all the
millisecond translations in the python code and only translating to
milliseconds in the javascript code that formats dates.
2017-07-13 08:54:21 -04:00
Florian Bruhin
71ee64a974 Merge branch 'jay/prompt-on-click' of https://github.com/jgkamat/qutebrowser 2017-07-13 11:01:04 +02:00
Jay Kamat
7dfca60893
Refactor tab_close_prompt_if_pinned
Now it lives in tabbedbrowser.py as method instead of a static function
2017-07-12 20:18:57 -07:00
Ryan Roden-Corrent
1aed2470e5 SQL code review.
- Fix flake8
- history.clear should also clear completion table
- call _resize_columns in set_model, not set_pattern
- add more unit-testing for the history completion table
2017-07-12 22:14:27 -04:00
Ryan Roden-Corrent
ea459a1eca SQL code review fixes.
- Ignore invalid variable name in flake8 (pylint already checks this and
  we don't want to have to double-ignore)
- Fix and test completion bug with `:set asdf `
- Remove unused import
- Use `assert not func.called` instead of `func.assert_not_called` for
  backwards compatibility
2017-07-12 08:19:31 -04:00
Florian Bruhin
53620ecce4 Fix printing on macOS
Fixes #2798
2017-07-12 07:43:03 +02:00
Florian Bruhin
ba8083c539 Fix issues with new stylesheet cache 2017-07-11 21:59:17 +02:00
Florian Bruhin
9307cf86fa Add a cache for rendered stylesheets
Otherwise, when showing hints a few times, we spend around 8-10s just in jinja
generating stylesheets.
2017-07-11 21:06:53 +02:00
Ryan Roden-Corrent
182d067ff8 SQL code review fixes.
- Fix comment and empty line check in _parse_entry
- connect layoutAboutToBeChanged signal
- assert sort_order is None if sort_by is None
- modify sql init failure message to ask about Qt sqlite support.
2017-07-11 08:07:48 -04:00
Florian Bruhin
c0426d3482 Merge branch 'pr/2808' 2017-07-11 09:27:08 +02:00
Florian Bruhin
882dc75536 Set default count for AbstractHistory.back/.forward
Otherwise, using back/forward mouse buttons will crash.
2017-07-11 08:38:06 +02:00
Florian Bruhin
f93b92cca8 adblock: Fix getting filename from URL
On Windows, we would end up with /C:/foo as "path".
2017-07-10 21:36:34 +02:00
Yashar Shahi
7da6908850 Check for interval being positive.
Check for interval being positive instead of checking for it to be
non-zero. So if somehow some unexpected thing happend and made
message-timeout negative, the bug doesn't cascade.
2017-07-10 21:14:55 +04:30
Yashar Shahi
1cb23f1193 Change timer interval after appending to _messages 2017-07-10 21:11:38 +04:30
Florian Bruhin
1f4012cc1e Merge branch 'master' of https://github.com/iordanisg/qutebrowser 2017-07-10 18:33:46 +02:00
Florian Bruhin
135fb042da Make settings from qute://settings persistent 2017-07-10 18:04:39 +02:00
Yashar Shahi
9574549798 Merge https://github.com/qutebrowser/qutebrowser 2017-07-10 19:58:03 +04:30
Florian Bruhin
045831f3c7 Fix coverage check 2017-07-10 16:57:26 +02:00
Yashar Shahi
cb0bd2c52d Do not call _set_timer_interval() at constructor
No need to call _set_timer_interval() at constructor since it's called
every time timer is going to be started.
2017-07-10 19:21:35 +04:30
Iordanis Grigoriou
9c83ea4717 Refactor _back_forward 2017-07-10 15:58:11 +02:00
Iordanis Grigoriou
6ab49fdf1d Move back/forward logic to AbstractHistory, fix method names 2017-07-10 15:43:35 +02:00
Yashar Shahi
3c1b05c81e Show messages longer if there are multiple of them 2017-07-10 18:05:35 +04:30
Florian Bruhin
e81dcccace Add a test for a None currentWidget with backforward widget 2017-07-10 09:29:45 +02:00
Florian Bruhin
5fb6cb713b Hide back/forward widget when there's no text 2017-07-10 07:59:56 +02:00
Iordanis Grigoriou
bf074d14de Adjust back/forward method arguments in AbstractHistory class 2017-07-10 01:00:48 +02:00
Iordanis Grigoriou
c6ed4fe4f9 Skip intermediate pages with :back/:forward and a count 2017-07-10 00:28:47 +02:00
Jay Kamat
28a2482cf7
Merge branch 'master' into jay/prompt-on-click 2017-07-09 14:17:03 -07:00
Daniel Hahler
b3a9e09d6c Add statusline widget for back/forward indicator
Fixes https://github.com/qutebrowser/qutebrowser/issues/2737.
2017-07-09 22:38:44 +02:00
Florian Bruhin
bb567a61b6 Fix ipc test coverage 2017-07-09 22:09:31 +02:00
Florian Bruhin
84c2289aa5 Merge branch 'master' of https://github.com/iordanisg/qutebrowser 2017-07-09 12:56:52 +02:00
Florian Bruhin
6a2163d36f ipc: Remove support for connecting to legacy servers 2017-07-09 12:49:47 +02:00
Florian Bruhin
cfb169b5f0 Remove unused import 2017-07-09 12:40:16 +02:00
Florian Bruhin
9e7f2e470f Move OpenGL workaround import
OpenGL.GL gets imported in earlyinit already anyways, so we can move everything
there.
2017-07-09 11:57:06 +02:00
Florian Bruhin
915cd5f016 Fix long lines 2017-07-09 11:51:22 +02:00
Florian Bruhin
fcf5158258 Recommend QT_XCB_FORCE_SOFTWARE_OPENGL
This won't disable OpenGL for stuff started from qutebrowser.

See #2368.
2017-07-08 17:36:14 +02:00
Florian Bruhin
b81474d2fd Improve earlyinit check for PyOpenGL
Importing OpenGL alone doesn't actually load libgl, it only checks that the
package is here. If libgl is missing, we'd later get an exception.
2017-07-08 17:33:50 +02:00
Iordanis Grigoriou
c9fd182dba Adjust suggested_fn_from_title, add tests 2017-07-08 16:28:58 +02:00
Ryan Roden-Corrent
f9f8900fe9 More sql code review fixes.
- remove outdated comment
- fix sql init error message
- clean up history text import code
- fix test_history file path in coverage check
- use real web history, not stub, for completion model tests
- use qtmodeltester in sql/list_category tests
- test url encoding in history tests
- fix test_clear by using a callable mock
- remove test_debug_dump_history_oserror as the check is now the same as
  for the file not existing
- rename nonempty to data in test_completionmodel
- add more delete_cur_item tests
- test empty option/value completion
2017-07-08 09:57:32 -04:00
Florian Bruhin
ad615941a2 Replace OS X with macOS 2017-07-08 11:12:43 +02:00
Florian Bruhin
0de0bbfa71 Fix :restart with private browsing mode 2017-07-08 10:46:08 +02:00
Ryan Roden-Corrent
515e82262d Merge remote-tracking branch 'upstream/master' into really_complete 2017-07-07 20:42:21 -04:00
Florian Bruhin
f80fd2a27c Merge branch 'pr/2782' 2017-07-07 18:38:29 +02:00
Christian Helbling
6d9e5dc931 avoid too long lines 2017-07-07 11:30:18 +02:00
Florian Bruhin
6a8d2ac826 Disable search workaround for Qt 5.9.2 2017-07-06 23:18:29 +02:00
Iordanis Grigoriou
82d194cf2e Improve function docstring, add more tests 2017-07-06 21:37:11 +02:00
Iordanis Grigoriou
3bfafb5e50 Refactor suggested_fn_from_title, add unit tests 2017-07-06 17:41:54 +02:00
Christian Helbling
d179450c29 :fullscreen, enter video fullscreen, :fullscreen, exit video fullscreen should not go into video fullscreen 2017-07-06 15:35:52 +02:00
Ryan Roden-Corrent
1dd5f06a4f Fix debug-dump-history behavior.
Ensure the file is closed before printing the success message. This will
hopefully fix the AppVeyor tests.
2017-07-06 08:02:16 -04:00
Ryan Roden-Corrent
cee0aa3adc Show error dialog is sql isn't available.
If creating the sql database fails, show an error dialog assuming sqlite
is not installed.

This removes the isDriverAvailable check as it was true even with sqlite
uninstalled.

sql.version now inits itself if sql is not already initialized and
prints 'UNAVAILABLE (<error message>)' if init fails. This is to avoid
cascading errors, where one error would create a crash dialog, which
calls sql.version, which would create another error.
2017-07-06 07:36:59 -04:00
Florian Bruhin
911e59b0f4 Improve version output without SSL support 2017-07-06 12:23:08 +02:00
Iordanis Grigoriou
57e4d4978b Use page title only for whitelisted extensions 2017-07-06 11:59:02 +02:00
Florian Bruhin
3c9de92d58 Add Gentoo instructions to backend warning 2017-07-06 00:41:06 +02:00
Florian Bruhin
a4833fcc46 Merge branch 'pr/2747' 2017-07-05 22:14:07 +02:00
Florian Bruhin
a8120a23c4 Update comment for TabBarStyle 2017-07-05 22:13:24 +02:00
Ryan Roden-Corrent
dc4472470e Merge remote-tracking branch 'upstream/master' into really_complete 2017-07-05 08:45:57 -04:00
Christian Helbling
361251bf53 mark public attribute as public, fix debug output 2017-07-04 23:30:06 +02:00
Christian Helbling
20db65e430 preserve window state when exiting video fullscreen 2017-07-04 22:56:44 +02:00
Florian Bruhin
28410b8533 Release v0.11.0 2017-07-04 18:02:34 +02:00
Christian Helbling
7ea7a2f3fd restore maximized state on :fullscreen and when exiting video fullscreen 2017-07-04 17:50:07 +02:00
Florian Bruhin
45b1285402 Merge pull request #2765 from jgkamat/jay/tab-crashes
Refactor set_tab_pinned to take a tab widget.
2017-07-04 17:24:10 +02:00
Florian Bruhin
0cdd3ff82f Update some more references to old config options 2017-07-04 16:46:02 +02:00
Florian Bruhin
cff61fa0bc Fix pylint
This also reverts commit 8df0b063be.
2017-07-04 15:34:10 +02:00
Florian Bruhin
88b878098d Implement pretty-printing of configtypes for the doc
This is also needed to make the docs environment work on Travis - as otherwise,
doc generation wasn't deterministic because of changing dict key order.
2017-07-04 15:09:23 +02:00
Florian Bruhin
397ca47efb Fix vulture 2017-07-04 15:09:23 +02:00
Florian Bruhin
9ac2dbcc80 Disallow surrogate escapes in dicts and lists in the config
In Dict.to_str() and List.to_str() we use json.dump to get a value. However,
JSON includes surrogate escapes in the dumped values, which breaks round trips.

>>> yaml.load(json.dumps({'\U00010000': True}))
{'\ud800\udc00': True}

>>> yaml.load(json.dumps({'\U00010000': True}, ensure_ascii=False))
yaml.reader.ReaderError: unacceptable character #x10000: special characters are not allowed

See:
https://stackoverflow.com/a/38552626/2085149
https://news.ycombinator.com/item?id=12798032
2017-07-04 15:09:23 +02:00
Florian Bruhin
0528a800f2 Fix config things relying on dict order 2017-07-04 15:08:04 +02:00
Florian Bruhin
91cd6c6288 Fix Python 3.4 circular imports 2017-07-04 15:08:04 +02:00
Florian Bruhin
b42265212b Update test_keyhints for new config
This also makes the keyhint display things sorted
2017-07-04 15:08:04 +02:00
Florian Bruhin
1663280f53 Update test_shared for new config
Also, make accept_language none_ok=True like it was in the old configdata.py
2017-07-04 15:08:04 +02:00
Florian Bruhin
78d7ac311f Use fonts.monospace properly 2017-07-04 15:08:04 +02:00
Florian Bruhin
4562a3574b Allow a list for content.user_stylesheets 2017-07-04 15:08:04 +02:00
Florian Bruhin
afb3b496e8 Add missing backend: QtWebKit for content.pdfjs 2017-07-04 15:08:04 +02:00
Florian Bruhin
a36f5bafc1 Rename content.javascript.can_*_windows to _tabs 2017-07-04 15:08:04 +02:00
Florian Bruhin
be94098597 Improve more docs 2017-07-04 15:08:04 +02:00
Florian Bruhin
5ada3606d8 Allow to not send the DNT header 2017-07-04 15:08:04 +02:00
Florian Bruhin
040be60697 Improve more docs 2017-07-04 15:08:04 +02:00
Florian Bruhin
202b8445f6 Move content.accept_language under headers 2017-07-04 15:08:04 +02:00
Florian Bruhin
f546cbe934 Clarify some docs 2017-07-04 15:08:04 +02:00
Florian Bruhin
d7036fe8a8 Clarify history_session_interval and rename it to _gap_interval
"session" is already overloaded enough.
2017-07-04 15:08:04 +02:00
Florian Bruhin
8712fc6fd3 Move new_instance_open_target out of url.
It doesn't really fit there really...
See 3cf028db23cbfe256e499d8881c3c2856f224d94
2017-07-04 15:08:04 +02:00
Florian Bruhin
d641652a92 More test_config improvements 2017-07-04 15:08:04 +02:00
Florian Bruhin
c214acd899 Remove config from objreg 2017-07-04 15:08:04 +02:00
Florian Bruhin
1a492e9f4a Re-add backend checks to new config 2017-07-04 15:08:04 +02:00
Florian Bruhin
556f49d367 Add PACFetcher.fetch
Let's not try to download proxies during tests...
2017-07-04 15:08:04 +02:00
Florian Bruhin
2b9b54cf6b Tests and improvements for ConfigContainer 2017-07-04 15:08:03 +02:00
Florian Bruhin
4495e721d8 Tests and fixes for config.Config 2017-07-04 15:08:03 +02:00
Florian Bruhin
e259293f83 Always copy config objects
If we mutate the value we get from the config, we want to make sure the value in
the config always stays the same (especially when it's the default!).
2017-07-04 15:08:03 +02:00
Florian Bruhin
2c3981e57e Get rid of Config.read_configdata()
No need for this indirection
2017-07-04 15:08:03 +02:00
Florian Bruhin
252c5396f3 Apply proxy changes from master
This are the same changes as done in 629038632c,
but only the part related to the config. This is so we don't forget this when
merging them.
2017-07-04 15:08:03 +02:00
Florian Bruhin
07d0ea6a54 Unit tests and improvements for :bind/:unbind 2017-07-04 15:08:03 +02:00
Florian Bruhin
3edebce833 Add tests for :set 2017-07-04 15:08:03 +02:00
Florian Bruhin
31b999ea59 Tests and improvements for KeyConfig 2017-07-04 15:08:03 +02:00
Florian Bruhin
725ffef5f3 Use a real config object in unit tests 2017-07-04 15:08:03 +02:00
Florian Bruhin
5aac991446 Remove unnecessary sip.isdeleted line
Now that the StyleSheetObserver is a child of the object it observes, it should
get cleaned up properly when the object is deleted.

This means this is hopefully not needed anymore, even on Qt 5.2.
2017-07-04 15:08:03 +02:00
Florian Bruhin
978013e750 Fix CommandParser and don't use a generator 2017-07-04 15:08:03 +02:00
Florian Bruhin
a8c7e8ba05 Add first config tests 2017-07-04 15:08:03 +02:00
Florian Bruhin
28670f8e48 Move config.style into config.config and refactor it 2017-07-04 15:08:03 +02:00
Florian Bruhin
a2f62238f1 Change default binding to leave passthrough mode to Ctrl-V
Also, display the binding in the statusbar
2017-07-04 15:08:03 +02:00
Florian Bruhin
df1685905e Add content.headers and content.cache groups 2017-07-04 15:08:03 +02:00
Florian Bruhin
50602cbf26 Add an url. group to settings 2017-07-04 15:08:03 +02:00
Florian Bruhin
5c08c6c930 Add conditional backend infos to docs 2017-07-04 15:08:03 +02:00
Florian Bruhin
034d727a2c Clean up configdata 2017-07-04 15:08:03 +02:00
Florian Bruhin
25ab3b30c2 Initial doc update with new settings 2017-07-04 15:08:03 +02:00
Florian Bruhin
94ac2ca56c Merge :wq into :quit and add an alias 2017-07-04 15:08:03 +02:00
Florian Bruhin
065f82f485 Fix endless recursion while validating aliases 2017-07-04 15:08:03 +02:00
Florian Bruhin
ac78039171 Use aliases for :w and :q 2017-07-04 15:08:03 +02:00
Florian Bruhin
ac64ea287a Rename tabs.new_position/_explicit to .related/.unrelated 2017-07-04 15:08:03 +02:00
Florian Bruhin
441b3a4df4 Allow missing fixed_keys for configtypes.Dict
We just fill them up with a None value for the value type, so we can e.g. only
specify a subset of modes for bindings and the rest is {}.
2017-07-04 15:08:03 +02:00
Florian Bruhin
9d8b76e497 Simplify _none_value for List/Dict configtypes
We don't need to check for fixed_keys/required_keys in get_obj (only get_py),
and we don't need to care about mutability in get_py.
2017-07-04 15:08:03 +02:00
Florian Bruhin
da0a2b8578 Handle {} and [] with none_ok for configtypes.Dict/List 2017-07-04 15:08:03 +02:00
Florian Bruhin
2ba637891a Add required_keys for configtypes.Dict 2017-07-04 15:08:03 +02:00
Florian Bruhin
bc526cf0ce Remove some FIXMEs 2017-07-04 15:08:03 +02:00
Florian Bruhin
7ee222af88 Return [] for none-values for configtypes.List 2017-07-04 15:08:03 +02:00
Florian Bruhin
c141c33b32 Clean up start_pages setting
The value is now of type FuzzyUrl, and the setting is renamed to start_pages.
2017-07-04 15:08:03 +02:00
Florian Bruhin
9cbacf3264 Use {} for none-dicts and fix keybindings 2017-07-04 15:08:03 +02:00
Florian Bruhin
0115285a84 Initial update for better bindings management 2017-07-04 15:08:03 +02:00
Florian Bruhin
127db2fe42 Be a bit more relaxed about values for Perc
We now allow float/int for objects, and strings without a trailing % sign.
2017-07-04 15:08:03 +02:00
Florian Bruhin
cbf6e4287f Rename fonts.tabbar to fonts.tabs 2017-07-04 15:08:03 +02:00
Florian Bruhin
e7ba56cb2c Read YAML config after config.val is ready
This means we can (at least somewhat) validate aliases in configtypes.Command.
2017-07-04 15:08:03 +02:00
Florian Bruhin
0ed0a6db57 Clean up code 2017-07-04 15:08:03 +02:00
Florian Bruhin
67cb6a9802 Implement initial reading from YAML 2017-07-04 15:08:03 +02:00
Florian Bruhin
70f6d0e305 Add qutebrowser.config.configfiles 2017-07-04 15:08:03 +02:00
Florian Bruhin
78434a330c Remove old stub FIXMEs 2017-07-04 15:08:03 +02:00
Florian Bruhin
fda4fd4888 Rename NewConfigManager.set to set_obj 2017-07-04 15:08:03 +02:00
Florian Bruhin
ad0a961a5f Add an lru_cache for configdata.is_valid_prefix()
This gets called a lot, and caused some :bind calls to take ~3s.

Stats after starting with a bit of :bind:
CacheInfo(hits=25917, misses=139, maxsize=256, currsize=139)
2017-07-04 15:08:03 +02:00
Florian Bruhin
45e7e35233 Detect mutated values in new config
This will allow config.py to get a value and then mutate it, and we can also
make things easier for :bind and :unbind.
2017-07-04 15:08:03 +02:00
Florian Bruhin
2577b2c5e3 Validate configtypes.Command correctly 2017-07-04 15:08:03 +02:00
Florian Bruhin
23d30d4fc0 Fix remaining :bind/:unbind issues 2017-07-04 15:08:03 +02:00
Florian Bruhin
f434f955c2 Improve exception handling for :bind/:unbind 2017-07-04 15:08:02 +02:00
Florian Bruhin
ba1bc29a97 Initial :bind/:unbind implementation 2017-07-04 15:08:02 +02:00
Florian Bruhin
290d27a064 Add a cmdexc.Error 2017-07-04 15:08:02 +02:00
Florian Bruhin
a6c629899e Split CommandRunner into runner/parser 2017-07-04 15:08:02 +02:00
Florian Bruhin
d4cbd4ace4 Fix getting the scrollbar option 2017-07-04 15:08:02 +02:00
Florian Bruhin
ed5bea6e3f Call int() for zoom level messages 2017-07-04 15:08:02 +02:00
Florian Bruhin
3c2d568a2e Add an ID for qute://settings inputs 2017-07-04 15:08:02 +02:00
Florian Bruhin
d7f1ebedbf Fix toggling options 2017-07-04 15:08:02 +02:00
Florian Bruhin
44e4816cbb Use get_opt in NewConfigManager.set 2017-07-04 15:08:02 +02:00
Florian Bruhin
5081e4f201 Fix NewConfigManager.get_str 2017-07-04 15:08:02 +02:00
Florian Bruhin
5e4675b34a Fix ignore_case handling 2017-07-04 15:08:02 +02:00
Florian Bruhin
340a62869d Fix javascript.prompt default 2017-07-04 15:08:02 +02:00
Florian Bruhin
ceca99a99c Fix :help with new config 2017-07-04 15:08:02 +02:00
Florian Bruhin
e752f87876 Add Shift-Delete mapping for :completion-item-del
This seems to be what Chromium and Firefox use for the same purpose.
2017-07-04 15:08:02 +02:00
Florian Bruhin
75798bebb0 Normalize bindings correctly when checking key_mappings 2017-07-04 15:08:02 +02:00
Florian Bruhin
383968d948 Add a Key config type
Make sure any key we get from the config is normalized).
2017-07-04 15:08:02 +02:00
Florian Bruhin
e894ad4ab0 Improve :set --temp docs 2017-07-04 15:08:02 +02:00
Florian Bruhin
6aafaca329 Fix invalid default_page replacement 2017-07-04 15:08:02 +02:00
Florian Bruhin
ae6cc543ed Fix shared.feature_permission 2017-07-04 15:08:02 +02:00
Florian Bruhin
089e1ee91b Rewrite various references to old settings 2017-07-04 15:08:02 +02:00
Florian Bruhin
88fb5bbd82 tests: Fix various issues with new config 2017-07-04 15:08:02 +02:00
Florian Bruhin
198040b2e2 Fix setting descriptions 2017-07-04 15:08:02 +02:00
Florian Bruhin
f27978e268 Rename input.insert_mode.auto_focused to _load 2017-07-04 15:08:02 +02:00
Florian Bruhin
3470e9bf5d Fix invocation with -s 2017-07-04 15:08:02 +02:00
Florian Bruhin
471755d370 Fix old config access in hints 2017-07-04 15:08:02 +02:00
Florian Bruhin
3aa7f771c1 Fix dirbrowser.html for stricter jinja env 2017-07-04 15:08:02 +02:00
Florian Bruhin
d0904a9f67 Adjust test settings 2017-07-04 15:08:02 +02:00
Florian Bruhin
c2a2845ee7 Remove the tabs.movable setting 2017-07-04 15:08:02 +02:00
Florian Bruhin
85bee4a7d2 Rename completion background settings to .odd/.even 2017-07-04 15:08:02 +02:00
Florian Bruhin
bc8176ff21 Remove most legacy config code 2017-07-04 15:08:02 +02:00
Florian Bruhin
785de9fb99 Add dump_userconfig 2017-07-04 15:08:02 +02:00
Florian Bruhin
b5eac744b5 Remove old caching code
Not deleting debug_cache_stats as we'll soon re-add stuff there.
2017-07-04 15:08:02 +02:00
Florian Bruhin
46d0fee11b Bring back :set 2017-07-04 15:08:02 +02:00
Florian Bruhin
30f1970850 Fix key-config usage 2017-07-04 15:08:02 +02:00
Florian Bruhin
aa75262fe4 Fix keyhintwidget 2017-07-04 15:08:02 +02:00
Florian Bruhin
22f096088b Fix alias handling 2017-07-04 15:08:02 +02:00
Florian Bruhin
f5d2c48bbb Fix new keyconfig issues 2017-07-04 15:08:02 +02:00
Florian Bruhin
056edcfed3 More keyconfig work 2017-07-04 15:08:02 +02:00
Florian Bruhin
67afc06d79 Initial work on new keyconfig 2017-07-04 15:08:02 +02:00
Florian Bruhin
e4278a69ac Re-activate aliases 2017-07-04 15:08:02 +02:00
Florian Bruhin
82102279bc Get rid of configdata.SECTION_DESC 2017-07-04 15:08:02 +02:00
Florian Bruhin
624c6777ff Reorder configdata.yml 2017-07-04 15:08:02 +02:00
Florian Bruhin
94b200835a Hack in setting a value to NewConfigManager 2017-07-04 15:08:02 +02:00
Florian Bruhin
dc74a55b84 Fix remaining configtypes issues 2017-07-04 15:08:02 +02:00
Florian Bruhin
72d4421ac8 Make ShellCommand a List subclass
Also, let's not require a list in Command (which is used for aliases).
2017-07-04 15:08:02 +02:00
Florian Bruhin
ecba175b16 Test and fix configtypes to_str. 2017-07-04 15:08:02 +02:00
Florian Bruhin
4c2f65819b Try to fix qute://settings 2017-07-04 15:08:02 +02:00
Florian Bruhin
5414744439 Clean up NewConfigManager 2017-07-04 15:08:02 +02:00
Florian Bruhin
d69c6d0c66 Reorganize how configtypes store their data
Now the "object" kind of value (like in YAML) is stored internally, and that's
the canonical value. The methods changed their meaning slightly, see the
docstring in configtypes.py for details.
2017-07-04 15:08:02 +02:00
Florian Bruhin
1cbb4ece4b Force configtype.Dict keys to be strings 2017-07-04 15:08:02 +02:00
Florian Bruhin
41655e7852 Fix handling of none_ok in List/Dict
We now always return None (and '' as string) when the user configured an empty
list or dict.
2017-07-04 15:08:01 +02:00
Florian Bruhin
8ea3d92697 Initial implementation of to_str for configtypes 2017-07-04 15:08:01 +02:00
Florian Bruhin
ffc29ee043 Make qute://settings work with QtWebEngine and new config
Fixes #2332
2017-07-04 15:08:01 +02:00
Florian Bruhin
18eb133811 configdata: Make sure default values are valid 2017-07-04 15:08:01 +02:00
Florian Bruhin
0857a45b0a configtypes: parse regex flags properly 2017-07-04 15:08:01 +02:00
Florian Bruhin
a7c3bb0d55 Initial qute://settings upgrade 2017-07-04 15:08:01 +02:00
Florian Bruhin
3a6bcb3dd0 Remove icon from base.html 2017-07-04 15:08:01 +02:00
Florian Bruhin
36a5614c61 Add "FIXME" 2017-07-04 15:08:01 +02:00
Florian Bruhin
a1ed81f790 Patch out setting completion
Let's bring it back with the completion refactoring
2017-07-04 15:08:01 +02:00
Florian Bruhin
6733e92b50 Handle files correctly in utils.yaml_dump 2017-07-04 15:08:01 +02:00
Florian Bruhin
001312ca82 Disallow Booleans for configtypes.Int.from_py 2017-07-04 14:42:56 +02:00
Florian Bruhin
dfee857466 Make utils.yaml_dump return str 2017-07-04 14:42:56 +02:00
Florian Bruhin
ffd1a91467 Fix Directory conftype 2017-07-04 14:42:56 +02:00
Florian Bruhin
61ba92ae18 configtypes: Separate str/py basic validation
This also ensures the behavior for none_ok is consistent.
2017-07-04 14:42:56 +02:00
Florian Bruhin
51a29468be configtypes: Use YAML for loading List/Dict from a string
This allows for a more lightweight syntax (like "{a: b}").
2017-07-04 14:42:56 +02:00
Florian Bruhin
41565fcfd4 configtypes: Use from_py for List/Dict values from a string 2017-07-04 14:42:56 +02:00
Florian Bruhin
7ddce62cd6 Refactor most of remaining config.get() calls 2017-07-04 14:42:56 +02:00
Florian Bruhin
51474724e5 Refactor objreg.get('config') calls 2017-07-04 14:42:56 +02:00
Florian Bruhin
cc0e66fe7b More config fixes 2017-07-04 14:42:56 +02:00
Florian Bruhin
6a451b37d7 re-raise NoOptionError 2017-07-04 14:42:56 +02:00
Florian Bruhin
52f15c84a6 Get rid of config sections 2017-07-04 14:42:56 +02:00
Florian Bruhin
7e7fbf106b Fix lint and old config options 2017-07-04 14:42:56 +02:00
Florian Bruhin
ce7597b3f6 Fix various configtypes issues found while writing tests 2017-07-04 14:42:56 +02:00
Florian Bruhin
d751539a25 Add __eq__ and __repr__ for PACFetcher
This makes it possible to use it in comparisons during tests easily.
2017-07-04 14:42:56 +02:00
Florian Bruhin
3cee9cdcd7 Fix JS logging 2017-07-04 14:42:56 +02:00
Florian Bruhin
45ce7efc71 Adjust feature permissions 2017-07-04 14:42:56 +02:00
Jakub Klinkovský
7eacea1057 Preserve fullscreen when exiting video fullscreen
Fixes #2778
2017-07-04 14:12:21 +02:00
Ryan Roden-Corrent
1e1335aa5e Make various SQL code review changes.
- Fix outdated comments
- Use mock specs when possible
- More precise error message check in test_import_txt_invalid.
- Fix copyright message
- Tweak missing pyqt error message
- Dead code: remove group_by and where from sqlcategory.
  With the new separate completion table, these are no longer used.
- Move test_history out of webkit/. History is no longer purely webkit
  related, it could be webengine.
2017-07-03 09:45:08 -04:00
Ryan Roden-Corrent
25c79bec67 Check correct SQL driver in earlyinit. 2017-07-03 08:15:06 -04:00
Ryan Roden-Corrent
a34df34208 Fix various test/flake8/pylint errors. 2017-07-03 08:12:47 -04:00
Ryan Roden-Corrent
f2dbff92f4 Check for PyQt.QtSql and sqlite in earlyinit.
Show a graphical error box with install instructions if PyQt.QtSql is
not found, rather than failing with CLI errors. Also show an error box
if the sqlite driver is not available.
2017-07-03 07:57:55 -04:00
Florian Bruhin
629038632c Add proxy support for QtWebEngine and Qt 5.7.1
This used to give us crashes in libproxy:
https://github.com/libproxy/libproxy/issues/45
https://bugreports.qt.io/browse/QTBUG-56852

However, trying again with Qt 5.7.1 on Debian and from PyPI, this doesn't happen
anymore, so it was probably something with how Archlinux handled things.

See #2082, #2775.
Reverts fd29528e4f
2017-07-03 10:29:28 +02:00
Florian Bruhin
e828f5b812 Fix most config changed handlers 2017-07-02 22:17:33 +02:00
Florian Bruhin
c25022f549 Fix LimitLineParser 2017-07-02 22:17:33 +02:00
Florian Bruhin
1022b7ea32 Make jinja templating more strict
This ensures we actually know when an AttributeError happens.

It also changes most external code to use the correct environment, rather than
simply creating a jinja2.Template, which wouldn't use the more tightened
environment.
2017-07-02 22:17:33 +02:00
Florian Bruhin
4b4acc5f5a Minor config fixes 2017-07-02 22:17:33 +02:00
Florian Bruhin
c8c9536beb Fix completion stuff 2017-07-02 22:17:33 +02:00
Florian Bruhin
8c1b5f0581 Fix up background_tabs, favicon_show and some custom config magic 2017-07-02 22:17:33 +02:00
Florian Bruhin
1f508d9d8f Fix config getters 2017-07-02 22:17:33 +02:00
Florian Bruhin
b9aa5d0e4e Fix valid_values initing from configdata 2017-07-02 22:17:33 +02:00
Florian Bruhin
fcc0b3e8c0 Fix tab indicator width 2017-07-02 22:17:33 +02:00
Florian Bruhin
269e9d69e0 Improve typechecking message 2017-07-02 22:17:33 +02:00
Florian Bruhin
500ad8b00f Use strings for Perc configtypes 2017-07-02 22:17:33 +02:00
Florian Bruhin
e6275ab561 Fix startpage 2017-07-02 22:17:33 +02:00
Florian Bruhin
298553d48d Fix QssColor 2017-07-02 22:17:33 +02:00
Florian Bruhin
61fe40f4a1 Initial stylesheet refactoring for new config 2017-07-02 22:17:33 +02:00
Florian Bruhin
e2b0fdf8aa Fix VerticalPosition and NewTabPosition
Make them string so they have to_py() defined.
2017-07-02 22:17:33 +02:00
Florian Bruhin
a3d4822b9f Fix up adblock settings 2017-07-02 22:17:33 +02:00
Florian Bruhin
26bf588fad Fix _validate_valid_values 2017-07-02 22:17:33 +02:00
Florian Bruhin
231b7303f5 Use null for empty config values. 2017-07-02 22:17:33 +02:00
Florian Bruhin
af134eb861 Refactor websettings for new config 2017-07-02 22:17:33 +02:00
Florian Bruhin
129ee33ffb Refactor former network section 2017-07-02 22:17:33 +02:00
Florian Bruhin
f1d81d86aa Fix configtypes _basic_validation 2017-07-02 22:17:33 +02:00
Florian Bruhin
aa6f229e6b Add utils.yaml_{load,dump} 2017-07-02 22:17:33 +02:00
Florian Bruhin
1a6511c7a8 Refactor most stuff using config.val.ui 2017-07-02 22:17:33 +02:00
Florian Bruhin
1ed8df8903 Fix various typos/bugs 2017-07-02 22:17:33 +02:00
Florian Bruhin
3e3685b68b Initial configexc refactoring 2017-07-02 22:17:33 +02:00
Florian Bruhin
5ab2c89a37 Adjust config.change_filter 2017-07-02 22:17:33 +02:00
Florian Bruhin
b5110b07f0 Fix newconfig init 2017-07-02 22:17:33 +02:00
Florian Bruhin
3009e5eebe Fix configtypes mistakes 2017-07-02 22:17:33 +02:00
Florian Bruhin
8de0445661 Move UserAgent to configdata 2017-07-02 22:17:33 +02:00
Florian Bruhin
616aad84d8 More configtypes refactoring 2017-07-02 22:17:33 +02:00
Florian Bruhin
5ec47da127 Get rid of configtypes.AutoSearch and IgnoreCase 2017-07-02 22:17:33 +02:00
Florian Bruhin
921d02e4d3 First portion of configtypes refactoring 2017-07-02 22:17:33 +02:00
Florian Bruhin
7e52eb7b0e Initial work on new configdata 2017-07-02 22:17:33 +02:00
Florian Bruhin
c2e75bf2fd Initial conversion to new config syntax 2017-07-02 22:17:33 +02:00
Florian Bruhin
938946c48b configdata: Add check for shadowing keys 2017-07-02 22:17:33 +02:00
Florian Bruhin
8b9b750f8f configdata: Rename some options for consistency 2017-07-02 22:17:33 +02:00
Florian Bruhin
52f6ea2525 Initial parsing 2017-07-02 22:17:33 +02:00
Florian Bruhin
f965805099 First setting renames 2017-07-02 22:17:33 +02:00
Florian Bruhin
836395cdb1 Add configdata.yml 2017-07-02 22:17:33 +02:00
Florian Bruhin
00c8d8da34 Initial stubbing out of a new config 2017-07-02 22:17:33 +02:00
Florian Bruhin
2f26490536 Remove FIXME 2017-07-02 14:03:38 +02:00
Jay Kamat
2fbadc46d2 Remove error when count is invalid to :tab-pin 2017-06-30 09:57:39 -07:00
Florian Bruhin
9cedaa60bc Check for PyQt5.QtQml in earlyinit 2017-06-30 14:56:02 +02:00
Florian Bruhin
e4a054d34e Stop marking QtWebEngine as experimental 2017-06-30 10:42:33 +02:00
Jay Kamat
596dee69d6
Clean up pin_tab
Also add a test case for :pin-tab with an invalid count
2017-06-29 20:04:02 -07:00
Ryan Roden-Corrent
c1f5e77fc6 Implement "Current" completion for bind.
When binding a key, the first row will be the current binding if the key
is already bound. This should make it easier for users to tell when they
are binding a key that is already bound, and what it is bound to.
2017-06-29 21:44:44 -04:00
Ryan Roden-Corrent
1e489325c4 Assert if index is invalid in delete_cur_item.
CompletionView already checks the index, so an error here shouldn't
happen.
2017-06-29 20:58:15 -04:00
Ryan Roden-Corrent
fd07c571e5 Store pattern in completion view, not model.
The pattern property is used for highlighting. It is purely
display-related, so it should be in the view rather than the model.
2017-06-29 20:56:39 -04:00
Ryan Roden-Corrent
c007f592b3 Use more intuitive argument order in sql.delete. 2017-06-29 20:43:42 -04:00
Florian Bruhin
d132b6ed71 Fix :scroll-page with --bottom-navigate on QtWebEngine
There were two issues here:

- The comparison was backwards, causing scroller.at_bottom() to always return
  true.
- When zoomed in, jsret['px']['y'] can be a float, which means we can be
  slightly off when checking the difference - math.ceil() fixes that.
2017-06-29 22:39:48 +02:00
Ryan Roden-Corrent
9c0c174534 Use builtin SortFilter regex functionality.
With the new completion API, we no longer need a custom filterAcceptsRow
function. This was necessary to handle the tree structure of the model,
but now we use a separate QSortFilterProxyModel for each category, so
the data it filters is flat. We can simplify the code by using the
builtin setFilterRegExp.

This changes the behavior a little, as now all list categories filter on
all columns. This should be beneficial if anything. For example, help
topics are now filtered on description in addition to name.

This also seems to slightly speed up filtering, according to the url
model benchmark.

Before:

----------------------------------------------- benchmark: 1 tests ----------------------------------------------
Name (time in s)                     Min     Max    Mean  StdDev  Median     IQR  Outliers(*)  Rounds  Iterations
-----------------------------------------------------------------------------------------------------------------
test_url_completion_benchmark     1.2806  1.3817  1.3195  0.0390  1.3068  0.0487          1;0       5           1
-----------------------------------------------------------------------------------------------------------------

After:

----------------------------------------------- benchmark: 1 tests ----------------------------------------------
Name (time in s)                     Min     Max    Mean  StdDev  Median     IQR  Outliers(*)  Rounds  Iterations
-----------------------------------------------------------------------------------------------------------------
test_url_completion_benchmark     1.1183  1.1508  1.1281  0.0132  1.1241  0.0142          1;0       5           1
-----------------------------------------------------------------------------------------------------------------
2017-06-29 12:44:02 -04:00
Jay Kamat
302961a86a
Refactor set_tab_pinned to take a tab widget.
See #2759
2017-06-28 22:22:33 -07:00
Florian Bruhin
f136f78802 Fix :undo documentation
See #2759
2017-06-28 22:41:08 +02:00
Jay Kamat
4d1dbe11e8
Prompt when closing a pinned tab via the mouse
Closes #2761
2017-06-27 19:03:13 -07:00
Ryan Roden-Corrent
6ac940fa32 Fix pylint/coverage errors.
Ensure 100% coverage for sqlcategory and history, and fix some linter
errors
2017-06-27 12:33:51 -04:00
Ryan Roden-Corrent
f06880c6e2 Fix history completion delete function.
In order to update SqlQueryModel's rowCount after re-running the query,
we must call setQuery again.
2017-06-27 08:42:10 -04:00
Iordanis Grigoriou
5e2be8a44a Fix PEP-8 issue 2017-06-27 08:25:59 +02:00
Iordanis Grigoriou
8a5b48d374 Add suggested_fn argument to get_request 2017-06-26 23:21:32 +02:00
Florian Bruhin
5ec94f96fd Allow a trailing % for :zoom 2017-06-26 21:51:35 +02:00
Florian Bruhin
92d5f6c41d Ignore _remove_tab for crashed deleted tabs 2017-06-26 20:50:17 +02:00
Florian Bruhin
24caaea54d Handle OSError in SessionManager.delete 2017-06-26 19:52:07 +02:00
Florian Bruhin
130be2aedc Handle OSError when trying to delete autosave session 2017-06-26 19:47:54 +02:00
Ryan Roden-Corrent
46161c3af0 Refactor delete_cur_item.
Taking the completion widget as an argument was overly complex.
The process now looks like:

1. CompletionView gets deletion request
2. CompletionView passes selected index to CompletionModel
3. CompletionModel passes the row data to the owning category
4. The category runs its custom completion function.

This also fixes a bug. With the switch to the hybrid (list/sql)
completion model, the view was no longer updating when items were
deleted. This fixes that by ensuring the correct signals are emitted.

The SQL model must be refreshed by running the query. We could try using
a SqlTableModel so we can call removeRows instead.

The test for deleting a url fails because qmodeltester claims the length
of the query model is still 3.
2017-06-26 08:57:36 -04:00
Iordanis Grigoriou
a24d7f6686 Use page title for filename with :download 2017-06-26 12:25:03 +02:00
Marius
df6b8b7ff5 Update tabwidget.py 2017-06-21 09:03:15 +02:00
Ryan Roden-Corrent
6080830a8b Fix outdated docstring and pylint error. 2017-06-20 22:25:09 -04:00
Ryan Roden-Corrent
b722cc1dec Pass invalid index to [can]FetchMore.
For QSqlQueryModel, the argument should always be an invalid index:
http://doc.qt.io/qt-5/qsqlquerymodel.html#canFetchMore

For a QStandardItemModel, it doesn't matter. Either way, passing the
top-level parent index was wrong.
2017-06-20 22:11:53 -04:00
Ryan Roden-Corrent
63cb88a0f4 Use _cat_from_index in completionmodel.data.
Keep all the category lookup inside _cat_from_idx for easier refactoring
if the organization ever changes.
2017-06-20 22:08:23 -04:00
Ryan Roden-Corrent
0f585eda4f Bring history.py back to 100% coverage.
The code of debug_dump_history was tweaked to handle a possible
OSException that can be thrown by open, which I noticed while trying to
test it.
2017-06-20 21:41:43 -04:00
Marius
f3a2b84033 remove space 2017-06-20 23:58:23 +02:00
Marius
dfedddf0bd Wrap scroll button workaround in try/except
for older pyqt5 versions (5.2.1)
2017-06-20 23:55:11 +02:00
Marius
6e166d139a Fix alignment of scroll buttons in tab bar 2017-06-20 21:18:13 +02:00
Florian Bruhin
096b0a7a37 Remove unused import 2017-06-20 15:03:42 +02:00
Florian Bruhin
750ef834dc Make PyOpenGL a required dependency
Looks like the "black screen" issue isn't the only thing going wrong, some
people even report segfaults since the vendor check was added.
2017-06-20 13:05:53 +02:00
Florian Bruhin
cf3c7266aa Make show_error keyword-only 2017-06-20 12:45:36 +02:00
Florian Bruhin
06d4a24bd1 Merge branch 'master' of https://github.com/iordanisg/qutebrowser 2017-06-20 12:45:21 +02:00
Florian Bruhin
038dcff4ba Ignore common URL issues while importing history
See #2646.

This ignores the "corrupted" Apple-lookalike URLs, comments and data: URLs.
2017-06-20 12:19:14 +02:00
Florian Bruhin
f838eb1bdc Use named formatting for queries in sql.py 2017-06-20 12:11:41 +02:00
Florian Bruhin
da875755d1 Add spaces after commas in SQL queries 2017-06-20 12:06:17 +02:00
Florian Bruhin
c1776bbf9d Add error message when query failed to prepare 2017-06-20 12:05:40 +02:00
Florian Bruhin
29ce1b3811 Add column order in SqlTable._insert_query
_insert_query gets called with a query and dict of values such as:

  {'val': 1, 'lucky': False, 'name': 'one'}

Via bindValues(), we only assign a placeholder in the query string to a value,
so we get a query with bindings like:

  INSERT INTO Foo values(:lucky,:val,:name)
  {':name': 'one', ':val': 1, ':lucky': False}

So what we're executing is something like:

  INSERT INTO Foo values(false,1,"one")

However, if the column order in the database doesn't happen to be the order
we're passing the values in, we get the wrong values in the wrong columns.

Instead, we now do:

  INSERT INTO Foo (lucky, val, name) values(false,1,"one")

Which inserts the values in the order we intended.

With Python 3.6, this just happened to work before because we always passed the
keyword arguments in the table column order, and in 3.6 dicts
(and thus **kwargs) happen to be ordered:
https://mail.python.org/pipermail/python-dev/2016-September/146327.html
2017-06-20 12:03:43 +02:00
Iordanis Grigoriou
f0ff02fcb2 Avoid throwing exception when no last focused tab exists 2017-06-19 15:48:17 +02:00
Florian Bruhin
7062f9e060 Update qt5-webkit-ng docs for Archlinux 2017-06-19 13:44:41 +02:00
Florian Bruhin
9f94f28181 Use :memory: for an in-memory database
Using an empty string for the same purpose only started working in some
recent-ish Qt/sqlite/? version, so using --version failed on Ubuntu Trusty.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
051d2665f3 Fix signal type error in CompletionView.
On Travis CI we are sometimes seeing:

```
CompletionView.selection_changed[str].emit():
argument 1 has unexpected type 'int'
```

Cast the data to a string before emitting it just to be safe.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
891a6bcf14 Fix flake8 errors 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
4e87773d89 Use a dict instead of named params for insert.
This allows replace to be a named parameter and allows consolidating
some duplicate code between various insert methods.

This also fixes some tests that broke because batch insert was broken.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
e436f48164 Small sql fixes.
- Remove unused SqlTable.Entry
- Fix wording of two log messages
- Remove unused import
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
f4f52ee204 Remove history.Entry.
No longer needed with sql backend. Query results build their own
namedtuple from the returned columns, and inserting new entries is just
done with named parameters.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
1fe1813431 Fix pylint errors. 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
679e001a48 Separate sqlcategory title from table name.
Also fix a number of sql/completion tests that were failing.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
61a1709141 Fix completion selection bug.
Fix the issue where pressing `o<esc>o` would show a url completion
dialog where attempting to <Tab> select items would do nothing but show
a Qt warning.

The fix is to ensure we set _last_completion_func to None whenever we
clear completion (there was a case I missed).

It also ensures we always delete the old model and adds a safety to
prevent deleting an in-use model is set_model is called with the current
model.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
fa39b82b3c Backup old history file after import.
Instead of removing it, move it to history.bak.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
22b7b21d5a Use named placeholders for sql queries. 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
862f8d3188 Always return col 0 for index parent.
This was changed during code review but was causing Qt errors while
TAB-completing in the selection view:

08:42:34 WARNING  qt         Unknown module:none:0 Can't select indexes from different model or with different parents
2017-06-19 07:44:11 -04:00
Florian Bruhin
18cd8ba0b6 Add indices for HistoryAtimeIndex and CompletionHistoryAtimeIndex
before
------

sqlite> SELECT * FROM History where not redirect and not url like "qute://%" and atime > ? and atime <= ? ORDER BY atime desc;
Run Time: real 0.072 user 0.063334 sys 0.010000

sqlite> explain query plan SELECT * FROM History where not redirect and not url like "qute://%" and atime > ? and atime <= ? ORDER BY atime desc;
0|0|0|SCAN TABLE History
0|0|0|USE TEMP B-TREE FOR ORDER BY

sqlite> explain query plan select url, title, strftime('%Y-%m-%d', last_atime, 'unixepoch') from CompletionHistory where (url like "%qute%" or title like "%qute%") order by last_atime desc;
0|0|0|SCAN TABLE CompletionHistory
0|0|0|USE TEMP B-TREE FOR ORDER BY

after
-----

sqlite> SELECT * FROM History where not redirect and not url like "qute://%" and atime > ? and atime <= ? ORDER BY atime desc;
Run Time: real 0.000 user 0.000000 sys 0.000000

sqlite> explain query plan SELECT * FROM History where not redirect and not url like "qute://%" and atime > ? and atime <= ? ORDER BY atime desc;
0|0|0|SEARCH TABLE History USING INDEX AtimeIndex (atime>? AND atime<?)

sqlite> explain query plan select url, title, strftime('%Y-%m-%d', last_atime, 'unixepoch') from CompletionHistory where (url like "%qute%" or title like "%qute%") order by last_atime desc;
0|0|0|SCAN TABLE CompletionHistory USING INDEX CompletionAtimeIndex
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
3a4ef09f58 More sql code review fixes 2017-06-19 07:44:11 -04:00
Florian Bruhin
9b0395db08 Add an lru cache for WebHistoryInterface.historyContains
When loading heise.de, for some crazy reason QtWebKit calls historyContains
about 16'000 times.

With this cache (which we simply clear when *any* page has been loaded, as then
the links which have been visited can change), that's down to 250 or so...
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
6fc61d12fc Assorted small fixes for sql code review. 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
feed9c8936 Better exception handling in history.
- Show an error message when import fails, not a generic crash dialog
- Raise CommandError when debug-dump-history fails
- Check that the path exists for debug-dump-history
2017-06-19 07:44:11 -04:00
Florian Bruhin
6ce52f39ae Add debug timings for SQL 2017-06-19 07:44:11 -04:00
Florian Bruhin
57d96a4512 Add a CompletionHistory instead of HistoryVisits table 2017-06-19 07:44:11 -04:00
Florian Bruhin
c64b7d00e6 Add separate table for history visits 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
7f27603772 Fix columns_to_filter for sql category. 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
389e1b0178 Fix bad objreg reference in app.py. 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
f8325cbbc1 Remove print statement 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
309b6ba32c Move _import_history to history.py.
Also adjusts the history import test to operate at a higher level and
ensure the old text file is removed (or isn't, in the case of an error).
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
ea0b3eee05 Use full, not partial index for history.
historyContains includes redirect urls, so we actually don't want a
partial index here.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
478a719f77 Use a prepared query for historyContains.
This is called often, hopefully a prepared query will speed it up.
This also modifies Query.run to return self for easier chaining, so you
can use `query.run.value()` instead of `query.run` ; query.value()`.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
5b827cf86a Fix typo in sql exception handling 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
6a0fc5afd2 Create a SQL index on History.url.
This will hopefully speed up historyContains but does not seem to speed
up the completion query, unfortunately.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
565ba23f8c Don't instantiate completion models nedlessly.
For real this time. A mistake on the last commit like this meant models
were still spuriously instantiated.
Now that the completion model is reused, the layoutChanged signal needs
to be forwarded through, otherwise the view will not update.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
42243d3d97 Add more performance logging to completion. 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
a01c76db54 Remove 'group by' from url completion query.
This seemed to have a significant performance impact. Removing it means
that instead of just seeing the most recent atime for a given url, you
will see multiple entries.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
c297f047d2 Don't regenerate completion model needlessly.
If the completion model would stay the same, just keep it and update the
filter pattern rather than instantiating a new model each time the
pattern changes.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
2cd02be7b1 Remove CompletionModel.columns_to_filter.
Instead set this on inidividual categories, as that is where it actually
gets used. This makes it easier for SqlCompletionCategory to reuse a
prepared query (as it gets the filter field names in its constructor).
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
8fb6f45bec Don't set pattern in SqlCategory constructor.
This will be called by the Completer after construction anyways, this
was a duplicate call that could be expensive.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
cf89ffa971 Fix pylint/flake8 errors 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
e67da51662 Use prepared SQL queries. 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
20000088de Add debug-dump-history and fix sql history tests.
Trying to read from the sql database from another process was flaky.
This adds a debug-dump-history command which is used by the history BDD
tests to validate the history contents.

It outputs history in the old pre-SQL text format, so it might be
useful for those who want to manipulate their history as text.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
e201a42383 Fix eslint errors 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
9b25b7ee5d Fix misspelling of 'occurs' 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
882da71397 Remove unused imports 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
eb61269068 Fix qute://history javascript for SQL.
Returning "next" was no longer possible as the SQL query does not fetch
more items than necessary. This is solved by using a start time, a
limit, and an offset. The offset is needed to prevent fetching duplicate
items if multiple entries have the same timestamp.

Two of the history tests that relied on qute://history were changed to
rely on qute://history/data instead to make them less failure-prone.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
0aa0478327 Use EXISTS for SqlTable.contains. 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
71191f10a2 Only complete most recent atime for url.
The history completion query is extended to pick only the most recent item for
a given url.

The tests in test_models now check for ordering of elements.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
9d4888a772 Optimize qute://history for SQL backend.
The old implementation was looping through the whole history list, which for
SQL was selecting every row in the database. The history benchmark was taking
~2s. If this is rewritten as a specialized SQL query, the benchmark takes
~10ms, an order of magnitude faster than the original non-SQL implementation.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
784d9bb043 Remove code rendered dead by sql implementation.
Vulture exposed the following dead code:

- AppendLineParse was only used for reading the history text file, which is now
  a sql database (and the import code for the old text file is simpler and does
  not need a complex line parser)

- async_read_done is no longer used as importing the history text file is
  synchronous (and should only happen once)

- config._init_key_config is unused as it was moved to keyconf.init
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
a8ed9f1c2f Fix qute://version sql init bug.
Calling sql.init() in version.version() would replace the existing sql
connection and cause a crash when accessed by opening qute://version.

Now version relies on sql already being initted, and app.py inits sql early if
the --version arg is given.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
f110cf4d53 Fix long hang after importing history.
Turns out historyContains was getting called for the webkit backend multiple
times when the browser starts. This was calling `url in history`, which was
enumerating the entire history as `__contains__` was not defined.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
024386d189 Fail on history file parsing errors.
Instead of skipping bad history lines during the import to sql, fail hard. We
don't want to delete the user's old history file if we couldn't parse all of
the lines.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
6412c88277 Clean up history module.
Eliminate out-of-date docstring and remove an unused signal.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
3e63b62d6e Fix pylint/flake8 for sql work. 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
8ff45331df Clean up sql implementation.
Now that sql is only used for history (not quickmarks/bookmarks) a number of
functions are no longer needed. In addition, primary key support was removed as
we actually need to support multiple entries for the same url with different
access times. The completion model will have to handle this by selecting
something like (url, title, max(atime)).

This also fixes up a number of tests that were broken with the last few
sql-related commits.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
80647b062a Convert old history file to sqlite.
If qutebrowser detects a history text file when it starts
(~/.local/share/qutebrowser/history by default on Linux), it will import this
file into the new sqlite database, then delete it.

The read is done as a coroutine as it can take some time.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
de5be0dc5a Store history in an on-disk sqlite database.
Instead of reading sqlite history from a file and storing it in an in-memory
database, just directly use an on-disk database. This resolves #755, where
history entries don't pop in to the completion menu immediately as they are
still being read asynchronously for a few seconds after the browser starts.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
7d04f155c8 Add missing docstring. 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
93e0bfa410 Fix tests after sql completion rebase. 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
5dce6fa494 Fix pylint/flake8 errors 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
f95dff4d9e Decouple categories from completionmodel.
Instead of add_list and add_sqltable, the completion model now supports
add_category, and callees either pass in a SqlCategory or ListCategory. This
makes unit testing much easier.

This also folds CompletionFilterModel into the ListCategory class.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
ce3c555712 Use list completion for bookmarks/quickmarks.
The RFC on moving from plaintext to SQL storage (#2340) showed that many would
be upset if bookmarks and quickmarks were no longer stored in plaintext.

This commit uses list-based completion for quickmarks and bookmarks. Now the
history storage can be moved from plaintext to an on-disk SQL database while
leaving bookmarks and quickmarks as-is.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
80619c88b3 Revert "Use SQL for quickmark/bookmark storage."
This reverts commit fa1ebb03b70dfff4ac64038e67d9bab04b984de5.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
e3a33ca427 Implement a hybrid list/sql completion model.
Now all completion models are of a single type called CompletionModel.
This model combines one or more categories. A category can either be a
ListCategory or a SqlCategory.

This simplifies the API, and will allow the use of models that combine simple
list-based and sql sources. This is important for two reasons:

- Adding searchengines to url completion
- Using an on-disk sqlite database for history, while keeping bookmarks and
  quickmars as text files.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
921211bbaa Remove web-history-max-items.
This was a performance optimization that shouldn't be needed with the new SQL
history backend. This also removes support for the LIMIT feature from SqlTable
as it only existed to support web-history-max-items.
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
c4c5723a61 Sort history completion entries by atime. 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
56f3b3a027 Small review fixups for SQL implementation.
Respond to the low-hanging code review fruit:

- Clean up some comments
- Remove an acidentally added duplicate init_autosave
- Combine two test_history tests
- Move test_init cleanup into a fixture to ensure it gets called.
- Name the _ argument of bind(_) to _key
- Ensure index is valid for first_item/last_item
- Move SqlException to top of module
- Rename test_index to test_getitem
- Return QItemFlags.None instead of None
- Fix copyright dates (its 2017 now!)
- Use * to force some args to be keyword-only
- Make some returns explicit
- Add sql to LOGGER_NAMES
- Add a comment to explain the sql escape statement
2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
3c676f9562 Fix pylint/flake8 errors for SQL work. 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
a050cb94f6 Report sqlite version with --version. 2017-06-19 07:44:11 -04:00
Ryan Roden-Corrent
c6645d47ba Remove newest_slice and StatusBar._option.
newest_slice is no longer needed after the completion refactor. Now that
history is based on the SQL backend, LIMIT is used instead.

StatusBar._option is not used, though I'm not sure why vulture only caught it
now.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
6a8b1d51fa Avoid config -> configmodel circular import.
Avoid the config dependency by using objreg.get('config') instead of
config.get.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
6cc2095221 Avoid keyconf circular import.
The new function-based completion API introduced a circular import:
config -> keyconf -> miscmodels -> config.

config only depended on keyconf so it could initialize it as part of
config.init. This can be resolved by moving this to keyconf.init and
initializing keyconf as part of app.init.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
21757a96a3 Add docstrings to SqlCompletionModel overrides.
Leaving QAbstractItemModel overrides undocumented made pylint angry.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
be07107b1c Fix end2end completion tests for SQL backend.
Change the logging to report the completion function name and have the end2end
tests check for this.

Remove the tests for realtime completion, as it was decided this is not an
important feature and the code is much simpler without it.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
6a04c4b3e8 Allow replacing quickmark with SQL backend.
This functionality was lost with the transition to SQL.
The user should be able to replace a quickmark if they answer 'yes' to the
prompt.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
02fb1a037c Implement canFetchMore for SQL completion.
This just forwards canFetchMore and fetchMore to the underlying tables.
It seems to be returning True and fetching in some cases (with a large
history), so I guess it is useful?
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
ffd044b52b Fix pylint and flake8 for SQL work.
Vanity commit. This also touches up a few comments.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
ea9217a61f Fix qutescheme for new SQL backend.
The qute://history and qute://bookmarks handlers were added during my work, and
had to be adapted to the SQL-based history backend.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
0e650ad719 Return namedtuples from SqlTable.
Instead of returning a regular tuple and trying to remember which index maps to
which field, return named tuples that allow accessing the fields by name.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
d89898ef7d Implement delete_cur_item for sql completion.
This re-enables bookmark/quickmark deletion for url completions via the new SQL
interface.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
fe80878788 Implement custom where clause in SQL.
Allow categories to specify a WHERE clause that applies in addition to the
pattern filter. This allows the url completion model to filter out redirect
entries.

This also fixed the usage of ESCAPE so it applies to all the LIKE statements.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
9f27a9a5d7 Implement column selectors for sql completion.
A SQL completion category can now provide a customized column expression for
the select statement. This enables the url model to format timestamps, as well
as rearrange the name and url in the quickmark section.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
3f6f03e325 Respect web-history-max-items with SQL.
Use a LIMIT with the sql competion model to limit history entries as the old
completion implementation did.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
df995c02a3 Get rid of varargs in sql.run_query.
Things are clearer when just passing a list.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
b70d5ba901 Use QSqlQueryModel instead of QSqlTableModel.
This allows setting the query as a QSqlQuery instead of a string, which allows:

- Escaping quotes
- Using LIMIT (needed for history-max-items)
- Using ORDER BY (needed for sorting history)
- SELECTing columns (needed for quickmark completion)
- Creating a custom select (needed for history timestamp formatting)
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
52d7d1df0c Use SQL completer for quickmarks/bookmarks. 2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
839d49a8ac Fix up pylint/flake8 for completion revamp. 2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
5bd047b70b Fix CompletionView.completion_item_del for new API.
The new function based completion models work a little differently so the view
needed slightly different error handling.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
c3155afc21 Rethrow KeyError as DoesNotExistError in urlmarks.
From @TheCompiler:
To expand on this: I think it's fine to use KeyError on a lower level, i.e.
with the SqlTable object with a dict-like interface. However, on this higher
level, I think it makes sense to re-raise them as more specific exceptions.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
d4f2a70f83 Slightly simplify CompletionModel.new_item.
There was no need to have a branch based on whether the misc value was None or
not.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
3005374ada Simplify sorting logic in sortfilter.
For URL completion, time-based sorting is handled by the SQL model.
All the other models use simple alphabetical sorting. This allowed cleaning up
some logic in the sortfilter, removing DUMB_SORT, and removing the
completion.Role.sort.

This also removes the userdata completion field as it was only used in url
completion and is no longer necessary with the SQL model.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
acea0d3c67 Use SQL completion for the open command.
Now that history, bookmark, and quickmark storage are SQL-backed, use
a sql completion model to serve url completions.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
6e1ea89ca1 Implement SQL completion model.
This model wraps one or more SQL tables and exposes data in a tiered
manner that can be consumed by the tree view used for completion.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
93d81d96ce Use SQL for quickmark/bookmark storage.
Store quickmarks and bookmarks in an in-memory sql database instead of a
python dict. Long-term storage is not affected, bookmarks and
quickmarks are still persisted in a text file.

The added and deleted signals were removed, as once sql completion
models are used the models will no longer need to update themselves.

This will set the stage for SQL-based history completion.
See #1765.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
9477a2eeb2 Use SQL for history storage.
The browser-wide in-memory web history is now stored in an in-memory sql
database instead of a python dict. Long-term storage is not affected, it
is still persisted in a text file of the same format.

This will set the stage for SQL-based history completion.
See #1765.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
f43f78c40f Implement SQL interface.
When qutebrowser starts, it creates an in-memory sqlite database. One
can instantiate a SqlTable to create a new table in the database. The
object provides an interface to query and modify the table.

This intended to serve as the base class for the quickmark, bookmark,
and history manager objects in objreg. Instead of reading their data
into an in-memory dict, they will read into an in-memory sql table.

Eventually the completion models for history, bookmarks, and quickmarks
can be replaced with SqlQuery models for faster creation and filtering.

See #1765.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
3b30b42211 Remove completion.instances, usertypes.Completion.
The new completion API no longer needs either of these. Instead of
referencing an enum member, cmdutils.argument.completion now points to
a function that returnsthe desired completion model.
This vastly simplifies the addition of new completion types. Previously
it was necessary to define the new model as well as editing usertypes
and completion.models.instances. Now it is only necessary to define a
single function under completion.models.

This is the next step of Completion Model/View Revamping (#74).
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
b36cf0572d Avoid potential circular import in config.py.
There was a circular import from
config -> keyconf -> miscmodels -> config.
This is resolved by scoping config's keyconf import to the one function
that uses it.
2017-06-19 07:42:12 -04:00
Ryan Roden-Corrent
08bb3f4f19 Implement completion models as functions.
First step of Completion Model/View revamping (#74). Rewrite the
completion models as functions that each return an instance of a
CompletionModel class.

Caching is removed from all models except the UrlModel. Models other
than the UrlModel can be generated very quickly so caching just adds
needless complexity and can lead to incorrect results if one forgets to
wire up a signal.
2017-06-19 07:42:12 -04:00
Florian Bruhin
40b949364e Fix qute://backend-warning issues
We now set a title correctly, and don't crash if we find a Debian/Ubuntu without
version.
2017-06-19 13:37:00 +02:00
Florian Bruhin
bef372e5f5 Clear search on page load
Fixes #2728
2017-06-19 10:27:27 +02:00
Florian Bruhin
4ae8e247d0 Show 'legacy QtWebKit' in version output 2017-06-19 10:24:33 +02:00
Florian Bruhin
5bb63e67e0 Remove another stray # 2017-06-19 09:43:45 +02:00
Florian Bruhin
8494332c3a Merge branch 'fix-tabbar-padding' of https://github.com/kmarius/qutebrowser 2017-06-19 09:43:26 +02:00
Florian Bruhin
df6c4c6e73 Fix earlyinit.qt_version issues 2017-06-19 09:42:49 +02:00
Florian Bruhin
6c534bea6b Actually remove version import in earlyinit... 2017-06-19 08:59:26 +02:00
Florian Bruhin
fdba676933 Move version.qt_version() to earlyinit
Importing version in earlyinit is a bad idea, as it already pulls in a lot of
stuff we don't want.
2017-06-19 08:57:29 +02:00
Marius
de743732aa remove # inside comment 2017-06-19 08:29:23 +02:00
Marius
ebd442ea95 add needed parens and remove trailing whitespace 2017-06-18 23:07:38 +02:00
Marius
68f172558b fix line length 2017-06-18 22:44:06 +02:00
Marius
4b2bf12efa Fix padding of remaining tabbar space with pinned tabs 2017-06-18 21:49:04 +02:00
Florian Bruhin
695a2656fe Rename webelem.js functions to match WebEngineElem
Fixes #2726
2017-06-16 23:14:17 +02:00
Florian Bruhin
9cc688ea2b Fix initial tab sizing with vertical tabbar 2017-06-16 23:00:16 +02:00
Iordanis Grigoriou
f28d523225 Select the last focused tab when running ':tab-focus <current tab number>' 2017-06-16 12:28:56 +02:00
Florian Bruhin
b37d040d44 Add version check for 5.8 search segfault workaround 2017-06-14 10:57:32 +02:00
Florian Bruhin
38d54cb112 Stabilize history tests
Get current URL right away in :view-source, and wait until source is shown in
the test.
2017-06-12 18:13:17 +02:00
Florian Bruhin
b687ede25c Adjust eslintrc for eslint 4.0 2017-06-12 09:23:20 +02:00
Florian Bruhin
57fbfbd606 Set an initial window size for background tabs
When we open a background tab, it gets a hardcoded size (800x600 or so) because
it doesn't get resized by the layout yet.

By resizing it to the size it'll actually have later, we make sure scrolling to
an anchor in an background tab works, and JS also gets the correct size for
background tabs.

Fixes #1190
Fixes #2495
See #1417
2017-06-11 17:48:01 +02:00
Florian Bruhin
2e5620cac1 Try a different way of fixing userscript crashes 2017-06-11 14:44:19 +02:00
Florian Bruhin
a49adc6298 Revert "Work around userscript crash issue"
This reverts commit 73ff2afb3f.

Doesn't seem to help, at least for pkill9...
2017-06-11 14:41:58 +02:00
Florian Bruhin
73ff2afb3f Work around userscript crash issue 2017-06-11 13:17:40 +02:00
Florian Bruhin
89218c9d31 Improve error handling in version.opengl_vendor()
Not being able to get versionFunctions is now handled, and the cleanup is done
in a finally: block.
2017-06-09 23:14:34 +02:00
Florian Bruhin
b874432c69 Remove private browsing notes for QtWebKit-NG 2017-06-09 10:31:21 +02:00
Florian Bruhin
6361a5bab2 Merge branch 'private_tag_tab_title' of https://github.com/craftyguy/qutebrowser 2017-06-08 14:17:43 +02:00
Florian Bruhin
c8d4ef13de Adjust default :messages level 2017-06-08 12:35:21 +02:00
Florian Bruhin
63f6409fdb Remove stray StatusBar._option 2017-06-08 12:29:07 +02:00
Clayton Craft
daa12ed435 Add private mode title format for tabs too
This continues the spirit of my previous PR and allows formatting tab
titles to designate when private mode is enabled. I didn't even realize
that tab title-format was a separate thing from window-title-format
(yes, it's in the name.. silly craftyguy), until now.
2017-06-07 08:17:03 -07:00
Florian Bruhin
09baa08948 Remove colon from error page 2017-06-06 22:15:19 +02:00
Florian Bruhin
dd4fb87db6 Update docs 2017-06-06 18:25:42 +02:00
Florian Bruhin
8990513c1b Merge commit '49b8737f7979fc878ba25aed94cc3e57f481ae3a' into craftyguy/private_tab_title 2017-06-06 18:23:51 +02:00
Florian Bruhin
8df0b063be Get rid of utils.unused because it's unused 2017-06-06 17:04:21 +02:00
Clayton Craft
49b8737f79 Implement changing of tab title when privacy mode is enabled 2017-06-06 08:00:19 -07:00
Florian Bruhin
6d175fbb4b Get rid of configtypes.WebKitBytes 2017-06-06 16:17:44 +02:00
Florian Bruhin
f9b046d766 Get proper settings object in WebEngineElement._click_js 2017-06-06 16:15:25 +02:00
Florian Bruhin
a7413d7b4a Remove stale getter 2017-06-06 15:59:42 +02:00
Florian Bruhin
1b0a125cf3 websettings: Improve errors when setting settings=... 2017-06-06 15:59:42 +02:00
Florian Bruhin
b1a0bc13f2 webkitsettings: Use self._get_settings in CookiePolicy._set 2017-06-06 15:59:42 +02:00
Florian Bruhin
30fe3ed328 Remove old websetting comments 2017-06-06 15:46:54 +02:00
Florian Bruhin
e17494c972 Cleanup 2017-06-06 15:25:21 +02:00
Florian Bruhin
0ca59f2184 Rename storage -> offline-web-application-storage to -cache 2017-06-06 14:50:57 +02:00
Florian Bruhin
c696723650 Merge storage -> offline-storage-database into local-storage setting
Looks like it's the same with QtWebEngine too - setting LocalStorageEnabled also
toggles WebSQL there.
2017-06-06 14:50:57 +02:00
Florian Bruhin
626d299a0d Add webenginesettings.DefaultProfileSetter.__repr__ 2017-06-06 14:50:57 +02:00
Florian Bruhin
2a32e26846 Get rid of various rarely customized settings
All those were customized by some <5 people in the past few years of crash
reports.

Closes #1751.
See #2639.
2017-06-06 14:50:57 +02:00
Florian Bruhin
1785b72393 Refactor websettings default handling
With per-domain settings, having a getter for a setting gets really complicated,
as there isn't one true value for a setting.

The only reason we needed those getters is to save away the default values for
some settings where we were unsure what the defaults are.

- For font setters, we can get the defaults from QFont, like QtWeb{Kit,Engine}
  do.
- For font sizes, we hardcode the defaults QtWeb{Kit,Engine} hardcodes too.
- For maximum-page-in-cache, we hardcode 0, just like QtWebKit.
- For default-encoding, we hardcode iso-8559-1, like QtWeb{Kit,Engine}
- For offline-storage-default-quota, we hardcode 5MB, like QtWebKit
- For offline-web-application-cache-quota, we hardcode MAXINT as default value,
  but we still keep the empty value in the config. It means "no quota"
  internally in QtWebKit, but it's a too confusing value to have in the config.
- For object-cache-capacities it's a bit more complicated (the defaults are
  calculated based on disk space), but let's just get rid of the setting
  altogether in the next commit (see #1751).

Closes #2639.
2017-06-06 14:50:57 +02:00
Florian Bruhin
d4f58533c0 Add error messages for QtWebEngine downloads
Fixes #2164
2017-06-06 06:29:52 +02:00
Florian Bruhin
a45de9cef2 Remove request tracking from NetworkManager
This breaks things (with "ValueError: list.remove(x): x not in list") on
PyQt 5.9 (probably due to the destroyed object tracking it introduces?).

This was originally added in 0abb5cf738 to fix
some segfaults on exit, but things look much better with recent Qt versions.
2017-06-05 18:19:29 +02:00
Florian Bruhin
4d64bcc852 Make version.opengl_vendor() work with an existing context
This makes it possible to use it in :debug-console
2017-06-04 23:05:23 +02:00
Florian Bruhin
a858611bb9 Don't make errors in version.opengl_vendor() fatal
Fixes #2694
2017-06-04 22:55:39 +02:00
Florian Bruhin
722c117d54 Better handling of OpenSSL 1.1
Fixes #2690
2017-06-02 21:52:53 +02:00
Florian Bruhin
a90429fe6e Update needed dependencies
Fixes #2683
2017-06-01 19:30:32 +02:00
Florian Bruhin
a690d242a4 Update webengine dependency message 2017-06-01 14:03:46 +02:00
Florian Bruhin
587861d899 Check for OpenGL ES later
It looks like we still got False on AppVeyor with "versionFunctions: Not
supported on OpenGL ES". Hopefully this helps.
2017-05-31 11:44:34 +02:00
Florian Bruhin
4cec9adce6 Fix lint 2017-05-31 09:44:17 +02:00
Florian Bruhin
912cea6e7d Improve version.opengl_vendor()
On Windows with OpenGL ES we can't use versionFunctions, so we just return None
early.

Also, this fixes some lint and adds a smoke test.
2017-05-30 19:23:27 +02:00
Florian Bruhin
b8a32c577f Merge branch 'nouveau' 2017-05-30 17:36:58 +02:00
Florian Bruhin
62b44c5338 Fix lint 2017-05-30 17:07:31 +02:00
Florian Bruhin
67755e6f6c Add error message for QtWebEngine and Nouveau
See #2368
2017-05-30 16:47:39 +02:00
Florian Bruhin
048aec1aa6 Revert "Reorganize earlyinit checks"
This reverts commit 6f3f9ede01a6b30b105d5110a48cfea592e8db52.
2017-05-30 15:53:29 +02:00
Florian Bruhin
d0461eece3 Reorganize earlyinit checks
We first do all checks we can without knowing the backend, before getting that.
This is because we need to do some more stuff in get_backend now.
2017-05-30 15:53:29 +02:00
Florian Bruhin
1c6fd6f725 Add a backend warning when using QtWebKit 2017-05-30 08:42:37 +02:00
Florian Bruhin
4cb82af11e Add QUTE_FAKE_OS_RELEASE envvar 2017-05-30 07:37:10 +02:00
Florian Bruhin
ef504e5b25 Allow None for WebKitElement.value
This fixes an exception when trying to run :open-editor with a comment field
with QtWebKit:

    16:37:51 DEBUG    webelem    webelem:is_editable:238 Checking if element is editable: <qutebrowser.browser.webkit.webkitelem.WebKitElement html='<div id="writer9997095275-writer" class="writer selectable no-lub put-art-here ui-droppable empty" style="min-height: 146px; width: 1169px;" contenteditable="true"></div>'>
    16:37:51 ERROR    misc       crashsignal:exception_hook:205 Uncaught exception
    Traceback (most recent call last):
      File "/home/florian/proj/qutebrowser/git/qutebrowser/app.py", line 882, in eventFilter
        return handler(event)
      File "/home/florian/proj/qutebrowser/git/qutebrowser/app.py", line 842, in _handle_key_event
        return man.eventFilter(event)
      File "/home/florian/proj/qutebrowser/git/qutebrowser/keyinput/modeman.py", line 337, in eventFilter
        return self._eventFilter_keypress(event)
      File "/home/florian/proj/qutebrowser/git/qutebrowser/keyinput/modeman.py", line 168, in _eventFilter_keypress
        handled = parser.handle(event)
      File "/home/florian/proj/qutebrowser/git/qutebrowser/keyinput/basekeyparser.py", line 307, in handle
        handled = self._handle_special_key(e)
      File "/home/florian/proj/qutebrowser/git/qutebrowser/keyinput/basekeyparser.py", line 136, in _handle_special_key
        self.execute(cmdstr, self.Type.special, count)
      File "/home/florian/proj/qutebrowser/git/qutebrowser/keyinput/keyparser.py", line 44, in execute
        self._commandrunner.run(cmdstr, count)
      File "/home/florian/proj/qutebrowser/git/qutebrowser/commands/runners.py", line 275, in run
        result.cmd.run(self._win_id, args, count=count)
      File "/home/florian/proj/qutebrowser/git/qutebrowser/commands/command.py", line 525, in run
        self.handler(*posargs, **kwargs)
      File "/home/florian/proj/qutebrowser/git/qutebrowser/browser/commands.py", line 1600, in open_editor
        tab.elements.find_focused(self._open_editor_cb)
      File "/home/florian/proj/qutebrowser/git/qutebrowser/browser/webkit/webkittab.py", line 589, in find_focused
        callback(webkitelem.WebKitElement(elem, tab=self._tab))
      File "/home/florian/proj/qutebrowser/git/qutebrowser/browser/commands.py", line 1580, in _open_editor_cb
        text = elem.value()
      File "/home/florian/proj/qutebrowser/git/qutebrowser/browser/webkit/webkitelem.py", line 116, in value
        assert isinstance(val, (int, float, str)), val
    AssertionError: None
2017-05-29 16:56:36 +02:00
Florian Bruhin
7186dcb98f Send crash reports to private pastebin
Fixes #481
2017-05-29 09:20:10 +02:00
Florian Bruhin
b32223acc7 Only inherit private mode when window is set
Otherwise, everything calling _open in a private window (like :quickmark-load)
will open a new window.
2017-05-29 06:37:28 +02:00
Florian Bruhin
8bd6974042 Open a window with an empty session
With general -> save-session on and only private windows open, we can easily get
a session file with "windows: []" in it. If we loaded such a file, we got no
windows at all when qutebrowser started.

Fixes #2664
2017-05-28 11:15:51 +02:00
Florian Bruhin
beb731c04c Move signal connections around 2017-05-28 10:54:16 +02:00
Florian Bruhin
06e754a632 Track HTML fullscreen per-tab
We now automatically get out of fullscreen when switching away from a
fullscreened tab. This also means we can't get into a situation where we can't
leave fullscreen anymore.

Fixes #2379.
2017-05-28 10:51:14 +02:00
Florian Bruhin
a18ebd52a9 Rename TabWidget methods 2017-05-26 18:39:35 +02:00
Florian Bruhin
e96f085f8d Merge commit '38ca583084e89de0da35cb1b626d21b051ea2c70' 2017-05-23 17:43:01 +02:00
Florian Bruhin
af1e1d9239 Merge commit 'c814ced7b35968cfdeb6284cc79168bfffed7c85' 2017-05-23 17:18:55 +02:00
Florian Bruhin
c32c01ffc0 Merge commit '419793c0b9ff4f293babea7623dcaf4787bbaa35' 2017-05-22 07:55:44 +02:00
Jay Kamat
419793c0b9
Misc cleanup and documentation update 2017-05-21 22:42:51 -07:00
Jay Kamat
00f001729b
Fix undo with pinned tabs
Add tests for undo with a pinned tab
Add tests for clone with a pinned tab
2017-05-21 21:03:33 -07:00
Jay Kamat
2a961c3951
Clean up pinned status to a centralized location
- Add support for :tab-clone with pinned tabs

Now tabbed_browser.set_tab_pinned can be called independently.
2017-05-21 19:49:10 -07:00
Florian Bruhin
aa8e6c8d17 Add parsed distribution to version info
Fixes #2369
2017-05-20 23:26:00 +02:00
Florian Bruhin
fe145b66c1 Add a version.distribution()
See #2369
2017-05-20 23:26:00 +02:00
Florian Bruhin
f66c1a0e44 Merge commit '3d9729839d6d9b5ee5d38afdf6ddf410dfca2027' into abbradar/pac-fix 2017-05-19 08:36:39 +02:00
Florian Bruhin
c4fb2bc609 Fix URL/renderer crash tests with Qt 5.9
The behavior in Qt changed there (in a good way), so we need to adjust the tests
accordingly.

Fixes #2514
2017-05-19 08:10:17 +02:00
Nikolay Amiantov
3d9729839d Fix crash on PAC evaluation error 2017-05-18 16:54:49 +03:00
Florian Bruhin
00a7a0cee6 Reorganize pylint config
This removes various stuff we don't need anymoe, and also re-enables and fixes
the import order check.
2017-05-17 20:20:12 +02:00
Florian Bruhin
12520bf4ba Install PyQt from PyPI for pylint
This means we can be sure to have QtWebEngine available and won't have QtWebKit.
2017-05-17 19:08:59 +02:00
Florian Bruhin
608ac89f06 Fix lint 2017-05-17 14:32:13 +02:00
Florian Bruhin
9898d80625 Remove legacy cx_Freeze code
This also removes frozen tests for now. They should be readded at some point...
2017-05-17 11:31:14 +02:00
Florian Bruhin
a48ea597d0 Set websettings on each profile's setting object
Turns out QWebEngineSettings.globalSettings() only sets things on the default
profile. We now get everything from the default profile settings, but set it on
both the default and the private profile.

Fixes #2638

(cherry picked from commit b11a4388cd10b6ff2fd917fca689ebdc50d581ae)
2017-05-17 06:31:51 +02:00
Jay Kamat
5e3c68530a
Regenerate documentation 2017-05-16 21:03:33 -07:00
Florian Bruhin
766a1ebb6d Remove wrong private browsing assertion
This tried to assert that we never create a DiskCache object when private
browsing is turned on. However, when initializing, we still create a global
DiskCache, so this will hit when qutebrowser is started with private browsing
turned on via the config.

We could just not create the DiskCache at all when started in private browsing
mode, however we might still need it later when opening a non-private window.
2017-05-16 11:33:52 +02:00
Florian Bruhin
27aa40428e Also make DownloadManager NAM private if private browsing is on
There's only one global DownloadManager with its own NAM (for downloads not
associated with a page). We can't really decide whether that should be private
or not, so as a best-effort approximation we simply make it private if private
browsing was turned on when starting qutebrowser.
2017-05-16 11:32:35 +02:00
Florian Bruhin
89dc8185b9 Fix lint 2017-05-16 09:08:59 +02:00
Florian Bruhin
1fcce6d87c Change how error page retries work
A simple reload won't work when e.g. the renderer process crashed, so let's try
this instead.

Also, searchFor seemed to be unused.
2017-05-16 07:51:37 +02:00
Florian Bruhin
a4021e8e7a Show error page for renderer process crashes on 5.9
Fixes #2291
2017-05-16 07:50:26 +02:00
Florian Bruhin
bdf56e63dd Fix long line 2017-05-16 07:31:02 +02:00
Florian Bruhin
d0dd1644af Set user agent correctly on QtWebEngine 2017-05-16 06:46:45 +02:00
Florian Bruhin
086139110d Merge branch 'new-private-browsing' 2017-05-16 06:32:15 +02:00
Florian Bruhin
adb924a758 Use -p for :save-session --with-private 2017-05-16 06:28:21 +02:00
Florian Bruhin
658abf7b2b Fix coverage on old Qt versions 2017-05-15 13:39:49 +02:00
Florian Bruhin
e13a5c0f17 Use a list for stylesheet flags
If we simply use sorted() on a dict, we define insert before private-command,
which means the statusbar isn't going to be green when in insert mode while
private browsing.
2017-05-15 11:07:43 +02:00
Florian Bruhin
3cdcc34d1d Update private-browsing option description 2017-05-15 11:07:43 +02:00
Florian Bruhin
c4307c9f03 Fix lint 2017-05-15 11:07:43 +02:00
Florian Bruhin
f6fc2666ce Generate stylesheet for statusbar 2017-05-15 11:07:43 +02:00
Florian Bruhin
73ca884d24 Add a setting for private command mode color
This also refactors how color properties are handled in StatusBar.
2017-05-15 11:07:43 +02:00
Florian Bruhin
3c3f695af4 Fix things pointed out in reviews 2017-05-15 11:07:43 +02:00
Florian Bruhin
6ee382ef30 Sort windows when saving sessions
This should help with flaky tests when the window order changes
2017-05-15 11:02:29 +02:00
Florian Bruhin
8993667479 Remove unused imports 2017-05-15 11:02:29 +02:00
Florian Bruhin
eda95d7926 Simplify window/private distinction in commands.py 2017-05-15 11:02:29 +02:00
Florian Bruhin
cde36f34b0 Remove QtWebKit-NG warnings
The next release will support private browsing, and we can't easily check the
version somehow.
2017-05-15 11:02:29 +02:00
Florian Bruhin
9805b43c85 Handle private browsing in sessions 2017-05-15 11:02:29 +02:00
Florian Bruhin
f907b6b6b0 Have an isolated command history for private windows 2017-05-15 11:02:26 +02:00
Florian Bruhin
dd675c4e8d Set title for :view-source pages 2017-05-15 09:16:24 +02:00
Florian Bruhin
5b1d35bef9 Don't add data: URLs to history 2017-05-15 09:04:16 +02:00
Florian Bruhin
920dde4a68 Don't set an URL for :view-source tabs
Otherwise the page URL gets added to the history again with QtWebKit.
2017-05-15 09:03:45 +02:00
Jay Kamat
17169812be
Misc cleanup and fixes 2017-05-14 00:21:51 -07:00
Matthias Lisin
c814ced7b3 Add Android UA 2017-05-13 15:05:54 +02:00
Anton Grensjö
47f391d38b
Set explicit=False for :navigate --tab
Related to #2624
2017-05-13 04:16:49 +02:00
Jay Kamat
b526c9a2a9
Try to fix a pylint error 2017-05-12 18:38:06 -07:00
Jay Kamat
068e47e22c
Fix a few style issues 2017-05-12 16:56:07 -07:00
Florian Bruhin
273749cce8 Don't set explicit=True for :tab-clone/:view-source
Fixes #2624
2017-05-12 22:27:24 +02:00
Jay Kamat
2ae1bfc033
Keep pinned tabs in place rather than moving them. 2017-05-12 13:09:22 -07:00
Jay Kamat
66dfb1b1c9
Fix a bug with titles not being refreshed when pinning tabs 2017-05-12 09:53:25 -07:00
Florian Bruhin
17fdda6a5e Check for href attribute in WebElement.is_link
Fixes #2619
2017-05-12 12:59:25 +02:00
Florian Bruhin
9e2aa65c02 Remove webelem.Group.prevnext
Apart from checking for buttons with an href attribute (which made no sense at
all and should never return any element) this was identical to
webelem.Group.links.
2017-05-12 09:41:12 +02:00
Florian Bruhin
203a5dff74 Get rid of webelem.FILTERS
There's actually no good reason to filter javascript links as we might want to
click them (or copy their URL) just like any other link - this fixes #2404.

With that being gone, we don't need FILTERS at all anymore, as we can check for
existence of the href attribute in the CSS selector instead.
2017-05-12 09:41:12 +02:00
Jay Kamat
21455cf0e7
Clean up pinned tab alert logic
should be a lot more reusable now
2017-05-11 15:37:52 -07:00
Jay Kamat
4c28487fd0
Warn user if pinned tab is closed via tab-only 2017-05-11 14:30:45 -07:00
Jay Kamat
3317834b36
Fix a bug where pinned tabs were occasionally miscounted
Example case: :tab-only. This should cover other cases, but currently those
cases (such as :tab-only) do NOT have a warning message when popping up.
2017-05-11 13:28:26 -07:00
Jay Kamat
725bafea54
Merge branch 'master' into jay/pintab 2017-05-10 23:51:33 -07:00
Florian Bruhin
c6e31391de Fix most tests/lint 2017-05-10 09:19:24 +02:00
Florian Bruhin
f4d3f97cb7 Implement private browsing for QtWebEngine 2017-05-10 09:17:54 +02:00
Florian Bruhin
1c50377c0a Initial work on new private browsing 2017-05-10 07:00:21 +02:00
Florian Bruhin
b91d4ee9c2 Clean up :debug-webaction 2017-05-09 22:02:30 +02:00
Florian Bruhin
822623f2ed Finally update copyrights... 2017-05-09 21:37:03 +02:00
Florian Bruhin
905032924a Remove search_displayed initialization in subclasses
We set this in BrowserTab anyways, and the value in WebKitTab was wrong.
2017-05-09 17:58:28 +02:00
Florian Bruhin
4b5e528d05 Add AbstractTab.key_press 2017-05-09 17:56:07 +02:00
Florian Bruhin
76fa126133 Simplify debug string 2017-05-09 17:55:51 +02:00
Florian Bruhin
e3eda28d88 Update docstrings 2017-05-09 17:52:13 +02:00
Jay Kamat
e10d636ca0
Fix a few small issues
- Remove an unused warnings
- Reverse if statement arguments to simplify logic
2017-05-09 08:08:05 -07:00
Jay Kamat
a3d41c0467
Refactor search method of AbstractBrowserTab into a field 2017-05-09 00:24:13 -07:00
Jay Kamat
d1aac9e9e9
Add docstrings to key_press methods 2017-05-08 23:43:21 -07:00
Jay Kamat
5bdd291d28
Refactor key_press into _repeated_key_press
Also split off generic key pressing ability from WebKitScroller to WebKitTab
2017-05-08 23:11:50 -07:00
Jay Kamat
63cffaf558
Refactor _key_press from WebEngineScroller to WebEngineTab 2017-05-08 22:49:14 -07:00
Jay Kamat
c9953b9f0d
Add support for follow_selected via fake-clicks 2017-05-08 22:31:29 -07:00
Jay Kamat
e07a1045a8
Add is_link method to webelem 2017-05-08 22:00:11 -07:00
Florian Bruhin
9db92de2d5 Add a no cover pragma for certificate error hashing 2017-05-09 06:15:21 +02:00
Florian Bruhin
90b0af97ce Improve serialization crash check
It now works correctly with view-source URLs and is disabled on Qt 5.9.

Fixes #2289
See #2458
2017-05-03 23:15:17 +02:00
Florian Bruhin
ea2d5e97e2 Disable serialization crash check on Qt 5.9 2017-05-03 21:31:09 +02:00
Florian Bruhin
ebf3d208f6 Adjust Qt 5.8.1 check
There's never going to be a 5.8.1
2017-05-03 21:25:00 +02:00
Florian Bruhin
a320aa5ef7 Disable renderer process crash workaround on Qt 5.9 2017-05-03 21:24:25 +02:00
Florian Bruhin
a77cb44723 Block all request methods in host blocker 2017-05-03 08:42:37 +02:00
Florian Bruhin
64e144f3eb Make text selectable in prompts 2017-05-01 13:52:46 +02:00
Florian Bruhin
5bbd16c92a Fix qWebKitVersion issues 2017-04-28 22:59:24 +02:00
Florian Bruhin
bffdea6719 Read qWebKitVersion in qtutils.is_webkit_ng.
This means we need to try and import qWebKitVersion in qtutils, but better there
than at every place which calls it.
2017-04-28 21:36:02 +02:00
Florian Bruhin
8101fe99a8 Fix starting with Python 2
Fixes #2567
2017-04-28 20:51:38 +02:00
Florian Bruhin
a5b1c293a4 Ignore comment position with eslint 2017-04-28 20:29:20 +02:00
Florian Bruhin
421aa0d319 Also try harder to get text content 2017-04-28 19:11:02 +02:00
Florian Bruhin
76ec465f67 Allow to set cookies-store at runtime with Qt 5.9
Fixes #2588
2017-04-28 17:40:43 +02:00
Florian Bruhin
5ed870e0c6 Fix lint 2017-04-28 16:29:44 +02:00
Florian Bruhin
6458c692cb Improve JS value type checks 2017-04-28 15:15:32 +02:00
Florian Bruhin
571f0c4486 Loosen JS value type check 2017-04-28 14:57:14 +02:00
Florian Bruhin
0c653c4703 Handle elem.className in webelem.js 2017-04-28 14:48:30 +02:00
Florian Bruhin
513f83d446 Try harder to get tag name from element
This could happen for any of the attributes, but for tagName this actually
happens in the wild... Since elem.tagName is equal to elem.nodeName we just try
to use this.

Fixes #2569
2017-04-28 14:48:30 +02:00
Florian Bruhin
06e317ac53 Do type checks on values we get from JS 2017-04-28 14:48:30 +02:00
Florian Bruhin
4f92fe6895 Add an assert for tag_name we get from JS
This should help tracking down #2569 once we get another report about it.
2017-04-28 10:33:57 +02:00
Florian Bruhin
d8bfa6d6b7 Merge commit '6549fd84ce461d3098c13818219df4e4bfd6b444' 2017-04-27 21:15:09 +02:00
Florian Bruhin
d62ebdb926 Make most of search BDD tests work with QtWebEngine 2017-04-27 21:02:26 +02:00
Florian Bruhin
4cd977cab6 Fix zero handling in qflags_key 2017-04-27 20:14:51 +02:00
Niklas Haas
6549fd84ce
Add tabs->favicon-scale setting
This allows users to change the size of the favicon independently from
the size of the font/tab, in order to adjust the balance between
favicons and text. The drawing code is also adjusted to place the icon
relative to the text center, rather than the text top.

Works as expected even for values of 0.0 (which is equivalent to hiding
the favicon completely).

Closes #2549.
2017-04-27 08:53:51 +02:00
Florian Bruhin
95b866e4f4 Merge commit 'fe7d21dfbe0b9dabcb66eaa61c20a5d16c9e175c' 2017-04-26 08:54:39 +02:00
Florian Bruhin
70d7a56b11 Also set Fusion style for downloads and completion
This makes those UI elements look the same on different platforms/OS styles,
with the small drawback of overriding the context menu style.

This most likely fixes #80 (though I couldn't reproduce that on Windows 10).
2017-04-25 22:20:37 +02:00
Florian Bruhin
66eb330a0a Always base tabbar on Fusion style.
Fixes crashes with qt5ct.
Fixes #2477.
Fixes #1554.
2017-04-25 21:44:15 +02:00
Florian Bruhin
1015badb8b Disable animation for completion view 2017-04-25 09:18:31 +02:00
Florian Bruhin
c3e6222296 Close the current tab when the tabbar itself is clicked 2017-04-25 06:59:51 +02:00
Florian Bruhin
3125b69d19 Fix no-cover pragma 2017-04-25 06:43:31 +02:00
Florian Bruhin
111944fb65 Revert "Raise exception when a stylesheet is unparsable."
This reverts commit 0400945ac4.

See #2571
2017-04-24 23:16:10 +02:00
Imran Sobir
fe7d21dfbe Show hostname in non-javascript history page. 2017-04-24 15:30:01 +05:00
Florian Bruhin
11c026bf4c Reenable QtWebKit cache with Qt 5.9.
This was fixed here:
https://codereview.qt-project.org/#/c/190818/

See #2427
2017-04-24 12:27:00 +02:00
Imran Sobir
18082526f4 Show hostname in history page. 2017-04-24 10:59:11 +05:00
Marcel Schilling
930b0f0818 typo fix (in comment) 2017-04-24 07:56:44 +02:00
Florian Bruhin
52f31ed15c Rename urlutils.safe_display_url to safe_display_string 2017-04-24 07:49:12 +02:00
Florian Bruhin
b632fe3285 Fix invalid URL handling in statusbar 2017-04-24 07:47:58 +02:00
Florian Bruhin
195d0ea207 Show Punycode URL for IDN pages in addition to decoded one
This helps when Unicode homographs are used for phishing purposes.
Fixes #2547
2017-04-24 06:58:41 +02:00
Florian Bruhin
beb661cdc7 Add xos4 Terminus to default monospace fonts 2017-04-23 23:11:12 +02:00
Florian Bruhin
9d2734ff62 Make sure host is valid for qute:// redirects 2017-04-16 13:15:15 +02:00
Florian Bruhin
c82bd83715 Implement RedirectNetworkReply.abort 2017-04-16 13:14:19 +02:00
Florian Bruhin
2d45257dcc Remove exclamation mark for bookmark messages 2017-04-16 13:08:15 +02:00
Florian Bruhin
842c2d297e Allow to set message clear timer to 0
Fixes #2527
2017-04-16 13:07:33 +02:00
Florian Bruhin
1d0f187fab Adjustments for new pylint version 2017-04-13 18:22:16 +02:00
Fritz Reichwald
3d549bf607 Remove closeWriteChannel from detached start 2017-04-12 07:32:12 +02:00
Fritz Reichwald
bc7f8018c0 Close stdin after starting QProcess Fixes 2491 2017-04-12 06:56:38 +02:00
Florian Bruhin
c47da15bb1 Remove nargs=1 for --debug-flag
Otherwisse we get [['foo'], ['bar']] from argparse...
2017-04-11 21:26:23 +02:00
Florian Bruhin
20b17f3fb1 Improve --debug-flag error message 2017-04-11 21:21:07 +02:00
Florian Bruhin
b966034250 Merge commit 'f31aead992e829cb15c4fbedbf816a23d2a916a7' into jswz72/master 2017-04-11 21:17:49 +02:00
Jacob Sword
f31aead992 Add default to --debug-flag 2017-04-09 23:34:33 -04:00
Jacob Sword
dcf8f29a67 Remove old --pdb-postmortem and --debug-exit flags 2017-04-09 10:43:40 -05:00
Jacob Sword
c0ac1bd79a Add 'dest' for '--debug-flag' 2017-04-09 10:34:51 -05:00
Jacob Sword
37d91cd17b Merge branch 'master' of https://github.com/jswz72/qutebrowser 2017-04-08 19:05:22 -04:00
Jacob Sword
7588cdb185 fixed formatting issues 2017-04-08 19:04:25 -04:00
Jacob Sword
6ccb420230 Fix syntax error in debug-exit 2017-04-08 18:42:26 -04:00
Florian Bruhin
778832a813 Set path when redirecting qute:* URLs
Fixes #2513
2017-04-08 23:04:10 +02:00
Jacob Sword
45dff6c0c8 update usage of debug-flag arguments 2017-04-08 16:54:08 -04:00
Jacob Sword
dadbf7657f Merge remote-tracking branch 'upstream/master' 2017-04-07 21:21:01 -04:00
Jacob Sword
3b87e7c297 Add --debug-exit argument and validity check 2017-04-07 21:12:42 -04:00
Florian Bruhin
fd9b86a340 Remove unused imports 2017-04-06 21:40:26 +02:00
Florian Bruhin
871504d91b Fix undefined names 2017-04-06 21:37:23 +02:00
Florian Bruhin
4ec5700cbf Redirect qute:foo to qute://foo
Before, we just returned the same data for both, but then we'll run into
same-origin restrictions as qute:history and qute:history/data are not the same
host.
2017-04-06 21:18:58 +02:00
Florian Bruhin
3cc9f9f073 Don't use from-import 2017-04-06 20:36:54 +02:00
Florian Bruhin
760dca475e Merge commit 'be254be13a61171d4109224450db9e67d1076080' into imransobir/fix-webkit-history 2017-04-06 20:34:49 +02:00
Martin Tournoij
e7755f5d9f
Add :debug-log-filter none
This allows us to clear any filters. Useful for users, and needed for
the tests.
2017-04-04 20:51:14 +01:00
Martin Tournoij
200e439a30
Fix crash of :debug-log-filter when --filter wasn't given
There was no `LogFilter`. The fix is to always initialize a
`LogFilter()` with `None`. as the "filter".

Fixes #2303.
2017-04-04 17:45:23 +01:00
Imran Sobir
be254be13a Use new history page on webkit-ng. 2017-04-04 19:21:25 +05:00
Martin Tournoij
c5427a0127
Fix display of errors while reading the key config file
Also catch `cmdexc.CommandError` on startup to show these errors in the
alert dialog on startup.

Fixes #1340
2017-04-04 09:50:12 +01:00
Florian Bruhin
0de3b5460e Only disable the cache on Qt 5.7.1
I ended up bisecting it, and https://codereview.qt-project.org/#/c/153977/
causes this, which is not in 5.7.0.
2017-04-04 08:24:50 +02:00
Florian Bruhin
2eb365b146 Also disable cache on Qt 5.7 2017-04-03 20:22:54 +02:00
Florian Bruhin
b6642e66fa Fix cache tests on Qt 5.8 2017-04-03 19:41:37 +02:00
Florian Bruhin
1b0ea19ca4 Disable QtNetwork cache on Qt 5.8
See #2427
2017-04-03 17:49:13 +02:00
Florian Bruhin
cb4c64eec9 Remove null argument for QtValueError 2017-04-03 10:18:56 +02:00
Florian Bruhin
2c3fcda18e Remove qtutils.ensure_not_null
It's not used anymore.
2017-04-03 09:32:13 +02:00
Florian Bruhin
3b1b325711 Fix logging 2017-04-03 09:04:28 +02:00
Florian Bruhin
a11356bb99 Don't require working icon to start 2017-04-03 08:32:39 +02:00
Florian Bruhin
35181ff84e Merge commit '4004d5adf09e6d22dae5d781a02c5fc2bbd26724' into Carpetsmoker/unwritable-keyconf 2017-04-03 06:55:01 +02:00
Martin Tournoij
4004d5adf0
Don't crash when trying to write an unwritable keyconf.
Also change the logic in _load_default a wee bit so that it won't try to
write the keys.conf on startup.

Fixes #1235
2017-04-03 01:48:39 +01:00
Florian Bruhin
248ff09624 Merge commit '5efca155948bc467e4fb7b19dafd98d47e33745b' into Carpetsmoker/config-comments 2017-04-02 19:14:00 +02:00
Florian Bruhin
b20267b57d Merge commit '7f13c9a3c31aa719144ca3afcad7af305dd2f6ed' into Carpetsmoker/relax-cmdline 2017-04-02 18:47:00 +02:00
Florian Bruhin
338307ac24 Add #noqa for Quitter._shutdown 2017-04-02 18:35:10 +02:00
Martin Tournoij
79a22f1f47
Allow pressing ^C when there's an unknown setting
All of it is just converting `objreg.get('xxx')` to `objreg.get('xxx',
None)` and adding a `if xxx is not None` check.

Fixes #1170
2017-04-01 21:14:35 +01:00
Martin Tournoij
7f13c9a3c3
Relax commandline parsing a bit
Problem 1: Entering a command of `:::save` gives an error.
Problem 2: Entering a command of `:save\n` gives an error.

Both scenarios may seem a bit silly at first, but I encountered both by
copy/pasting a command:

1. Enter `:` in qutebrowser.
2. Copy a full line from a terminal starting with `:`.
3. You will now have both of the above problems.

Solution: Trim all whitespace and `:` of a command. This is also what
Vim does, by the way.
2017-03-31 17:14:11 +01:00
Florian Bruhin
1eda2b0ea4 Fallback to clipboard when primary selection is unsupported 2017-03-31 13:05:34 +02:00
Florian Bruhin
64feb62fb1 Paste clipboard when using shift-insert in prompts 2017-03-31 13:05:34 +02:00
Florian Bruhin
708b46d6c0 Fix text with empty primary selection 2017-03-31 13:03:40 +02:00
Florian Bruhin
2c4e549d80 Close temporary download file for QtWebEngine
Otherwise, Chromium won't be able to write on it on Windows - and we only
need the name anyways.
2017-03-31 13:03:18 +02:00
Florian Bruhin
a55d1b1ee8 Save old socket for IPC
At least on Windows with Qt 5.8, we get readyRead notifications *after*
disconnect...
2017-03-31 13:03:17 +02:00
Martin Tournoij
5efca15594
Put option comments right above the option value
Problem: I like to edit `~/.config/qutebrowser/qutebrowser.conf`
manually with Vim. This works great, except that the current format is a
bit of a pain to deal with:

	[section-name]
	# section description
	#
	# [ Description of all the options]

	actual options

So if I want to know the description or what the default value is, I
need to scroll up and back down.

Solution: change the order of the comments to:

	# section description
	[section-name]

	# Option description
	option = value

	# Option description two
	optiontwo = value

	# Hello, world!
	[section-two]
	...

Which is much more convenient (and also what almost any other program
does).

(This patch changes much less code than it looks in the diff; I just
de-looped and moved `_str_option_desc` below `_str_items` as that makes
more sense since it gets called by `_str_items`).
2017-03-30 18:45:28 +01:00
Florian Bruhin
6939f81de7 Merge commit '563a5431e35831cb0a8c418835c54d0264d92c78' into Kingdread/windows-drive-cwd 2017-03-30 10:48:39 +02:00
Florian Bruhin
2377235c14 Merge commit 'caf0a87e16cf930f67ce9fc64ea94e17cae6269d' into amosbird/master 2017-03-30 10:48:32 +02:00
Florian Bruhin
6a144ef7bd Merge branch 'Kingdread/windows-drive-cwd' 2017-03-30 10:41:58 +02:00
Daniel Schadt
563a5431e3 fixup! use message.error instead of a tooltip 2017-03-29 18:32:07 +02:00
Daniel Schadt
186eab8eb1 use message.error instead of a tooltip 2017-03-29 17:07:53 +02:00
Daniel Schadt
99f7bfa712 show messages on top of the prompt
Otherwise, errors are hidden behind the prompt, which makes it hard to
use them in the filename prompt.
2017-03-29 16:44:29 +02:00
Imran Sobir
3aaebe83fb Remove noscript message from history.html. 2017-03-29 14:22:58 +05:00
Amos Bird
caf0a87e16 Fix #2476, recognize SOCKS5, SOCKS4 in proxy. 2017-03-29 14:22:37 +08:00
Imran Sobir
4a4c7b96d1 Add nojs history page. 2017-03-28 18:34:47 +05:00
Florian Bruhin
bcb4649235 Fix crash when window_ids change during init 2017-03-27 08:00:19 +02:00
Florian Bruhin
b98d34b29c Handle None-tab in get_tab_fields
I can't reproduce this but I got a crash report about it.
2017-03-27 07:57:43 +02:00
Florian Bruhin
bcee6d295c Handle None-widget in tabbedbrowser.widgets()
I can't reproduce this, but got a crash report about it.
2017-03-27 07:52:33 +02:00
Florian Bruhin
f6906512dc Merge commit 'df93e30ec20dd1b2b4fe163bdb5a69c232fb8c71' into Al-Caveman/master 2017-03-27 07:00:53 +02:00
Florian Bruhin
37d22a7cfd Merge commit '9dccd00ebb2483fd0bb6c6447f57c76a4b40d335' into Kingdread/windows-drive-cwd 2017-03-26 22:14:47 +02:00
Florian Bruhin
39b09f7822 Improve messageview hide code 2017-03-26 15:03:44 +02:00
Florian Bruhin
2181e1ddc4 Merge commit '13677d3563dbd01ae188a2b1a79c7dd840a5dc5e' into pkill-nine/upstream-master-close_message_on_click 2017-03-26 14:59:08 +02:00
pkill9
5e1c530d71 Add docstring to MessageView.mousePressEvent 2017-03-25 21:03:21 +00:00
pkill9
67034273f7 Move criteria into a list and add middle mouse button. 2017-03-25 15:58:37 +00:00
caveman
df93e30ec2 fixes #2468 2017-03-25 11:44:36 +04:00
Daniel Schadt
9dccd00ebb fix unused import 2017-03-24 14:49:30 +01:00
Daniel Schadt
df83f7aa99 also add path transformations to :download 2017-03-24 12:30:29 +01:00
Daniel Schadt
07b3a7db7c add integration tests for reserved filenames 2017-03-24 11:57:05 +01:00
Daniel Schadt
bc4430e5d9 prevent reserved filenames on Windows
Fixes #82

Prevents filenames like COM1, ...
2017-03-24 11:36:19 +01:00
Daniel Schadt
9d905ebb5c disallow filenames like E:filename
Per-drive working directories are not really supported.
2017-03-24 11:04:20 +01:00
Daniel Schadt
3da21a32d2 treat E: and E:\ the same when downloading
Fixes #2305
2017-03-23 18:16:15 +01:00
Ryan Roden-Corrent
a68f997d95 Make keyhint delay configurable.
ui.keyhint-delay controls the time from starting a keychain to showing the
keyhint dialog. Resolves #2462.
2017-03-22 21:50:26 -04:00
Florian Bruhin
042ffeca91 Merge commit '631936361405d812f353b4108246c883cdf48100' into Kingdread/issue-2304 2017-03-22 22:50:28 +01:00
Florian Bruhin
4d65abfcc6 Check if widget is deleted in _on_webkit_icon_changed 2017-03-22 06:32:09 +01:00
Daniel Schadt
ebc70f66e5 Check for None-reply in _do_die
Fixes #2304

In some cases, the finished handler fired before the error handler, e.g.
when downloading a 500 error page that is sent as attachment:

    HTTP/1.1 500 Internal Server Error
    Content-Type: application/octet-stream
    Content-Disposition: inline; filename="attachment.jpg"

here we downloaded 0 bytes, fired the finished handler and after that
fired the error handler because of the 500 - but the finished handler
had already set our reply to None (and displayed the error message).
2017-03-21 18:54:21 +01:00
Florian Bruhin
f8e043214a Update WORKAROUND comments 2017-03-21 10:29:31 +01:00
Florian Bruhin
081abde9cd Fix indent 2017-03-20 22:06:05 +01:00
Florian Bruhin
3fbb9a14e0 Fix continuing a search after clearing it
Fixes #2438
2017-03-20 21:34:33 +01:00
Florian Bruhin
c996245012 Fix line length 2017-03-20 16:48:21 +01:00
Florian Bruhin
98f17a03bb Prevent page without history from being serialized
Fixes #2458
2017-03-20 11:50:04 +01:00
Florian Bruhin
6888ac04e1 Fix handling of failed downloads with QtWebEngine 2017-03-20 09:44:07 +01:00
Florian Bruhin
3e2ba32240 Fix retrying downloads with QtWebEngine
Fixes #2298
2017-03-20 09:35:53 +01:00
Florian Bruhin
7652b6ae03 Merge commit '724e6b29c38a55f722f17997379f1ebe190fa6db' 2017-03-20 09:11:47 +01:00
thuck
650b1de3b6 Merge branch 'master' of https://github.com/The-Compiler/qutebrowser into pintab 2017-03-19 14:26:48 +01:00
thuck
02bf0401ab Last pinned to pinned_count 2017-03-19 14:05:21 +01:00
thuck
2eb07fc9cc Fix line size 2017-03-19 14:03:24 +01:00
Florian Bruhin
99c7301fb4 Update IPC atime once all 3h
See #996
2017-03-16 09:24:49 +01:00
Imran Sobir
724e6b29c3 Make session interval configurable. 2017-03-16 12:11:16 +05:00
Imran Sobir
fb97c6dffc Send history item atime in milliseconds. 2017-03-16 12:03:40 +05:00
Florian Bruhin
d33e590ce5 Fix lint 2017-03-15 22:15:52 +01:00
Florian Bruhin
85fff35eef Merge branch 'gl-workaround' 2017-03-15 19:52:33 +01:00
Florian Bruhin
0877092cea Add workaround for black screen with QtWebEngine
Fixes #2441
2017-03-15 19:52:21 +01:00
Florian Bruhin
84d2e9adc6 Improve documentation around scrolling
Fixes #2447
2017-03-14 16:58:33 +01:00