Questions about plasma notifications

Marco Martin notmart at gmail.com
Mon Mar 15 11:42:28 CET 2010


On Sunday 14 March 2010, Eduardo Robles Elvira wrote:
> 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.

yes, this would be nice (i wonder what should happen in the case of an analog 
meter tough, probably in this case nothing should happen)
also, i think a way to show the rogressbar empty is still needed, for instance 
in the systemmonitor disk usage applet, when it tries to show an invalid 
partition... mybe in this case happens when the maximum is negative.

>  2. In JobTotalsWidget::updateJob() check if m_job->totalAmounts has a
> value with 0, and if so then use the busy indicator.

this one would requre much more local little patches where a thing like that 
would make sense...
i would like more Meter being a bit smarter..

>  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

great :)
to me approach1 is the best.

> * 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.

this is a pretty delicate issue, since usually you still don't want the 
notification (for instance while moving a local file), wile in some cases, 
like the one you mentioned would be always good to have a notification.
i don't see other "clean" ways other than adding api explicitly for that (so 
to kio job and the dbus spec) but that would be really ungood as well.
I'm a bit out of ideas, someone has a better one? ;)

Cheers,
Marco Martin


More information about the Plasma-devel mailing list