Bug 429265 - Import Python Plugin doesn't activate the plugin
Summary: Import Python Plugin doesn't activate the plugin
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Scripting (show other bugs)
Version: 4.4.1
Platform: Mint (Ubuntu based) Linux
: NOR wishlist
Target Milestone: ---
Assignee: Rebecca Breu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-17 21:22 UTC by Tiar
Modified: 2020-11-24 18:35 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tiar 2020-11-17 21:22:02 UTC
SUMMARY
If the user uses Import Python Plugin plugin, they need to first import it, then  restart Krita, then enable the plugin, then restart Krita, then use the plugin.
It would be better if the importer enabled plugin just like the Script Starter does.
It would be best if there was a dialog asking the user if they want to enable the plugin or not, with "yes"/checked checkbox as default choice (since usually you import a plugin to use it...).

STEPS TO REPRODUCE
1. Use Import Python Plugin to import a plugin.
2. Restart Krita.

OBSERVED RESULT
The plugin is disabled.

EXPECTED RESULT
There was a dialog asking me if I want to enable the plugin, and if I selected yes, the plugin is enabled next time I open Krita.


SOFTWARE/OS VERSIONS
Krita

 Version: 4.4.1
 Languages: en_US, en, en_US, en, en_US, en, pl_PL, pl, pl_PL, pl
 Hidpi: true

Qt

  Version (compiled): 5.12.9
  Version (loaded): 5.12.9
Comment 1 Halla Rempt 2020-11-18 07:21:13 UTC
This isn't going to easy at all...
Comment 2 Tiar 2020-11-18 13:56:17 UTC
Nope, it just needs an entry in `kritarc`, just like Script Starter does. See
plugins/python/krita_script_starter/krita_script_starter.py, line 290.
The only issue would be to find the exact name of the plugin to enable, but it shouldn't be that difficult either.
Comment 3 Halla Rempt 2020-11-18 14:01:03 UTC
And a restart of Krita, I thought you wanted to have the plugin activated on import, instead of just enabled.
Comment 4 Tiar 2020-11-18 16:55:27 UTC
Well, right now it's two restarts (import, restart, enable, restart), automatic enabling will make it into one, so already an improvement :)
Comment 5 Bug Janitor Service 2020-11-24 17:40:10 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/600
Comment 6 Rebecca Breu 2020-11-24 18:35:11 UTC
Git commit 3d010f44a1686d2e1bf350903345b0d9135032f2 by Rebecca Breu.
Committed on 24/11/2020 at 17:31.
Pushed by rempt into branch 'master'.

Let users choose to enable imported plugins

The final MessageBox informing the user about the successfully imported plugins now lets the user choose to enable them immediately. The user still needs to restart Krita, but at least now you only need to restart once, and you don't have to search through the Plugin Manager yourself.

M  +21   -11   plugins/python/plugin_importer/plugin_importer_extension.py

https://invent.kde.org/graphics/krita/commit/3d010f44a1686d2e1bf350903345b0d9135032f2