API enhancement for 2.8.0

Elliott Sales de Andrade qulogic at pidgin.im
Wed Mar 30 15:55:01 EDT 2011


On Wed, Mar 23, 2011 at 5:33 PM, Andrew Victor <avictor.za at gmail.com> wrote:
> hi,
>
> Is it possible we could add the following for 2.8.0:
>    void purple_request_field_set_tooltip(PurpleRequestField *field,
> const char *tooltip);
>    const char *purple_request_field_get_tooltip(const
> PurpleRequestField *field);
>
> It will provide a mechanism for prpl's to provide some
> context-sensitive help on Request UI forms.
>
> Appended is a proof-of-concept patch...
> (If Pidgin 2.8.0's minimum GTK+ version is still 2.10.0, the gtk calls
> need to be within GTK_CHECK_VERSION() checks)
>
>
> ============================================================
> --- libpurple/request.h f3460d06e7653696508046113ed3205809fb4add
> +++ libpurple/request.h 105dff1d6175f3637652a91a0aaf8475fb91e709
> @@ -108,6 +108,7 @@ struct _PurpleRequestField
>        char *id;
>        char *label;
>        char *type_hint;
> +       char *tooltip;
>
>        gboolean visible;
>        gboolean required;

I'm not sure what the macro stuff around it does, but I don't think
this is ABI compatible, and would have to wait for 3.0.0. Perhaps
something could be done with the type_hint field. It's a string that
could potentially hold some sort of tooltip, but since the semantics
aren't really defined, I don't know how ABI-compatible that would be
considered.

> ============================================================
> --- pidgin/gtkrequest.c c13851355e046995c5e133960c40c9e4c2fe48cd
> +++ pidgin/gtkrequest.c a44a112c10f72a30800fb2790247d508a485bb39
In several places:
> +               if (tooltip != NULL)
> +                       gtk_widget_set_tooltip_text(textview, tooltip);
> +

Why are you checking for NULL here? Doesn't
gtk_widget_set_tooltip_text handle it? I would assume that would mean
"remove the current tooltip", though I don't think the libpurple API
would be able to do that anyway.

-- 
Elliott aka QuLogic
Pidgin developer




More information about the Devel mailing list