mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
uihelpers: Move a few more functions closer to their callers
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user