Help with .server file



Hi,

I'm writing a program (http://www.bitwiser.org/icanoop/Python/) that creates
an entry in the nautilus context menu using a .server file. It's a privacy
program so the entry says "Encrypt/Decrypt".

I would like the menu to offer the "Encrypt/Decrypt" option for regular
files but not for directories. As it is now the menu item shows up for files
and directories. I can't find decent documentation on how to write these
.server files (yes, I have read the Bonobo API activation reference manual).
So I am hoping for one of the following...

1. Somebody points me to better docs that I am not aware of.

2. Somebody points me to the Bonobo source code that actually parses .server
files so that I can figure it out myself. I looked for it but not knowing
the gnome/bonobo/nautilus code very well I don't know where to look for
oaf_attribute processing.

3. Somebody is nice enough to just tell me how to do it and I will document
it for others.

Here is my .server file so far

-----------------------------------------------------
<oaf_info>

	<oaf_server
		iid="OAFIID:PrivateRyan_Factory"
		type="exe" location="/usr/libexec/privateryan-nautilus-context-menu">

		<oaf_attribute name="repo_ids" type="stringv">
			<item value="IDL:Bonobo/GenericFactory:1.0"/>
		</oaf_attribute>
		
	</oaf_server>

	<oaf_server
		iid="OAFIID:PrivateRyan_EncryptDecrypt"
		type="factory" location="OAFIID:PrivateRyan_Factory">

		<oaf_attribute name="repo_ids" type="stringv">
			<item value="IDL:Bonobo/Unknown:1.0"/>
			<item value="IDL:Bonobo/Listener:1.0"/>
		</oaf_attribute>

		<oaf_attribute name="name" type="string" value="Encrypt/Decrypt"/>
		<oaf_attribute name="description" type="string" value="Encrypt or Decrypt files"/>

		<oaf_attribute name="bonobo:supported_uri_schemes" type="stringv">
                	<item value="file"/>
		</oaf_attribute>

		<oaf_attribute name="bonobo:supported_mime_types" type="stringv">
                	<item value="*/*"/>
		</oaf_attribute>

		<oaf_attribute name="nautilus:context_menu_handler"
				type="boolean" value="true"/>

		<oaf_attribute name="nautilus:can_handle_multiple_files"
				type="boolean" value="false"/>
		
		<oaf_attribute name="nautilusverb:EncryptDecrypt" type="string" 
				value="Encrypt/Decrypt"/>

	</oaf_server>

</oaf_info>
---------------------------------------------------------------

Also feel free to tell me about mistakes I have made because I really don't
know what I am doing with this, I just copied stuff from file-roller and
fontilus.

Thanks,
-- 
Ryan Boder
http://www.bitwiser.org/icanoop



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