Commit Graph

1252 Commits

Author SHA1 Message Date
Damien Elmes
630cddc786 fix superscript shortcut
https://anki.tenderapp.com/discussions/beta-testing/627-anki-210-beta-1#comment_43048185
2017-07-22 10:54:45 +10:00
Damien Elmes
8a85471374 bump version 2017-07-20 12:17:59 +10:00
Damien Elmes
17bb179d06 experimental prewrap support
- add option to wrap html in implicit pre-wrap environment during
editing and review - defaults to off
- update paste filter to convert divs/Ps to newlines and non-breaking
spaces to normal ones
- catch enter key and write \n instead of creating a new div

also:

- remove extra caretToEnd() call that is no longer required
- add dd/dt/dl to allowed tags
2017-07-20 12:16:47 +10:00
Damien Elmes
f7b3457ff0 fix drawLinks reference 2017-07-17 14:54:12 +10:00
Damien Elmes
9df1947e41 require decorator 2017-07-17 13:18:56 +10:00
Damien Elmes
dffab1376f Merge branch 'master' of github.com:dae/anki 2017-07-17 13:16:06 +10:00
Damien Elmes
896889ad82 Merge pull request #191 from dequis/signature-preserving-decorator
Make hooks.wrap preserve signatures, fixes hooking some pyqt5 callbacks
2017-07-17 13:15:56 +10:00
Damien Elmes
7d351346ab Merge pull request #190 from ankitest/patch-12
Let users extend their bottom buttons functions
2017-07-17 13:14:03 +10:00
Damien Elmes
d99dcaafdc don't open separate browser window on iframe load
https://anki.tenderapp.com/discussions/beta-testing/627-anki-210-beta-1#comment_43008395
2017-07-17 12:40:38 +10:00
dequis
37ba8832f8 Make hooks.wrap preserve signatures, fixes hooking some pyqt5 callbacks
It looks like pyqt5 is playing dirty and checking the number of args of
functions before calling them. When using hooks.wrap, pyqt5 thinks it
can pass any amount of arguments (because *args) and you get exceptions
like this inside the wrap function, when calling the 'old' function:

>TypeError: onFindDupes() takes 1 positional argument but 2 were given

This commit fixes it by preserving the signature of the wrapped method,
by adding an optional dependency on the "decorator" module.

Making it an optional dependency is probably not the wisest idea but
since this is a small edge case it might be smoother to start like this.

I also added functools.wraps() as a fallback, which won't help much but
is slightly more correct.

See this article for details: https://hynek.me/articles/decorators/
2017-07-16 23:25:34 -03:00
Dmitry Mikheev
5bfd93842c Let users extend their bottom buttons functions
Like this:
```
aqt.deckbrowser.DeckBrowser.drawLinks.extend([
            ["", "rebuildAll", _("Rebuild All")],
            ["", "emptyAll", _("Empty All")],
])
```
2017-07-15 18:39:01 +05:00
Damien Elmes
4eb3902759 bump version 2017-07-12 11:26:26 +10:00
Damien Elmes
7ecd889d8f preserve newlines and indents when pasting text
https://anki.tenderapp.com/discussions/ankidesktop/24123-paragraphsnew-lines-not-preserved-when-copypasting-into-anki
2017-07-12 10:57:01 +10:00
Damien Elmes
14597bd888 if a non-media link pasted, paste the url text directly 2017-07-11 14:58:22 +10:00
Damien Elmes
e8777e8630 bump version 2017-07-10 15:22:47 +10:00
Damien Elmes
7d71170a33 catch windows firewall issue 2017-07-09 13:26:50 +10:00
Damien Elmes
15ca733f14 fix base folder location on windows 2017-07-09 13:22:01 +10:00
Damien Elmes
2d25069936 run garbage collector after webengine window
we GC on autosave, but doing an explicit GC prevents excess memory
consumption when rapidly opening and closing windows using
webengine
2017-07-08 12:28:11 +10:00
Damien Elmes
d1f05907be update addon docs 2017-07-05 12:41:05 +10:00
Damien Elmes
36ed23e103 fix python version check 2017-07-05 12:28:03 +10:00
Damien Elmes
c392418ba7 bump version 2017-07-05 10:54:27 +10:00
Damien Elmes
2b8987f654 fix browse add-ons command failing to load on linux 2017-06-27 12:04:42 +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
90f7038109 fix exit code 120 when quitting in python 3.6 2017-06-26 13:03:05 +10:00
Damien Elmes
294813f4fd switch undo shortcut
on windows webengine seems to install a permanent ctrl+z handler that is
active even when an editing area is not selected, so our shortcut is
never triggered when the webengineview is focused.
2017-06-24 19:24:43 +10:00
Damien Elmes
ea5f2bb0ef don't need to set bgcol when the window is transparent 2017-06-24 19:15:14 +10:00
Damien Elmes
7bd33242cf disable pinch to zoom gesture 2017-06-23 14:34:56 +10:00
Damien Elmes
e635157ee4 move stats and sync buttons to the center 2017-06-23 14:03:18 +10:00
Damien Elmes
a3bdd04d42 set bgcol in ankiwebview 2017-06-23 13:07:59 +10:00
Damien Elmes
7af591cfd7 add cancel button to recording window 2017-06-23 13:04:32 +10:00
Damien Elmes
4967275973 bump version 2017-06-22 18:09:48 +10:00
Damien Elmes
1b41e68f05 remove gradients from toolbars in favour of system colour 2017-06-22 18:06:40 +10:00
Damien Elmes
a3fa2ff5ba remove duplicate <html> in editor, set bg on page creation 2017-06-22 18:01:47 +10:00
Damien Elmes
59f877737e start webview as transparent to reduce flicker 2017-06-22 18:01:01 +10:00
Damien Elmes
7d86984a12 turn off webview cache to reduce memory footprint 2017-06-22 17:06:33 +10:00
Damien Elmes
aa77df0805 give toolbars an approx height to reduce flashing at startup 2017-06-22 16:56:29 +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
34dcf64d76 another attempt at fixing key handling
we can't use an event filter on the top level webview, because it
ignores the return value of the filter and leads to Anki thinking
keys have been pressed twice

