[virt-tools-list] [PATCH 4 of 6] details: add SPICE details

Marc-André Lureau marcandre.lureau at redhat.com
Fri Dec 17 13:51:25 UTC 2010


# HG changeset patch
# User Marc-André Lureau <marcandre.lureau at redhat.com>
# Date 1292592815 -3600
# Node ID 01667175a00b22b91f3592761dbd148a5bb47d58
# Parent  a72eb055da5dea83f320861f1148c3c5fe6781af
details: add SPICE details

diff -r a72eb055da5d -r 01667175a00b src/virtManager/details.py
--- a/src/virtManager/details.py	Fri Nov 12 17:05:48 2010 +0100
+++ b/src/virtManager/details.py	Fri Dec 17 14:33:35 2010 +0100
@@ -2014,25 +2014,37 @@
 
         is_vnc = (gfx.type == "vnc")
         is_sdl = (gfx.type == "sdl")
+        is_spice = (gfx.type == "spice")
+
+        def port_to_string(port):
+            return (port == -1 and _("Automatically allocated") or str(port))
 
         port = _("N/A")
+        tls_port = _("N/A")
+        address = _("N/A")
+        passwd  = _("N/A")
+        keymap  = _("N/A")
+
+        if is_vnc or is_spice:
+            port = port_to_string(gfx.port)
+            address = gfx.listen or "127.0.0.1"
+            passwd = "-"
+            keymap = gfx.keymap or _("None")
+
         if is_vnc:
             gtype = _("VNC server")
-            port  = (gfx.port == -1 and
-                     _("Automatically allocated") or
-                     str(gfx.port))
+        elif is_spice:
+            gtype = _("SPICE server")
+            tls_port = port_to_string(gfx.tlsPort)
         elif is_sdl:
             gtype = _("Local SDL window")
         else:
             gtype = gfx.type
 
-        address = (is_vnc and (gfx.listen or "127.0.0.1") or _("N/A"))
-        passwd  = (is_vnc and "-" or _("N/A"))
-        keymap  = (is_vnc and (gfx.keymap or _("None")) or _("N/A"))
-
         self.window.get_widget("graphics-type").set_text(gtype)
         self.window.get_widget("graphics-address").set_text(address)
         self.window.get_widget("graphics-port").set_text(port)
+        self.window.get_widget("graphics-tls-port").set_text(tls_port)
         self.window.get_widget("graphics-password").set_text(passwd)
         self.window.get_widget("graphics-keymap").set_text(keymap)
 
diff -r a72eb055da5d -r 01667175a00b src/vmm-details.glade
--- a/src/vmm-details.glade	Fri Nov 12 17:05:48 2010 +0100
+++ b/src/vmm-details.glade	Fri Dec 17 14:33:35 2010 +0100
@@ -1,4 +1,4 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <glade-interface>
   <!-- interface-requires gtk+ 2.6 -->
   <!-- interface-naming-policy toplevel-contextual -->
@@ -1487,7 +1487,7 @@
                                                   <widget class="GtkEntry" id="security-label">
                                                     <property name="visible">True</property>
                                                     <property name="can_focus">True</property>
-                                                    <property name="invisible_char">&#x25CF;</property>
+                                                    <property name="invisible_char">●</property>
                                                     <signal name="changed" handler="on_security_label_changed"/>
                                                   </widget>
                                                   <packing>
@@ -1952,7 +1952,7 @@
                                                   <widget class="GtkSpinButton" id="config-vcpus">
                                                     <property name="visible">True</property>
                                                     <property name="can_focus">True</property>
-                                                    <property name="invisible_char">&#x25CF;</property>
+                                                    <property name="invisible_char">●</property>
                                                     <property name="adjustment">2 1 32 1 2 0</property>
                                                     <property name="climb_rate">1</property>
                                                     <property name="numeric">True</property>
@@ -2103,7 +2103,7 @@
                                                   <widget class="GtkEntry" id="config-vcpupin">
                                                     <property name="visible">True</property>
                                                     <property name="can_focus">True</property>
-                                                    <property name="invisible_char">&#x25CF;</property>
+                                                    <property name="invisible_char">●</property>
                                                     <accessibility>
                                                       <atkproperty name="AtkObject::accessible-name" translatable="yes">Virtual CPU Affinity Select</atkproperty>
                                                     </accessibility>
