Archive for July, 2008

More on kuiserver and extenders

July 24, 2008

I would like to explain some of the work I’ve done some more, so I can address some questions people have asked, and hopefully give people a better idea what this is all about.

First to make clear: the kuiserver itself is just a visualization of kjobs. A kjob can be anything that takes some time: file transfers, checking of email, rendering of fractals, stuff like that. Most applications currently use a simple progressbar or a dialog as visualization of kjobs. With kuiserver, they can also register a kjob with the kuiserver so it can display the job.
An application explicitly needs to register a job with kuiserver to avoid a lot of entries in the kuiserver where the user is probably not interested in. For example: A mail client can, if you have multiple mail accounts, only register the parent job for all those mail accounts to kuiserver, and have only that job shown in kuiserver, while still showing the progress of the different accounts in the application itself. A way to visualize subjobs in kuiserver might also be neat, but I’m not yet sure about this part.
In my branch I’ve changed one line in kdelibs (I love abstraction layers!) to make every kio job (kio jobs also inherit kjob of course) register to kuiserver instead of using the standard dialog based job tracker. Other applications will need to make similar changes to be able to be shown in kuiserver.

Yesterday I’ve actually made the pause/cancel/resume work, (in the screenshot in my previous blogentries the buttons are there but didn’t actually do anything) so the kuiserver is now already pretty much good enough for my daily needs. What it could still use is letting old, not detached entries, expire after some time (the list could grow quite large otherwise). Also it could be a bit more pretty and polished, and maybe display some more information (speed, amount transfered etc.), but that isn’t my main priority now. But the kuiserver dataengine I’ve made makes all that information available and adding it is mainly figuring out a way to display this information without resorting to make it an ugly load of text. But I’m sure the great oxygen people can figure out a nice final design before 4.2.
There’s more interesting stuff that could be added to kuiserver (showing progress in drag handle, let applications register custom actions), but first I’m going to focus some more on the extender side of things. After all, that is where my summer of code project is about, and kuiserver is just a convenient test case.

Ooh, little screen of the kuiserver with actual working pause/resume/cancel buttons (and a little bit of other polish):

More kuiserver and extender goodness

More kuiserver and extender goodness

The reason why the middle finished transfer still shows a stop button is because that’s the way to remove the item from the kuiserver. But once I’ve changed kuiserver to let finished jobs ‘expire’, that won’t be needed anymore. The middle transfer is also ‘collapsed’ so it takes up less space. By clicking the icon, you can expand/collapse items.

Now I’m going to focus on reviewing the extender api. I’m looking for feedback on the api as it exists currently, so it can be improved. If you’re interested, the current api is on the plasma-devel mailing list (subject: Extender api review). After this review I will merge the extender branch into svn so it will become easy for anybody running trunk/ to test the extender api and kuiserver applet.

Advertisements

Quick screenshot

July 23, 2008

I’ll blog some more about the extender progress tomorrow, but in the meantime, here’s a screenshot showing some of the progress. For your viewing pleasure:

Kuiserver screenshot

Kuiserver screenshot

Credit to pinheiro for his great extender dragger design. 🙂

Extender update.

July 7, 2008

As you might know, I’m implementing ‘extenders’ in plasma for the Google Summer of Code. I haven’t blogged about my progress yet, and I’ve made some good progress, so time for a new blogpost. For an explanation about what extenders are and why they’re useful you should read my previous blogpost.

So what’s working right now?
Detachable widgets can be freely dragged around, dropped in other applets, dropped in a containment, ordered, and you’ll see spacers inserted in layouts on the place where the detachable will land when dropped there, so we even got some nice visual feedback.
When an applet that uses detachables is put into vertically constrained space, it automagically ‘collapses’: the detachables are moved to an extender and only an icon is shown where clicking the icon shows/hides the extender. Showing an icon is the default behavior, but you can reimplement a function to customize this behavior.
Detachables can have configuration data associated with them, so they can be reinstantiated when plasma gets restarted. This only requires the developer to implement a factory function.
The api provides a way to quickly search through all detachables that have been created by a certain applet so detachables will not be duplicated after a plasma restart.
When an applet contains no detachables it can automagically display a label telling so, so you won’t have a completely empty applet when it has nothing to display.

I’ve also started developing a kuiserver data engine and applet. The applet displays all running file transfers, and is the first actually useful applet that uses extenders (the other applet being a test applet that’s really just that and does nothing remotely useful). It’s quite limited at the moment still, (not to speak about the sheer ugliness of the thing), but it shows how easy it is to use extenders in a real world applet: the applet, minus whitespace and comments, is only 25 lines of code. Plasma rocks! 🙂

Now for the obligatory screenshot:

A screenshot showing the very first useful applet that uses an extender

A screenshot showing the very first useful applet that uses an extender

What do you see, except for some quite ugly graphics? You see the kuiserver applet (the icon in the panel, it’s extender showing two completed transfers), and one of the transfers it shows is being dragged to another applet (the useless test applet). In case you’re wondering, the blue things are drag handles.

So what’s next? Pinheiro has agreed to make some mockups of extenders, so soon I’ll be able to make them actually look good. I will also add a ‘collect detachables’ function: a way to quickly return detached widgets to the applet they came from. And the kuiserver applet could use some love: the ability to cancel/pause transfers would be a nice addition for example. Stay tuned: I’ll probably create a little screencast showing extender usage in action soon.