Ark: service menu, password protection files and more

Time for another update on my Ark changes!
Let’s just do it simple, I’ll put some screenshots here and I’ll explain along:

The batch extract/extraction progress

This is probably the feature I’ve been working most on. After modifying the libarchive plugin and doing some calculating of how much is to be extracted, the extraction shows very nicely and accurately how far it has come in the total extraction. It will also extract many files in a row when given from the command line. Now, some users might wonder (some might even complain) on why I’m even making a command line tool with gui feedback at all. Some of the other users again, will understand immediately just why this comes in handy, which brings us to the next point:

The dolphin/konqueror service menu


With the batch extraction in place and ark taking lots of nice parameters, implementing the service menu for dolphin/konqueror is a breeze. I haven’t completed it fully so far, but above is a quick preview of what’s working so far. Next up here will be a small submenu, showing additional entries such as “Extract to…”, “Extract all to subfolders”, etc. (I haven’t really decided which use cases deserve a menu entry here, feel free to discuss this in the comments section).

The (once more) redesigned extract dialog


So after playing with several solutions of how to actually informing the user of the auto-subfolder mechanism, I eventually decided that the best way to make it natural while not doing too much uncontrollable magic in the background is to first check if the archive is a single folder archive, next use this information to enable/disable the checkbox and informing the user why this choice has been made.

Password protected archives

Finally, there is the password protected rar files that was mentioned in the comments by a user in a previous blog entry. At first I was surprised to see that there was simply no support for passwords at all in the new archive framework, but after coding a little bit I was once more again impressed about how solid the ark codebase is, and how easy it was to add this extra property to the display. So far rar and zip files are checked for password protection, and the display reflects this. Next up is querying the user for the actual password, and finally getting that password all the way to the extraction code.

Another thing that surprised me was that libzip, which is what ark uses for zip files, doesn’t support reading/writing password protected archives yet. A way around this now would be to either 1. switch completely to using the command line zip utility, like the way rar is handled now, 2. switch to the cli zip util only for password protected files, or 3. pull out the relevant extraction functionality from the cli zip util, and include this as another zip plugin for ark. What do you think?

