Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#80 closed Bug (fixed)

Plugin icon is not updated when restoring plugin from project

Reported by: Matthäus Wander Owned by: Thomas Schmid
Priority: Important Milestone:
Component: AnotherEditor Keywords:
Cc:

Description

  • Open BooleanOperators sample
  • Expected: out of the four BoolInput instances on the left, two shall show a green and two a red icon
  • Actual: all four instances show a red icon, though for two of them the value is set to true (and correctly shown in settings)

This has no influence on icon changes after the plugin has been restored. So the general icon-update-code is working correctly.

Sören experienced the same problem in its CLK plugin as it can be seen in the comments of his constructor. His workaround is: use neutral icon as default. When changing value to true -> set green icon, when changing value to false -> set red icon.

A similar problem occurs for the current RSAKeyGenerator pluginwhich hides settings dynamically: after restore all settings are shown. Therefore the problem may be generalized as: Editor does not handle events properly when restoring plugin from saved project.

Problem 1:

  • BaseElement.Initialize() calls the plugin's Initialize method first, but sets the events afterwards in visualElement
  • it's seems obvious, that both calls need to be switched, but I'm not sure whether this has unforseeable side effects
  • After switching both method calls, the icon still doesn't change.

Further debugging reveals Problem 2:

  • VisualElement.OnPluginStatusChanged(...) in line 979 calls this.Template.FindName("BaseImage", this)
  • this call usually returns an image instance, but it does not during the Initialize (returns null)
  • with the image instance being null, the method returns without changing anything

Why is the image instance null? Where is it set? When is it not null anymore?

Change History (4)

comment:1 Changed 12 years ago by Thomas Schmid

Resolution: fixed
Status: newclosed

fixed in revison 910

comment:2 Changed 12 years ago by Matthäus Wander

(In [943]) Converter:

  • added initialization for icon and task pane visibility (references #80, #46)
  • set default conversion to string (init fails otherwise)

comment:3 Changed 12 years ago by Matthäus Wander

(In [944]) Comparators:

  • icon update in Initialization (references #80)

RSA:

  • duplicate icon definitions removed (hope this doesn't break some particular workaround or whatever)

comment:4 Changed 12 years ago by Matthäus Wander

thanks!

Note: See TracTickets for help on using tickets.