← Back to team overview

zim-wiki team mailing list archive

Firefox addon zim-clip: new features and a question for Jaap


Hi everybody

Just to inform the community that i found a couple of hours to work on
zim-clip (http://omacronides.com/projets/ff-zim-clip/), the firefox
plugin that allows to copy a web page content as a Zim quick note.
There's 2 new functionalities :

* A toolbar button to copy a link of the current web page into a "marks"
zim page (a king of 'read-it-later' feature :-).
* You can choose the zim notebook to store clips et marks on the
preference dialog.

Here's what it looks like :

I'm a little bit disappointed  with the notebook chooser : firefox
addon-sdk simple-prefs, the module i use to define addon preferences,
doesn't have a combolist type. I hacked a little utility to build a
combolist panel, but i can't show the selected item outside the it.
Maybe I'll  drop out that feature.

The Button/widget for marks is created on the addon toolbar (bottom
bar), as it's the only place allowed by the addon-sdk ; but you can move
it to the main toolbar with the "customize" window. Clicking on it opens
a panel where you can change the text used to build the link and add a
comment. Comment by default will be the localized current date (e.g.
here again, maybe i'll drop that functionality to use the quicknote
dialog, for the same reason as the notebook chooser preference : all the
zim logic belongs to zim. The other option is to hide the quicknote
dialog instead .

Speaking of quicknote plugin, a question for you Jaap. I found what's
maybe a bug, or i'm misunderstanding the API. I thought that if you
don't give a 'basename' option to the plugin, it will (1) consider
'namespace' as the page name and (2) the 'Create a new page for each
note' checkbox will be unchecked. (1) is ok but the checkbox state
checked or unchecked seems only to be lead by it's previous state (it is
always checked when you provide a 'basename'). To be sure that checkbox
is always unchecked when run a command without basename, like this one :

	zim.py --plugin quicknote notebook=notebook namespace=:marks

I had to add some code in the plugin :

#### modified file 'zim/plugins/quicknote.py'
--- zim/plugins/quicknote.py	2012-09-29 21:21:38 +0000
+++ zim/plugins/quicknote.py	2012-12-10 20:11:46 +0000
@@ -188,6 +188,8 @@

 		if basename:
 			self.uistate['new_page'] = True # Be consistent with input
+		else:
+			self.uistate['new_page'] = False

 		# Set up the inputs and set page/ namespace to switch on
 		# toggling the checkbox


Is that correct ?


Rui Nibau

Follow ups