Commit Graph

36 Commits

Author SHA1 Message Date
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
Damien Elmes
99c90b929b warn when prefs.db corrupt and catch another case 2013-07-18 18:59:14 +09:00
Damien Elmes
aa0cac1ed3 send to trash when deleting profile 2013-05-23 14:03:21 +09:00
Damien Elmes
0afce5f19a support unc pathnames again
Turns out that WebKit does support UNC pathnames in the base tag, but it is
picky about the leading number of slashes.
2013-05-17 14:12:59 +09:00
Damien Elmes
ce99114dc3 more robust desktop location detection 2013-05-12 17:24:01 +09:00
Damien Elmes
616e731e34 when given base on cmdline, get abspath 2013-03-12 09:24:46 +09:00
Damien Elmes
d05331d31c if global profile can't be loaded, start with new prefs.db 2013-02-15 08:59:44 +09:00
Damien Elmes
df961cc509 remember import mode 2013-01-08 10:32:41 +09:00
Damien Elmes
be7b293b15 remember allowHTML setting 2012-12-22 13:18:28 +09:00
Damien Elmes
b2457811a2 optimize imports 2012-12-22 09:17:10 +09:00
Damien Elmes
d477df8c28 merged libanki and ankiqt into single distro 2012-12-21 16:51:59 +09:00