From 50602cbf26ac8e709c659f650f7ed8ed0c1f9a4c Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 2 Jul 2017 12:07:27 +0200 Subject: [PATCH] Add an url. group to settings --- doc/help/settings.asciidoc | 148 +++++++++---------- qutebrowser/app.py | 4 +- qutebrowser/browser/commands.py | 6 +- qutebrowser/browser/navigate.py | 2 +- qutebrowser/config/configdata.yml | 180 ++++++++++++----------- qutebrowser/mainwindow/mainwindow.py | 4 +- qutebrowser/mainwindow/tabbedbrowser.py | 9 +- qutebrowser/utils/urlutils.py | 8 +- tests/end2end/features/downloads.feature | 2 +- tests/end2end/features/editor.feature | 2 +- tests/end2end/features/history.feature | 2 +- tests/end2end/features/invoke.feature | 22 +-- tests/end2end/features/misc.feature | 4 +- tests/end2end/features/navigate.feature | 4 +- tests/end2end/features/open.feature | 8 +- tests/end2end/features/tabs.feature | 10 +- tests/end2end/features/urlmarks.feature | 2 +- tests/end2end/features/yankpaste.feature | 6 +- tests/end2end/fixtures/quteprocess.py | 2 +- 19 files changed, 213 insertions(+), 212 deletions(-) diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index 31ee3cf9d..3cb33392c 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -11,7 +11,6 @@ |<>|Whether to save the config automatically on quit. |<>|How often (in milliseconds) to auto-save config/cookies/etc. |<>|Whether to always save the open pages. -|<>|Whether to start a search when something else than a URL is entered. |<>|Keybindings mapping keys to commands in different modes. |<>|Default keybindings. If you want to add bindings, modify `bindings.commands` instead. |<>|This setting can be used to map keys to other keys. @@ -145,7 +144,6 @@ |<>|User stylesheet to use (absolute filename or filename relative to the config directory). Will expand environment variables. |<>|Enables or disables WebGL. |<>|Whether load requests should be monitored for cross-site scripting attempts. -|<>|The page to open if :open -t/-b/-w is used without URL. Use `about:blank` for a blank page. |<>|The directory to save downloads to. |<>|Whether to prompt the user for the download location. |<>|Whether to remember the last used download directory. @@ -206,15 +204,11 @@ |<>|Time from pressing a key to seeing the keyhint dialog (ms) |<>|Time (in ms) to show messages in the statusbar for. |<>|Whether to show messages in unfocused windows. -|<>|How to open links in an existing instance if a new one is launched. -|<>|Which window to choose when opening links as new tabs. |<>|Show a filebrowser in upload/download prompts. |<>|The rounding radius for the edges of prompts. |<>|Show a scrollbar. |<>|Whether to enable smooth scrolling for web pages. Note smooth scrolling does not work with the `:scroll-px` command. -|<>|Definitions of search engines which can be used via the address bar. |<>|The name of the session to save by default, or unset for the last loaded session. -|<>|The default page(s) to open at the start. |<>|Whether to hide the statusbar unless a message is shown. |<>|Padding for the statusbar. |<>|The position of the status bar. @@ -240,10 +234,16 @@ |<>|Width of the progress indicator (0 to disable). |<>|The width for pinned tabs with a horizontal tabbar, in px. |<>|Whether to wrap when changing tabs. -|<>|The URL segments where `:navigate increment/decrement` will search for a number. +|<>|Whether to start a search when something else than a URL is entered. +|<>|The page to open if :open -t/-b/-w is used without URL. Use `about:blank` for a blank page. +|<>|The URL segments where `:navigate increment/decrement` will search for a number. +|<>|How to open links in an existing instance if a new one is launched. +|<>|Which window to choose when opening links as new tabs. +|<>|Definitions of search engines which can be used via the address bar. +|<>|The default page(s) to open at the start. +|<>|The URL parameters to strip with :yank url. |<>|Hide the window decoration when using wayland (requires restart) |<>|The format to use for the window title. The following placeholders are defined: -|<>|The URL parameters to strip with :yank url. |<>|The default zoom level. |<>|The available zoom levels. |<>|How much to divide the mouse wheel movements to translate them into zoom increments. @@ -284,18 +284,6 @@ Valid values: Default: empty -[[auto_search]] -== auto_search -Whether to start a search when something else than a URL is entered. - -Valid values: - - * +naive+: Use simple/naive check. - * +dns+: Use DNS requests (might be slow!). - * +never+: Never search automatically. - -Default: +pass:[naive]+ - [[bindings.commands]] == bindings.commands Keybindings mapping keys to commands in different modes. @@ -1414,12 +1402,6 @@ Valid values: Default: empty -[[default_page]] -== default_page -The page to open if :open -t/-b/-w is used without URL. Use `about:blank` for a blank page. - -Default: +pass:[https://start.duckduckgo.com/]+ - [[downloads.location.directory]] == downloads.location.directory The directory to save downloads to. @@ -1891,33 +1873,6 @@ Valid values: Default: empty -[[new_instance_open_target]] -== new_instance_open_target -How to open links in an existing instance if a new one is launched. - -Valid values: - - * +tab+: Open a new tab in the existing window and activate the window. - * +tab-bg+: Open a new background tab in the existing window and activate the window. - * +tab-silent+: Open a new tab in the existing window without activating the window. - * +tab-bg-silent+: Open a new background tab in the existing window without activating the window. - * +window+: Open in a new window. - -Default: +pass:[tab]+ - -[[new_instance_open_target_window]] -== new_instance_open_target_window -Which window to choose when opening links as new tabs. - -Valid values: - - * +first-opened+: Open new tabs in the first (oldest) opened window. - * +last-opened+: Open new tabs in the last (newest) opened window. - * +last-focused+: Open new tabs in the most recently focused window. - * +last-visible+: Open new tabs in the most recently visible window. - -Default: +pass:[last-focused]+ - [[prompt.filebrowser]] == prompt.filebrowser Show a filebrowser in upload/download prompts. @@ -1957,25 +1912,12 @@ Valid values: Default: empty -[[searchengines]] -== searchengines -Definitions of search engines which can be used via the address bar. -The searchengine named `DEFAULT` is used when `auto_search` is turned on and something else than a URL was entered to be opened. Other search engines can be used by prepending the search engine name to the search term, e.g. `:open google qutebrowser`. The string `{}` will be replaced by the search term, use `{{` and `}}` for literal `{`/`}` signs. - -Default: +pass:[{"DEFAULT": "https://duckduckgo.com/?q={}"}]+ - [[session_default_name]] == session_default_name The name of the session to save by default, or unset for the last loaded session. Default: empty -[[start_pages]] -== start_pages -The default page(s) to open at the start. - -Default: +pass:[["https://start.duckduckgo.com"]]+ - [[statusbar.hide]] == statusbar.hide Whether to hide the statusbar unless a message is shown. @@ -2227,8 +2169,26 @@ Valid values: Default: +pass:[true]+ -[[url_incdec_segments]] -== url_incdec_segments +[[url.auto_search]] +== url.auto_search +Whether to start a search when something else than a URL is entered. + +Valid values: + + * +naive+: Use simple/naive check. + * +dns+: Use DNS requests (might be slow!). + * +never+: Never search automatically. + +Default: +pass:[naive]+ + +[[url.default_page]] +== url.default_page +The page to open if :open -t/-b/-w is used without URL. Use `about:blank` for a blank page. + +Default: +pass:[https://start.duckduckgo.com/]+ + +[[url.incdec_segments]] +== url.incdec_segments The URL segments where `:navigate increment/decrement` will search for a number. Valid values: @@ -2240,6 +2200,52 @@ Valid values: Default: +pass:[["path", "query"]]+ +[[url.new_instance_open_target]] +== url.new_instance_open_target +How to open links in an existing instance if a new one is launched. + +Valid values: + + * +tab+: Open a new tab in the existing window and activate the window. + * +tab-bg+: Open a new background tab in the existing window and activate the window. + * +tab-silent+: Open a new tab in the existing window without activating the window. + * +tab-bg-silent+: Open a new background tab in the existing window without activating the window. + * +window+: Open in a new window. + +Default: +pass:[tab]+ + +[[url.new_instance_open_target_window]] +== url.new_instance_open_target_window +Which window to choose when opening links as new tabs. + +Valid values: + + * +first-opened+: Open new tabs in the first (oldest) opened window. + * +last-opened+: Open new tabs in the last (newest) opened window. + * +last-focused+: Open new tabs in the most recently focused window. + * +last-visible+: Open new tabs in the most recently visible window. + +Default: +pass:[last-focused]+ + +[[url.searchengines]] +== url.searchengines +Definitions of search engines which can be used via the address bar. +The searchengine named `DEFAULT` is used when `url.auto_search` is turned on and something else than a URL was entered to be opened. Other search engines can be used by prepending the search engine name to the search term, e.g. `:open google qutebrowser`. The string `{}` will be replaced by the search term, use `{{` and `}}` for literal `{`/`}` signs. + +Default: +pass:[{"DEFAULT": "https://duckduckgo.com/?q={}"}]+ + +[[url.start_pages]] +== url.start_pages +The default page(s) to open at the start. + +Default: +pass:[["https://start.duckduckgo.com"]]+ + +[[url.yank_ignored_parameters]] +== url.yank_ignored_parameters +The URL parameters to strip with :yank url. + +Default: +pass:[["ref", "utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content"]]+ + [[window.hide_wayland_decoration]] == window.hide_wayland_decoration Hide the window decoration when using wayland (requires restart) @@ -2268,12 +2274,6 @@ The format to use for the window title. The following placeholders are defined: Default: +pass:[{perc}{title}{title_sep}qutebrowser]+ -[[yank_ignored_url_parameters]] -== yank_ignored_url_parameters -The URL parameters to strip with :yank url. - -Default: +pass:[["ref", "utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content"]]+ - [[zoom.default]] == zoom.default The default zoom level. diff --git a/qutebrowser/app.py b/qutebrowser/app.py index 9ccf37078..582bcbd23 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -271,7 +271,7 @@ def process_pos_args(args, via_ipc=False, cwd=None, target_arg=None): if via_ipc and target_arg and target_arg != 'auto': open_target = target_arg else: - open_target = config.val.new_instance_open_target + open_target = config.val.url.new_instance_open_target win_id = mainwindow.get_window(via_ipc, force_target=open_target) tabbed_browser = objreg.get('tabbed-browser', scope='window', window=win_id) @@ -307,7 +307,7 @@ def _open_startpage(win_id=None): window=cur_win_id) if tabbed_browser.count() == 0: log.init.debug("Opening start pages") - for url in config.val.start_pages: + for url in config.val.url.start_pages: tabbed_browser.tabopen(url) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index b72ccc248..13ba42111 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -307,7 +307,7 @@ class CommandDispatcher: private: Open a new window in private browsing mode. """ if url is None: - urls = [config.val.default_page] + urls = [config.val.url.default_page] else: urls = self._parse_url_input(url) @@ -778,7 +778,7 @@ class CommandDispatcher: url_query.setQueryDelimiters('=', ';') url_query.setQuery(url_query_str) for key in dict(url_query.queryItems()): - if key in config.val.yank_ignored_url_parameters: + if key in config.val.url.yank_ignored_parameters: url_query.removeQueryItem(key) url.setQuery(url_query) return url.toString(flags) @@ -1192,7 +1192,7 @@ class CommandDispatcher: @cmdutils.register(instance='command-dispatcher', scope='window') def home(self): """Open main startpage in current tab.""" - self._current_widget().openurl(config.val.start_pages[0]) + self._current_widget().openurl(config.val.url.start_pages[0]) def _run_userscript(self, cmd, *args, verbose=False): """Run a userscript given as argument. diff --git a/qutebrowser/browser/navigate.py b/qutebrowser/browser/navigate.py index a77853908..ff620dabb 100644 --- a/qutebrowser/browser/navigate.py +++ b/qutebrowser/browser/navigate.py @@ -42,7 +42,7 @@ def incdec(url, count, inc_or_dec): background: Open the link in a new background tab. window: Open the link in a new window. """ - segments = set(config.val.url_incdec_segments) + segments = set(config.val.url.incdec_segments) try: new_url = urlutils.incdec_number(url, inc_or_dec, count, segments=segments) diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml index 3771266cb..09b6b5f60 100644 --- a/qutebrowser/config/configdata.yml +++ b/qutebrowser/config/configdata.yml @@ -15,28 +15,11 @@ aliases: desc: >- Aliases for commands. -auto_search: - type: - name: String - valid_values: - - naive: Use simple/naive check. - - dns: Use DNS requests (might be slow!). - - never: Never search automatically. - default: naive - desc: Whether to start a search when something else than a URL is entered. - confirm_quit: type: ConfirmQuit default: [never] desc: Whether to confirm quitting the application. -default_page: - type: FuzzyUrl - default: https://start.duckduckgo.com/ - desc: >- - The page to open if :open -t/-b/-w is used without URL. Use `about:blank` - for a blank page. - history_session_interval: type: Int default: 30 @@ -53,49 +36,6 @@ ignore_case: default: smart desc: Whether to find text on a page case-insensitively. -new_instance_open_target: - type: - name: String - valid_values: - - tab: Open a new tab in the existing window and activate the window. - - tab-bg: Open a new background tab in the existing window and activate - the window. - - tab-silent: Open a new tab in the existing window without activating the - window. - - tab-bg-silent: Open a new background tab in the existing window without - activating the window. - - window: Open in a new window. - default: tab - desc: How to open links in an existing instance if a new one is launched. - -new_instance_open_target_window: - type: - name: String - valid_values: - - first-opened: Open new tabs in the first (oldest) opened window. - - last-opened: Open new tabs in the last (newest) opened window. - - last-focused: Open new tabs in the most recently focused window. - - last-visible: Open new tabs in the most recently visible window. - default: last-focused - desc: Which window to choose when opening links as new tabs. - -searchengines: - default: - DEFAULT: https://duckduckgo.com/?q={} - type: - name: Dict - required_keys: ['DEFAULT'] - keytype: String - valtype: SearchEngineUrl - desc: >- - Definitions of search engines which can be used via the address bar. - - The searchengine named `DEFAULT` is used when `auto_search` is turned on and - something else than a URL was entered to be opened. Other search engines can - be used by prepending the search engine name to the search term, e.g. `:open - google qutebrowser`. The string `{}` will be replaced by the search term, - use `{{` and `}}` for literal `{`/`}` signs. - session_default_name: type: name: SessionName @@ -104,35 +44,6 @@ session_default_name: desc: The name of the session to save by default, or unset for the last loaded session. -start_pages: - type: - name: List - valtype: FuzzyUrl - default: ["https://start.duckduckgo.com"] - desc: The default page(s) to open at the start. - -url_incdec_segments: - type: - name: FlagList - valid_values: [host, path, query, anchor] - default: [path, query] - desc: The URL segments where `:navigate increment/decrement` will search for a - number. - -yank_ignored_url_parameters: - type: - name: List - valtype: String - none_ok: true - default: - - ref - - utm_source - - utm_medium - - utm_campaign - - utm_term - - utm_content - desc: The URL parameters to strip with :yank url. - ## auto_save auto_save.config: @@ -1175,6 +1086,97 @@ tabs.wrap: type: Bool desc: Whether to wrap when changing tabs. +## url + +url.auto_search: + type: + name: String + valid_values: + - naive: Use simple/naive check. + - dns: Use DNS requests (might be slow!). + - never: Never search automatically. + default: naive + desc: Whether to start a search when something else than a URL is entered. + +url.default_page: + type: FuzzyUrl + default: https://start.duckduckgo.com/ + desc: >- + The page to open if :open -t/-b/-w is used without URL. Use `about:blank` + for a blank page. + +url.incdec_segments: + type: + name: FlagList + valid_values: [host, path, query, anchor] + default: [path, query] + desc: The URL segments where `:navigate increment/decrement` will search for a + number. + +url.new_instance_open_target: + type: + name: String + valid_values: + - tab: Open a new tab in the existing window and activate the window. + - tab-bg: Open a new background tab in the existing window and activate + the window. + - tab-silent: Open a new tab in the existing window without activating the + window. + - tab-bg-silent: Open a new background tab in the existing window without + activating the window. + - window: Open in a new window. + default: tab + desc: How to open links in an existing instance if a new one is launched. + +url.new_instance_open_target_window: + type: + name: String + valid_values: + - first-opened: Open new tabs in the first (oldest) opened window. + - last-opened: Open new tabs in the last (newest) opened window. + - last-focused: Open new tabs in the most recently focused window. + - last-visible: Open new tabs in the most recently visible window. + default: last-focused + desc: Which window to choose when opening links as new tabs. + +url.searchengines: + default: + DEFAULT: https://duckduckgo.com/?q={} + type: + name: Dict + required_keys: ['DEFAULT'] + keytype: String + valtype: SearchEngineUrl + desc: >- + Definitions of search engines which can be used via the address bar. + + The searchengine named `DEFAULT` is used when `url.auto_search` is turned on + and something else than a URL was entered to be opened. Other search engines + can be used by prepending the search engine name to the search term, e.g. + `:open google qutebrowser`. The string `{}` will be replaced by the search + term, use `{{` and `}}` for literal `{`/`}` signs. + +url.start_pages: + type: + name: List + valtype: FuzzyUrl + default: ["https://start.duckduckgo.com"] + desc: The default page(s) to open at the start. + +url.yank_ignored_parameters: + type: + name: List + valtype: String + none_ok: true + default: + - ref + - utm_source + - utm_medium + - utm_campaign + - utm_term + - utm_content + desc: The URL parameters to strip with :yank url. + ## window window.hide_wayland_decoration: diff --git a/qutebrowser/mainwindow/mainwindow.py b/qutebrowser/mainwindow/mainwindow.py index 8b39322f5..7005aa453 100644 --- a/qutebrowser/mainwindow/mainwindow.py +++ b/qutebrowser/mainwindow/mainwindow.py @@ -60,7 +60,7 @@ def get_window(via_ipc, force_window=False, force_tab=False, # Initial main window return 0 - open_target = config.val.new_instance_open_target + open_target = config.val.url.new_instance_open_target # Apply any target overrides, ordered by precedence if force_target is not None: @@ -98,7 +98,7 @@ def get_window(via_ipc, force_window=False, force_tab=False, def get_target_window(): """Get the target window for new tabs, or None if none exist.""" try: - win_mode = config.val.new_instance_open_target_window + win_mode = config.val.url.new_instance_open_target_window if win_mode == 'last-focused': return objreg.last_focused_window() elif win_mode == 'first-opened': diff --git a/qutebrowser/mainwindow/tabbedbrowser.py b/qutebrowser/mainwindow/tabbedbrowser.py index d49407a3a..b160de007 100644 --- a/qutebrowser/mainwindow/tabbedbrowser.py +++ b/qutebrowser/mainwindow/tabbedbrowser.py @@ -263,11 +263,10 @@ class TabbedBrowser(tabwidget.TabWidget): elif last_close == 'blank': self.openurl(QUrl('about:blank'), newtab=True) elif last_close == 'startpage': - for url in config.val.start_pages: + for url in config.val.url.start_pages: self.openurl(url, newtab=True) elif last_close == 'default-page': - url = config.val.default_page - self.openurl(url, newtab=True) + self.openurl(config.val.url.default_page, newtab=True) def _remove_tab(self, tab, *, add_undo=True, crashed=False): """Remove a tab from the tab list and delete it properly. @@ -329,8 +328,8 @@ class TabbedBrowser(tabwidget.TabWidget): no_history = len(self.widget(0).history) == 1 urls = { 'blank': QUrl('about:blank'), - 'startpage': config.val.start_pages[0], - 'default-page': config.val.default_page, + 'startpage': config.val.url.start_pages[0], + 'default-page': config.val.url.default_page, } first_tab_url = self.widget(0).url() last_close_urlstr = urls[last_close].toString().rstrip('/') diff --git a/qutebrowser/utils/urlutils.py b/qutebrowser/utils/urlutils.py index e79be83e1..37d36ec21 100644 --- a/qutebrowser/utils/urlutils.py +++ b/qutebrowser/utils/urlutils.py @@ -70,7 +70,7 @@ def _parse_search_term(s): if len(split) == 2: engine = split[0] try: - config.val.searchengines[engine] + config.val.url.searchengines[engine] except KeyError: engine = None term = s @@ -100,7 +100,7 @@ def _get_search_url(txt): assert term if engine is None: engine = 'DEFAULT' - template = config.val.searchengines[engine] + template = config.val.url.searchengines[engine] url = qurl_from_user_input(template.format(urllib.parse.quote(term))) qtutils.ensure_valid(url) return url @@ -193,7 +193,7 @@ def fuzzy_url(urlstr, cwd=None, relative=False, do_search=True, url = qurl_from_user_input(urlstr) log.url.debug("Converting fuzzy term {!r} to URL -> {}".format( urlstr, url.toDisplayString())) - if do_search and config.val.auto_search != 'never' and urlstr: + if do_search and config.val.url.auto_search != 'never' and urlstr: qtutils.ensure_valid(url) else: if not url.isValid(): @@ -238,7 +238,7 @@ def is_url(urlstr): Return: True if it is a valid URL, False otherwise. """ - autosearch = config.val.auto_search + autosearch = config.val.url.auto_search log.url.debug("Checking if {!r} is a URL (autosearch={}).".format( urlstr, autosearch)) diff --git a/tests/end2end/features/downloads.feature b/tests/end2end/features/downloads.feature index 2d4c4b911..3ff024be1 100644 --- a/tests/end2end/features/downloads.feature +++ b/tests/end2end/features/downloads.feature @@ -601,7 +601,7 @@ Feature: Downloading things from a website. Scenario: Downloading invalid URL When I set downloads.location.prompt to false - And I set auto_search to never + And I set url.auto_search to never And I run :download foo! Then the error "Invalid URL" should be shown diff --git a/tests/end2end/features/editor.feature b/tests/end2end/features/editor.feature index cd27c3b59..6c2f1144d 100644 --- a/tests/end2end/features/editor.feature +++ b/tests/end2end/features/editor.feature @@ -54,7 +54,7 @@ Feature: Opening external editors Then the error "Only one of -t/-b/-w can be given!" should be shown Scenario: Editing a URL with invalid URL - When I set auto_search to never + When I set url.auto_search to never And I open data/hello.txt And I set up a fake editor replacing "http://localhost:(port)/data/hello.txt" by "foo!" And I run :edit-url diff --git a/tests/end2end/features/history.feature b/tests/end2end/features/history.feature index fdae2a1b2..51c12feb7 100644 --- a/tests/end2end/features/history.feature +++ b/tests/end2end/features/history.feature @@ -109,7 +109,7 @@ Feature: Page history @qtwebengine_skip @qtwebkit_ng_skip Scenario: Opening a valid URL which turns out invalid - When I set auto_search to naive + When I set url.auto_search to naive And I run :open http://foo%40bar@baz Then "QFSFileEngine::open: No file name specified" should be logged And "Error while loading : Host not found" should be logged diff --git a/tests/end2end/features/invoke.feature b/tests/end2end/features/invoke.feature index c63f4bc03..a52bc424f 100644 --- a/tests/end2end/features/invoke.feature +++ b/tests/end2end/features/invoke.feature @@ -7,7 +7,7 @@ Feature: Invoking a new process Given I clean up open tabs Scenario: Using new-instance-open-target = tab - When I set new_instance_open_target to tab + When I set url.new_instance_open_target to tab And I open data/title.html And I open data/search.html as a URL Then the following tabs should be open: @@ -15,7 +15,7 @@ Feature: Invoking a new process - data/search.html (active) Scenario: Using new-instance-open-target = tab-bg - When I set new_instance_open_target to tab-bg + When I set url.new_instance_open_target to tab-bg And I open data/title.html And I open data/search.html as a URL Then the following tabs should be open: @@ -23,7 +23,7 @@ Feature: Invoking a new process - data/search.html Scenario: Using new-instance-open-target = window - When I set new_instance_open_target to window + When I set url.new_instance_open_target to window And I open data/title.html And I open data/search.html as a URL Then the session should look like: @@ -37,8 +37,8 @@ Feature: Invoking a new process - url: http://localhost:*/data/search.html Scenario: Using new-instance-open-target_window = last-opened - When I set new_instance_open_target to tab - And I set new_instance_open_target_window to last-opened + When I set url.new_instance_open_target to tab + And I set url.new_instance_open_target_window to last-opened And I open data/title.html And I open data/search.html in a new window And I open data/hello.txt as a URL @@ -55,8 +55,8 @@ Feature: Invoking a new process - url: http://localhost:*/data/hello.txt Scenario: Using new-instance-open-target_window = first-opened - When I set new_instance_open_target to tab - And I set new_instance_open_target_window to first-opened + When I set url.new_instance_open_target to tab + And I set url.new_instance_open_target_window to first-opened And I open data/title.html And I open data/search.html in a new window And I open data/hello.txt as a URL @@ -75,8 +75,8 @@ Feature: Invoking a new process # issue #1060 Scenario: Using target_window = first-opened after tab-detach - When I set new_instance_open_target to tab - And I set new_instance_open_target_window to first-opened + When I set url.new_instance_open_target to tab + And I set url.new_instance_open_target_window to first-opened And I open data/title.html And I open data/search.html in a new tab And I run :tab-detach @@ -95,8 +95,8 @@ Feature: Invoking a new process - url: http://localhost:*/data/search.html Scenario: Opening a new qutebrowser instance with no parameters - When I set new_instance_open_target to tab - And I set start_pages to ["http://localhost:(port)/data/hello.txt"] + When I set url.new_instance_open_target to tab + And I set url.start_pages to ["http://localhost:(port)/data/hello.txt"] And I open data/title.html And I spawn a new window And I wait until data/hello.txt is loaded diff --git a/tests/end2end/features/misc.feature b/tests/end2end/features/misc.feature index 37af3af89..1ea41f0ca 100644 --- a/tests/end2end/features/misc.feature +++ b/tests/end2end/features/misc.feature @@ -327,12 +327,12 @@ Feature: Various utility commands. # :home Scenario: :home with single page - When I set start_pages to ["http://localhost:(port)/data/hello2.txt"] + When I set url.start_pages to ["http://localhost:(port)/data/hello2.txt"] And I run :home Then data/hello2.txt should be loaded Scenario: :home with multiple pages - When I set start_pages to ["http://localhost:(port)/data/numbers/1.txt", "http://localhost:(port)/data/numbers/2.txt"] + When I set url.start_pages to ["http://localhost:(port)/data/numbers/1.txt", "http://localhost:(port)/data/numbers/2.txt"] And I run :home Then data/numbers/1.txt should be loaded diff --git a/tests/end2end/features/navigate.feature b/tests/end2end/features/navigate.feature index 43b5c0394..d1bb18735 100644 --- a/tests/end2end/features/navigate.feature +++ b/tests/end2end/features/navigate.feature @@ -97,8 +97,8 @@ Feature: Using :navigate And I run :navigate decrement with count 5 Then data/numbers/3.txt should be loaded - Scenario: Setting url-incdec-segments - When I set url_incdec_segments to [anchor] + Scenario: Setting url.incdec_segments + When I set url.incdec_segments to [anchor] And I open data/numbers/1.txt And I run :navigate increment Then the error "No number found in URL!" should be shown diff --git a/tests/end2end/features/open.feature b/tests/end2end/features/open.feature index 33ac599c3..c31d6aab3 100644 --- a/tests/end2end/features/open.feature +++ b/tests/end2end/features/open.feature @@ -17,17 +17,17 @@ Feature: Opening pages url: http://localhost:*/data/numbers/1.txt Scenario: :open without URL - When I set default_page to http://localhost:(port)/data/numbers/11.txt + When I set url.default_page to http://localhost:(port)/data/numbers/11.txt And I run :open Then data/numbers/11.txt should be loaded Scenario: :open without URL and -t - When I set default_page to http://localhost:(port)/data/numbers/2.txt + When I set url.default_page to http://localhost:(port)/data/numbers/2.txt And I run :open -t Then data/numbers/2.txt should be loaded Scenario: :open with invalid URL - When I set auto_search to never + When I set url.auto_search to never And I run :open foo! Then the error "Invalid URL" should be shown @@ -37,7 +37,7 @@ Feature: Opening pages # FIXME:conf # Scenario: Searching with :open - # When I set auto_search to naive + # When I set url.auto_search to naive # And I set searchengines.DEFAULT to http://localhost:(port)/data/numbers/{}.txt # And I run :open 3 # Then data/numbers/3.txt should be loaded diff --git a/tests/end2end/features/tabs.feature b/tests/end2end/features/tabs.feature index 7aed7013a..8f6e49611 100644 --- a/tests/end2end/features/tabs.feature +++ b/tests/end2end/features/tabs.feature @@ -715,7 +715,7 @@ Feature: Tab management When I open data/hello.txt And I run :tab-only And I set tabs.last_close to startpage - And I set start_pages to ["http://localhost:(port)/data/numbers/4.txt"] + And I set url.start_pages to ["http://localhost:(port)/data/numbers/4.txt"] And I run :tab-close And I wait until data/numbers/4.txt is loaded And I run :undo @@ -727,7 +727,7 @@ Feature: Tab management When I open data/hello.txt And I run :tab-only And I set tabs.last_close to default-page - And I set default_page to http://localhost:(port)/data/numbers/6.txt + And I set url.default_page to http://localhost:(port)/data/numbers/6.txt And I run :tab-close And I wait until data/numbers/6.txt is loaded And I run :undo @@ -739,7 +739,7 @@ Feature: Tab management Given I have a fresh instance When I open about:blank And I set tabs.last_close to default-page - And I set default_page to about:blank + And I set url.default_page to about:blank And I run :undo And I run :undo Then the error "Nothing to undo!" should be shown @@ -807,7 +807,7 @@ Feature: Tab management - about:blank (active) Scenario: last-close = startpage - When I set start_pages to ["http://localhost:(port)/data/numbers/7.txt", "http://localhost:(port)/data/numbers/8.txt"] + When I set url.start_pages to ["http://localhost:(port)/data/numbers/7.txt", "http://localhost:(port)/data/numbers/8.txt"] And I set tabs.last_close to startpage And I open data/hello.txt And I run :tab-only @@ -819,7 +819,7 @@ Feature: Tab management - data/numbers/8.txt (active) Scenario: last-close = default-page - When I set default_page to http://localhost:(port)/data/numbers/9.txt + When I set url.default_page to http://localhost:(port)/data/numbers/9.txt And I set tabs.last_close to default-page And I open data/hello.txt And I run :tab-only diff --git a/tests/end2end/features/urlmarks.feature b/tests/end2end/features/urlmarks.feature index e7f4dec5b..c171cbcd3 100644 --- a/tests/end2end/features/urlmarks.feature +++ b/tests/end2end/features/urlmarks.feature @@ -20,7 +20,7 @@ Feature: quickmarks and bookmarks Then the error "Title must be provided if url has been provided" should be shown Scenario: Saving a bookmark with an invalid url - When I set auto_search to never + When I set url.auto_search to never And I run :bookmark-add foo! "some example title" Then the error "Invalid URL" should be shown diff --git a/tests/end2end/features/yankpaste.feature b/tests/end2end/features/yankpaste.feature index 9d4d4dfa3..e390bc40d 100644 --- a/tests/end2end/features/yankpaste.feature +++ b/tests/end2end/features/yankpaste.feature @@ -145,7 +145,7 @@ Feature: Yanking and pasting. url: http://localhost:*/data/hello.txt Scenario: Pasting an invalid URL - When I set auto_search to never + When I set url.auto_search to never And I put "foo bar" into the clipboard And I run :open {clipboard} Then the error "Invalid URL" should be shown @@ -169,7 +169,7 @@ Feature: Yanking and pasting. # FIXME:conf # Scenario: Pasting multiline text - # When I set auto_search to naive + # When I set url.auto_search to naive # And I set searchengines.DEFAULT to http://localhost:(port)/data/hello.txt?q={} # And I put the following lines into the clipboard: # this url: @@ -183,7 +183,7 @@ Feature: Yanking and pasting. # FIXME:conf # Scenario: Pasting multiline whose first line looks like a URI - # When I set auto_search to naive + # When I set url.auto_search to naive # And I set searchengines.DEFAULT to http://localhost:(port)/data/hello.txt?q={} # And I put the following lines into the clipboard: # text: diff --git a/tests/end2end/fixtures/quteprocess.py b/tests/end2end/fixtures/quteprocess.py index 2b0acb2f3..58ac2fef5 100644 --- a/tests/end2end/fixtures/quteprocess.py +++ b/tests/end2end/fixtures/quteprocess.py @@ -453,7 +453,7 @@ class QuteProc(testprocess.Process): settings = [ ('messages.timeout', '0'), ('auto_save.interval', '0'), - ('new_instance_open_target_window', 'last-opened') + ('url.new_instance_open_target_window', 'last-opened') ] if not self.request.config.webengine: settings.append(('content.ssl_strict', 'false'))