After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 731279 - Tool Preset Editor not working correctly
Tool Preset Editor not working correctly
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
git master
Other All
: High major
: 2.10
Assigned To: GIMP Bugs
GIMP Bugs
: 732320 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-06-05 16:59 UTC by jose americo gobbo
Modified: 2016-11-07 12:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Analysis of flows to edit and create new presets (4.02 KB, text/plain)
2015-08-29 02:45 UTC, jose americo gobbo
Details
my dialogs with the commit 3d1c564... (125.56 KB, image/png)
2016-10-13 00:01 UTC, jose americo gobbo
Details

Description jose americo gobbo 2014-06-05 16:59:15 UTC
In the current Gimp 2.8.10 and Gimp 2.9 devel are present some problems with the creation and editing workflow of Tool Presets. I've a short description of these instances and where aren't working correctly or in a predictable way.

---
Preset creation and interactions instances with the presets and Tool Preset Editor
We've three workflow or ways to build the presets:
1. From Tool Options Menu;
2. From the bottom buttons on Tool Options tab [save a preset, restore a preset, delete a preset];
3. From Tool Presets tab (list) > directly from the list to edit a preset or with the bottom buttons on the tab [edit, new, delete].

--
Describing the incoherences and problems with Presets Instances
1. From Tool Options Menu
Edit Tool Preset > Is not possible to edit a preset correctly because the instance 'Edit Tool Preset' don't restoring the values of the preset to edit on tool options instance.
2. From bottom buttons on Tool Options tab > works fine.
3. From Tool Presets tab (list) > is not possible to create any new preset with the current parameters on the Tool Options tab, because when we create a new tool preset or edit a preset the parameter isn't aligned with tool options or with a tool preset present on list.

---
Tool Preset Editor Problems
I've tested all checks of 'Apply stored X' and don't are working Brush, Dynamics and Pattern. When you check, for example, 'Apply stored brush' and successively unchecked the apply the original brush is always present in the tool options parameters. The same thing is succeeding to Dynamics and Pattens. Just to FG/BG, Gradient and Palette works fine.

---
Global problems
The workflow to create a tool preset needs to be consistent in all instances... for example, if you edit from the Tool Presets tab... it needs to be reloaded the original parameters on the tool options and any variation on these parameters need to be save after the save button presents in this tab.
Currently the any way to save a tool preset is to use the instances present on the Tool Options (menu and bottom buttons).
To edit a tool preset is necessary first to reload the preset, after change the current parameters on tool options and successively to save selecting the same preset using the Save Preset voice on the Tool Options menu.

---
Suggestion
Always that we are working around the presets (new and edit) in the save instance all tool options parameters are reloaded again on the preset. Is also important that all checks "Apply stored X" are working correctly too.
Comment 1 Max Mustermann 2014-06-28 08:40:50 UTC
Which presets do you mean? Those that are shipped with GIMP or presets you created on your own?
Comment 2 jose americo gobbo 2014-07-09 21:05:40 UTC
The preset that I've created... the behavior don't have relation with privileges (write-read) because if you change the original gimp presets the behavior that I've described is the same.
Comment 3 Michael Schumacher 2014-09-24 07:34:21 UTC
I can't reproduce this - all of the settings restore or don't according to the options set when saving the preset, and also those options themselves - a second possible reading of this bug, I think - are stored correctly, too.

2.8.14 on Windows.
Comment 4 jose americo gobbo 2015-02-13 14:50:58 UTC
Preset created, restored, edited directly from the Tool menu Options> works fine.
The same preset created in the tool options menu when I recover through the list of new presets, is also usually recovered.

If the preset editor, the new tab, turn off the color FG / BG ... the preset is saved and can not remember the original color, which is correct.

If I have this preset and again I turn on the color ... for example, even changing the color of the FG / BG in the Tool Options, it does not save the new set of colors, but simply plug the previous set ... that is ... there is a single how to bring the parameters and through and only that everything starts and edited via the Tool Options menu.

