GNOME Bugzilla – Bug 414492
don't show swap history when computer has no swap
Last modified: 2013-08-02 00:00:07 UTC
System Monitor shouldn't show the Swap History in the Resources panel if the computer doesn't have any swap.
This still happens in 2.22.2. It doesnt really take much time to fix if(swap.exists()){ swap_bar.show(true); } else { swap_bar.show(false); } //Just to show little effort this takes
what a nice patch, unfortunalety, i haven't managed to apply it.
Created attachment 198610 [details] "not available" after swapoff
Hiding the swap history and as proposed in [1] the color picker feels weird. A swap can be turned on and off at any time. Therefore the elements should be always present as the swap space can come and go. I find it more intuitive to show a "not available" string instead of a "0.0 of 0.0". [Patch attached] Unfortunately this change requires translation effort. [1] - https://bugs.launchpad.net/ubuntu/+source/gnome-system-monitor/+bug/231256 [2] - attachment "not available" after swapoff
Created attachment 198611 [details] [review] adds "not available" string if mem entry has a total of 0
Dmitri: the patch looks OK, but please also move the translator comment with the line for the swap usage containing the translatable string format, as this way I think translators won't be able to see the translator comment which could help them understand what they are translating.
The following fix has been pushed: 466b7e6 Don't show swap history when computer has no swap
Created attachment 200974 [details] [review] Don't show swap history when computer has no swap
(In reply to comment #4) > Hiding the swap history and as proposed in [1] the color picker feels weird. A > swap can be turned on and off at any time. Therefore the elements should be > always present as the swap space can come and go. This committed fix is even weirder. We are now telling the user that "Yes, we know there is no swap but we'll draw this useless line anyway." The swap history and the color picker should appear and disapper as swap is added or removed.
Created attachment 200981 [details] system monitor with swap removed Hiding the swap would mean that we would have only memory displayed in the middle section, so for this we would have to - remove the swap icon and details from below the chart - display only one line on the chart - update the section header and in my opinion after these changes the UI would not look as balanced as it does right now. (see the attached screenshot of what it would look like after making the above changes) So I think this bug needs a bit of design work to be able to better address it. As a temporary solution, I suggest disabling the color picker and not displaying the swap on the chart, but leaving the header and the swap info with the not available label there.
(In reply to comment #10) > As a temporary solution, I suggest disabling the color picker and not > displaying the swap on the chart, but leaving the header and the swap info with > the not available label there. I think this would be a good solution. This way there wouldn't be a useless graph on computers without swap but if a user checks System Monitor on an unfamiliar computer without swap they wouldn't be left wondering where the swap graph went.
(In reply to comment #10) > As a temporary solution, I suggest disabling the color picker and not > displaying the swap on the chart, but leaving the header and the swap info with > the not available label there. I do think we could lose the line on the graph. The LoadGraph object is not very flexible at the moment. The number of lines on the bottom 2 graphs are hard coded for example. LoadGraph is a bastard mix of C and C++ code (basically describes all of System Monitor, actually) in its worst form. I'd like to see this improved. I don't really have a strong opinion as to whether the color-picker should be disabled or not, though. Currently the color picker is not designed to grey out when set insensitive anyway. So, this would need to be changed. I am against removing it entirely, though. I tried this and as the current layout stands, I find it causes an imbalance.
[Adding missing "QA Contact" entry so system monitor bug report changes can still be watched via the "Users to watch" list on https://bugzilla.gnome.org/userprefs.cgi?tab=email when the assignee is changed to an individual.]
I have added a sensitive parameter to the color pickers, and in case we have no swap the swap picker is set to insensitive, and the swap graph is not drawn. This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.