Vilhelm-Ian / anki-search-inside-add-card

An add-on providing full-text-search and PDF reading functionality to Anki's Add card dialog
https://ankiweb.net/shared/info/1781298089
GNU Affero General Public License v3.0
13 stars 3 forks source link

Error when trying to edit an anki note when reading pdf #14

Open OuraN2O opened 7 months ago

OuraN2O commented 7 months ago

When my pdf was open I tried to edit an already made anki note but I had an error. image

Debug info :

Anki 24.04 (429bc9e1)  (ao)
Python 3.9.18 Qt 6.6.2 PyQt 6.6.1
Platform: Linux-6.8.2-arch2-1-x86_64-with-glibc2.39

Traceback (most recent call last):
  File "aqt.webview", line 50, in cmd
  File "aqt.webview", line 157, in _onCmd
  File "aqt.webview", line 680, in _onBridgeCmd
  File "aqt.hooks", line 5415, in call
  File "/home/admin/.local/share/Anki2/addons21/572933442/src/commandparsing.py", line 141, in expanded_on_bridge_cmd
    open_editor(mw, int(cmd[15:]))
  File "/home/admin/.local/share/Anki2/addons21/572933442/src/dialogs/editor.py", line 51, in open_editor
    dialog = EditDialog(mw, note)
  File "/home/admin/.local/share/Anki2/addons21/572933442/src/dialogs/editor.py", line 64, in __init
    self.form.setupUi(self)
  File "_aqt.forms.editcurrent_qt6", line 36, in setupUi
AttributeError: 'EditDialog' object has no attribute 'setCentralWidget'

I tried looking a bit into it but honestly I'm lost lol

(I'm sorry I'm reporting a lot of issues but this addon is the base of my work routine :sweat_smile: )

Vilhelm-Ian commented 7 months ago

@OuraN2O as you can see the code. This addon is written in a unique way and also the author himself said it's hard to mantain.

That's why I started working on an alternative that will have the same features. It's in my repo it's called incshelf. It's verry rudementary currently. But I think you will like it. Are you on windows or linux. Because if you are on windows I can send you an already build binary.

Also I will take a look at this issue eventually

OuraN2O commented 7 months ago

Oh okay that's cool ! I'm on linux but when you have something somewhat prepared for it I'd be glad to test it

Vilhelm-Ian commented 7 months ago

@OuraN2O I can give you a build for linux. But the appimage is 200 mb. If you are using arch I think I can share you a build that is small

OuraN2O commented 7 months ago

Yes I'm using arch, do you want my mail or something ?

abhishek7786 commented 3 weeks ago

@Vilhelm-Ian I'm getting the same error; Is it fixed now; or is there any quick fix which I can apply; Any help is appreciated

Also this occurs when Editing a card after searching in add window of Anki

image

Anki 24.06.3 (d678e393) (ao) Python 3.9.18 Qt 6.6.2 PyQt 6.6.1 Platform: macOS-14.1.1-arm64-arm-64bit

Traceback (most recent call last): File "aqt.webview", line 50, in cmd File "aqt.webview", line 160, in _onCmd File "aqt.webview", line 689, in _onBridgeCmd File "_aqt.hooks", line 5416, in call File "/Users/abhishekdwivedi/Library/Application Support/Anki2/addons21/572933442/src/command_parsing.py", line 141, in expanded_on_bridge_cmd open_editor(mw, int(cmd[15:])) File "/Users/abhishekdwivedi/Library/Application Support/Anki2/addons21/572933442/src/dialogs/editor.py", line 51, in open_editor dialog = EditDialog(mw, note) File "/Users/abhishekdwivedi/Library/Application Support/Anki2/addons21/572933442/src/dialogs/editor.py", line 64, in init self.form.setupUi(self) File "_aqt.forms.editcurrent_qt6", line 36, in setupUi AttributeError: 'EditDialog' object has no attribute 'setCentralWidget'

Vilhelm-Ian commented 3 weeks ago

sorry I have been busy. i will take a look at it.

Vilhelm-Ian commented 3 weeks ago

@OuraN2O @abhishek7786 I fixed it

Vilhelm-Ian commented 3 weeks ago

can you test the latest commit

OuraN2O commented 3 weeks ago

can you test the latest commit

Hey ! Thx for looking to it. I see that responsiveness of the editor dialog doesn't work (see my screenshot) image

abhishek7786 commented 3 weeks ago

Hi, Thanks @Vilhelm-Ian for the prompt reply. Tested new commit. Issue is fixed, Now I can search the card and edit it too.

( small pain point -> After clicking the edit icon When card gets open in browser window, card is very small size, makes editing card bit difficult, refer below for the detail)

As far as this issue is concerned it is fixed now.

image

curious58 commented 2 weeks ago

Hi!

I also have the same problem. I can't edit a note after searching in the search bar of the add-on. I get this error:

Anki 24.06.3 (d678e393) (ao) Python 3.9.18 Qt 6.6.2 PyQt 6.6.1 Platform: Windows-10-10.0.22631

Traceback (most recent call last): File "aqt.webview", line 50, in cmd File "aqt.webview", line 160, in _onCmd File "aqt.webview", line 689, in _onBridgeCmd File "_aqt.hooks", line 5416, in call File "C:\Users\shiel\AppData\Roaming\Anki2\addons21\572933442\src\command_parsing.py", line 141, in expanded_on_bridge_cmd open_editor(mw, int(cmd[15:])) File "C:\Users\shiel\AppData\Roaming\Anki2\addons21\572933442\src\dialogs\editor.py", line 51, in open_editor dialog = EditDialog(mw, note) File "C:\Users\shiel\AppData\Roaming\Anki2\addons21\572933442\src\dialogs\editor.py", line 64, in init self.form.setupUi(self) File "_aqt.forms.editcurrent_qt6", line 36, in setupUi AttributeError: 'EditDialog' object has no attribute 'setCentralWidget'

May I know how I can fix this? Thank you!

Vilhelm-Ian commented 2 weeks ago

@curious58 pull the latest commit from github. Or download it as a zip and put it in your anki addons folder

curious58 commented 2 weeks ago

I'm so sorry but I'm not familiar with doing this, which commit should I download? May I ask for a link?

Thank you!

OuraN2O commented 2 weeks ago

Hi, go on the addon page, then "Code" (the green button), then "Download zip". image When you have the zip, unzip it and copy paste the files in the addon folder (you can know where it by going in anki > tools > addon > click on the addon > view files)

curious58 commented 2 weeks ago

Problem fixed! Thank you so much!