Florian Bruhin
8c5b7bcd03
Fix lint
2018-03-12 08:51:36 +01:00
Florian Bruhin
9941812127
Normalize keys read from the config
...
This makes sure the internal bindings.commands object only contains normalized
key sequences.
Fixes #3699
2018-03-12 08:00:56 +01:00
Florian Bruhin
990c0707f4
Make from_obj() work for List/Dict configtypes
...
We can't easily make it work for ListOrValue as we don't know which of both we
get at this point.
2018-03-12 08:00:18 +01:00
Florian Bruhin
d72691ee49
Simplify ListOrValue configtype
2018-03-12 07:38:56 +01:00
Jay Kamat
996561b50e
Apply tabs.min_width to all tabs when tabs are unshrunk
2018-03-09 14:36:01 -05:00
Jay Kamat
4a78b0519d
Add tabs.min_width setting
...
Controls min width in pixels of non pinned tabs
Closes #3690
2018-03-09 02:05:49 -05:00
Florian Bruhin
482b622b1b
Fix handling of empty bindings without breaking :unbind
...
1899e313fd
as a fix for #3631 broke :unbind, as
the config system treats None and '' equally.
Instead, allow None/'' again, but just handle it as "no binding".
2018-03-08 11:42:27 +01:00
Florian Bruhin
1899e313fd
Disallow binding to an empty command
...
This was introduced (most likely accidentally) in
9cbacf3264
.
Fixes #3631
2018-03-08 08:14:52 +01:00
Florian Bruhin
b9d26ee268
Add an input.insert_mode.auto_enter setting
...
Closes #3143
2018-03-07 23:45:19 +01:00
Florian Bruhin
514138aad2
Allow to bind numbers in keybindings
...
This mostly reverts 4ef5db1bc4
for #1966 , but
fixes #3684 by allowing numbers to be bound again. If the user wants to bind
numbers instead of using them for a count, why not let them.
2018-03-07 22:37:10 +01:00
Florian Bruhin
34815f5cf8
Make bindings.default only settable in autoconfig.yml
...
Fixes #3131
2018-03-07 18:30:44 +01:00
Florian Bruhin
e2cdb5c8cf
Allow empty vlaue for bindings.key_mappings
2018-03-06 21:43:07 +01:00
Florian Bruhin
43cab4d978
Add bindings to toggle plugins
...
See #3622
2018-03-05 18:20:06 +01:00
Florian Bruhin
a796d1f33f
Always enable JavaScript for file://, chrome:// and qute://
...
See #3622
2018-03-05 17:09:47 +01:00
Florian Bruhin
4ef5db1bc4
Disallow numbers in keybindings
...
Fixes #1966
2018-03-04 23:17:51 +01:00
Florian Bruhin
c9c0bc0bbd
Update docs
2018-03-04 20:28:46 +01:00
Florian Bruhin
58b7599152
Remove old fixme
2018-03-04 20:21:58 +01:00
Florian Bruhin
5a5873d4ee
Rename KeyConfig._prepare to ._validate
2018-02-27 14:16:41 +01:00
Florian Bruhin
244590f49d
Handle unknown keys with :bind/:unbind
2018-02-27 13:09:48 +01:00
Florian Bruhin
8090d3e289
Handle invalid keys in config.py
2018-02-27 13:02:32 +01:00
Florian Bruhin
362f923f06
Fix lint
2018-02-27 09:34:55 +01:00
Florian Bruhin
f40f4082ba
Validate configtypes.Key correctly
2018-02-27 07:56:34 +01:00
Florian Bruhin
e8d5fb5cca
Normalize keybinding with :bind
2018-02-27 07:51:14 +01:00
Florian Bruhin
b1f4b1eaba
Fix :unbind with already bound keys
...
The previous change was incorrect and caused a regression (test_unbound_twice)
2018-02-27 07:40:54 +01:00
Florian Bruhin
1b0aea5e05
Bring simple bindings to front in get_reverse_bindings_for
2018-02-27 06:56:57 +01:00
Florian Bruhin
01462008c9
Clearly separate yesno/prompt key modes
2018-02-26 22:49:15 +01:00
Florian Bruhin
f92bb16408
Make config.bind work
2018-02-26 10:38:59 +01:00
Florian Bruhin
321d5c5d20
Merge branch 'master' into keys
2018-02-25 21:25:12 +01:00
Florian Bruhin
08bc55995b
First attempt at reloading pages after setting changes
2018-02-25 14:45:09 +01:00
Florian Bruhin
2c96446bb9
Track which settings changed for a URL
...
This is currently only used so only changed settings are logged, but will used
for more in the next commit.
2018-02-23 18:11:33 +01:00
Florian Bruhin
75b65e2f11
Simplify attribute handling in Web(Kit|Engine)Settings
...
Let's just have lists in _ATTRIBUTES for WebEngineSettings as well, that allows
us to share some more code.
2018-02-23 17:59:12 +01:00
Florian Bruhin
fc6a0dbe64
Show a simple error page on loading errors without JS
...
We can't tell what exactly the error is, but it's surely better than nothing.
2018-02-23 17:29:17 +01:00
Florian Bruhin
3956f81e73
Refactor websettings
...
This refactors the whole web(kit|engine|) settings mess a bit so there's a
Web(Kit|Engine)Settings object for (non-static) settings set on a
QWeb(Engine)Settings object in Qt. Everything else is set on module-level a bit
less declaratively.
The whole inheritance mess is gone, and we can now also construct a
Web(Kit|Engine)Settings object for a given tab.
Fixes #2701
2018-02-23 09:51:28 +01:00
Florian Bruhin
eb4c806ddb
Add URL pattern to settings output
2018-02-22 08:07:54 +01:00
Florian Bruhin
5c4277aac8
Add some default keybindings for toggling scripts
...
Those follow the following pattern:
1) "t" for 'toggle"
2) "s" for "scripts", upper-casing ("S") to make the toggle permanent
3) "h" for host, "H" for host with subdomains, "u" for the exact URL
2018-02-22 08:07:54 +01:00
Florian Bruhin
cfeeb7460b
Add docstrings to ConfigAPI
2018-02-21 09:14:49 +01:00
Florian Bruhin
0d4e20c395
Whitelist config options which support URL patterns
2018-02-20 23:26:22 +01:00
Florian Bruhin
17b235b523
Add error handling for parsing patterns from YAML
2018-02-20 22:29:21 +01:00
Florian Bruhin
439d51875f
Add config.pattern()
2018-02-20 20:54:26 +01:00
Florian Bruhin
3ade923edb
Add basic pattern support for config.py
2018-02-20 18:43:42 +01:00
gammelon
16218a9900
Remove unnecessary try, rephrase to imperative mood
2018-02-20 18:11:50 +01:00
Florian Bruhin
a3dfec20c1
Rename --url to --pattern
2018-02-20 17:56:47 +01:00
Florian Bruhin
9685445559
Fix issues with Python 3.5
2018-02-20 17:56:47 +01:00
Florian Bruhin
e482c76874
YamlConfig: Refuse to read a newer config version
2018-02-20 17:08:28 +01:00
Florian Bruhin
03114ccf51
Migrate YAML config files in old format
2018-02-20 16:14:06 +01:00
Florian Bruhin
b3d788fead
Add YamlConfig._pop_object
2018-02-20 15:46:05 +01:00
Florian Bruhin
d511c5436d
Remove dead config code
2018-02-20 12:30:34 +01:00
Florian Bruhin
19c00ff92a
configutils: Clean up comments
2018-02-20 12:30:34 +01:00
Florian Bruhin
50c847562f
configutils.Values: Make it possible to pass values
2018-02-20 12:30:34 +01:00
Florian Bruhin
ab02fcb116
configutils.Values: Add __repr__
2018-02-20 12:30:34 +01:00
Florian Bruhin
1ada821092
Make sure config options exist
2018-02-19 22:09:54 +01:00
Florian Bruhin
cea664e396
Don't emit changed in unset if unneeded
2018-02-19 22:09:54 +01:00
Florian Bruhin
ab119975e7
Only emit changed in unset if there was a change
2018-02-19 22:09:46 +01:00
Florian Bruhin
8fead148e2
Add FIXME
2018-02-19 22:09:46 +01:00
Florian Bruhin
1409f4e564
Fix migration of tabs.persist_mode_on_change
2018-02-19 22:09:46 +01:00
Florian Bruhin
19148a4593
Fix :config-unset
2018-02-19 22:09:46 +01:00
Florian Bruhin
615c6ffe5a
Make :config-write-py work again
2018-02-19 22:09:46 +01:00
Florian Bruhin
0f907b1a77
Fix getting YAML values in test_configcommands.py
2018-02-19 22:09:46 +01:00
Florian Bruhin
75181e16fa
Fix test_models.py
...
The Config object got initialized via the config_stub fixture early, so we need
to force it to re-init its values after patching configdata.DATA.
2018-02-19 22:09:46 +01:00
Florian Bruhin
c89e804653
Fix handling of invalid types in YamlConfig
2018-02-19 22:08:42 +01:00
Florian Bruhin
87e329aee3
Fix config.dump_userconfig() with defaults
2018-02-19 22:08:42 +01:00
Florian Bruhin
f43c7fa360
Fix changing values in configutils.Values
2018-02-19 22:08:42 +01:00
Florian Bruhin
cb631d532a
Fix getting global value from configutils.Values
2018-02-19 22:08:42 +01:00
Florian Bruhin
8b666d2d2e
Try to update settings in acceptNavigationRequest
...
This still doesn't seem to update them early enough?
2018-02-19 22:08:42 +01:00
Florian Bruhin
bd6e99158e
Get rid of the second deepcopy for config values
...
There were two reasons why we deepcopy mutable objects in the config:
1) So mutations don't mess with our internal/default values.
2) So we can detect mutations and update the config.
If we're going to copy the value for 1) in maybe_copy(), we know the original
value is not going to be mutated, so we can use that directly for self._mutables
instead of making another copy.
2018-02-19 22:07:53 +01:00
Florian Bruhin
93972ff3f1
Copy value before watching it for mutations in config
...
If we copy it afterwards, we are going to mutate the copied object.
2018-02-19 22:07:53 +01:00
Florian Bruhin
ddb914dc65
Refactor YAML init
2018-02-19 22:07:53 +01:00
Florian Bruhin
8504ad6ff3
Change how iterating over Config/YamlConfig works
2018-02-19 22:07:53 +01:00
Florian Bruhin
6abb42a066
Make saving in autoconfig.yml work
2018-02-19 22:07:53 +01:00
Florian Bruhin
4691753965
Avoid running change handlers on config.clear
2018-02-19 22:07:53 +01:00
Florian Bruhin
9c670e13ce
Make clearing config work
2018-02-19 22:07:53 +01:00
Florian Bruhin
a6b979539d
Add missing configutils.py
2018-02-19 22:07:53 +01:00
Florian Bruhin
14a69d9047
Fix lint
2018-02-19 22:07:53 +01:00
Florian Bruhin
2a7998847f
Unset values properly
2018-02-19 22:07:53 +01:00
Florian Bruhin
74a7676111
Fix issues with per-domain proof-of-concept
2018-02-19 22:07:53 +01:00
Florian Bruhin
d09afdf0ee
Refactor handling of mutables with url/pattern in Config
...
This also should not copy stuff coming from the config if it's not needed.
2018-02-19 22:07:53 +01:00
Florian Bruhin
8551288efb
Start working on different per-URL storage
2018-02-19 22:07:53 +01:00
Florian Bruhin
5e50824042
Broken per-URL proof-of-concept
2018-02-19 22:07:53 +01:00
Florian Bruhin
4ed07d6062
Initial implementation of per-URL setting storage
2018-02-19 22:07:53 +01:00
gammelon
42ac3dcda0
Add Option url.open_base_url
...
when set to true, invoking a searchengine shortcut without argument
opens the baseurl of that searchengine instead of DEFAULT searchengine
2018-02-17 11:21:22 +01:00
George Edward Bulmer
9397cc74c1
Pylint indentation fix
2018-02-12 14:24:53 +00:00
George Edward Bulmer
561e5d17b9
Remove extraneous space
2018-02-12 14:22:25 +00:00
George Edward Bulmer
b59a7cdcc0
Report syntax errors as unhandled exceptions
...
Update tests accordingly
2018-02-12 14:07:05 +00:00
George Edward Bulmer
ce8b457bac
Only display exception type if no traceback
...
Update test to match
2018-02-12 13:43:22 +00:00
George Edward Bulmer
164b2a3eef
Fix a lengthy line
2018-02-11 23:20:24 +00:00
George Edward Bulmer
72103ec730
Format error type in a different way
2018-02-11 23:16:04 +00:00
George Edward Bulmer
21a50cf961
Use the repr() of the exception instead of str()
2018-02-11 17:46:09 +00:00
Florian Bruhin
d306f81130
Merge remote-tracking branch 'origin/pr/3525'
2018-02-11 10:44:27 +01:00
Florian Bruhin
6d750aff8b
Merge remote-tracking branch 'origin/pr/3430'
2018-02-10 16:27:41 +01:00
715cc7b7dd
Make statusbar widgets configurable
2018-02-10 13:15:11 +01:00
Florian Bruhin
4ac4833c93
Clean up YamlConfig._handle_migrations
2018-02-10 11:44:18 +01:00
Marc Jauvin
504e29c004
fix configfiles tests
...
- fix test_renamed_key()
- fix test_deleted_key()
- combine both test_merge_persist tests using @pytest.mark.parametrize
- fix _handle_migrations(): mark data dirty for renamed and deleted
2018-02-09 21:25:11 -05:00
Marc Jauvin
9b7db8ee8a
Need to mark config as dirty in _handle_migrations()
...
Add tests for tabs.persist_mode_on_change migration
2018-02-09 14:41:33 -05:00
Marc Jauvin
85dfe5c403
add special code to migrate tabs.persist_mode_on_change setting to tabs.mode_on_change.
2018-02-09 11:28:21 -05:00
Marc Jauvin
f3b52aaf23
fix asciidoc for tabs.mode_on_change
2018-02-09 10:39:02 -05:00
Marc Jauvin
a7db197e45
replace persist_mode_on_change with mode_on_change
...
supports old persist_mode_on_change functionality or new save/restore mode
2018-02-09 10:39:02 -05:00
Florian Bruhin
3e38aab0f6
Document configdata.Migrations
2018-02-09 11:31:25 +01:00
Florian Bruhin
1a81f7231b
Make sure multiple wrong keys are reported
2018-02-08 22:02:22 +01:00
Florian Bruhin
298dcb4c90
Validate config separately from migrations
...
It makes for cleaner code, and it makes sure the target of renamed options
actually exists.
2018-02-08 21:49:41 +01:00
Florian Bruhin
3306247ae5
Merge branch 'editor-watch'
2018-02-07 22:31:49 +01:00