Skip to content
  • Jehan's avatar
    app: GimpAction now has a "reason" parameter to explain being disabled. · 811d3569
    Jehan authored
    In some cases, in particular for actions generated from plug-in
    procedure right now, we were displaying the reason of the insensitivity
    (typically right now, only the drawable type is cited). This was done by
    appending the reason to the tooltip, separated by 2 newlines, which
    resulted in extra ugly design, no nice way to style this info directly
    (with pango for instance if the widget display allows it, or on a
    separate info widget in a possible future, or whatnot).
    
    Also it would mean that the action search could match a disabled action
    by mistake if a search word happens to be in the reason message.
    
    This improves the situation with the following changes:
    * gimp_action_set_sensitive() now takes an optional reason string to set
      the reason message.
    * Same for gimp_action_group_set_action_sensitive().
    * gimp_action_get_sensitive() returns an optional reason string.
    * gimp_procedure_get_sensitive()'s tooltip return value now becomes a
      reason (it won't contain anymore the tooltip and the reason
      concatenated, only the reason for separate processing).
    811d3569