The GPG Key selection done!

This week i have completed the GPG key selection in Evolution, using the Seahorse cryptui and its DBus APIs. And I have added a new GPG key frame to the Security tab in account editor. Of course, it is implemented through EPlugin! Following is the snapshot:

snapshot1:adding a new GPG Key frame using EPlugin, replacing the Entry with a ComboBox.
snapshot2: you can select your GPG key from the combobox now:)

Besides, if you are brave enough, you can try it now:
1.svn co svn://www.cipsc.org.cn/seahorse-key seahorse-key
2.mv seahorse-key /path/to/trunk/evolution/plugins/seahorse-key
3.patch the configure.in (using configure.in.diff in seahorse-key) and ./autogen.sh --prefix=/usr && make && make install
4.enjoy it!

a.Seahorse installed.(http://live.gnome.org/Seahorse)
b.Evolution trunk from svn repos( http://svn.gnome.org/svn/evolution/trunk)
c.GNU Autotools

However there are some questions:
1. How to restore the key been selected when restart the Evolution?
Apparently , this info should be stored within the account, but the EAccount structure provides no fields for this. Now i store it in a GHashTable (key is the account->address), this is very ugly.
Worse more, the hashtable will be destroyed and initialized again when the Evolution application restarts, should i write the hashtable to a file? and reload it when the Evolution restarts?
neither is a good way, IMO.

2.How to hide the original GPG Key frame through the EPlugin?
please give me some good pointers if you know that, .

Happy Hacking!


Pete said...

Wow, does this even fit on an 800 pixel tall display? It looks enormous.

Zhang Shunchang said...

so i want to hide the original GPG frame :)
but i have no idea about that.

andre said...

Awesome work! But I also wonder how that should fit on my screen. Maybe having subtabs, but that's also evil...
Well, still some time left until UI Freeze for GNOME 2.24 takes place. ;-)

Gustavo Noronha said...


disclaimer: I'm not someone who has read the evo code

I believe all your questions would be answered by changing the approach of your work: instead of writing a separate plugin, you should really be writing a patch for the current implementation

this means you'd also be extending the EAccount structure to hold the new data you need to save

mpt said...

While you’re replacing that section, I wonder if you might be interested in fixing a couple of design problems in that section of the dialog.

It’s bad for a checkbox to have a label starting with “Always”, because that means it’s not clear what happens when the checkbox is unchecked. Here, what happens when “Always sign messages when using this account” is unchecked? Does Evolution sign messages just sometimes? When? Does it ask you when you click Send? Or do you have to choose a menu item? Or what? The other two checkboxes starting with “Always” have the same problem.

Usually the way to solve this is to replace the checkbox with a pair of radio buttons. For example, “Sign messages sent from this account: (*) Always ( ) ________”.

It’s also bad for a checkbox to have a label starting with “Do not” (or “Don’t”, or “Never”), because it’s back to front, so it’s harder to understand what it does. Here, “Do not sign meeting requests (for Outlook compatibility)” would be better as “Sign meeting requests (doesn’t work with Outlook)”.

Zhang Shunchang said...

There are two checkboxs at the menu of new mail composer. You can choose to encrypt or sign the msg.

Thanks for your suggestion. If your have any good idea for improvement of evo, please let me know.:)