Bug 418901 - "Ten brushes" script button breaks toolbar
Summary: "Ten brushes" script button breaks toolbar
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Shortcuts and Canvas Input Settings (other bugs)
Version First Reported In: 4.2.8
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-15 22:19 UTC by KDE Neon user
Modified: 2020-03-23 13:31 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description KDE Neon user 2020-03-15 22:19:17 UTC
Case A
1. Tools > Scripts > Ten Brushes > Right-click > Add to Toolbar > Brushes and Stuff
2. Add "Ten brushes"
3. Restart Krita

Result: all custom actions disappear after restarting Krita.


Case B
1. Configure Toolbar > Brushes and Stuff
2. Add "Ten brushes"
3. Restart Krita

Result: it disappears after restarting Krita.


Windows 10

Related: #365222
Comment 1 Ahab Greybeard 2020-03-16 16:26:38 UTC
For the 4.2.9-beta (9th March) appimage, I can confirm this for Case A and Case B.

For Case A, after Step 2. the Ten Brushes icon appears on the Toolbar and it works.
At this stage, Configure Toolbar -> Brushes and Stuff does not show Ten Brushes as being on the Toolbar.
After Step 3. All custom actions have disappeared from the Toolbar and Configure Toolbar -> Brushes and Stuff shows that Ten Brushes is on the Toolbar, even though it isn't.

For Case B, Configure Toolbar -> Brushes and Stuff also shows that Ten Brushes is on the Toolbar when it isn't, after a restart.

I had identical results when adding Document Tools to the Toolbar.

More:
When I tried this with Ten Scripts in Case A, there was an identical situation and furthermore, all scripts vanished from the Tools -> Scripts listing until after a restart.
I was not able to reproduce this afer a restart,

When I tried adding Filter Manager in Case A, **-the entire Brushes and Stuff section of the toolbar disappeared and did not come back after a restart-**. In this condition, Configure Toolbar -> Brushes and Stuff showed that all the icons/actions were there, even though they were not.
I recovered from this by restoring a recent backup of kritarc.
However, I was not able to reproduce this when I tried it again, a few times.
Comment 2 Halla Rempt 2020-03-17 08:52:03 UTC
Yes, every action that's created from a python script cannot be added to the toolbar because the toolbars are created before the scripts are loaded. This is the same problem that we used to have with actions created in the tools; the tools would only be loaded when a document was created, which is after the toolbars are created.
Comment 3 Halla Rempt 2020-03-17 09:41:27 UTC
Git commit 73c25f7fa908f0cdb97c5da3e5cc9f84a1b993c1 by Boudewijn Rempt.
Committed on 17/03/2020 at 09:40.
Pushed by rempt into branch 'master'.

Load python plugin actions before the xmlgui is constructed

M  +2    -2    libs/libkis/Krita.cpp
M  +2    -1    libs/libkis/Krita.h
M  +3    -3    libs/libkis/Notifier.cpp
M  +4    -4    libs/libkis/Notifier.h
M  +3    -0    libs/ui/KisMainWindow.cpp
M  +5    -1    libs/ui/KisPart.cpp
M  +8    -1    libs/ui/KisPart.h
M  +13   -0    plugins/python/tenbrushes/tenbrushes.action

https://invent.kde.org/kde/krita/commit/73c25f7fa908f0cdb97c5da3e5cc9f84a1b993c1
Comment 4 Halla Rempt 2020-03-23 13:31:57 UTC
Git commit 27649591d23fca1da3a9d90bac4dcbd3aab28b4a by Boudewijn Rempt.
Committed on 23/03/2020 at 13:03.
Pushed by rempt into branch 'krita/4.2'.

Load python plugin actions before the xmlgui is constructed
(cherry picked from commit 73c25f7fa908f0cdb97c5da3e5cc9f84a1b993c1)

M  +2    -2    libs/libkis/Krita.cpp
M  +2    -1    libs/libkis/Krita.h
M  +3    -3    libs/libkis/Notifier.cpp
M  +4    -4    libs/libkis/Notifier.h
M  +3    -0    libs/ui/KisMainWindow.cpp
M  +5    -1    libs/ui/KisPart.cpp
M  +8    -1    libs/ui/KisPart.h
M  +13   -0    plugins/python/tenbrushes/tenbrushes.action

https://invent.kde.org/kde/krita/commit/27649591d23fca1da3a9d90bac4dcbd3aab28b4a