and if we use an event filter on the focusProxy(), the
keypress/release events are sent even when a text field is currently
focused, leading to shortcuts being triggered when typing in the answer

to solve this, we move away from handling the key press events
directly, and instead install shortcuts for the events we want to
trigger. in addition to the global shortcuts, each state can install
its own shortcuts, which we remove when transitioning to a new state

also remove the unused canFocus argument to ankiwebview, and accept a parent
argument as required by the code in forms/
2017-06-22 16:39:31 +10:00
Damien Elmes
22f2fdf7d6 fix esc key in type answer field
without the change, the selection disappears but typed characters
still go to the input area
2017-06-22 15:10:47 +10:00
Damien Elmes
ac81fefc14 add note about being an alpha 2017-06-14 11:59:58 +10:00
Damien Elmes
e93f4abcab fix deck expanded state being reset
the setExpanded() call was triggering the callback, turning off
expanded state

https://anki.tenderapp.com/discussions/ankidesktop/23841-bug-when-editing-card-fields-decks-automatically-collapse
2017-06-14 11:43:47 +10:00
Damien Elmes
0abff36cfa bump version 2017-06-07 13:31:16 +10:00
Damien Elmes
25cc3eceb5 make sure stats window starts focused on osx 2017-06-07 11:50:29 +10:00
Damien Elmes
017984c15c fix crash when opening profile from profile manager 2017-06-06 16:09:15 +10:00
Damien Elmes
76e508e25d various key handling fixes
- key presses while a webview is focused no longer make it to the
main window's keyPressEvent() routine, so AnkiWebView now uses its
event filter to pass the key events to the main window
- move the shared key handling out of keyPressEvent into
globalKeyHandler()
- make sure all key handling routines return true or false to
indicate if an event was handled or not
- remove focus when esc hit in the main window, to retain old
behaviour of allowing esc to clear focus from the type answer box
2017-06-06 15:56:21 +10:00
Damien Elmes
c24f122d6e require qt 5.9 2017-06-06 14:33:53 +10:00
Damien Elmes
ca08b742fa Revert "work around https://bugreports.qt.io/browse/QTBUG-54755"
This reverts commit 0bd79abe11.
2017-06-05 16:52:22 +10:00
Damien Elmes
e6c25b90e9 Merge pull request #189 from lukecwilliams/master
Fix issue where null tag list crashes Mnemosyne import
2017-06-02 21:59:08 +10:00
Luke Williams
9e375f1c7b Fix issue where null tag list crashes Mnemosyne import 2017-05-30 17:38:39 -04:00
Damien Elmes
476aedbd6b fix issues with 'lots of decks' msg
https://anki.tenderapp.com/discussions/beta-testing/460-anki-210-alpha-13#comment_42641183
2017-05-28 11:13:16 +10:00