details: Small direct interface tweaks

- List nicer names for mode in the UI
- Fix a label spacing issue if expanding the UI
- Don't set mode = "" for non direct interfaces
This commit is contained in:
Cole Robinson 2011-05-19 12:13:20 -04:00
parent 37ab864cfb
commit 7d5acf4b86
4 changed files with 8 additions and 8 deletions

View File

@ -1837,10 +1837,9 @@ class vmmDetails(vmmGObjectUI):
net_bridge = self.window.get_widget("network-bridge")
nettype, source = uihelpers.get_network_selection(net_list, net_bridge)
source_mode = None
if (nettype == "direct"):
source_mode = self.get_combo_label_value("network-source-mode")
else:
source_mode = ""
model = self.get_combo_label_value("network-model")

View File

@ -543,9 +543,10 @@ class vmmDomain(vmmLibvirtObject):
if not newtype:
return
editdev.source = None
editdev.type = newtype
editdev.source = newsource
editdev.source_mode = newmode
editdev.source_mode = newmode or None
return self._redefine_device(change, devobj)
def define_network_model(self, devobj, newmodel):
def change(editdev):

View File

@ -209,10 +209,10 @@ def populate_source_mode_combo(vm, combo):
# [xml value, label]
model.append([None, _("")])
model.append(["vepa", "vepa"])
model.append(["bridge", "bridge"])
model.append(["private", "private"])
model.append(["passthrough", "passthrough"])
model.append(["vepa", "VEPA"])
model.append(["bridge", "Bridge"])
model.append(["private", "Private"])
model.append(["passthrough", "Passthrough"])
def build_netmodel_combo(vm, combo):
dev_model = gtk.ListStore(str, str)

View File

@ -3721,7 +3721,6 @@ I/O:</property>
<child>
<widget class="GtkHBox" id="network-source-mode-box">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
<widget class="GtkComboBox" id="network-source-mode-combo">
<property name="visible">True</property>
@ -3762,6 +3761,7 @@ I/O:</property>
<packing>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
</widget>