Commit Graph

60 Commits

Author SHA1 Message Date
Damien Elmes
b88de95cd8 bundle sip-generated stubs
the PyQt5-stubs package that's floating around depends on an old
Qt, and throws a bunch of errors
2019-12-16 09:59:18 +10:00
Damien Elmes
c508498ba8 add aqt/ 2019-12-16 08:51:38 +10:00
Damien Elmes
241b7ea005 use locales instead of two digit lang codes
and move away from launchpad
2019-09-23 21:18:03 +10:00
Damien Elmes
4f819d06ec display a more helpful message when base folder not readable in startup 2019-07-17 17:23:22 +10:00
Damien Elmes
09651be9e7 check a profile exists every time
if something went wrong between pm.meta() and .ensureProfile() in the
past, it would lead to an inability to start Anki due to the a lack of
any profiles

https://anki.tenderapp.com/discussions/ankidesktop/32972-linux-upgrade-problems-20-219
2019-03-06 15:27:13 +10:00
Damien Elmes
ebdd8dae4b tidy up unused imports 2019-03-04 17:25:19 +10:00
Damien Elmes
e91901911f WindowsError may not be defined 2019-03-04 12:29:55 +10:00
Damien Elmes
919738a9d7 print warning when add-ons access _ without importing it 2019-03-04 12:08:48 +10:00
Damien Elmes
da2ddcc6e2 explicitly import _ and ngettext 2019-03-04 11:58:34 +10:00
Damien Elmes
bf6e10ec88 catch profile rename error in non-English locales 2019-02-06 09:02:56 +10:00
Damien Elmes
372d5ed6e8 update copyright and clarify licenses 2019-02-05 14:01:33 +10:00
Damien Elmes
e41c399954 Revert "default to GL mode auto on qt 5.12"
This reverts commit d7760d9831.

unfortunately there still appear to be widespread issues on qt 5.12
2019-01-06 09:59:25 +10:00
Damien Elmes
d7760d9831 default to GL mode auto on qt 5.12 2018-12-10 15:17:21 +10:00
Damien Elmes
7e2305ac0c fix encoding error when setting up profile
https://anki.tenderapp.com/discussions/ankidesktop/30926-error-when-choosing-ukrainian-as-the-interface-language
2018-11-27 12:55:24 +10:00
Damien Elmes
3126611ecf display warning when profile corrupted 2018-10-29 21:06:33 +10:00
Damien Elmes
eef0b92374 correctly load prefs file modified in more recent qt 2018-10-29 21:06:11 +10:00
Damien Elmes
8775314e36 use custom mpv config folder
not the first time the default location has caused problems for users
https://anki.tenderapp.com/discussions/ankidesktop/29531-bug-ankis-version-of-mpv-loads-mpvconf-from-configmpv-on-macos
2018-09-24 16:26:08 +10:00
Damien Elmes
ae3c0416db fix catch of access denied error 2018-09-17 23:38:19 +10:00
Damien Elmes
a8ce102916 disable question fade when using software rendering 2018-08-30 13:26:08 +10:00
Damien Elmes
f2b5c8a862 support specifying gfx driver in profile folder
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.
2018-08-08 23:48:25 +10:00
Damien Elmes
3ff504461d don't attempt to rename profile folder if it's a file 2018-07-11 15:23:24 +10:00
Damien Elmes
c01ba49168 remove stale journal file when resetting prefs 2018-03-22 14:10:23 +10:00
Damien Elmes
3a059d15b5 check prefs21.db integrity
otherwise some corruption errors only become apparent when trying to
load an individual profile
2018-01-14 17:47:21 +10:00
Damien Elmes
7b844d12cb increase default number of backups; don't put in trash 2017-10-05 14:39:47 +10:00
Damien Elmes
b0a62838b5 profile tweaks
- handle unpickling of anki 2.0 prefs
- copy the prefs on first load, as python2 is not capable of reading the
protocol 3 pickles we write for proper bytes support
- when there's an error unpickling, write a clean copy of the
preferences instead of forgetting all profiles and starting from scratch
2017-08-28 18:35:24 +10:00
Damien Elmes
a66c5f555f revamp profile manager
- use a main window instead of a dialog, so the menu items of the main
window don't appear while the profile window is active on OS X
- the profile manager now has a button to automatic restoring from
backup, which will prevent old backups from being clobbered
- drop support for profile passwords
- do the right thing when user quits from the menu in profile manager
mode
2017-08-16 19:45:39 +10:00
Damien Elmes
15ca733f14 fix base folder location on windows 2017-07-09 13:22:01 +10:00
Damien Elmes
c2f7b48a29 use QStandardPaths instead of the env var 2017-02-25 18:07:01 +10:00
Damien Elmes
57c8e43327 change profile folder on windows and linux
onedrive seems to frequently screw up the permissions on the documents
folder. since we're stuck with more difficult to find folders on
mac/win, we may as well migrate linux as well, to a more
standards-compliant path.
2017-02-22 18:16:19 +10:00
Damien Elmes
88d8be32d9 allow setting base via env var 2017-02-15 13:41:19 +10:00
Illia Volochii
13b7e01044 Stop inheriting from object
It is not needed in Python 3.
2017-02-07 00:21:33 +02:00
Damien Elmes
a76c6a1bcf use 'Library/Application Support' to match 2.0.x 2017-01-13 21:14:04 +10:00
Damien Elmes
de7e40537d port majority of code to qt5.5+
- 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)
2016-05-31 18:51:40 +10:00
Damien Elmes
15b349e3a8 start port to python 3
unit tests pass and main screens of GUI load
2016-05-12 14:45:35 +10:00
Damien Elmes
89a5777585 store profiles as blobs
the cPickle data may not be valid utf8, and even with
text_factory=str this seems to cause problems sometimes
2016-05-12 14:19:16 +10:00
Damien Elmes
864a9135dc allow language changing in prefs
avoided adding this in the past as on a multi user system it allows
one profile user to annoys others by changing the interface language,
but it comes at the expense of easily changing the language for users
who choose the wrong one on first startup
2016-04-05 11:02:01 +10:00
Damien Elmes
1d2afd1ab3 make sure .db is initialized at start of profiles init
fixes
File "aqt/profiles.pyc", line 253, in _loadMeta
  File "aqt/profiles.pyc", line 234, in recover
