virtManager, create: prevent focus on widget when not visible

it fixes this error:

(virt-manager:11184): Gtk-WARNING **: GtkEntry - did not receive focus-out-event. If you connect a handler to this signal, it must return FALSE so the entry gets the event as well.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2014-07-04 12:02:59 +02:00
parent 7fcdd61920
commit 6e7c406b6a

View File

@ -1197,7 +1197,8 @@ class vmmCreate(vmmGObjectUI):
return
self.widget("install-os-version-entry").set_text("")
self.widget("install-os-version-entry").grab_focus()
if self.widget("install-os-version").get_visible():
self.widget("install-os-version-entry").grab_focus()
def change_os_version(self, box):
show_all = uiutil.get_list_selection(box, 3)