@@ -2370,7 +2370,7 @@
                                               <widget class="GtkSpinButton" id="config-memory">
                                                 <property name="visible">True</property>
                                                 <property name="can_focus">True</property>
-                                                <property name="invisible_char">&#x25CF;</property>
+                                                <property name="invisible_char">●</property>
                                                 <property name="adjustment">50 50 32000 1 25 0</property>
                                                 <property name="climb_rate">2</property>
                                                 <property name="numeric">True</property>
@@ -2413,7 +2413,7 @@
                                               <widget class="GtkSpinButton" id="config-maxmem">
                                                 <property name="visible">True</property>
                                                 <property name="can_focus">True</property>
-                                                <property name="invisible_char">&#x25CF;</property>
+                                                <property name="invisible_char">●</property>
                                                 <property name="adjustment">50 50 32000 1 25 0</property>
                                                 <property name="climb_rate">2</property>
                                                 <property name="numeric">True</property>
@@ -3370,7 +3370,7 @@
                                       <widget class="GtkTable" id="table34">
                                         <property name="visible">True</property>
                                         <property name="border_width">3</property>
-                                        <property name="n_rows">5</property>
+                                        <property name="n_rows">6</property>
                                         <property name="n_columns">2</property>
                                         <property name="column_spacing">8</property>
                                         <property name="row_spacing">4</property>
@@ -3398,8 +3398,8 @@
                                           <packing>
                                             <property name="left_attach">1</property>
                                             <property name="right_attach">2</property>
-                                            <property name="top_attach">4</property>
-                                            <property name="bottom_attach">5</property>
+                                            <property name="top_attach">5</property>
+                                            <property name="bottom_attach">6</property>
                                             <property name="x_options">GTK_FILL</property>
                                             <property name="y_options"></property>
                                           </packing>
@@ -3414,8 +3414,8 @@
                                           <packing>
                                             <property name="left_attach">1</property>
                                             <property name="right_attach">2</property>
-                                            <property name="top_attach">3</property>
-                                            <property name="bottom_attach">4</property>
+                                            <property name="top_attach">4</property>
+                                            <property name="bottom_attach">5</property>
                                             <property name="x_options">GTK_FILL</property>
                                             <property name="y_options"></property>
                                           </packing>
@@ -3497,8 +3497,8 @@
                                             <property name="label" translatable="yes">Password:</property>
                                           </widget>
                                           <packing>
-                                            <property name="top_attach">3</property>
-                                            <property name="bottom_attach">4</property>
+                                            <property name="top_attach">4</property>
+                                            <property name="bottom_attach">5</property>
                                             <property name="x_options">GTK_FILL</property>
                                             <property name="y_options"></property>
                                           </packing>
@@ -3510,8 +3510,37 @@
                                             <property name="label" translatable="yes">Keymap:</property>
                                           </widget>
                                           <packing>
-                                            <property name="top_attach">4</property>
-                                            <property name="bottom_attach">5</property>
+                                            <property name="top_attach">5</property>
+                                            <property name="bottom_attach">6</property>
+                                            <property name="x_options">GTK_FILL</property>
+                                            <property name="y_options"></property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkLabel" id="label30">
+                                            <property name="visible">True</property>
+                                            <property name="xalign">1</property>
+                                            <property name="label" translatable="yes">TLS port:</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="top_attach">3</property>
+                                            <property name="bottom_attach">4</property>
+                                            <property name="x_options">GTK_FILL</property>
+                                            <property name="y_options"></property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <widget class="GtkLabel" id="graphics-tls-port">
+                                            <property name="visible">True</property>
+                                            <property name="xalign">0</property>
+                                            <property name="label">label401</property>
+                                            <property name="selectable">True</property>
+                                          </widget>
+                                          <packing>
+                                            <property name="left_attach">1</property>
+                                            <property name="right_attach">2</property>
+                                            <property name="top_attach">3</property>
+                                            <property name="bottom_attach">4</property>
                                             <property name="x_options">GTK_FILL</property>
                                             <property name="y_options"></property>
                                           </packing>




More information about the virt-tools-list mailing list