From 724e6b29c38a55f722f17997379f1ebe190fa6db Mon Sep 17 00:00:00 2001 From: Imran Sobir Date: Thu, 16 Mar 2017 12:11:16 +0500 Subject: [PATCH] Make session interval configurable. --- qutebrowser/browser/qutescheme.py | 4 +++- qutebrowser/config/configdata.py | 6 ++++++ qutebrowser/html/history.html | 2 ++ qutebrowser/javascript/history.js | 8 +++----- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/qutebrowser/browser/qutescheme.py b/qutebrowser/browser/qutescheme.py index be6a99c69..45ce71c27 100644 --- a/qutebrowser/browser/qutescheme.py +++ b/qutebrowser/browser/qutescheme.py @@ -33,6 +33,7 @@ import urllib.parse from PyQt5.QtCore import QUrlQuery import qutebrowser +from qutebrowser.config import config from qutebrowser.utils import (version, utils, jinja, log, message, docutils, objreg) from qutebrowser.misc import objects @@ -246,7 +247,8 @@ def qute_history(url): return 'text/html', json.dumps(list(history)) else: - return 'text/html', jinja.render('history.html', title='History') + return 'text/html', jinja.render('history.html', title='History', + session_interval=config.get('ui', 'history-session-interval')) @add_handler('javascript') diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index cb4d260b8..1c15a878f 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -291,6 +291,12 @@ def data(readonly=False): )), ('ui', sect.KeyValue( + ('history-session-interval', + SettingValue(typ.Int(), '30'), + "The maximum time in minutes between two history items for them " + "to be considered being from the same session. Use -1 to " + "disable separation."), + ('zoom-levels', SettingValue(typ.List(typ.Perc(minval=0)), '25%,33%,50%,67%,75%,90%,100%,110%,125%,150%,175%,' diff --git a/qutebrowser/html/history.html b/qutebrowser/html/history.html index d52a3c071..58e467135 100644 --- a/qutebrowser/html/history.html +++ b/qutebrowser/html/history.html @@ -68,6 +68,8 @@ table {