Commit Graph

291 Commits

Author SHA1 Message Date
Damien Elmes
644670d0d6 return a localized error for all error kinds
some errors are not yet localized, but now the Python code
doesn't need to think about which property to use
2020-02-27 10:46:24 +10:00
Damien Elmes
cfe4af81cf add missing short argument to legacy fmtTimeSpan() 2020-02-26 20:36:59 +10:00
Damien Elmes
a634188ec5 fix dark mode target Qt version 2020-02-26 16:53:35 +10:00
Damien Elmes
65ec9d190d formatting fixes 2020-02-25 17:56:46 +10:00
Damien Elmes
db69f84c0a interrupt current audio when autoplay off 2020-02-25 17:49:06 +10:00
Damien Elmes
f71484a444 ensure user doesn't try to export into data folder
https://anki.tenderapp.com/discussions/ankidesktop/39008-export-path-accidentally-set-to-collectionmedia-possible-damage
2020-02-25 17:38:49 +10:00
Damien Elmes
06dee0ef08 formatting fix 2020-02-25 17:29:10 +10:00
Damien Elmes
fbbbbd6a7d 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
fd835d9b64 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
32b38bf26d ensure Anki starts on Windows systems that don't have TTS installed 2020-02-25 16:25:17 +10:00
Damien Elmes
621774559f don't allow UI scale < 100%
Both Windows and Linux installs fail to render properly when the scale
is below 100%:

https://anki.tenderapp.com/discussions/ankidesktop/38909-user-interface-size

Retina Macs do render properly, but they tend to display at appropriate
size out of the box anyway.
2020-02-25 16:20:14 +10:00
Damien Elmes
0fae85d2b4 don't pick up system dark theme in -alternate Mac build
The older Qt doesn't support it properly
2020-02-25 15:46:39 +10:00
Glutanimate
8454e27efb Use a consistent function signature across load and save hooks 2020-02-24 15:47:48 +01:00
Glutanimate
7cc9311b79 Add deck_conf_did_setup_ui_form hook
Called earlier than deck_conf_will_show, allowing add-on authors
to perform UI modifications before the deck config is loaded.
2020-02-24 15:29:23 +01:00
Glutanimate
335047187a Add hooks for extending the deck options dialog
Introduces three new hooks:

* deck_conf_will_show: Allows adding or modifying widgets
* deck_conf_did_load_config: Allows add-on widgets to read from config
* deck_conf_will_save_config: Allows add-on widgets to write to config
2020-02-24 13:42:30 +01:00
Damien Elmes
2f4ee0e523
Merge pull request #456 from Arthur-Milchior/noDefaultDeckInBrowser
No default deck in browser
2020-02-24 19:35:49 +10:00
Damien Elmes
b9280ca31e enable v2 apkg export 2020-02-24 18:54:55 +10:00
Damien Elmes
1afac2492b fix tr() 2020-02-24 18:37:02 +10:00
Damien Elmes
0a618c40ad add Tobias to contributors
if anyone else is reading this and thinks they should be on the list,
please let me know!
2020-02-24 18:36:37 +10:00
Damien Elmes
e73157285e remove old fmtTimeSpan() and associated strings 2020-02-23 18:47:16 +10:00
Damien Elmes
703b9da09c move the big error message into FTL
this works around the issue Pontoon has with saving translations with
trailing newlines, and makes it easier for translators to update in
the future, as the errors are now using markdown
2020-02-23 18:01:34 +10:00
Damien Elmes
0e931808c9 translations no longer require an open collection 2020-02-23 14:57:02 +10:00
Damien Elmes
4430c67069 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
bb86c9dbd6 should(default)deckbedisplayed in snake case 2020-02-22 04:08:01 -08:00
Arthur Milchior
927749d7a6 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
Arthur Milchior
1126ae293e forceDefault to force_default 2020-02-22 04:01:42 -08:00
Damien Elmes
42939fe0e4 remove unused import 2020-02-21 19:58:54 +10:00
Damien Elmes
49fe080636 add studied_today(), move to statistics.ftl 2020-02-21 18:01:15 +10:00
Damien Elmes
f4330cd213 simplify interval display in review log 2020-02-21 15:29:38 +10:00
Damien Elmes
2fc15d0d3a 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
598226a5c0 possible fix for race conditions in the sound code
https://anki.tenderapp.com/discussions/ankidesktop/39030-erro-ao-adicionar-arquivo-de-udio

the lock should at least ensure _process doesn't disappear in the
middle of our logic, and the longer wait should reduce the chances
of .stop() timing out and allowing multiple audio files to play

Not very happy with the current approach, as in the timeout case
you have multiple threads competing to access the same data
2020-02-21 15:14:09 +10:00
Damien Elmes
abe9f50c14 Revert "Merge pull request #452 from Arthur-Milchior/noDefaultDeckInBrowser"
This reverts commit b93d30795c, reversing
changes made to e16d6055c1.

More discussion required on https://github.com/ankitects/anki/pull/452
2020-02-21 12:27:39 +10:00
Damien Elmes
b3585502cd
Merge pull request #448 from glutanimate/top_toolbar_links_hook
Add a hook for adding links to the top toolbar
2020-02-21 12:18:25 +10:00
Damien Elmes
b93d30795c
Merge pull request #452 from Arthur-Milchior/noDefaultDeckInBrowser
No default deck in browser
2020-02-21 12:10:36 +10:00
Glutanimate
496548d886 Refactor ToolbarLink dataclass into create_link arguments
ToolbarLink was more of a vestigial left-over from an interim
implementation. This change simplifies link addition and brings
it closer in line with adding buttons in the editor screen
2020-02-20 18:22:31 +01:00
Glutanimate
075a2792f5 Restore gui_hooks changes 2020-02-20 17:05:27 +01:00
Glutanimate
de333cd503 Add ids to all link elements 2020-02-20 16:34:02 +01:00
Glutanimate
a7d56561ba Rename CenterLink to more generic ToolbarLink and add inline docs 2020-02-20 16:30:22 +01:00
Glutanimate
dfefd67508 Update 'top_toolbar_did_init_links' hook 2020-02-20 16:23:33 +01:00
Glutanimate
e13fee5aa3 Refactor center link creation and link handler registration
Uses a CenterLink dataclass to describe individual links, and transforms
them into HTML using create_link, which may also be used by add-ons.
2020-02-20 16:15:50 +01:00
Glutanimate
33f7d7ed50 Merge branch 'master' into top_toolbar_links_hook 2020-02-20 15:17:48 +01:00
Arthur Milchior
0f18e9ee4b no default in left-side browser 2020-02-19 02:42:04 -08:00
Arthur Milchior
bdcd111d72 Replace g[idx] by variable name 2020-02-19 02:41:57 -08:00
Arthur Milchior
a0bd232cfd remove default deck from filter list 2020-02-19 02:41:56 -08:00
Damien Elmes
d0ec26709b pin fcntl, which went missing on Linux in a recent update 2020-02-19 19:59:31 +10:00
Arthur Milchior
bdf10d9649 method shouldBeDisplayed 2020-02-19 01:56:33 -08:00
BlueGreenMagick
8318cb8e0c
fix typo
<font> tag was closed by </span>
2020-02-19 17:46:12 +09:00
Damien Elmes
e0951e4cfe add 'new #' prefix to new cards in the due column 2020-02-18 11:16:15 +10:00
Damien Elmes
8c80e46d80 fix card info screen 2020-02-18 10:59:24 +10:00
Damien Elmes
0309113b0a fix legacy filter return values being ignored 2020-02-18 09:12:16 +10:00