diff --git a/qutebrowser/app.py b/qutebrowser/app.py index 594764c37..db070770c 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -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):