Commit Graph

28 Commits

Author SHA1 Message Date
Damien Elmes
ebdd8dae4b tidy up unused imports 2019-03-04 17:25:19 +10:00
Damien Elmes
372d5ed6e8 update copyright and clarify licenses 2019-02-05 14:01:33 +10:00
Damien Elmes
bdaedb7898 onReset() already sets note; don't need to do it twice 2018-04-30 15:15:43 +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
797a7ea229 refactor editor focus handling
this fixes a bug where navigating to the next/previous card using
shortcut keys resulted in the first field being clobbered

- get rid of the stealFocus option in favour of explicitly passing
focusTo to setNote()
- setFields() is no longer responsible for setting focus
- add focusTo var to the browser so that the row changed hook can
restore focus when navigating to next/previous card
- fix the row changed hook being called twice
- the blur event now includes the field number instead of relying on the
 editor to have the correct currentField
- the current field is set to null on blur
- use deferred js and a callback rather than keeping track of when we
were loaded
- add shift+tab shortcut to go to previous field
2017-08-05 15:16:20 +10:00
Damien Elmes
17d68cc957 use a clearer name for fmtQA() 2017-03-14 15:48:40 +09:00
Henrik Enggaard Hansen
857733c8e9 Use the same formatting for the browser and card history 2017-03-13 15:52:27 +01:00
Glutanimate
d530d5fdef Remove temporary note when switching note model 2017-02-16 05:00:49 +01:00
Henrik Enggaard Hansen
86c332e064 Typographic changes in history string 2017-02-05 09:13:14 +01:00
Henrik Enggaard Hansen
ce8ae436ea Insert ellipsis in history string 2017-02-05 08:45:08 +01:00
David Bailey
620db69544 Fix bug caused when deleting a card just added and clicking History 2017-01-09 10:55:30 +00:00
David Bailey
4b83ba50f5 Show latest data under History in the Add dialog 2017-01-08 13:48:58 +00:00
Damien Elmes
8e71554ac4 saveNow() now requires a callback
the current code was freezing when clicking on 'cards' in the
browser - it looks like like the javascript callback was never
being called despite calling processEvents(). so we need to
refactor the code to call saveNow() with a callback that does the
subsequent processing.

a lot of the browser code was implicitly calling saveNow() via
beginReset(), so we've had to change all that code to save
immediately before it begins any processing. found a probable bug in
the process - it doesn't look like onRowChange() was saving before
overwriting the note, so theoretically edits could be lost if the
user switched to another card very quickly after typing something.

onSearch() has been split into a GUI-activated onSearchActivated()
that takes care of saving, and a lower level search() that refreshes
the current search. it keeps track of the last search via an instance
variable so that it refreshes properly if a user accidentally adds
some characters to their search without activating the search, then
does something like reverse the sort order.
2016-07-14 20:23:44 +10:00
Damien Elmes
a1caa93054 fix mem leaks in dialogs
- ensure we're cleaning them up after they're rejected
- run the garbage collector afterwards so the qwebengineprocess
  instances get cleaned up
2016-07-04 13:22:35 +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
Glutanimate
df4b74f7bb Preserve identical fields when switching note types 2016-04-10 13:11:25 +02:00
Damien Elmes
6f95527758 use the larger arrow only on windows, and in other screens 2015-09-28 23:09:30 +10:00
steveaw
e5bc1650f9 Add hooks for context menus 2013-07-16 17:42:50 +10:00
Damien Elmes
19a48fec6a Revert "remember tags when add cards window opened (#632)"
This reverts commit ddc85b3a39.
2013-05-30 10:55:39 +09:00
Damien Elmes
ddc85b3a39 remember tags when add cards window opened (#632) 2013-05-27 12:52:24 +09:00
Damien Elmes
46fea20985 shortcut key for history button 2013-05-23 14:44:00 +09:00
Damien Elmes
04b010a6d1 make sure we focus first field when adding next note (#605) 2013-05-22 12:54:29 +09:00
Damien Elmes
ebba215a9a cloze deletion tweaks (#601)
- allow creation of cloze deletion when note type not selected; warn with
tooltip. prevents selection from getting lost
- warn before adding cloze note type with no deletions
2013-05-17 15:57:22 +09:00
Damien Elmes
b2457811a2 optimize imports 2012-12-22 09:17:10 +09:00
Damien Elmes
b84681c2fe add cmd+w shortcut to add cards window & stats window 2012-12-22 09:11:29 +09:00
Damien Elmes
b5c6a77c9f don't restore tags from model 2012-12-22 08:29:16 +09:00
Damien Elmes
d477df8c28 merged libanki and ankiqt into single distro 2012-12-21 16:51:59 +09:00