Re: Question about nautilus_menu_provider_emit_items_updated_signal



On Mon, 2010-04-26 at 20:31 +0800, Jason Heeris wrote:
> On 26 April 2010 19:19, Alexander Larsson <alexl redhat com> wrote:
> >> What do I emit it from? The nautilus.MenuProvider doesn't provide any
> >> "emit" method.
> >
> > Signal emission is a basic part of gobject, not a method on
> > MenuProvider.
> 
> Sorry... I'm just not clear on the details here. If I subclass
> gobject.GObject and use the "emit" method, then I get:


> Emitting signal...
> Traceback (most recent call last):
>   File "/home/jason/.nautilus/python-extensions/MenuProvTest.py", line
> 32, in updated_callback
>     self.emit('items_updated')
> TypeError: <MenuProviderTest object at 0x7f1c4a452fa0 (GObject at
> 0x287b100)>: unknown signal name: items_updated
> 
> If I add the "items_updated" signal to my class' __gsignals__ dict,
> then there's no exception, but nothing happens (I presume then that
> I'm not firing the signal that the nautilus extension API defines, but
> my own custom one now).

I'm not sure how binding this in python works, but you should not have
to add your own signal like that if you derive your object from
NautilusMenuProvider. The code already adds that signal. I think you
need to ask the python people for more details.


-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
       alexl redhat com            alexander larsson gmail com 
He's a lounge-singing drug-addicted farmboy who hides his scarred face behind 
a mask. She's a psychotic cigar-chomping bodyguard who dreams of becoming 
Elvis. They fight crime! 



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