GNOME Bugzilla – Bug 159083
Progress window needed for large crypt operations
Last modified: 2006-04-24 20:55:24 UTC
Please describe the problem: When creating a large encyrpted archive Seahorse hangs and you get a weird whacked window. It still seems to do what it needs to do as it will create the encrypted archive but I have had to do a "force quit" to exit the program.The achive that I am refering to here is 50megs. Smaller one like 7 - 10 seem to work fine. I am not sure what the threshhold is. Same thing happens with .zip and .tar.gz Steps to reproduce: 1. Right Click of a folder 2. Select "encrypt".. 3. Choose how you want to compress the folder and once it is done compressing once you select the key to encrypt to it hangs and you get the blank screen see attachment. Actual results: Program hangs.. it will encrypt and eventually the "hanging window" will disappear. While it is "hanging" there is a significant over system slowdown if you are trying to do other things. Expected results: Encrypt the folder and have a "clean exit" from Seahorse. Does this happen every time? yes Other information: No
Created attachment 34034 [details] screenshot of bug 159083
We need to work on progress windows showing up for all operations that take more time than a given threshold. Ideally the progress window should remain hidden for the first few seconds, and then show up after a few seconds.
How large is the file you're noticing this on?
500 Megs. On smaller files like around 50 megs there isn't the same problem..
Noticed that the file operations could be a lot less resource intensive. Seahorse was first performing the entire operation in memory, and then writing it out to a file. Changed so it writes out as data is available. This should help alleviate this problem for now.
Nate, Are there any good examples that you know of on implementing progress windows, and knowing which operations require them? Adam
This is a good section of the HIG to read: http://developer.gnome.org/projects/gup/hig/2.0/feedback.html I've been doing a lot of work on this recently, but would welcome help. Much of the work so far has been base class and infrastructure work to support async operations everwhere. I've added the SeahorseOperation base class a while back to this end. It should be a base class for all operations that could possibly take longer that roughly 1 second. Over the last few days, I've added progress (percentage, status message etc...) support to SeahorseOperation, and will check this in shortly. One other thing I've been working on slowly is making all user operations parellizable. Like for example importing a key from a remote key server can be started, and then the user can for example export other keys while that's happening etc... Naturally the file operations called from nautilus don't really have to have this requirement, but it would be good if everything was coded this way, so we have reentrant code. IMO, progress windows should base themselves off of SeahorseOperation which fires signals when progress is changed etc... They should only display after over 1 second of time has elapsed and the operation is still not complete. What we want to prevent is flashing the user with progress windows which they can't even read, because the operation is done too fast.
I committed a bunch of code that adds progress support to SeahorseOperation. The progress bars on the main windows now watch this. Remaining: - Flesh out the current operations to provide notifications and progress. The capability is there, we just need to hook in the various messages at the appropriate points. - Add more operations for the crypt operations. These would be wrappers around the gpgme_set_progress_cb and gpgme_wait etc... - Add common code for a progress window that listens on SeahorseOperation. We'd use this for operations that aren't bound to a main window (and thus can't use it's progress bar)
Status Update: We have progress dialog code committed. Next we need it to serialize the large crypto operations into SeahorseOperation's.
If there's a completed example, and a list of functions to serialize, I could work on this.
A SeahorseOperation basically works asynchronously so that makes this a bit complex. In the case of files the fact that they can all be different sizes (etc...) makes this even more interesting. The only examples in the CVS are in the various SeahorseKeySource's (like SeahorsePGPSource, SeahorseLDAPSource etc...).
I've added SeahorsePGPOperation which will do the heavy lifting here. Should be pretty easy to implement the progress dialogs now. Documentation for using SeahorsePGPOperation is in the seahorse-pgp-operation.h header.
Created attachment 63004 [details] [review] progressbar patch for key generation This patch displays a progress bar when creating keys with either the druid or in advanced mode. It uses the SeahorsePGPOperation that Nate implemented.
Nice. I committed it with a few small changes. I figured I'd note them here in case it's a help: seahorse_pgp_key_op_generate() * returns a SeahorseOperation instead of SeahorsePGPOperation * initialize |pop| properly * free expires_date properly * initialized *err ok_clicked() / on_druid_finish() * Made progress text translatable included seahorse-progress.h in seahorse-generate-druid.c
Finally committed progress windows for file operations today. A new 'seahorse-tool' binary, which does the actual encryption and decryption. However this should be transparent to users.