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

View File

@ -4005,7 +4005,7 @@ I/O:</property>
<widget class="GtkTable" id="graphics-table"> <widget class="GtkTable" id="graphics-table">
<property name="visible">True</property> <property name="visible">True</property>
<property name="border_width">3</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="n_columns">2</property>
<property name="column_spacing">8</property> <property name="column_spacing">8</property>
<child> <child>
@ -4078,8 +4078,8 @@ I/O:</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
</widget> </widget>
<packing> <packing>
<property name="top_attach">5</property> <property name="top_attach">6</property>
<property name="bottom_attach">6</property> <property name="bottom_attach">7</property>
<property name="x_options">GTK_FILL</property> <property name="x_options">GTK_FILL</property>
<property name="y_options"></property> <property name="y_options"></property>
</packing> </packing>
@ -4094,8 +4094,8 @@ I/O:</property>
<property name="mnemonic_widget">gfx-keymap-combo</property> <property name="mnemonic_widget">gfx-keymap-combo</property>
</widget> </widget>
<packing> <packing>
<property name="top_attach">6</property> <property name="top_attach">7</property>
<property name="bottom_attach">7</property> <property name="bottom_attach">8</property>
<property name="x_options">GTK_FILL</property> <property name="x_options">GTK_FILL</property>
<property name="y_options"></property> <property name="y_options"></property>
</packing> </packing>
@ -4126,8 +4126,8 @@ I/O:</property>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="right_attach">2</property> <property name="right_attach">2</property>
<property name="top_attach">6</property> <property name="top_attach">7</property>
<property name="bottom_attach">7</property> <property name="bottom_attach">8</property>
<property name="x_options">GTK_FILL</property> <property name="x_options">GTK_FILL</property>
<property name="y_options"></property> <property name="y_options"></property>
</packing> </packing>
@ -4213,8 +4213,8 @@ I/O:</property>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="right_attach">2</property> <property name="right_attach">2</property>
<property name="top_attach">5</property> <property name="top_attach">6</property>
<property name="bottom_attach">6</property> <property name="bottom_attach">7</property>
<property name="x_options">GTK_FILL</property> <property name="x_options">GTK_FILL</property>
</packing> </packing>
</child> </child>
@ -4228,6 +4228,33 @@ I/O:</property>
<property name="x_options">GTK_FILL</property> <property name="x_options">GTK_FILL</property>
</packing> </packing>
</child> </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> </widget>
</child> </child>
</widget> </widget>