The parameters of the Tool Options and Tool Presets Editor are not aligned, if I try once created the preset modify it interacting from the Tool Presets Editor, the configuration of the current parameters of the Tool Options are not considered.

The last test I did was done in version 2.8.14 on Linux / Gnome Ubuntu 14:04.
Comment 5 Joao S. O. Bueno 2015-02-13 15:28:50 UTC
One of the main problems there seems to be that the preset editor does not show the values actually stored for the preset.

I can confirm this is a show-stopper for nice workflows using presets 

Maybe we should unfold this bug report in smaller issues so that they can be better understood and acted upon.  (if there actually is buggy behavior on what is saved restored, that fix can go in 2.8 - if it is only apparently buggy due to the actually saved values not been shown, just changes for 2.10 onwards should apply)
Comment 6 Joao S. O. Bueno 2015-02-13 15:51:37 UTC
Americo just confirmed with me that some erratic behavior on what was saved/restored is ok in 2.8.14  -- so what we are missing here is better control of the actual presets contents.


So, the main point here is "improve tool presets workflow": 
1 - it is currently very hard, and counter productive to know which
values are actually saved to a preset - and impossible to actually modify them
without creating a new preset. Quoting and rephrasing the summary: 

"""
if you edit [the preset] from the Tool Presets editor... it needs to [reload] the original parameters on the tool options and any [modification] on these parameters need to be [saved] after the save button [is clicked] in this tab.

"""
Comment 7 jose americo gobbo 2015-02-13 16:07:00 UTC
For me the major problem is: if you create a new preset from the "new" button in the Tool Presets (list) Tab > Tool Preset Editor Tab, nothing works - the preset does not save the current selected tool options instances.

The unique way to create and editing presets is trough the Tool Options Menu... in another words... works only the older Gimp 2.6 workflow.
Comment 8 jose americo gobbo 2015-02-13 16:14:34 UTC
Addendo: the workflow Tool Presets (lis) Tab > Tool Preset Editor Tab > Modify the parameters on Tool Options > Save Preset, don't works because the parameters are not updated. The parameters recorded are the same of the last preset reloaded from the list.
Comment 9 jose americo gobbo 2015-02-13 16:19:16 UTC
... > Save Preset (always from Tool Preset Editor Tab).
Comment 10 jose americo gobbo 2015-04-01 21:17:33 UTC
Again I've controlled the Preset instances on GIMP Git Master commit 7f67c43.

===
A- From TOOL OPTIONS tab instances
+ Create a new preset [= Works =]:
1- Tool Options Menu > 2- Save Tool Preset > 3- New Preset Tool > 4- to Preset Editor tab, where I can apply all applies and change the preset name > 5- save [button].

