Commit Graph

7122 Commits

Author SHA1 Message Date
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