[gnome-boxes] wizard: More details at summary page on VM creation



commit ad6370d224ea2c481e9342e9aa35bc5fff83027a
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Tue Nov 29 00:31:21 2011 +0200

    wizard: More details at summary page on VM creation
    
    https://bugzilla.gnome.org/show_bug.cgi?id=665068

 src/unattended-installer.vala |   15 +++++++++++++++
 src/wizard.vala               |   23 ++++++++++++++++++++++-
 2 files changed, 37 insertions(+), 1 deletions(-)
---
diff --git a/src/unattended-installer.vala b/src/unattended-installer.vala
index 2462125..acce378 100644
--- a/src/unattended-installer.vala
+++ b/src/unattended-installer.vala
@@ -14,6 +14,21 @@ private abstract class Boxes.UnattendedInstaller: InstallerMedia {
         private set { _floppy_path = value; }
     }
 
+    public bool express_install {
+        get { return express_toggle.active; }
+    }
+
+    public string username {
+        get { return username_entry.text; }
+    }
+
+    public string hidden_password {
+        owned get {
+            return password_entry.text.length > 0 ?
+                   string.nfill (password_entry.text_length, '*') : "no password";
+        }
+    }
+
     protected string unattended_src_path;
     protected string unattended_dest_name;
 
diff --git a/src/wizard.vala b/src/wizard.vala
index 7949677..c0c5cc1 100644
--- a/src/wizard.vala
+++ b/src/wizard.vala
@@ -116,6 +116,16 @@ private class Boxes.Wizard: Boxes.UI {
         });
     }
 
+    private static string memory_to_string (int64 memory) {
+        if (memory >= Osinfo.GIBIBYTES)
+            // Translators: GB here means giga bytes. More information: http://en.wikipedia.org/wiki/Gigabyte
+            return _("%lld GB".printf (memory / Osinfo.GIBIBYTES));
+        else
+            // Does anyone have < 1M memory?
+            // Translators: MB here means mega bytes. More information: http://en.wikipedia.org/wiki/Megabyte
+            return _("%lld MB".printf (memory / Osinfo.MEBIBYTES));
+    }
+
     public Wizard (App app) {
         this.app = app;
 
@@ -273,8 +283,19 @@ private class Boxes.Wizard: Boxes.UI {
                     summary.add_property (_("Port"), uri.port.to_string ());
                 break;
             }
-        } else if (install_media != null)
+        } else if (install_media != null) {
             summary.add_property (_("System"), install_media.label);
+            if (install_media is UnattendedInstaller) {
+                var media = install_media as UnattendedInstaller;
+                if (media.express_install) {
+                    summary.add_property (_("Username"), media.username);
+                    summary.add_property (_("Password"), media.hidden_password);
+                }
+
+                summary.add_property (_("Memory"), memory_to_string (resources.ram));
+                summary.add_property (_("Disk"),  _("%s maximum".printf (memory_to_string (resources.storage))));
+            }
+        }
     }
 
     private void add_step (Gtk.Widget widget, string title, WizardPage page) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]