We need to set the OpenGL mode prior to Qt initialisation, but
want to fetch the current driver from the profile manager - and
the profile manager required Qt to already be set up.
Work around this by moving away from QStandardPaths in favour of
a pure Python module. The profile manager now does early setup
using winpaths, and we defer most of the setup until Qt has been
initialised.
Also we install a message handler to catch OpenGL initialisation
errors, and automatically switch to the next driver so users
don't need to manually change the driver.
The --hwaccel option has been removed, as it is no longer necessary.
remove the old forceClose hack in favour of a callback when closing, so
all windows have a chance to save properly before the collection is
unloaded
also:
- fix a warning shown when opening about screen
- require a call to editor.cleanup() when closing a window, to make sure
any pending js callbacks don't try to fire on a deleted object
- make sure we gc webview when closing editcurrent
- main.py still needs refactoring to make use of the change
- a few issues to work out still, and editor changes not done yet
- for communication between webengine and python code, we set window
.location to 'http://anki/<something>' - the leading http is
necessary for qt to call the link handler, which was introduced
in qt5.5
- the designer files now use a promoted qobject to create instances
of AnkiWebView
- we use the css zoom property to alter webengine font size based on
system dpi
- prefs and addons folder stored in new location (at least for now)
- get rid of shared memory check as it was causing problems when an existing
session was forcefully closed; instead we rely on the socket
- include a hash of the user's name in the key so that multiple users can run
anki at the same time
By placing argument parsing at the top, we skip starting up all the QT
stuff when using options like --help or --version that cause the program
to exit anyway.