Clean up _open_special_pages()
This commit is contained in:
parent
7858beee06
commit
ce532654cb
@ -351,10 +351,6 @@ def _open_startpage(win_id=None):
|
|||||||
def _open_special_pages(args):
|
def _open_special_pages(args):
|
||||||
"""Open special notification pages which are only shown once.
|
"""Open special notification pages which are only shown once.
|
||||||
|
|
||||||
Currently this is:
|
|
||||||
- Quickstart page if it's the first start.
|
|
||||||
- Legacy QtWebKit warning if needed.
|
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
args: The argparse namespace.
|
args: The argparse namespace.
|
||||||
"""
|
"""
|
||||||
@ -366,25 +362,23 @@ def _open_special_pages(args):
|
|||||||
tabbed_browser = objreg.get('tabbed-browser', scope='window',
|
tabbed_browser = objreg.get('tabbed-browser', scope='window',
|
||||||
window='last-focused')
|
window='last-focused')
|
||||||
|
|
||||||
# Quickstart page
|
pages = [
|
||||||
|
# state, condition, URL
|
||||||
|
('quickstart-done',
|
||||||
|
True,
|
||||||
|
'https://www.qutebrowser.org/quickstart.html'),
|
||||||
|
|
||||||
quickstart_done = general_sect.get('quickstart-done') == '1'
|
('config-migration-shown',
|
||||||
|
os.path.exists(os.path.join(standarddir.config(),
|
||||||
|
'qutebrowser.conf')),
|
||||||
|
'qute://help/configuring.html'),
|
||||||
|
|
||||||
if not quickstart_done:
|
]
|
||||||
tabbed_browser.tabopen(
|
|
||||||
QUrl('https://www.qutebrowser.org/quickstart.html'))
|
|
||||||
general_sect['quickstart-done'] = '1'
|
|
||||||
|
|
||||||
# Setting migration page
|
for state, condition, url in pages:
|
||||||
|
if general_sect.get(state) != '1' and condition:
|
||||||
needs_migration = os.path.exists(
|
tabbed_browser.tabopen(QUrl(url), background=False)
|
||||||
os.path.join(standarddir.config(), 'qutebrowser.conf'))
|
general_sect[state] = '1'
|
||||||
migration_shown = general_sect.get('config-migration-shown') == '1'
|
|
||||||
|
|
||||||
if needs_migration and not migration_shown:
|
|
||||||
tabbed_browser.tabopen(QUrl('qute://help/configuring.html'),
|
|
||||||
background=False)
|
|
||||||
general_sect['config-migration-shown'] = '1'
|
|
||||||
|
|
||||||
|
|
||||||
def on_focus_changed(_old, new):
|
def on_focus_changed(_old, new):
|
||||||
|
Loading…
Reference in New Issue
Block a user