searene / Anki-Addons

This repository is used to store all kinds of anki addons that I created
MIT License
24 stars 3 forks source link

PR: Image Resizer 2.1, fixed drag & drop #18

Closed lgaborini closed 6 years ago

lgaborini commented 6 years ago

Now drag & dropped images (local files) are correctly resized.

searene commented 6 years ago

Thanks for the fast fix! I'll upload it to AnkiWeb later.

searene commented 6 years ago

Uploaded to AnkiWeb: https://ankiweb.net/shared/info/1214357311

lgaborini commented 6 years ago

Great! However, I am no longer able to open the configuration window using the uploaded add-on.
The ID must be also added to the setConfigAction method:

mw.addonManager.setConfigAction('1214357311', self._settings)
searene commented 6 years ago

That's weird, I have no problem opening the config window. And I just checked the Anki2.1 source code, the first parameter of setConfigAction was just a key to the addon settings, so it didn't matter whether it was ImageResizer or 1214357311.

I'm using Linux, which operating system are you using? Did changing the first parameter to the addon ID work for you?

lgaborini commented 6 years ago

I'm on Windows, it works with that fix!

I re-downloaded the add-on from the website, deleting and recreating the settings. The first parameter matches the directory name in the add-on directory (all add-ons are named like their IDs).

I guess that the bundled Python imports modules from the add-on directory, by using the IDs as aliases.

searene commented 6 years ago

Hi lgaborini, I've changed the first parameter to the addon id and updated it on AnkiWeb, could you have a check and make sure it works on Windows? Thanks!

lgaborini commented 6 years ago

I confirm it works! Thank you!

searene commented 6 years ago

That's great, thanks for making this addon better!

lgaborini commented 6 years ago

Thanks for making this addon! 😄