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
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
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
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
37ba256900
Ensure web-history-max-items has int64 as maxval.
...
See #2779 .
2017-08-27 22:29:01 -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
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
Ryan Roden-Corrent
71b71dbc58
Merge remote-tracking branch 'upstream/master' into HEAD
2017-08-06 18:13:49 -04: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
0f85898137
Add a config version to the YAML file
2017-07-19 08:22:00 +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
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
dc4472470e
Merge remote-tracking branch 'upstream/master' into really_complete
2017-07-05 08:45:57 -04: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
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
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
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
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
340a62869d
Fix javascript.prompt default
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
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
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
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
f5d2c48bbb
Fix new keyconfig issues
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
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
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
001312ca82
Disallow Booleans for configtypes.Int.from_py
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
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
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
b9aa5d0e4e
Fix valid_values initing from configdata
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
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