uihelpers: Move a few more functions closer to their callers

This commit is contained in:
Cole Robinson
2014-01-26 17:42:24 -05:00
parent 20088ab8fb
commit 58d5e0b799
16 changed files with 258 additions and 275 deletions

View File

@@ -165,6 +165,18 @@ class vmmCreateInterface(vmmGObjectUI):
# Initialization routines #
###########################
@staticmethod
def iface_in_use_by(conn, name):
use_str = ""
for i in conn.list_interface_names():
iface = conn.get_interface(i)
if name in iface.get_slave_names():
if use_str:
use_str += ", "
use_str += iface.get_name()
return use_str
@staticmethod
def build_interface_startmode_combo(combo):
model = Gtk.ListStore(str)
@@ -558,8 +570,8 @@ class vmmCreateInterface(vmmGObjectUI):
for row in row_dict.values():
name = row[INTERFACE_ROW_NAME]
row[INTERFACE_ROW_IN_USE_BY] = uihelpers.iface_in_use_by(self.conn,
name)
row[INTERFACE_ROW_IN_USE_BY] = self.iface_in_use_by(self.conn,
name)
for row in row_dict.values():
model.append(row)