[REVIEW] integration of kuiserver applet into the systemtray

Rob Scheepmaker r.scheepmaker at student.utwente.nl
Mon Nov 17 20:50:15 CET 2008


Hello all,

I've been working on integrating the kuiserver into the systemtray. At the 
moments it works, but it still has a couple of small issues, and the code is 
not yet as clean as I would like it to be, but considering the freeze is in a 
couple of hours, I really want to get this into svn as fast as possible, and 
would love some feedback to fix some problems this patch might have.

Attached you'll find a screenshot of the result. Basically i've implemented a 
job protocol (which uses applicationjobs dataengine), moved the jobwidget from 
playgrounds kuiserver applet to the systrays ui directory, and made sure all 
the protocol registering is done correctly.
Notice the green arrow icon at the left side of the systray... I noticed the 
usual way of doing icons in the systray is implementing a taskprotocol and 
task as part of the protocol providing the icon. This situation is a bit 
different though. In it's current implementation, that arrow will be shown 
whenever there are items in the systray's extender (arrow-up when the dialog 
is closed, arrow-down when the dialog is open), independent of which protocol 
provided the extenderitem. I think that's the correct way because both jobs, 
and notifications can last a long time (some notifications last indefinitely 
until an action is explicitly takes), so we should provide the user with a way 
to hide and show them when they want to. Because this task is not really 
specific to a protocol, and only relevant to the systray's UI, I've decided to 
put the task providing this icon (SystemTray::Extender::Task) in ui/. Besides, 
it also seemed to me that writing a taskprovider for this situation would be a 
bit overkill since it's just one task that has to be added or removed 
depending on the amount of items in the extender, and it is a task that solely 
concerns the actual systemtray applet. So I've added Applet as a friend to 
TaskArea, to be able to call addTask there directly from applet. If you think 
this decision is wrong, please tell me, and I can still create a taskprovider 
for this.

You might also note that there are a couple of changes to the applicationjobs 
dataengine, and jobwidget.cpp. For example, it now provides a complete list of 
process and total amounts in all different units provided by the kjob, and not 
only the amount of files and data. This makes the engine more generic, and 
it's really up to the visualization (jobwidget) to decide what to do with that 
information.

There is also a patch attached to libplasma which is necessary to use this 
kuiserver integration: I've moved showPopup to being a slot, and added a 
togglepopup slot to popupapplet. This is more consistent (we have a hidepopup 
slot after all, why not a way to show or toggle?), and doesn't require to add 
a slot to the systray and call the necesarry functions from there.

There are still problems: the arrow icon has margins which are too large (I 
used an Plasma::IconWidget here, is that maybe the problem?), and there's 
stuff I just haven't had time to test yet (are detached items being restored 
correctly?). And I should probably add some documentation. But I assume small 
trivial improvements (when do we automatically want to hide or show the dialog 
for example? what do users expect here?) to improve usability aren't too much 
of a problem while in feature freeze.

Please let me know If you think it's ok for me to commit this.

Regards,
Rob

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ��k
Type: image/png
Size: 37329 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20081117/9c499f58/attachment-0001.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kuiserverintegration.diff
Type: text/x-patch
Size: 58650 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20081117/9c499f58/attachment-0002.diff 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: popupapplet.diff
Type: text/x-patch
Size: 1941 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20081117/9c499f58/attachment-0003.diff 


More information about the Plasma-devel mailing list