Fix NIC naming, make MAC address copy-and-pastable again

This commit is contained in:
Hugh O. Brock 2007-04-25 17:51:42 -04:00
parent b6f4d007cd
commit 21d090d6fa
3 changed files with 30 additions and 97 deletions

View File

@ -415,7 +415,6 @@ class vmmDetails(gobject.GObject):
self.window.get_widget("network-source-device").set_text(netinfo[1])
else:
self.window.get_widget("network-source-device").set_text("-")
self.window.get_widget("network-target-device").set_text(netinfo[2])
self.window.get_widget("network-mac-address").set_text(netinfo[3])
def config_vcpus_changed(self, src):
@ -427,8 +426,6 @@ class vmmDetails(gobject.GObject):
self.vm.set_vcpu_count(vcpus)
self.window.get_widget("config-vcpus-apply").set_sensitive(False)
def config_memory_changed(self, src):
self.window.get_widget("config-memory-apply").set_sensitive(True)
@ -541,13 +538,13 @@ class vmmDetails(gobject.GObject):
row[3] = nic
missing = False
# Insert poisition is at end....
# Insert position is at end....
# XXX until we add support for Mice, etc
insertAt = insertAt + 1
# Add in row
if missing:
hw_list_model.insert(insertAt, ["NIC %s" % nic[2], self.pixbuf_nic, VMM_HW_NIC, nic])
hw_list_model.insert(insertAt, ["NIC #%d" % len(currentNICs), self.pixbuf_nic, VMM_HW_NIC, nic])
# Now remove any no longer current devs
devs = range(len(hw_list_model))

View File

@ -497,13 +497,11 @@ class vmmDomain(gobject.GObject):
try:
ret = ctx.xpathEval("/domain/devices/interface")
n = 0
for node in ret:
type = node.prop("type")
devmac = None
source = None
target = "eth%d" % n
n = n + 1
target = None
for child in node.children:
if child.name == "source":
if type == "bridge":
@ -518,7 +516,8 @@ class vmmDomain(gobject.GObject):
source = None
elif child.name == "mac":
devmac = child.prop("address")
elif child.name == "target":
target = child.prop("dev")
# XXX Hack - ignore devs without a MAC, since we
# need mac for uniqueness. Some reason XenD doesn't
# always complete kill the NIC record

View File

@ -2341,7 +2341,7 @@
<widget class="GtkTable" id="table31">
<property name="border_width">3</property>
<property name="visible">True</property>
<property name="n_rows">4</property>
<property name="n_rows">3</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">3</property>
@ -2425,36 +2425,8 @@
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="network-mac-address">
<property name="visible">True</property>
<property name="label" translatable="yes">label396</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</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="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
@ -2488,62 +2460,6 @@
</packing>
</child>
<child>
<widget class="GtkLabel" id="label398">
<property name="visible">True</property>
<property name="label" translatable="yes">Target device:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="network-target-device">
<property name="visible">True</property>
<property name="label" translatable="yes">label399</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="network-source-device">
<property name="visible">True</property>
@ -2571,6 +2487,27 @@
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="network-mac-address">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char">•</property>
<property name="activates_default">False</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="y_options"></property>
</packing>
</child>
</widget>
</child>
</widget>
@ -2658,7 +2595,7 @@
<child>
<widget class="GtkLabel" id="label400">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Tip:&lt;/b&gt; 'source' refers to information seen from the host OS, while 'target' refers to information seen from the guest OS</property>
<property name="label" translatable="yes">&lt;b&gt;Tip:&lt;/b&gt; 'Source device' refers to the name of the device as seen from the host OS.</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>