Questions about plasma notifications

Eduardo Robles Elvira edulix at gmail.com
Sun Mar 14 23:50:16 CET 2010


Hello everyone,

In Artesanos we are working in the new KDE Bluetooth stack (aka
Bluedevil). When receiving files from a device, we're using a KJob.
When plasma-desktop is active and showing the notifications applet,
the notifications applet shows the KJob progress bar. But there are
two issues I wnat to address/discuss:

*  The progress bar

Sometimes when receiving a file over bluetooth, for some reason the
sender device doesn't advertise the file size, so we cannot show the
percentage of the file being transferred. Currently this means that
the notification shows an empty progress bar.

What I suggest is that a "busy indicator" as with QProgressBar should
be used instead. Note that the progressbar shown by omission is the
"global progress bar", which account for all the active kjobs
progress. Only if you click in the expand button the current list of
active kjobs is shown.My suggestion is:
 1. implement a patch for Plasma::Meter widget (JobTotalsWidget is the
one being used and inherits from Plasma::Meter) which works as
QProgressBar: if the properties maximum and minimum are set to zero, a
busy indicator will be shown instead of a pecentage of steps.
 2. In JobTotalsWidget::updateJob() check if m_job->totalAmounts has a
value with 0, and if so then use the busy indicator.
 3. In order to make the above work in the global progress bar too, in
the notifications manager Manager::updateTotals() function, do
something like:
if (d->jobs.count() == 1) {
            QMap<QString, qlonglong> totalAmounts =
d->jobs.first()->totalAmounts();
            if (totalAmounts.size() == 1 &&
totalAmounts.values().first() == 0) {
                d->jobTotals->setTotalAmounts(totalAmounts);
            }
        }

I can work a patch for this, but first I wanted to see if it's correct at all :P

* Job Finished notification

When a Job takes less than X seconds (currently, 1.5s) to finish, no
notification is shown. And that's ok and has been discussed before: we
want to bother the user as little as possible and a notification that
happens for less than 1.5 seconds doesn't makes sense. But what about
the "job finished" notification? That one doesn't have a
time-constrain, and is equally useful independant of the time the job
took to finish.

Use case of this: sending a picture over bluetooth from our mobile to
our superb laptop. The user accepts the file transfer. As it's a small
picture, and the phone is 10cm away from the laptop, the transfer is
nearly instantaneous. No progress dialog is shown. However, the user
still wants to be able to know when the transfer has been completed,
and to be able to access to the received file, but the "finished"
notification never comes.

I can work on patch for this if it's ok too, then send it to review
board. Other option is to manually check if the transfer took less
than 1.5 seconds and in that case send manually a "finished"
notification, or delay the finalization of the job so that it takes at
least 1.5 seconds..., but those are hacks.

Regards,
    Eduardo Robles Elvira.


More information about the Plasma-devel mailing list