-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Steps towards Compatibility with Anki 2.1 #72
Conversation
…ge structure Some files were importing Chinese_support, but not actually using it. Remove those imports.
Some file search paths were dependent on the original addon directory structure. Make those relative by using the __name__.
Anki no longer builds its UI the same way, there is no rebuildAddonsMenu step that could be wrapped. Need to figure out some other way to implement the menu. Maybe a hook in the config editor?
So if I'm not mistaken the only remaining pieces which are breaking the colored editing functionality is cjklib? What is causing the submenu to not showup? |
No, I don't think there's any issue with cjklib. I have been using this branch for the past few months, and essentially it works. It's just not very user-friendly due to the missing features (like convenient configuration, which is kind of important). There are no colors in the editor because they require CSS to be injected, but Anki 2.1 has revamped their editor code, so the old CSS injection strategy no longer works. It should be possible to adapt it, though. The submenu doesn't show up because there no longer is a simple addons menu to hook into, so I commented that code out. This functionality should probably be provided by the "config" button of the new addon manager. Currently that just opens an editor for the raw JSON. I might have the time to make the necessary changes sometime next week, but no promises. If anyone else wants to try their hand, the code that needs replacing was commented out in a6df731 and 167c118 |
I'm confused. Can someone please help me understand what's missing for this addon to work with Anki 2.1? My previous impression was that it is cjklib, which I have started to port, but if this is not the case, then I might prefer to work on something else, eg. polishing other parts of this addon. |
@muellert You might be better off looking at https://github.com/luoliyan/chinese-support-redux, since the port seems to be significantly more complete than mine. It's probably better if I close this PR, since it's unlikely that I'll ever complete it at this point. |
The changes in this PR are not backwards-compatible, so it shouldn't be merged. Anki 2.1 changes a bunch of APIs and uses Python 3/Qt5 instead of Python 2/Qt4, so it would have been difficult not to break compatibility.
Things that work without uncaught exceptions:
Things that are currently broken:
In both cases, the internal interfaces used to implement these features were removed from Anki, apparently in favor of a solution based on HTML/JavaScript. It will be necessary either to hook into their replacements, or to reimplement them.
Although not yet complete, it works well enough that I'll be using it from now on. Hopefully I'll find time to iron out those missing features.