mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-03-10 12:58:27 +03:00
addhardware: allow setting the char device target name
This commit is contained in:
parent
8c1eba2573
commit
6fa885e583
@ -54,6 +54,7 @@ char_widget_mappings = {
|
||||
"bind_port" : "char-bind-port",
|
||||
"bind_host" : "char-bind-host",
|
||||
"protocol" : "char-use-telnet",
|
||||
"target_name" : "char-target-name",
|
||||
}
|
||||
|
||||
def get_list_selection(widget):
|
||||
@ -117,6 +118,7 @@ class vmmAddHardware(vmmGObjectUI):
|
||||
"char_host_focus_in": (self.update_doc, "source_host"),
|
||||
"char_bind_host_focus_in": (self.update_doc, "bind_host"),
|
||||
"char_telnet_focus_in": (self.update_doc, "protocol"),
|
||||
"char_name_focus_in": (self.update_doc, "target_name"),
|
||||
})
|
||||
util.bind_escape_key_close(self)
|
||||
|
||||
@ -443,6 +445,7 @@ class vmmAddHardware(vmmGObjectUI):
|
||||
self.window.get_widget("char-bind-host").set_text("127.0.0.1")
|
||||
self.window.get_widget("char-bind-port").get_adjustment().value = 4556
|
||||
self.window.get_widget("char-use-telnet").set_active(False)
|
||||
self.window.get_widget("char-target-name").set_text("com.redhat.spice.0")
|
||||
|
||||
# Hide all notebook pages, so the wizard isn't as big as the largest
|
||||
# page
|
||||
@ -1143,6 +1146,7 @@ class vmmAddHardware(vmmGObjectUI):
|
||||
bind_host = self.window.get_widget("char-bind-host").get_text()
|
||||
source_port = self.window.get_widget("char-port").get_adjustment().value
|
||||
bind_port = self.window.get_widget("char-bind-port").get_adjustment().value
|
||||
target_name = self.window.get_widget("char-target-name").get_text()
|
||||
|
||||
if self.window.get_widget("char-use-telnet").get_active():
|
||||
protocol = VirtualCharDevice.CHAR_PROTOCOL_TELNET
|
||||
@ -1156,6 +1160,7 @@ class vmmAddHardware(vmmGObjectUI):
|
||||
"bind_port": bind_port,
|
||||
"bind_host": bind_host,
|
||||
"protocol": protocol,
|
||||
"target_name": target_name,
|
||||
}
|
||||
|
||||
try:
|
||||
|
@ -1504,7 +1504,7 @@ to connect to the virtual machine.</property>
|
||||
<child>
|
||||
<widget class="GtkTable" id="char-param-table">
|
||||
<property name="visible">True</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">8</property>
|
||||
@ -1519,6 +1519,34 @@ to connect to the virtual machine.</property>
|
||||
<property name="right_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkEntry" id="char-target-name">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<signal name="focus_in_event" handler="char_name_focus_in"/>
|
||||
</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>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="target-name-label">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">Name:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">char-use-telnet</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<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="GtkCheckButton" id="char-use-telnet">
|
||||
<property name="visible">True</property>
|
||||
|
Loading…
x
Reference in New Issue
Block a user