[Kimchi-devel] [PATCH] [Kimchi 2/2] Issue #923: Template always shows VNC, even if I save Spice in my template

Jose Ricardo Ziviani joserz at linux.vnet.ibm.com
Thu Apr 7 19:07:56 UTC 2016


Signed-off-by: Jose Ricardo Ziviani <joserz at linux.vnet.ibm.com>
---
 ui/js/src/kimchi.template_edit_main.js | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/ui/js/src/kimchi.template_edit_main.js b/ui/js/src/kimchi.template_edit_main.js
index eda83b2..de72452 100644
--- a/ui/js/src/kimchi.template_edit_main.js
+++ b/ui/js/src/kimchi.template_edit_main.js
@@ -65,14 +65,22 @@ kimchi.template_edit_main = function() {
         $('#template-edit-memory-textbox').val(template.memory.current);
         $('#template-edit-max-memory-textbox').val(template.memory.maxmemory);
 
-        $('#template-edit-graphics').append('<option value="vnc" selected="selected">VNC</option>');
+        if (template.graphics.type == 'vnc') {
+            $('#template-edit-graphics').append('<option value="vnc" selected="selected">VNC</option>');
+        } else {
+            $('#template-edit-graphics').append('<option value="vnc">VNC</option>');
+        }
         var enableSpice = function() {
             if (kimchi.capabilities == undefined) {
                 setTimeout(enableSpice, 2000);
                 return;
             }
             if (kimchi.capabilities.qemu_spice == true) {
-                $('#template-edit-graphics').append('<option value="spice">Spice</option>');
+                if (template.graphics.type == 'spice') {
+                    $('#template-edit-graphics').append('<option value="spice" selected="selected">Spice</option>');
+                } else {
+                    $('#template-edit-graphics').append('<option value="spice">Spice</option>');
+                }
             }
         };
         var isImageBasedTemplate = function() {
-- 
1.9.1




More information about the Kimchi-devel mailing list