details: Explicitly list some SPICE values

This also allows changing the keymap, like with VNC displays.
This commit is contained in:
Cole Robinson 2010-12-20 12:48:14 -05:00
parent a3b50aa61f
commit 41b38c4856
2 changed files with 58 additions and 21 deletions

View File

@ -2245,28 +2245,40 @@ class vmmDetails(vmmGObjectUI):
show_row(widget_name)
self.window.get_widget("gfx-" + widget_name).set_text(text)
def port_to_string(port):
if port is None:
return "-"
return (port == -1 and _("Automatically allocated") or str(port))
gtype = gfx.type
is_vnc = (gtype == "vnc")
is_sdl = (gtype == "sdl")
is_spice = (gtype == "spice")
is_other = not any([is_vnc, is_sdl, is_spice])
if is_vnc:
set_title(_("VNC Display"))
set_title(_("%(graphicstype)s Server") %
{"graphicstype" : str(gtype).upper()})
port = (gfx.port == -1 and
_("Automatically allocated") or
str(gfx.port))
if is_vnc or is_spice:
port = port_to_string(gfx.port)
address = (gfx.listen or "127.0.0.1")
passwd = gfx.passwd or ""
keymap = (gfx.keymap or None)
show_text("port", port)
show_text("address", address)
show_text("password", passwd)
show_row("keymap", "-box")
self.set_combo_label("gfx-keymap", 0, keymap)
elif is_sdl:
if is_vnc:
passwd = gfx.passwd or ""
show_text("password", passwd)
if is_spice:
tlsport = port_to_string(gfx.tlsPort)
show_text("tlsport", tlsport)
if is_sdl:
set_title(_("Local SDL Window"))
display = gfx.display or _("Unknown")
@ -2275,10 +2287,8 @@ class vmmDetails(vmmGObjectUI):
show_text("display", display)
show_text("xauth", xauth)
else:
gtype = str(gtype).upper()
set_title(_("%s Display") % gtype)
show_text("type", gtype)
if is_other:
show_text("type", str(gtype).upper())
def refresh_sound_page(self):
sound = self.get_hw_selection(HW_LIST_COL_DEVICE)

View File

@ -4005,7 +4005,7 @@ I/O:</property>
<widget class="GtkTable" id="graphics-table">
<property name="visible">True</property>
<property name="border_width">3</property>
<property name="n_rows">7</property>
<property name="n_rows">8</property>
<property name="n_columns">2</property>
<property name="column_spacing">8</property>
<child>
@ -4078,8 +4078,8 @@ I/O:</property>
<property name="use_underline">True</property>
</widget>
<packing>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="top_attach">6</property>
<property name="bottom_attach">7</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
@ -4094,8 +4094,8 @@ I/O:</property>
<property name="mnemonic_widget">gfx-keymap-combo</property>
</widget>
<packing>
<property name="top_attach">6</property>
<property name="bottom_attach">7</property>
<property name="top_attach">7</property>
<property name="bottom_attach">8</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
@ -4126,8 +4126,8 @@ I/O:</property>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">6</property>
<property name="bottom_attach">7</property>
<property name="top_attach">7</property>
<property name="bottom_attach">8</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
@ -4213,8 +4213,8 @@ I/O:</property>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="top_attach">6</property>
<property name="bottom_attach">7</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
@ -4228,6 +4228,33 @@ I/O:</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="gfx-tlsport-title">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="ypad">2</property>
<property name="label" translatable="yes">TLS Port:</property>
</widget>
<packing>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="gfx-tlsport">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label">label</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
</widget>
</child>
</widget>