! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
xfce4-diskperf-plugin doesn't work nice with removable drives
Status:
RESOLVED: FIXED
Severity:
enhancement
Product:
Xfce4-diskperf-plugin
Component:
General

Comments

Description Harald Judt 2010-10-28 16:43:56 CEST
Created attachment 3159 
Make plugin work with devices connected after plugin start.

xfce4-diskperf-plugin will not work if you configure it to monitor a removable drive. I'd like to use it with USB drives and other hotpluggable stuff.

The configuration dialog won't let you enter a device which doesn't exist and will use hda or whatever as default. However, you can do the configuration while the device is connected, and the settings will be saved successfully. Plug the device in at a later time, and the monitor will work ok.

However, upon panel restart, the plugin will not do its monitoring duty anymore if the device is not present.

I've fixed the last problem, but I think it's more a hack than a real solution. See patch attached.

Enhancement proposal:

1) Let user specify non-existent device in configuration dialog, perhaps popup a warning or changing text color to red when it doesn't exist like in thunar mass renamer.

2) Make plugin work when device gets connected after panel restart.
Comment 1 Harald Judt 2011-02-25 13:34:49 CET
I take the liberty of bumping this bug so it won't get lost.

Note though, that the patch only fixes this in Linux, not *BSD. I don't use FreeBSD etc., so I cannot test any changes.

Additionally, a patch is recommended to change the dialog currently alerting the user that the specified device doesn't exist. Maybe I will post such a patch when I have more time.

A better solution would be to create one instance of diskperf-plugin to watch several drives at once and add or remove progress meters and labels accordingly, depending on which drive is available (attached).
Comment 2 Landry Breuil editbugs 2012-04-03 16:32:06 CEST
Idea is nice, but a full patch properly implementing this would be welcome..
Comment 3 Harald Judt 2012-04-24 19:49:40 CEST
Created attachment 4361 
show-tooltip-when-no-stats-available.patch

Ok, let's try to improve the situation a bit.

First, here's a patch to always show a tooltip, even when no stats are available. I found it weird and a bit annoying that sometimes the tooltip would not appear; it's like the plugin simply ignores my request to display information, which is a behaviour I'm not very fond of.

This patch does not require attachment 3159  from the initial report. If I did not accidently make a mistake, it should apply fine.

I'm planning on removing the error message from the configuration dialog. With this patch, the tooltip will tell when the stats are not available. Next, I'll try to adapt the first patch so that it is compatible with a non-linux OS. Any help here would be greatly appreciated, as I cannot test it as a linux user.
Comment 4 Harald Judt 2012-04-24 20:37:29 CEST
Created attachment 4362 
no-errors-in-config.patch

Remove the error in the configuration dialog, relying on the tooltip displaying the error.

Of course, this has one drawback: The actual cause of the error will not be shown anymore, e.g. "Device does not exist". However, I wonder whether this is really a problem, because a default device name (even os-specific!) is already provided when the user adds a new monitor to the panel. Also, this check is only performed once - at configuration time, so if any problem arises later, the user will not be informed anyway.

I think the functionality gained when used together with the other patches outweighs this drawback, but opinions might differ.
Comment 5 Harald Judt 2012-04-24 20:52:45 CEST
Created attachment 4363 
linux-init-dev-on-demand.patch

After looking through the code, I believe that the problem this bug report was created for actually exists only on linux. Gathering stats works differently (and apparently simpler) on the other platforms.

I've modified the original patch so that the device is initialized (I don't even know if that is the correct word here) only when necessary, that is when it becomes available.

Is this solution acceptable for you?
Comment 6 Harald Judt 2012-04-24 20:55:30 CEST
Sorry, the last explanation was wrong... In fact, the patch tries to initialize the device when gathering stats was unsuccessful before.
Comment 7 Landry Breuil editbugs 2012-04-25 19:52:23 CEST
Applied all the patches to git, tested here on OpenBSD with an USB key, the behaviour is still correct. Thanks!

Bug #6749

Reported by:
Harald Judt
Reported on: 2010-10-28
Last modified on: 2012-04-25

People

Assignee:
Xfce-Goodies Maintainers
CC List:
1 user

Version

Attachments

Additional information