abdnh / anki-incontext

An Anki add-on that shows random example sentences each time you review a vocabulary card
https://ankiweb.net/shared/info/385420176
GNU General Public License v3.0
3 stars 1 forks source link

'Ui_Dialog' object has no attribute 'gridLayout' #13

Closed ghost closed 1 year ago

ghost commented 1 year ago
Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue to the add-on author.
Debug info:
Anki 2.1.55 (e3c3405f) Python 3.10.8 Qt 6.4.0 PyQt 6.4.0
Platform: Linux-5.15.79-1-lts-x86_64-with-glibc2.36
Flags: frz=False ao=True sv=3
Add-ons, last update check: 2022-11-17 22:04:20
Add-ons possibly involved: ⁨incontext⁩

Caught exception:
Traceback (most recent call last):
  File "/home/yaoberh/.local/share/Anki2/addons21/incontext/__init__.py", line 55, in open_dialog
    dialog = InContextDialog(mw, sentences_db)
  File "/home/yaoberh/.local/share/Anki2/addons21/incontext/incontext_dialog.py", line 221, in __init__
    self.setup_ui()
  File "/home/yaoberh/.local/share/Anki2/addons21/incontext/incontext_dialog.py", line 225, in setup_ui
    self.form.gridLayout.addWidget(self.wordlist_view, 4, 0)  # type: ignore[call-overload]
AttributeError: 'Ui_Dialog' object has no attribute 'gridLayout'
abdnh commented 1 year ago

Looks like you have outdated files in the forms subfolder.

Note that I recently removed generated form files from this repo (to keep things clean, as those files are generated from the files in the designer subfolder), so If you want to use the version on GitHub, you first have to generate the forms by running make. I've recently published the add-on to AnkiWeb, so I recommend getting it from there instead: https://ankiweb.net/shared/info/385420176

Before removing the existing version, be sure to back up your user_files folder and move it to the folder of the AnkiWeb add-on after installing it!

ghost commented 1 year ago

Working now! Thanks a lot.