details: When VM is run, always update console page

If we were focused on the VM details page for a container, then clicked
'Run', the console page wouldn't be switched to view the serial console.
Make that work, but continue to not switch focus away from the current
non-console page.

Based on Cédric's patch here: http://www.redhat.com/archives/virt-tools-list/2015-January/msg00078.html
This commit is contained in:
Cole Robinson 2015-01-27 13:39:23 -05:00
parent cbba1c4dd3
commit f815c988aa

View File

@ -1345,9 +1345,14 @@ class vmmDetails(vmmGObjectUI):
def activate_default_console_page(self):
pages = self.widget("details-pages")
if pages.get_current_page() != DETAILS_PAGE_CONSOLE:
return
# console.activate_default_console_page() will as a side effect
# switch to DETAILS_PAGE_CONSOLE. However this code path is triggered
# when the user runs a VM while they are focused on the details page,
# and we don't want to switch pages out from under them.
origpage = pages.get_current_page()
self.console.activate_default_console_page()
pages.set_current_page(origpage)
# activate_* are called from engine.py via CLI options
def activate_default_page(self):