Commit graph

100 commits

Author SHA1 Message Date
Damien Elmes
25789e14ef avoid adjusting position if selected row is visible
https://anki.tenderapp.com/discussions/beta-testing/1868-anki-2124-beta#comment_48227037
2020-04-11 15:54:52 +10:00
Damien Elmes
c3f149ab94 make sure preview window is closed when browser closed 2020-04-10 20:32:48 +10:00
Damien Elmes
6fa53fa734 fix preview closing
https://anki.tenderapp.com/discussions/beta-testing/1868-anki-2124-beta#comment_48228480
2020-04-08 16:21:20 +10:00
Arthur Milchior
d095b017e4 _basename to basename, since it's not private in use 2020-04-06 23:51:50 +02:00
Arthur Milchior
859178c113 _basename used where possible 2020-04-06 23:51:42 +02:00
Arthur Milchior
e6024d4d3d replace _path by path (because it's not private here) 2020-04-06 23:50:43 +02:00
Arthur Milchior
8962194dcb uses _path where possible 2020-04-06 23:50:37 +02:00
Damien Elmes
b5022ad354 store config in separate DB table
- mtime is tracked on each key individually, which will allow
merging of config changes when syncing in the future
- added col.(get|set|remove)_config()
- in order to support existing code that was mutating returned
values (eg col.conf["something"]["another"] = 5), the returned list/dict
will be automatically wrapped so that when the value is dropped, it
will save the mutated item back to the DB if it's changed. Code that
is fetching lists/dicts from the config like so:

col.conf["foo"]["bar"] = baz
col.setMod()

will continue to work in most case, but should be gradually updated to:

conf = col.get_config("foo")
conf["bar"] = baz
col.set_config("foo", conf)
2020-04-06 15:39:47 +10:00
Damien Elmes
ac54f85840 update tag handling
- tag list stored in a separate DB table
- non-wildcard searches now do full unicode case folding
(eg tag:masse matches 'Maße')
- wildcard matches do simple unicode case folding
- some functions haven't been updated yet, so ascii folding will
continue to be used in some operations
2020-04-03 19:34:46 +10:00
Damien Elmes
3f965f5534 use old name for preview dialog to avoid breaking add-ons 2020-04-03 09:00:18 +10:00
Damien Elmes
3959f7dcb8 render() conflicts with Qt method 2020-04-03 08:29:35 +10:00
Arthur Milchior
ef0cbb3a79 snake case 2020-04-02 17:44:06 +02:00
Arthur Milchior
2eed489792 Methods used by browser are not public
As suggested by Glutanimate on https://github.com/ankitects/anki/pull/532#discussion_r401254100
2020-04-02 17:44:06 +02:00
Arthur Milchior
d85c8288f6 remove the word preview from previewer variable
As suggested by glutanimate https://github.com/ankitects/anki/pull/532#discussion_r401255290
2020-04-02 17:44:06 +02:00
Arthur Milchior
7ce77e071d Class PreviewerBrowser
This let a previewer class which can be used to display a single card,
and a previewer for the browser
2020-04-02 17:44:06 +02:00
Arthur Milchior
7ea1ff840f move previewer to a different class.
This uses exactly the same code, with one exception. In the previewer
`self` became `self.parent` in order to have action on the
browser. And in the browser, some `self` become `self.previewer` to
access the previewer. (Some function having an action on the previewer
starting from the browser now are separated in two. One version in the
previewer doing the same thing. One version in the browser, calling
the version in the previewer if it exists.)

Preview dialog now takes a QWidget in general, not necesarrily a
Browser. The parameter is called parent
2020-04-02 17:44:06 +02:00
Damien Elmes
91c2e89360 ignore row change events that arrive after browser closed
https://anki.tenderapp.com/discussions/ankidesktop/40148-bug-when-suspending-cards
2020-04-02 19:44:51 +10:00
Damien Elmes
8d952570a8 left-align tags
https://anki.tenderapp.com/discussions/ankidesktop/40068-tags-column-in-browser-is-centered
2020-04-01 13:29:42 +10:00
Damien Elmes
78aad6b64b always position selection in center after search
https://anki.tenderapp.com/discussions/beta-testing/1888-retaining-position-when-searching
2020-04-01 11:01:20 +10:00
Arthur Milchior
015d07ec56 hook browser_header_will_show_context_menu 2020-03-27 23:06:22 +01:00
Hk-tang
f6d2c95888 Change not not to bool 2020-03-23 11:16:39 -06:00
Damien Elmes
28b0281972 allow customizing search order 2020-03-21 17:38:09 +10:00
Damien Elmes
6d7bf16b5a fix reversing sort order 2020-03-21 16:57:33 +10:00
Damien Elmes
eab7686d2f remove old finder code; add search hooks to browser & remove old one 2020-03-21 16:38:46 +10:00
Damien Elmes
67d1842691 enable sorting on the extra browser columns 2020-03-21 07:55:53 +10:00
Damien Elmes
cdb85ef72e disable word wrap in browser rows 2020-03-20 21:15:23 +10:00
Damien Elmes
f3296382ea ensure endReset() is called even if an exception is raised 2020-03-20 21:15:23 +10:00
Damien Elmes
c13056773b flush config on sort order change 2020-03-20 21:15:23 +10:00
Damien Elmes
a02c4ed994 drop the DB progress handler code
This code was an awful hack to provide some semblance of UI
responsiveness while executing DB statements on the main thread.
Instead, we can just run DB statements in a background thread now,
keeping the UI responsive.
2020-03-20 21:15:23 +10:00
Arthur Milchior
1993c0af70 Browser introduce method time_format
I expect to use this in my add-on 1243668133 (by monkey patching in
this case) where it would allow to show hours/minutes/seconds... in browser
2020-03-19 22:59:59 +01:00
Arthur Milchior
552c0cd8a8 adding missing constants in browser file 2020-03-17 06:32:46 +01:00
Damien Elmes
863e5f5e51 make sure audio queue is cleared when transitioning between cards
https://anki.tenderapp.com/discussions/beta-testing/1846-anki-2122-beta#comment_48150139
2020-03-14 20:04:40 +10:00
Damien Elmes
1161ac1962 fix play icons not appearing in browser preview when autoplay off 2020-03-14 19:29:11 +10:00
Glutanimate
fce24c6eea Type-annotate editor.card 2020-03-04 17:41:26 +01:00
Arthur Milchior
57efc22d99 browser_did_init 2020-03-01 11:39:41 +01:00
Damien Elmes
93c2e04267 FString -> TR 2020-02-27 12:25:19 +10:00
Damien Elmes
94ba217c25 formatting fixes 2020-02-25 17:56:46 +10:00
Damien Elmes
5ca00fc92d interrupt current audio when autoplay off 2020-02-25 17:49:06 +10:00
Damien Elmes
59328d9ade tweak rounding
- avoid rounding minutes
- round the seconds taken in the card info screen
- provide different precise and imprecise modes, since we need
to display seconds to multiple decimals in some areas
2020-02-25 17:29:06 +10:00
Damien Elmes
fa41f24bf6 fix display of 1+ day intervals in review history
https://anki.tenderapp.com/discussions/ankidesktop/39189-interval-field-of-card-info-display-wrong-unit
2020-02-25 17:00:02 +10:00
Damien Elmes
43dae5c90e Merge pull request #456 from Arthur-Milchior/noDefaultDeckInBrowser
No default deck in browser
2020-02-24 19:35:49 +10:00
Damien Elmes
70ae99778f remove old fmtTimeSpan() and associated strings 2020-02-23 18:47:16 +10:00
Damien Elmes
0d1a30c6d8 rework Fluent handling
- all .ftl files for a language are concatenated into a single file
at build time
- all languages are included in the binary
- external ftl files placed in the ftl folder can override the
built-in definitions
- constants are automatically generated for each string key
- dropped the separate StringsGroup enum
2020-02-23 13:22:50 +10:00
Arthur Milchior
adfbd0d70f should(default)deckbedisplayed in snake case 2020-02-22 04:08:01 -08:00
Arthur Milchior
6a50730f0d Remove options for all/allNames
Instead, we always see default deck if it has a child
As indicated in https://github.com/ankitects/anki/pull/452
2020-02-22 04:03:42 -08:00
Damien Elmes
8afaaf9c70 simplify interval display in review log 2020-02-21 15:29:38 +10:00
Damien Elmes
74bff450e2 add non-abbreviated timespan translation; update existing short=True calls
- drop the '5m3s' special casing done in the card stats screen, and
just use decimals
- change alignment of the review log so that the non-abbreviated
spans are easier to read
2020-02-21 15:29:38 +10:00
Damien Elmes
e98e85a0b8 Revert "Merge pull request #452 from Arthur-Milchior/noDefaultDeckInBrowser"
This reverts commit 56d908cc28, reversing
changes made to c123b5bf95.

More discussion required on https://github.com/ankitects/anki/pull/452
2020-02-21 12:27:39 +10:00
Arthur Milchior
59587f1bb2 no default in left-side browser 2020-02-19 02:42:04 -08:00
Arthur Milchior
541e586db1 Replace g[idx] by variable name 2020-02-19 02:41:57 -08:00