Nir Soffer has posted comments on this change.

Change subject: webadmin: Display more accurate size of ISO files
......................................................................


Patch Set 3: -Code-Review

(5 comments)

Waiting for new shiny patch :-)

....................................................
Commit Message
Line 9: Up until now DiskSizeRenderer which is used to render all 
image/disk/file
Line 10: sizes had 3 limitations:
Line 11: 1. Size appeared only in GB.
Line 12: 2. All numbers were integers.
Line 13: 3. Size smaller than 1GB appeared as '<1GB'
Done
Line 14: 
Line 15: From now on, it supports MB, KB, and numbers with floating point.
Line 16: 
Line 17: This patch uses new capability when displaing sizes of ISO files and 
floppies


Line 15: From now on, it supports MB, KB, and numbers with floating point.
Line 16: 
Line 17: This patch uses new capability when displaing sizes of ISO files and 
floppies
Line 18: under Storage -> Images.
Line 19: 
I understand now what you mean - you can describe it better like this:

    Now the render supports more precise and human friendly formatting, 
displaying size in KB/MB/GB.

    The new capability is used now only in <views modified> because <reason for 
changing>, other views uses the legacy format because <reason for not changing>.
Line 20: Change-Id: I95961fde2256a44b8474d8f41562bc0e33b0ad4a
Line 21: Bug-Url: https://bugzilla.redhat.com/1005889


....................................................
File 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/renderer/DiskSizeRenderer.java
Line 13:     }
Line 14: 
Line 15:     public enum Format {
Line 16:         DEFAULT,
Line 17:         FORMATTED
Human readable is not a new concept, see man ls (1)
Line 18:     }
Line 19: 
Line 20:     private final DiskSizeUnit unit;
Line 21:     private final Format format;


Line 68: 
Line 69:         return sizeInGB;
Line 70:     }
Line 71: 
Line 72:     private String format(double sizeInGB) {
Use the same name you are using in the Format enum?
Line 73:         if (sizeInGB == 0) {
Line 74:             // sizeInGB = 0 means that Engine is working with old VDSM 
which doesn't return the correct size, so it
Line 75:             // should display the size as 'less than 1 GB' for 
backward compatibility
Line 76:             return "< 1 GB"; //$NON-NLS-1$


Line 73:         if (sizeInGB == 0) {
Line 74:             // sizeInGB = 0 means that Engine is working with old VDSM 
which doesn't return the correct size, so it
Line 75:             // should display the size as 'less than 1 GB' for 
backward compatibility
Line 76:             return "< 1 GB"; //$NON-NLS-1$
Line 77:         }
Makes sense.
Line 78: 
Line 79:         NumberFormat fmt = NumberFormat.getFormat("####.##"); 
//$NON-NLS-1$
Line 80:         if (sizeInGB >= 1) {
Line 81:             return fmt.format(sizeInGB) + " GB"; //$NON-NLS-1$


-- 
To view, visit http://gerrit.ovirt.org/19550
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I95961fde2256a44b8474d8f41562bc0e33b0ad4a
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Sergey Gotliv <sgot...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Daniel Erez <de...@redhat.com>
Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com>
Gerrit-Reviewer: Sergey Gotliv <sgot...@redhat.com>
Gerrit-Reviewer: Tal Nisan <tni...@redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to