GNOME Bugzilla – Bug 693207
boxes uses different units from all the others
Last modified: 2016-03-31 14:02:58 UTC
in the boxes ui for changing disk size, I see GiB. That gave me some raised eyebrows in a recent demonstration, and claims of inconsistency. And indeed, comparing the rest of the desktop: nautilus - GB disks - GB baobab - GB
Yes, we should use G_FORMAT_SIZE_DEFAULT except for the ram size, which should be G_FORMAT_SIZE_IEC_UNITS.
Yeah, I'll fix this after I'm done with bug#688333.
Created attachment 235281 [details] [review] Dont use IEC units Use the default size units of GLib.format_size() for consistancy with other GNOME modules (e.g nautilus, disks and baobab etc).
Review of attachment 235281 [details] [review]: I don't think this is quite right. The format_size docs say: * @G_FORMAT_SIZE_IEC_UNITS: use IEC (base 1024) units with "KiB"-style * suffixes. IEC units should only be used for reporting things with * a strong "power of 2" basis, like RAM sizes or RAID stripe sizes. * Network and storage sizes should be reported in the normal SI units. So, we should probably still use them for the RAM size. Also, using different units for the presentations means we have to use the right basis for the step size (i.e. 1000 based for disk, 1024 based for ram).
(In reply to comment #4) > Review of attachment 235281 [details] [review]: > > I don't think this is quite right. The format_size docs say: > > * @G_FORMAT_SIZE_IEC_UNITS: use IEC (base 1024) units with "KiB"-style > * suffixes. IEC units should only be used for reporting things with > * a strong "power of 2" basis, like RAM sizes or RAID stripe sizes. > * Network and storage sizes should be reported in the normal SI units. > > So, we should probably still use them for the RAM size. But IMHO that would look very inconsistent and therefore bad in the UI. :( Wouldn't it? > Also, using different units for the presentations means we have to use the > right basis for the step size (i.e. 1000 based for disk, 1024 based for ram). I changed that in bug#688333.
Well, its what our docs say... Guess we should bring it up somewhere if we disagree with it. The step size *value* was changed, yes, but not the base. With that change it is 64 * Osinfo.MEBIBYTES == 64 * 1024 * 1024, which is crap when we render numbers with a base of 1000 * 1000.
(In reply to comment #6) > Well, its what our docs say... Guess we should bring it up somewhere if we > disagree with it. I wonder if the doc writer was thinking about these getting presented at the same place/page in the UI. The only existing GNOME app that I could think of that uses both on the same page is system monitor and that uses IEC units for both RAM and storage. I think our case is more similar to that of system monitor than nautilus as accuracy is kinda important for us too. Although Disks uses GB but it uses the full format. Maybe we should do the same for both for 'current' size label and use the default (short) format on min and max? > The step size *value* was changed, yes, but not the base. With that change it > is > 64 * Osinfo.MEBIBYTES == 64 * 1024 * 1024, which is crap when we render numbers > with a base of 1000 * 1000. Yeah, now I get it.
Oh and mockups use default untis for both: https://github.com/gnome-design-team/gnome-mockups/raw/master/boxes/boxes-install5.5.png
a few more cases in point: gnome-system-monitor: uses GiB for memory sizes... but then also uses it for disk space details panel, control-center: uses GiB for memory and GB for disk space
I think GiB for ram and GB for disk is right. Its somewhat confusing, but so are any other choices and there is at least a reasonable rationale for this particular choice (and its in-line with the glib docs).
Created attachment 236251 [details] [review] properties: Allow configuring format of size strings i-e Whether to use default format or IEC.
Created attachment 236252 [details] [review] wizard,libvirt-machine: Don't use IEC units for storage
Both these look ok to me, but you also need to change the step size so that its in the right kind of unit wrt the format of the slide.
Review of attachment 236251 [details] [review]: ack
Review of attachment 236252 [details] [review]: ack (but you also need to change step side)
Created attachment 236603 [details] [review] wizard,libvirt-machine: Don't use IEC units for storage
Review of attachment 236603 [details] [review]: ack
Attachment 236251 [details] pushed as e581dfd - properties: Allow configuring format of size strings Attachment 236603 [details] pushed as b8c2d4c - wizard,libvirt-machine: Don't use IEC units for storage