+ Edit a preset:
Process 1 [= Don't Works =]
1- Tool Options Menu > 2- Edit Tool Preset > 3- Preset > 4- change the instances of preset > 5- save it on Tool Preset Editor [save button].

Process 2 [= Works =]
1- Tool Options Menu > 2- Edit Tool Preset > 3- Preset > 4- change the instances of preset > 5- again Tool Preset Menu > 5- Save Tool Preset and to choose the same Preset.

===
B- From the TOOL PRESETS List tab instances
--
Create a new Tool Preset
Process 1 [= Don't works =]:
1- Create a New Tool Preset [button] > 2- Focus on Tool Preset Editor > 3- Change the parameters of the tool > 4- click on Save button of Tool Preset Editor.

Process 2 [= Works =]:
1- change or setting the parameter of a tool that I need of a preset > 2- Tool Preset tab [list] > 3- click on 'Create a new tool preset' button > 4- focus on Tool Preset Editor tab > -5 apply the applies and to get a name > 6- save the preset with save button

Note: if you change something after that you've clicked in the step 3- nothing that you've modified will be recorded on the preset... the sequence is without rethinks. To modify it you need turn again the step 1-.

--
Edit a preset [button]
Process 1 [= Works =]:
1- click a 'preset' of the list > 2- change the parameters on the tool options or other tabs > 3- click on 'Edit this tool preset' button > 4- focus on 'Tool Preset Editor' > 5- change the applies, if is necessary > 6- save the preset with the 'save' button.

Process 2 [= Don't Works =]:
1- click a 'preset' of the list > 2- click on 'Edit this tool preset' button > 3- focus on Tool Preset Editor > 4- change the parameters on the tool options or other tabs > 5- change the applies, if is necessary, on the Tool Preset Editor tab > 6- Save the preset with 'save' button on the Tool Preset Editor.

---
The bug on the workflow is yet present.
The main problem of the 'save button' on Tool Preset Editor is that it saves only the data before you using the NEW/EDIT instances on Tool Options or the buttons on Tool Presets tab [list]... this imply that some rethinks and some flows are not possible... and it causes an inconsistence on the preset workflow.
Comment 11 jose americo gobbo 2015-08-29 02:45:02 UTC
Created attachment 310230 [details]
Analysis of flows to edit and create new presets

I think that this document could be useful to understand better this bug and where it appears.
Comment 12 jose americo gobbo 2015-08-29 03:36:07 UTC
Comment on attachment 310230 [details]
Analysis of flows to edit and create new presets

>I've analyzed the natural possibilities of combination to resolve the presets.
>
>CREATE NEW PRESET FLOWS
>The flows that is working are: A1, B1, B2.
>The flows that is not working are: A2, B2, B3.

The flows that is not working are: A2, B3.
Comment 13 jose americo gobbo 2015-08-31 01:38:14 UTC
In short and alternatives

Main Problems of Preset Widgets on 2.8+ and 2.9+
---

After that I've made all flow tests, some are sincerely a bit bizarre (I made only to understand where some problems are born :) The brief of all these tests perhaps could have these contexts:
Creating a new preset with new widgets -- The new widget don't are working as the user expects... see Flow A2 (to create a new preset on the Tool Presets widget (list) we have a contextual menu and optional buttons). The unique flow that I've found OK, but unusual is the Flow A1. We need first change the parameters on the Tool Options and after to click at New Preset on the Tool Presets widget.
Editing a new preset with new widgets -- The new widget don't are working with the user expects... see Flow C4. The flows that are OK are only C1 and C2... but I've used a mix of the old 2.6+ solution with a new 2.8 widgets, see C1 and C2 and all two are a bit unusuals.
For me the steps to create and editing presets need an another workflow, more clean and predictable.

I am not a developer, but I have thought some improvements and/or alternatives:

---
Alternative 1
- On Tool Presets widget (list) when I'm creating a new or editing a preset, after the choice, the focus must be on Tool Options tab and not on Tool Preset Editor widget.
- On the Tool Options, we need a label of to indicate the Preset the we are creating or editing. If you are editing a existent preset this label could indicate, with a cursive or another tip when I've changed something on.
- Tool Options buttons only with 'Save'* button and Reset Default values button. The 'Save'* button, on Tool Options widget, is for me an previous step to send the data do Tool Preset Editor widget (applies)... and is more correct to change the name and the icon to something more equivalent to 'Send To...' concept.
- Tool Options Menu, up right side '>'... perhaps the only change is to change the name of the 'Save Preset...' voice to Send 'To Preset Editor' widget.
- The 'Save' button of Tool Preset Editor must align again the data of tool options.

---
Radical Alternative - Downgrade partial to 2.6+.
- To cut the New and Edit Preset of Tool Presets widget (list) on the contextual menu and on the buttons (bottom);
- To change the concept of 'Save'* button on Tool Options Menu and the buttons below (optional) to "Send To..." Tool Preset Editor widget;
- Modify the Tool Preset editor from tab to a simple popup... in this way this widget appears only with is necessary... and is another way to avoid many user workflow mistakes.
Comment 14 Michael Schumacher 2015-08-31 08:42:01 UTC
I thought we had arrived at the following on IRC:

- the only way to save the Tool Options dialog values to a tool preset is to go through the menu or the buttons in the Tool Options dialog

- the Tool Presets dialog can be used to create, rename or delete tool presets, and edit them (by opening the Tool Presets Editor dialog)

- the Tool Presets Editor dialog allows to set various options, for example the preset name and whether colors, brush, pattern, ... of the preset are to be applied when loading the preset. It does not allow to store any current Tool Options settings, even if the Save button there is used


Or, in short: the Save button in the Tool Presets Editor dialog doesn't do what one might expect.
Comment 15 jose americo gobbo 2015-08-31 13:51:36 UTC
(In reply to Michael Schumacher from comment #14)
> I thought we had arrived at the following on IRC:
> 
> - the only way to save the Tool Options dialog values to a tool preset is to
> go through the menu or the buttons in the Tool Options dialog
> 
> - the Tool Presets dialog can be used to create, rename or delete tool
> presets, and edit them (by opening the Tool Presets Editor dialog)
>
> - the Tool Presets Editor dialog allows to set various options, for example
> the preset name and whether colors, brush, pattern, ... of the preset are to
> be applied when loading the preset. It does not allow to store any current
> Tool Options settings, even if the Save button there is used.
> 
> Or, in short: the Save button in the Tool Presets Editor dialog doesn't do
> what one might expect.

Correct, thanks!
Comment 16 Michael Natterer 2015-10-14 21:08:40 UTC
This (doesn't quite) fix one of the problems mentioned here. Also, this
is not an enhancement, the entire tool preset stuff is totally broken
in various ways...

commit 93fdaa059709e6314adf3d6aaa8e7622ac3913f3
Author: Michael Natterer <mitch@gimp.org>
Date:   Wed Oct 14 23:02:07 2015 +0200

    Bug 731279 - Tool Preset Editor not working correctly
    
    This (doesn't quite) fix an obscure part of the tool preset bugs: when
    changing the brush on a GimpPaintOptions instance, we might or might
    not change the brush size, aspect etc. to the set brush's native
    values, possibly overwriting the intended values from a tool preset.
    
    Implement GimpConfig::copy() and copy the affected values again after
    the entire object has been copied, so we actually use the value of
    gimp_config_copy()'s "source" object.
    
    This would fix that particular tool preset problem if there wasn't
    another bug that is still unfixed, stay tuned...

 app/paint/gimppaintoptions.c | 59 +++++++++++++++++++++++++++++++++++++++++++++--------------
 1 file changed, 45 insertions(+), 14 deletions(-)
Comment 17 jose americo gobbo 2015-10-14 23:08:10 UTC
(In reply to Michael Natterer from comment #16)
> This (doesn't quite) fix one of the problems mentioned here. Also, this
> is not an enhancement, the entire tool preset stuff is totally broken
> in various ways...

I wrote some texts for each part of this issue:
* What is 'working' but not ideal or a bit confuse => create presets.
* What do not working => edit in all dialogs (tool options and tool presets list).

I've drew all flows to each part.

These texts are all linked with images to help the comprehension of these process to create and editing presets.
I thought that I've three possibilities to publish the docs:
1. separate each part in another bug report and after make a reference in this bug report, more general.
2. to build in another platform... more easier (for me)... and where is possible to correct some parts and to link here.
3. to append in this bug report some xhtml or pdfs, where is possible follow easily the links to the images (is possible to have pdf or xhtml as attachment on bugzilla?).

Which is better?
Comment 18 jose americo gobbo 2016-07-07 00:55:17 UTC
I have written a proposal:
https://bugzilla.gnome.org/show_bug.cgi?id=768497
Comment 19 Michael Natterer 2016-10-12 18:35:05 UTC
This fixes the core brokenness of presets, the rest ist just
GUI fine tuning:

commit d1e3d7c5c7615e080948bd8da00de6a50d8a0d6e
Author: Michael Natterer <mitch@gimp.org>
Date:   Wed Oct 12 20:12:08 2016 +0200

    Bug 731279 - Tool Preset Editor not working correctly
    
    This fixes restoring of brush properties (size, spacing angle etc.)
    from presets, which was utterly broken before. The fix consists of
    two parts:
    
    - In tool_manager_preset_changed(), always copy the brush properties
      again after setting the preview on the tool options, in order to
      override brush properites that get copied from a linked brush when
      that brush gets set on the tool options.
    
    But no amount of copying stuff again and again would help without:
    
    - In gimp_context_set_by_type(), don't use g_object_set() to set the
      object (brush, pattern etc.). Instead, build a GValue and call
      gimp_context_set_property(). This may seem odd, but avoids a
      g_object_freeze_notify()/thaw_notify() around the g_object_set(),
      which was causing "notify" to be emitted at the very end, after
      everything this context change has triggered. GimpContext is an
      essential core object and there is an expectation of a reasonable
      order of signal emissions and callbacks being called. The "notify"
      at the end was keeping any callbacks of the context's "foo-changed"
      signals to override anything an earlier callback had done, if a
      "notify" callback was overriding that overriding again.
    
    This was probably the reason for a lot of odd behavior observed over
    the years. In fact, I have been searching for this for at least 5
    years.

 app/core/gimpcontext.c   | 27 +++++++++++++++++++++++----
 app/tools/tool_manager.c | 20 ++++++++++----------
 2 files changed, 33 insertions(+), 14 deletions(-)
Comment 20 jose americo gobbo 2016-10-12 19:05:18 UTC
(In reply to Michael Natterer from comment #19)
> This fixes the core brokenness of presets, the rest ist just
> GUI fine tuning:
> 
> commit d1e3d7c5c7615e080948bd8da00de6a50d8a0d6e
> Author: Michael Natterer <mitch@gimp.org>
> Date:   Wed Oct 12 20:12:08 2016 +0200

Thanks! In the next days I will do some tests.
I have suggested some ideas how simplify the GUI (current Tool Preset Editor), Menus and is possible (essentially from Tool Options) to create and edit presets:
https://bugzilla.gnome.org/show_bug.cgi?id=768497
Comment 21 Michael Natterer 2016-10-12 21:55:09 UTC
This adds "Save" an "Restore" buttons:

commit 3d1c5641f79d65b2145fb22b6ddeed01fbd80c8b
Author: Michael Natterer <mitch@gimp.org>
Date:   Wed Oct 12 23:51:24 2016 +0200

    Bug 731279 - Tool Preset Editor not working correctly
    
    Have "Save" and "Restore" buttons in both the tool preset list/grid
    and the tool preset editor. The save button stores the active tool's
    options in the preset, if possible.

 app/actions/Makefile.am                   |  2 ++
 app/actions/tool-preset-editor-actions.c  | 22 ++++++++++--
 app/actions/tool-preset-editor-commands.c | 88 +++++++++++++++++++++++++++++++++++++++++++++++
 app/actions/tool-preset-editor-commands.h | 28 +++++++++++++++
 app/actions/tool-presets-actions.c        |  8 +++++
 app/actions/tool-presets-commands.c       | 42 ++++++++++++++++++++++
 app/actions/tool-presets-commands.h       |  2 ++
 app/widgets/gimphelp-ids.h                |  2 ++
 app/widgets/gimptoolpreseteditor.c        |  8 +++++
 app/widgets/gimptoolpresetfactoryview.c   |  7 +++-
 menus/tool-preset-editor-menu.xml         |  3 ++
 menus/tool-presets-menu.xml               |  1 +
 po/POTFILES.in                            |  2 ++
 13 files changed, 211 insertions(+), 4 deletions(-)
Comment 22 Michael Natterer 2016-10-12 21:56:16 UTC
Can you please check of there is an actual bug left here? I think the
rest are just GUI changes also covered in bug #768497.
Comment 23 jose americo gobbo 2016-10-12 22:33:33 UTC
Now, commit 3d1c5641f79d65b2145fb22b6ddeed01fbd80c8b, the bug has fixed in the broken instances. I have a fast check in the problematic issues and on the broken flows: now all are working fine.

In the bug #768497 is suggested to cut the option to create/edit presets from Tool Presets Dialog list, but now I have seen that this dialog has changed and is working fine. So, it remains to resolve, as you have written, GUI and Menus ('<' via top upper right button and contextual menus on the items) issues to resolve.

Is opportune to revise the proposal in bug #768497?
Comment 24 jose americo gobbo 2016-10-12 22:53:24 UTC
I need a bit more time to test the new buttons on 'Tool Preset Editor' and on 'Tool Presets - Tool Options' dialog (list of presets).
For example, is not clear for me what exactly do the button 'Restore this tool preset'. If the action is to align the data of preset also in Tool Options dialog... this isn't happening. The same case is happening with the same button on the Tool Presets - Tool Options Dialog (tool presets list).

So, if you has selected a preset on this list and I change something on Tool Options... the idea of the 'Restore this tool preset' button, will be restore the original data on Tool Options, with cancelling my on-the-fly changes... this isn't happening.

Steps:
1) select a preset on the list of Tool Preset - Tool Options dialog;
2) now, change something on the values on Tool Options dialog;
3) click now on 'Restore this tool preset' on Tool Preset - Tool options (list);
4) the data is not loaded in the Tool Options dialog.

The same steps can be used to see the behavior of 'Tool Preset Editor'.
On the 'Tool Options' we have also 'Restore this tool preset' button, but here is necessary choose the preset to restore... in this case is working.
Comment 25 jose americo gobbo 2016-10-12 23:08:34 UTC
I have checked the 'Restore this tool preset' option on the Menus ('<' via button upper right side) of 'Tool Preset Editor' and on 'Tool Presets - Tool Options' dialogues... and they are with same behavior... the original data of presets aren't restored.
Comment 26 Michael Natterer 2016-10-12 23:25:00 UTC
I don't follow, the restore buttons in both the preset list and
the editor are working just fine for me. Perhaps you can make
a screenshot so I can spot what is different in your setup?
Comment 27 jose americo gobbo 2016-10-13 00:01:12 UTC
Created attachment 337543 [details]
my dialogs with the commit 3d1c564...

My box is ubuntu gnome 14.04.2
Gnome 3.10
Comment 28 jose americo gobbo 2016-10-13 00:11:16 UTC
(In reply to jose americo gobbo from comment #27)
> Created attachment 337543 [details]
> my dialogs with the commit 3d1c564...

I have made a short screencast video: https://youtu.be/CL1QF1OqFas
Comment 29 jose americo gobbo 2016-10-13 01:00:06 UTC
So, I have tested now... this issue around 'Restore this tool preset' has relation with MWM... with SWM is OK, the button is working.
Comment 30 Michael Natterer 2016-10-13 07:54:22 UTC
Ah, thanks :) Will fix...
Comment 31 Michael Natterer 2016-10-13 09:39:46 UTC
Fixed in master, I guess we can now close the bug and track GUI
improvements in bug #768497 ?

commit 3a52bf4cce1c1954419231d67a887818b53f0e12
Author: Michael Natterer <mitch@gimp.org>
Date:   Thu Oct 13 11:36:51 2016 +0200

    Bug 731279 - Tool Preset Editor not working correctly
    
    Call gimp_context_tool_preset_changed() on the global user context,
    not on the tool preset list's or tool preset editor's local
    context. Fixes restoring of presets in MWM. Tracked down by Jose
    Americo Gobbo.

 app/actions/tool-preset-editor-commands.c | 2 +-
 app/actions/tool-presets-commands.c       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Comment 32 jose americo gobbo 2016-10-13 13:11:14 UTC
(In reply to Michael Natterer from comment #31)
> Fixed in master, I guess we can now close the bug and track GUI
> improvements in bug #768497 ?
I have checked the last commit and all is working fine.

Yes, you can close this bug report. Thank you very much!

Now, I will revise the bug #768497... because I had an approach a bit different with options in the Tool Presets list dialog. Now is working perfectly and I don't see motif by which must be cut the create/edit options in this dialog.
Comment 33 Michael Natterer 2016-10-13 22:19:54 UTC
Thanks for checking!
Comment 34 Michael Natterer 2016-11-07 12:58:52 UTC
*** Bug 732320 has been marked as a duplicate of this bug. ***