Move new_instance_open_target out of url.
It doesn't really fit there really... See 3cf028db23cbfe256e499d8881c3c2856f224d94
This commit is contained in:
parent
d641652a92
commit
8712fc6fd3
@ -270,7 +270,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.url.new_instance_open_target
|
||||
open_target = config.val.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)
|
||||
|
@ -36,6 +36,32 @@ 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.
|
||||
|
||||
session_default_name:
|
||||
type:
|
||||
name: SessionName
|
||||
@ -1110,32 +1136,6 @@ url.incdec_segments:
|
||||
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={}
|
||||
|
@ -60,7 +60,7 @@ def get_window(via_ipc, force_window=False, force_tab=False,
|
||||
# Initial main window
|
||||
return 0
|
||||
|
||||
open_target = config.val.url.new_instance_open_target
|
||||
open_target = config.val.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.url.new_instance_open_target_window
|
||||
win_mode = config.val.new_instance_open_target_window
|
||||
if win_mode == 'last-focused':
|
||||
return objreg.last_focused_window()
|
||||
elif win_mode == 'first-opened':
|
||||
|
@ -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 url.new_instance_open_target to tab
|
||||
When I set 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 url.new_instance_open_target to tab-bg
|
||||
When I set 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 url.new_instance_open_target to window
|
||||
When I set 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 url.new_instance_open_target to tab
|
||||
And I set url.new_instance_open_target_window to last-opened
|
||||
When I set new_instance_open_target to tab
|
||||
And I set 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 url.new_instance_open_target to tab
|
||||
And I set url.new_instance_open_target_window to first-opened
|
||||
When I set new_instance_open_target to tab
|
||||
And I set 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 url.new_instance_open_target to tab
|
||||
And I set url.new_instance_open_target_window to first-opened
|
||||
When I set new_instance_open_target to tab
|
||||
And I set 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,7 +95,7 @@ Feature: Invoking a new process
|
||||
- url: http://localhost:*/data/search.html
|
||||
|
||||
Scenario: Opening a new qutebrowser instance with no parameters
|
||||
When I set url.new_instance_open_target to tab
|
||||
When I set 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
|
||||
|
@ -453,7 +453,7 @@ class QuteProc(testprocess.Process):
|
||||
settings = [
|
||||
('messages.timeout', '0'),
|
||||
('auto_save.interval', '0'),
|
||||
('url.new_instance_open_target_window', 'last-opened')
|
||||
('new_instance_open_target_window', 'last-opened')
|
||||
]
|
||||
if not self.request.config.webengine:
|
||||
settings.append(('content.ssl_strict', 'false'))
|
||||
|
Loading…
Reference in New Issue
Block a user