AttributeError: 'ProfileManager' object has no attribute 'db'
2014-08-09 12:50:32 +09:00
Soren I. Bjornstad
9e69da6c9a use Documents/Anki (in English) if no DocumentsLocation
Otherwise it gets created directly in the home folder, which is
confusing when you would expect that only to happen on older installs
which previously used it.
2014-07-22 11:22:06 -05:00
Damien Elmes
1099b743b7 yet another file locking bug: must close prefs.db before moving 2014-07-07 13:18:00 +09:00
Damien Elmes
bbefeb0cfd make sure we don't rename to existing prefs.db.broken 2014-07-07 10:47:57 +09:00
Soren I. Bjornstad
8e2b653bd0 make path to documents folder translatable 2014-07-03 14:46:34 -05:00
Soren I. Bjornstad
0c937074eb prevent profiles from getting out of sync when rename fails
If there is an error in renaming the folder, don't write the new profile
name to the database.
2014-06-28 11:31:02 -05:00
Soren I. Bjornstad
4619933e7e change default Anki folder location on Linux to Documents/Anki
(leave in ~/Anki for existing installs)
2014-06-26 10:55:45 -05:00
Soren I. Bjornstad
9ac6ac4d2b Merge branch 'windows-case-fix' 2014-06-24 15:30:32 -05:00
Soren I. Bjornstad
a2eb5a09c3 allow changing case of profile name on Windows 2014-06-24 15:28:32 -05:00
Soren I. Bjornstad
50e0d0b811 better message when Anki can't create a profile folder 2014-06-20 10:00:44 -05:00
Damien Elmes
8fecf53c3b use qdesktopservices on qt5+pyqt4 2014-03-06 09:03:52 +09:00
Damien Elmes
4b217664aa confirm interface language selection on first startup 2014-01-14 14:40:45 +09:00
Damien Elmes
1f05392113 change default import mode to ignore updates 2013-11-26 18:19:54 +09:00
Damien Elmes
9f548ad85a recover from a corrupt prefs.db that fails to load at all 2013-11-13 15:29:50 +09:00