Commit Graph

7741 Commits

Author SHA1 Message Date
Anton S
40185385cf moved methods to restore initial order 2017-10-10 01:37:39 +03:00
Anton S
14da05f7b1 use open_url to handle FileOpen event 2017-10-10 01:31:31 +03:00
Anton S
00f0e519a9 added option to suppress window raising 2017-10-10 01:30:58 +03:00
Anton S
552d041422 reused some code from process args 2017-10-10 01:30:14 +03:00
Anton S
5301a42495 raise last focused window if requested 2017-10-10 01:00:34 +03:00
Anton S
6b7cecc840 separated window raising into it's own function 2017-10-10 01:00:33 +03:00
Florian Bruhin
8a6ea6a375 Add spaces around args with annotations
Looks like pylint 1.7.3/.4 notices those
2017-10-09 21:21:17 +02:00
Joakim Reinert
0226025308 add adjustable amount of chars required to update completions 2017-10-09 16:51:19 +02:00
Joakim Reinert
019d66a4c6 add adjustable delay for completion updates 2017-10-09 16:51:19 +02:00
Florian Bruhin
b5777299fd Fix getting a short text from the SqlError 2017-10-09 16:08:56 +02:00
Florian Bruhin
b608259751 Handle some sqlite errors gracefully
We mark some SQL errors as "environmental", and then show those as error
messages instead of raising an exception.

Fixes #3004
Workaround for #2930
2017-10-09 16:06:24 +02:00
Luca Benci
0578349e29 Default completion.use_best_match to false 2017-10-09 11:12:42 +02:00
Luca Benci
71048a1b55 Add (and use) completion.use_best_match config 2017-10-09 11:12:37 +02:00
Luca Benci
9d0dfd5726 Always run best-matching command 2017-10-09 11:12:28 +02:00
Florian Bruhin
83aa936276 Ignore _on_history_trigger for destroyed tabs 2017-10-09 07:13:43 +02:00
Florian Bruhin
e95260092c Add some more dwb keybindings
See #13
2017-10-09 07:00:59 +02:00
Florian Bruhin
0e64511d63 Split up _init_envvars from configinit.early_init 2017-10-09 06:52:14 +02:00
Florian Bruhin
f63b95c298 Fix the window.hide_wayland_decoration setting
Fixes #2267
2017-10-09 06:50:29 +02:00
Florian Bruhin
220d1be500 Fix docstring 2017-10-08 23:10:08 +02:00
Florian Bruhin
36ef68c698 Add :bind --default
Closes #3059
2017-10-08 21:48:48 +02:00
Florian Bruhin
8c1e95787d Improve error message for PercOrInt
Fixes #3068
2017-10-08 19:47:05 +02:00
Florian Bruhin
6c3f90146f Make qtutils.version_check strict by default
This also renames 'strict' to 'compiled' to be more descriptive.
It also fixes a crash when starting qutebrowser with an older compiled Qt
version which was introduced recently (calling setSpellCheckEnabled).
2017-10-08 19:08:37 +02:00
Florian Bruhin
1d1faf8d25 Merge remote-tracking branch 'origin/pr/2940' 2017-10-08 16:53:10 +02:00
Florian Bruhin
1d7af2e74b Use double quotes to avoid escaping 2017-10-08 15:25:21 +02:00
Florian Bruhin
277daa334d Merge remote-tracking branch 'origin/pr/2891' 2017-10-08 15:23:01 +02:00
Florian Bruhin
e63d11527d Get rid of CommandRunner.run_safely_init
All messages are queued nowadays.
2017-10-08 14:42:42 +02:00
Florian Bruhin
51ea56375e Improve error handling for config commands
- Use self._handle_config_error() for key commands too
- Catch getting an invalid key properly
- Remove (wrong) "set: " prefix
2017-10-08 14:40:10 +02:00
Florian Bruhin
8d34d4d4f5 Turn on overflow checking in sip 2017-10-08 12:58:28 +02:00
Bryan Gilbert
be3727a599 Improved zoom level management and enforcement 2017-10-06 20:30:06 -04:00
Michal Siedlaczek
4bac2f3e44 Initialize profiles with spellchecking turn on by default. 2017-10-06 07:58:26 -04:00
Florian Bruhin
54e5176f28 Revert "Only emit perc_changed signal when the percentage actually changed"
This reverts commit 1d50c2c39a.
This breaks various end2end test relying on getting log messages for scrolling.
2017-10-06 10:16:41 +02:00
Florian Bruhin
1d50c2c39a Only emit perc_changed signal when the percentage actually changed
QtWebEngine emits scrollPositionChanged a lot during smooth scrolling, and
there's no reason we need to update percentages when they didn't *actually*
change.

This reduces the updates with a single spacebar press from 6-7 to 2-3 on my
machine, which might not be enough though.

See #2233
2017-10-06 08:51:48 +02:00
Florian Bruhin
2651688ef4 Only show customized options for :config-unset completion 2017-10-05 18:40:34 +02:00
Florian Bruhin
618586f8b0 Merge branch 'config-write-py' 2017-10-05 11:30:50 +02:00
Florian Bruhin
712e4a975a Add a test to make sure :write-config-py files actually work 2017-10-05 10:48:14 +02:00
Florian Bruhin
ade0e1bd0b Finish ConfigPyWriter and tests 2017-10-05 10:21:31 +02:00
Florian Bruhin
231b0522ca Refactor write_config_py 2017-10-05 09:01:33 +02:00
Florian Bruhin
8dc34cf78a Write commented lines with :write-config-py when writing defaults 2017-10-05 08:50:41 +02:00
Anton S
91c6847e59 [review] style fixes 2017-10-05 01:49:13 +03:00
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