Re: Extensions and putting icons in toolbar



On Fri, 2008-01-11 at 18:23 +0100, Gilles Dartiguelongue wrote:
> Hi list,
> 
> I'm trying to get an icon in the toolbar from an extension
> (nautilus-sendto) and to get it to behave properly. It means that it
> should be sensitive when I select files and not in a list of already
> defined case. All of this logic is already implemented in the
> nautilus_nste_get_file_items callback.
> 
> However since I want a toolbar item, I've created a new callback :
> nautilus_nste_get_toolbar_items
> 
> My first problem was that writing the sensitive attribute didn't do
> anything since the attribute is only read once to create the button.
> Attached is a patch that allows the NautilusMenuItem to notify the
> button of the sensitivity change.
> 
> nautilus-ui-utilities.c |   18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)

This causes a ref count cycle on the action and the item. I commited a
slightly different fix.

> Now I want to get the list of files in order to set a sensible value for
> the sensitivity. I've connected a callback to the selection_changed
> signal but it seems that from an extension, there is no way to get the
> list of selected files in order to accomplish that. It is not a problem
> for a get_file_items type callback because it's used each time the
> right-click menu is shown (afaiu).
> 
> The data is available but buried in class depending on
> libnautilus-private so my question is, am I just a fool to want to
> access this data and if not, what is the best course to fix this
> problem ?

Right now there just isn't enought information in the extensions API to
allow this sort of thing. This could be added, but need quite some work
in design and implementation.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]