Damien Elmes
c078cdddfd
if base folder can't be written, defer displaying message until qt is ready
2019-12-24 20:33:39 +10:00
Damien Elmes
9767b6b8a5
fix failure to start on new install - lang init needs to be deferred
2019-12-24 20:24:07 +10:00
Glutanimate
9d4d5c1120
Explicitly import non-qt modules that used to be imported from aqt.qt
2019-12-23 14:37:27 +01:00
Damien Elmes
17af26dcb5
apply black to all files
2019-12-23 10:34:10 +10:00
Damien Elmes
c1587254f4
use isort to tidy up imports
2019-12-20 19:19:29 +10:00
Damien Elmes
ddac1dd579
a few more typing fixes
2019-12-20 17:55:19 +10:00
Damien Elmes
b6b8df2dcf
add a bunch of annotations for mypy
2019-12-20 15:07:40 +10:00
Damien Elmes
3a4f94ab86
add UI scale preference
2019-12-19 09:58:16 +10:00
Damien Elmes
5ce3de0e98
setup profile earlier in startup, but defer warning message until qt init
2019-12-19 09:38:36 +10:00
Damien Elmes
ff6b58c265
opt in to qt's new non-integer scaling
2019-12-17 18:43:32 +10:00
Damien Elmes
18a3ead1d2
disable help button in title bar
2019-12-17 17:59:19 +10:00
Damien Elmes
eee099c0b2
add a few hints to some commonly used code
...
and add the extra hints mypy wanted
2019-12-16 19:46:40 +10:00
Mike Hordecki
8617ec7250
Add support for OpenGL software rendering.
...
In some systems, the default Qt hardware renderer is buggy. There's a Qt
option for forcing software rendering. This commit adds support for a
new environment variable, ANKI_SOFTWAREOPENGL, that, when set, will
prompt Anki to force software OpenGL in Qt.
2019-08-16 23:18:28 +02:00
Wilco Greven
9b10e3f43e
Set applicationName and desktopFileName before instantiating the application.
...
When these are set after instantiating the application Anki will load both
$XDG CONFIG HOME/.config/Ankirc and $XDG CONFIG HOME/.config/ankirc.
2019-07-20 13:10:59 +02:00
Wilco Greven
ffab5d31d4
Set the desktop file name.
...
Otherwise, on Wayland, Anki will look for python3.desktop This fixes the window icon.
2019-07-18 23:14:34 +02:00
Damien Elmes
79660e41bb
keep global i18n handlers working
...
the previous change broke the translations of copy&pasted anki code in
add-ons
should fix
https://anki.tenderapp.com/discussions/ankidesktop/32922-chinese-characters-in-the-main-window-when-setting-language-to-japanese#comment_47043676
2019-03-07 18:34: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
f9f5d9d3ab
deprecated global _/ngettext was returning None
...
the plurals may still be wrong in the ngettext case, but at least
it should not lead to premature tracebacks
2019-03-05 07:46:27 +10:00
Damien Elmes
5185e817fc
move from deprecated optparse to argparse
2019-03-04 16:45:29 +10:00
Damien Elmes
919738a9d7
print warning when add-ons access _ without importing it
2019-03-04 12:08:48 +10:00
Damien Elmes
372d5ed6e8
update copyright and clarify licenses
2019-02-05 14:01:33 +10:00
Damien Elmes
4c6c0d428b
detect and refuse to run on nouveau
2018-12-18 19:29:34 +10:00
Arthur-Milchior
b8523944ff
The note in curentEdit is not changed until the window is closed.
...
https://anki.tenderapp.com/discussions/ankidesktop/31105-reopening-an-edit-window
I added a «reopen» method, which I believe may be useful in other
cases too. I check whether the method exists before calling it, so
there should be no compatibility problem.
2018-11-28 10:24:59 +01:00
Damien Elmes
e18bd4d67d
work around existing instance not responding quickly
...
on a slow computer the first instance may have set up the local
server but not yet started the main loop, so when a user double clicks
on the icon twice, the second instance was timing out and opening
another window, then giving locked database errors
to work around this, increase the timeout, and tell the user the
existing instance is not responding instead of creating a new instance
https://anki.tenderapp.com/discussions/ankidesktop/30306-error
https://anki.tenderapp.com/discussions/ankidesktop/30550-im-sorry
2018-10-28 14:17:16 +10:00
Damien Elmes
7d62b186f8
disable proxy support if 127.0.0.1 is not bypassed
...
There doesn't appear to be an easy way to tell WebEngine to ignore
the proxy for 127.0.0.1, so if the user has not bypassed the proxy
for local addresses, completely disable it. This may break remote
image and script references, but should at least allow the app to
load without intervention.
2018-10-11 15:49:04 +10:00
Damien Elmes
0d6d7b9bad
print early tracebacks to console
2018-09-24 16:24:11 +10:00
Damien Elmes
f699ebb370
add hw accel toggle to prefs
2018-08-30 13:39:04 +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
9fd085af37
don't unmaximize when showing browser
...
https://anki.tenderapp.com/discussions/beta-testing/1228-anki-210-release-candidate/page/2#comment_45812673
2018-08-01 21:11:35 +10:00
Damien Elmes
c15df04622
remove beta warning
2018-07-28 16:44:23 +10:00
Damien Elmes
099bd045d0
default to software rendering on Windows/Linux
2018-07-28 16:43:19 +10:00
Damien Elmes
41205bd5ca
allow user to override scaling
...
which may help wth issues like
https://anki.tenderapp.com/discussions/beta-testing/918-text-size-in-ubuntu-1710
and
https://anki.tenderapp.com/discussions/ankidesktop/25708-anki-with-high-dpi-screen
2017-11-27 11:01:15 +10:00
Damien Elmes
33c5b5f9e7
remove lodpi hack, don't assume physical DPI is always 72
2017-10-05 16:42:46 +10:00
Damien Elmes
e1a4c52175
pass opts to main window; force zoom factor to 1 on lodpi
2017-10-03 12:12:57 +10:00
Damien Elmes
d530134218
option to disable qt's hidpi scaling
...
https://anki.tenderapp.com/discussions/beta-testing/765-problem-with-the-ui-of-anki
2017-10-02 16:26:23 +10:00
krassowski
755c9487c9
Add docstring explaining introduced arguments of _run()
2017-09-23 15:01:29 +00:00
krassowski
b863d7972c
Allow to run App&GUI without entering the main event loop
2017-09-21 03:02:39 +00:00
Damien Elmes
d3d96222bc
prefs and dialog tweaks
...
- manage prefs window so it only opens once, and gets closed properly
- provide silentlyClose shortcut to dialogmanager windows
2017-09-10 15:15:12 +10:00
Damien Elmes
8ab5a3a176
use callback when closing windows
...
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
2017-08-16 12:48:15 +10:00
Damien Elmes
a57b913450
opt in to qt's full hidpi support
...
doesn't seem to affect the webviews on Linux, so we need to keep the old
zoom code around for now
2017-08-10 15:02:46 +10:00
Damien Elmes
538678a7a9
remove old comment
2017-08-02 16:18:09 +10:00
Damien Elmes
c392418ba7
bump version
2017-07-05 10:54:27 +10:00
Damien Elmes
1fe86e1bde
about tweaks
...
- fix sort order
- treat as a collection window so it's only opened once, and is
closed on quit
- use our standard font
2017-06-26 13:05:11 +10:00
Damien Elmes
aeaf9df32f
ensure only one copy of stats shown, and close with collection
2017-06-22 16:51:54 +10:00
Damien Elmes
ac81fefc14
add note about being an alpha
2017-06-14 11:59:58 +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
b56ca60d2f
remove mac setLibraryPaths() call
2016-12-16 21:20:08 +10:00
Damien Elmes
6377dd161f
fix mesa driver being loaded on nvidia driver machines
2016-08-01 12:16:06 +10:00
Damien Elmes
6a109caa7c
dialogs.open() needs to un-minimize as well
2016-07-18 13:02:21 +10:00
Damien Elmes
34b95514b5
import anki earlier so we can catch invalid python version
2016-06-22 14:42:41 +10:00