mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-23 17:34:21 +03:00
details: add a remove_devobj_internal function
Reviewed-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
11d6536542
commit
71befc0f5d
@ -1801,8 +1801,7 @@ class vmmDetails(vmmGObjectUI):
|
||||
kwargs, self.vm, self.err,
|
||||
devobj=devobj)
|
||||
|
||||
# Device removal
|
||||
def remove_device(self, devobj):
|
||||
def remove_devobj_internal(self, devobj):
|
||||
log.debug("Removing device: %s", devobj)
|
||||
|
||||
# Define the change
|
||||
@ -1822,8 +1821,7 @@ class vmmDetails(vmmGObjectUI):
|
||||
detach_err = (str(e), "".join(traceback.format_exc()))
|
||||
|
||||
if not detach_err:
|
||||
self.disable_apply()
|
||||
return
|
||||
return True
|
||||
|
||||
self.err.show_err(
|
||||
_("Device could not be removed from the running machine"),
|
||||
@ -1833,6 +1831,12 @@ class vmmDetails(vmmGObjectUI):
|
||||
buttons=Gtk.ButtonsType.OK,
|
||||
dialog_type=Gtk.MessageType.INFO)
|
||||
|
||||
# Device removal
|
||||
def remove_device(self, devobj):
|
||||
success = self.remove_devobj_internal(devobj)
|
||||
if success:
|
||||
self.disable_apply()
|
||||
|
||||
#######################
|
||||
# vmwindow Public API #
|
||||
#######################
|
||||
|
Loading…
Reference in New Issue
Block a user