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':
|
if via_ipc and target_arg and target_arg != 'auto':
|
||||||
open_target = target_arg
|
open_target = target_arg
|
||||||
else:
|
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)
|
win_id = mainwindow.get_window(via_ipc, force_target=open_target)
|
||||||
tabbed_browser = objreg.get('tabbed-browser', scope='window',
|
tabbed_browser = objreg.get('tabbed-browser', scope='window',
|
||||||
window=win_id)
|
window=win_id)
|
||||||
|
@ -36,6 +36,32 @@ ignore_case:
|
|||||||
default: smart
|
default: smart
|
||||||
desc: Whether to find text on a page case-insensitively.
|
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:
|
session_default_name:
|
||||||
type:
|
type:
|
||||||
name: SessionName
|
name: SessionName
|
||||||
@ -1110,32 +1136,6 @@ url.incdec_segments:
|
|||||||
desc: The URL segments where `:navigate increment/decrement` will search for a
|
desc: The URL segments where `:navigate increment/decrement` will search for a
|
||||||
number.
|
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:
|
url.searchengines:
|
||||||
default:
|
default:
|
||||||
DEFAULT: https://duckduckgo.com/?q={}
|
DEFAULT: https://duckduckgo.com/?q={}
|
||||||
|
@ -60,7 +60,7 @@ def get_window(via_ipc, force_window=False, force_tab=False,
|
|||||||
# Initial main window
|
# Initial main window
|
||||||
return 0
|
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
|
# Apply any target overrides, ordered by precedence
|
||||||
if force_target is not None:
|
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():
|
def get_target_window():
|
||||||
"""Get the target window for new tabs, or None if none exist."""
|
"""Get the target window for new tabs, or None if none exist."""
|
||||||
try:
|
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':
|
if win_mode == 'last-focused':
|
||||||
return objreg.last_focused_window()
|
return objreg.last_focused_window()
|
||||||
elif win_mode == 'first-opened':
|
elif win_mode == 'first-opened':
|
||||||
|
@ -7,7 +7,7 @@ Feature: Invoking a new process
|
|||||||
Given I clean up open tabs
|
Given I clean up open tabs
|
||||||
|
|
||||||
Scenario: Using new-instance-open-target = tab
|
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/title.html
|
||||||
And I open data/search.html as a URL
|
And I open data/search.html as a URL
|
||||||
Then the following tabs should be open:
|
Then the following tabs should be open:
|
||||||
@ -15,7 +15,7 @@ Feature: Invoking a new process
|
|||||||
- data/search.html (active)
|
- data/search.html (active)
|
||||||
|
|
||||||
Scenario: Using new-instance-open-target = tab-bg
|
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/title.html
|
||||||
And I open data/search.html as a URL
|
And I open data/search.html as a URL
|
||||||
Then the following tabs should be open:
|
Then the following tabs should be open:
|
||||||
@ -23,7 +23,7 @@ Feature: Invoking a new process
|
|||||||
- data/search.html
|
- data/search.html
|
||||||
|
|
||||||
Scenario: Using new-instance-open-target = window
|
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/title.html
|
||||||
And I open data/search.html as a URL
|
And I open data/search.html as a URL
|
||||||
Then the session should look like:
|
Then the session should look like:
|
||||||
@ -37,8 +37,8 @@ Feature: Invoking a new process
|
|||||||
- url: http://localhost:*/data/search.html
|
- url: http://localhost:*/data/search.html
|
||||||
|
|
||||||
Scenario: Using new-instance-open-target_window = last-opened
|
Scenario: Using new-instance-open-target_window = last-opened
|
||||||
When I set url.new_instance_open_target to tab
|
When I set new_instance_open_target to tab
|
||||||
And I set url.new_instance_open_target_window to last-opened
|
And I set new_instance_open_target_window to last-opened
|
||||||
And I open data/title.html
|
And I open data/title.html
|
||||||
And I open data/search.html in a new window
|
And I open data/search.html in a new window
|
||||||
And I open data/hello.txt as a URL
|
And I open data/hello.txt as a URL
|
||||||
@ -55,8 +55,8 @@ Feature: Invoking a new process
|
|||||||
- url: http://localhost:*/data/hello.txt
|
- url: http://localhost:*/data/hello.txt
|
||||||
|
|
||||||
Scenario: Using new-instance-open-target_window = first-opened
|
Scenario: Using new-instance-open-target_window = first-opened
|
||||||
When I set url.new_instance_open_target to tab
|
When I set new_instance_open_target to tab
|
||||||
And I set url.new_instance_open_target_window to first-opened
|
And I set new_instance_open_target_window to first-opened
|
||||||
And I open data/title.html
|
And I open data/title.html
|
||||||
And I open data/search.html in a new window
|
And I open data/search.html in a new window
|
||||||
And I open data/hello.txt as a URL
|
And I open data/hello.txt as a URL
|
||||||
@ -75,8 +75,8 @@ Feature: Invoking a new process
|
|||||||
# issue #1060
|
# issue #1060
|
||||||
|
|
||||||
Scenario: Using target_window = first-opened after tab-detach
|
Scenario: Using target_window = first-opened after tab-detach
|
||||||
When I set url.new_instance_open_target to tab
|
When I set new_instance_open_target to tab
|
||||||
And I set url.new_instance_open_target_window to first-opened
|
And I set new_instance_open_target_window to first-opened
|
||||||
And I open data/title.html
|
And I open data/title.html
|
||||||
And I open data/search.html in a new tab
|
And I open data/search.html in a new tab
|
||||||
And I run :tab-detach
|
And I run :tab-detach
|
||||||
@ -95,7 +95,7 @@ Feature: Invoking a new process
|
|||||||
- url: http://localhost:*/data/search.html
|
- url: http://localhost:*/data/search.html
|
||||||
|
|
||||||
Scenario: Opening a new qutebrowser instance with no parameters
|
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 set url.start_pages to ["http://localhost:(port)/data/hello.txt"]
|
||||||
And I open data/title.html
|
And I open data/title.html
|
||||||
And I spawn a new window
|
And I spawn a new window
|
||||||
|
@ -453,7 +453,7 @@ class QuteProc(testprocess.Process):
|
|||||||
settings = [
|
settings = [
|
||||||
('messages.timeout', '0'),
|
('messages.timeout', '0'),
|
||||||
('auto_save.interval', '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:
|
if not self.request.config.webengine:
|
||||||
settings.append(('content.ssl_strict', 'false'))
|
settings.append(('content.ssl_strict', 'false'))
|
||||||
|
Loading…
Reference in New Issue
Block a user