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):
|
||||
"""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: The argparse namespace.
|
||||
"""
|
||||
@ -366,25 +362,23 @@ def _open_special_pages(args):
|
||||
tabbed_browser = objreg.get('tabbed-browser', scope='window',
|
||||
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
|
||||
|
||||
needs_migration = os.path.exists(
|
||||
os.path.join(standarddir.config(), 'qutebrowser.conf'))
|
||||
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'
|
||||
for state, condition, url in pages:
|
||||
if general_sect.get(state) != '1' and condition:
|
||||
tabbed_browser.tabopen(QUrl(url), background=False)
|
||||
general_sect[state] = '1'
|
||||
|
||||
|
||||
def on_focus_changed(_old, new):
|
||||
|
Loading…
Reference in New Issue
Block a user