[gnome-boxes] Don't provide option to eject CDROM during installation



commit 4bed1f58ce63b529722ce42453e87f56b11d2d49
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Tue Mar 12 03:06:35 2013 +0200

    Don't provide option to eject CDROM during installation
    
    Both installation and live sessions require the installer/live media to
    be present and therefore it does not make sense to allow users to eject
    it during installation/live session. User could accidently click the
    'Remove' button and everythig goes boom.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=690779

 src/libvirt-machine-properties.vala |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)
---
diff --git a/src/libvirt-machine-properties.vala b/src/libvirt-machine-properties.vala
index bef32b5..446ba54 100644
--- a/src/libvirt-machine-properties.vala
+++ b/src/libvirt-machine-properties.vala
@@ -273,28 +273,36 @@ private class Boxes.LibvirtMachineProperties: GLib.Object, Boxes.IPropertiesProv
 
         var label = new Gtk.Label ("");
         label.set_ellipsize (Pango.EllipsizeMode.END);
-
         grid.add (label);
 
         var source = disk_config.get_source ();
         bool empty = (source == null || source == "");
 
+        if (empty)
+            // Translators: empty is listed as the filename for a non-mounted CD
+            label.set_markup (Markup.printf_escaped ("<i>%s</i>", _("empty")));
+        else
+            label.set_text (get_utf8_basename (source));
+
+        if (VMConfigurator.is_install_config (machine.domain_config) ||
+            VMConfigurator.is_live_config (machine.domain_config)) {
+            add_property (ref list, _("CD/DVD"), grid);
+
+            return;
+        }
+
         var button_label = new Gtk.Label ("");
         var button = new Gtk.Button ();
         button.add (button_label);
 
         grid.add (button);
 
-        if (empty) {
+        if (empty)
             // Translators: This is the text on the button to select an iso for the cd
             button_label.set_text (_("Select"));
-            // Translators: empty is listed as the filename for a non-mounted CD
-            label.set_markup (Markup.printf_escaped ("<i>%s</i>", _("empty")));
-        } else {
+        else
             // Translators: Remove is the label on the button to remove an iso from a cdrom drive
             button_label.set_text (_("Remove"));
-            label.set_text (get_utf8_basename (source));
-        }
 
         button.clicked.connect ( () => {
             if (empty) {


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