29 Responses to “Ark: service menu, password protection files and more”

  1. Beat Wolf Says:

    nice!! the rar password comment came from me, you are now my official hero🙂 thx!!!

    for the zip problem.. as a developer i would say, switch to cli zip completely. It seems complicated to have two backends for the same file type. And not having password support does not seem right either..

  2. David Says:

    Thanks a lot! Finally Ark is getting some love! Is drag & drop extraction possible yet? (double klick an archive, ark opens and shows the content, user drags the content to a dolphin window…)

  3. IAnjo Says:

    I think wrapping cli programs doesn’t normally give much control/integration to the application (in this case ark), so I would be kinda against it — it’s this level of integration that is very needed and user-friendly and missing from most compression apps in linux, for example on windows winrar gives you stats about total status, time left, etc vs what ark has had for years “Extracting…” and a moving bar just to show it wasn’t stopped (although you show there that you just changed it, at least for .tar.gz, and kudos for that).

    With zip being a such widely-used format, isn’t there a lib that supports passwords?

  4. Bob Says:

    I suggest the fourth option for password-protected ZIP files, which is probably the most elegant:

    1) Transfer the password code from the command-line zip utility to libzip.

  5. Anonymous Says:

    Looks great!

  6. Arend van Beelen jr. Says:

    Wow, not only are you doing a great job on Ark, I should also give some big thumps up about the way you’re involving your users (call them fans if you like ;)) in the process!

    Ps.: I agree with Bob about implementing password support in libzip. It’s also the thoughest though, as it’s probably an entirely different codebase for you to dive into. Therefore I think you should take at the resources you have to see whether it’s worth it and whether you have the time for it. If you decide to do it though, I think many developers will thank you for it😉

  7. Fri13 Says:

    I’m not a coder, so I dont know is first or fourth option best.

    But if it is someway a backend frontend action currently, I would use CLI for ZIP working like on RAR. But if the porting the code to libzip helps all other users, I recomenned it. Like if we then can be sure that we can open password protected ZIP files on all KDE applications, it is worth it.

    But I have always liked the Unix kind idea. Example of tar and gzip/bzip. Tar makes a package what gets zipped with other tool. This way we have powerfull tools.

    And I just love that new metering bar to show progress, I have always used krusader to do extracting on bigger than 20Mb archives or file-roller (gnome software) because I can see the progress.

    I hope that progress window can be hided and show it by using knotify as own progress there like the http://img180.imageshack.us/img180/4492/plasmoidspart2re2.jpg shows. Dont remember who pasted that URL, but it was on planetkde.org to one blog.

    Or at least have that progress bar integrated to ARK window itself so you can see what it is doing, and mayby a scroll file list showing the current file what is being extracted/packaged and marking it with green O.K mark.

    What one day I would like to see, is plasmoid for archiving files, you have kget kind spot where you drop files/directories and it will ask place where to store the archive and you get that screenshot kind list of the progress🙂

  8. Fri13 Says:

    Oh forget this, mayby have own sidepanel of ark, on dolphin. This way you could have “places”, “folders” and “ark”. So when you select the archive, you get buttons on sidepanel to allow extraction/adding files etc. Or adding files should be easy as just draggin them top of archive and it will start progerss (and it will be shown on that knotify window progress list ;-))

  9. Manuel Says:

    Nice work! I also ask myself: is there really no zip-lib with password-support? In that case it would be great to get support into it, else use a better zip-lib.

  10. Psychotron Says:

    > What do you think?

    What I think? I think that you rock!!! You’re doing great work! It’s often these inconspicuous things like an archiver which can constantly annoy you when they don’t work really well. The better that someone took up the job!

  11. Phobeus Says:

    Batch Extraction with service menu? You are my hero saving me lots of konsole typing and let kde 4 feel much more like kde 3.5. Do you have a paypal account where I can donate 15€? Buy a big box of beer/cola whatever from it!🙂

  12. Tim Says:

    Definitely use add the password code to ark — it’s the right way to do it. It would be good if you used librar (if there is one) instead of the rar command line too. For the following reasons:

    a) It’s cleaner and more ‘correct’.
    b) rar/zip might change the cli interfaces and then it would break horribly.
    c) You’re less likely to make silly quoting mistakes when passing file-name locations etc.
    d) Better integration – can give feedback easier etc.
    e) Less scope for security flaws.

  13. tsb Says:

    Great progress! I would also like to say that I really like the way you involve the users. Fun to keep an eye on the updates.

  14. Harald Says:

    @Fri13: The progress system is a very simple one, the extraction is a KJob and I pass it to a standard KWidgetJobTracker, so when/if the plasmoid is implemented, it shouldn’t be hard to connect the two. (But to be honest, I think the times you would start an extraction so big that you’d actually go to the desktop to watch the progress are quite few)

    @IAnjo: Agreed, that was also the major motivation for adding the progress in the first place. But wrapping cli programs doesn’t have to mean less feedback, it’s just a question of activating it from the cli and parse it properly.

    …but on the other hand:
    @Tim: The points you offer are very valid. Especially handling of international filenames is more prone to bugs when using cli…

    @Phobeus: Hehe, great to hear that you’re pleased. Good feedback here on the blog is enough, really🙂

  15. Robin Says:

    So, if you can calculate the progress percentage, you can also show how long it is going to take until the extraction is finished, right? You can probably use an existing implementation (not copying the source code, mind you) of this, maybe there’s even an “ETA progress bar” widget.

  16. Jucato Says:

    Wow! I must say I’m impressed. Ark (in KDE 3) has been one those apps that “I’d rather not use but since there’s no better KDE app…”. And creating proper service menus for Ark was indeed frustrating. I am so glad that someone’s working on Ark and that it’s turning out quite nicely.

    Both thumbs up and keep up the great work!🙂

  17. Fri13 Says:

    @Harald “(But to be honest, I think the times you would start an extraction so big that you’d actually go to the desktop to watch the progress are quite few)”

    You are right on that, but I mean that we could use knotify to tell when the progress is ready. This was one original ideas that we have box what shows all progress [dvd burning, downloading, copying etc] in one place. And this would be great there too. If it is easy to press a button to get it there if needed, so it’s not there always every single small [

  18. Phobeus Says:

    I am also looking forward to a kuiserver plasmoid where all current operations are listed. A process dialog is in most times more anonying than helping. Having a list of all operation at one place, clicking on it and then gets a dialog shown would be IMAO much better for most users. (At least it is interesting for big archives only). So I agree with Fri13.

    @harald: Ok, then I double the amount and it goes to the e.V.😉 Keep up the good work and also keep the users informed about the progress. I really like to see what’s going on in the trunk🙂

  19. GeniusDex Says:

    Why are there 3 dots after the “so this option has been automatically unchecked…” line? I’d say there’s no more info that will pop up or so so that a single dot will do.

  20. Harald Says:

    @GeniusDex: Agreed, I’ll remove two of the dots🙂

  21. Bart Says:

    Looks great! But what about further Dolphin integration? Back in the KDE3 days it was possible to double click an archive and then browse trough and interact with it in Konqueror. Will there be similar functionallity for this in Dolphin in the future?

  22. Heller Says:

    Great🙂 Thank you for your work !

    Do you think that a third checkbox with “Close Ark after extraction is finished” may be OK ? It is usually the first thing that a user do as soon as the extracting job is completed.

    And be carreful, the Extract dialog box is near 800×600 (if your screenshot show the default size).

  23. Something's broken with the comment thing ;) Says:

    -no text-

  24. Kevin Kofler Says:

    IMHO, you should add password protection support to upstream libzip. If upstream is dead, put up a new upstream somewhere (but please not inside Ark’s build tree – keeping things as a library means other projects can benefit from your improvements as well).

  25. Rodrigo Fernandes Says:

    Wow, thank you very very much these features are great.

    I don’t know if i’m the typical use-case, but i’ve longed for a “extract to a new dir, only if there is more than a folder in the archive” function. (This is particularly useful in the context menu). If that’s what the “redesigned extract dialog” means then happy me.

    And to keep the “automagical” down a notch, you could use a notify event with something like (Archive contained only a folder, extracting to “), to be handled by the notification plasmoid

  26. maxauthority Says:

    Wow, the “single folder” detection is probably the best thing which i have missed forever from any unzip-utility. It’s just terribly annoying if you get a .zip file from somebody without subfolders (windows users mostly), and clobber the current directory.

    Very nice work on the UI, I also love the new 1 dialog-only extraction dialog, the old 2 step process was just awkward.

  27. xdmx Says:

    Just one thing about the service menu and the “extract all to subfolders…”. Can you do something which merge every extractions into one? Actually i’m using a service menu for kde 3.5.9 which for every archive open a new extraction in the same time the others. If you have not so many files (5-6) it works nice. But if you have something like 1000-2000 archives, open so many processes in one time the computer isn’t so happy🙂

  28. Harald Says:

    @xdmx: This is what the batch extract interface already does, all extraction are handled linearly. Will be available from kde 4.2.

  29. xdmx Says:

    ok, perfect🙂 thanks

Comments are closed.


%d bloggers like this: