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,
|
kwargs, self.vm, self.err,
|
||||||
devobj=devobj)
|
devobj=devobj)
|
||||||
|
|
||||||
# Device removal
|
def remove_devobj_internal(self, devobj):
|
||||||
def remove_device(self, devobj):
|
|
||||||
log.debug("Removing device: %s", devobj)
|
log.debug("Removing device: %s", devobj)
|
||||||
|
|
||||||
# Define the change
|
# Define the change
|
||||||
|
@ -1822,8 +1821,7 @@ class vmmDetails(vmmGObjectUI):
|
||||||
detach_err = (str(e), "".join(traceback.format_exc()))
|
detach_err = (str(e), "".join(traceback.format_exc()))
|
||||||
|
|
||||||
if not detach_err:
|
if not detach_err:
|
||||||
self.disable_apply()
|
return True
|
||||||
return
|
|
||||||
|
|
||||||
self.err.show_err(
|
self.err.show_err(
|
||||||
_("Device could not be removed from the running machine"),
|
_("Device could not be removed from the running machine"),
|
||||||
|
@ -1833,6 +1831,12 @@ class vmmDetails(vmmGObjectUI):
|
||||||
buttons=Gtk.ButtonsType.OK,
|
buttons=Gtk.ButtonsType.OK,
|
||||||
dialog_type=Gtk.MessageType.INFO)
|
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 #
|
# vmwindow Public API #
|
||||||
#######################
|
#######################
|
||||||
|
|
Loading…
Reference in New Issue