Merge auto-open option into show
This commit is contained in:
parent
d98c81c9d6
commit
8da8441623
@ -200,7 +200,7 @@ class CompletionView(QTreeView):
|
||||
selmodel.setCurrentIndex(
|
||||
idx, QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows)
|
||||
|
||||
if config.get('completion', 'show'):
|
||||
if config.get('completion', 'show') == 'auto':
|
||||
self.show()
|
||||
|
||||
def set_model(self, model):
|
||||
@ -227,8 +227,7 @@ class CompletionView(QTreeView):
|
||||
if old_model is not None:
|
||||
old_model.deleteLater()
|
||||
|
||||
if (config.get('completion', 'auto-open') and
|
||||
config.get('completion', 'show')):
|
||||
if config.get('completion', 'show') == 'always':
|
||||
self.show()
|
||||
else:
|
||||
self.hide()
|
||||
|
@ -351,6 +351,7 @@ class ConfigManager(QObject):
|
||||
('tabs', 'hide-always'),
|
||||
('ui', 'display-statusbar-messages'),
|
||||
('general', 'wrap-search'),
|
||||
('completion', 'auto-open'),
|
||||
]
|
||||
CHANGED_OPTIONS = {
|
||||
('content', 'cookies-accept'):
|
||||
@ -363,6 +364,8 @@ class ConfigManager(QObject):
|
||||
_get_value_transformer({'false': 'none', 'true': 'debug'}),
|
||||
('ui', 'keyhint-blacklist'):
|
||||
_get_value_transformer({'false': '*', 'true': ''}),
|
||||
('completion', 'show'):
|
||||
_get_value_transformer({'false': 'never', 'true': 'always'}),
|
||||
}
|
||||
|
||||
changed = pyqtSignal(str, str)
|
||||
|
@ -427,9 +427,14 @@ def data(readonly=False):
|
||||
)),
|
||||
|
||||
('completion', sect.KeyValue(
|
||||
('auto-open',
|
||||
SettingValue(typ.Bool(), 'true'),
|
||||
"Automatically open completion when typing."),
|
||||
('show',
|
||||
SettingValue(typ.String(
|
||||
valid_values=typ.ValidValues(
|
||||
('always', "Whenever a completion is available."),
|
||||
('auto', "Whenever a completion is requested."),
|
||||
('never', "Never.")
|
||||
)), 'always'),
|
||||
"When to show the autocompletion window."),
|
||||
|
||||
('download-path-suggestion',
|
||||
SettingValue(
|
||||
@ -444,10 +449,6 @@ def data(readonly=False):
|
||||
SettingValue(typ.TimestampTemplate(none_ok=True), '%Y-%m-%d'),
|
||||
"How to format timestamps (e.g. for history)"),
|
||||
|
||||
('show',
|
||||
SettingValue(typ.Bool(), 'true'),
|
||||
"Whether to show the autocompletion window."),
|
||||
|
||||
('height',
|
||||
SettingValue(typ.PercOrInt(minperc=0, maxperc=100, minint=1),
|
||||
'50%'),
|
||||
|
@ -66,7 +66,7 @@ def completer_obj(qtbot, status_command_stub, config_stub, monkeypatch, stubs,
|
||||
"""Create the completer used for testing."""
|
||||
monkeypatch.setattr('qutebrowser.completion.completer.QTimer',
|
||||
stubs.InstaTimer)
|
||||
config_stub.data = {'completion': {'auto-open': False}}
|
||||
config_stub.data = {'completion': {'show': 'auto'}}
|
||||
return completer.Completer(status_command_stub, 0, completion_widget_stub)
|
||||
|
||||
|
||||
|
@ -34,8 +34,7 @@ def completionview(qtbot, status_command_stub, config_stub, win_registry,
|
||||
"""Create the CompletionView used for testing."""
|
||||
config_stub.data = {
|
||||
'completion': {
|
||||
'show': True,
|
||||
'auto-open': True,
|
||||
'show': 'always',
|
||||
'scrollbar-width': 12,
|
||||
'scrollbar-padding': 2,
|
||||
'shrink': False,
|
||||
|
Loading…
Reference in New Issue
Block a user