config: Validate graphics type directly after reading
Fixes an error in 'new vm' wizard if graphics_type is unset in gconf
This commit is contained in:
parent
3b2cba5b1a
commit
1d8222d9ea
|
@ -509,7 +509,10 @@ class vmmConfig(object):
|
|||
self.conf.notify_add(self.conf_dir + "/new-vm/remote-sound", cb, data)
|
||||
|
||||
def get_graphics_type(self):
|
||||
return self.conf.get_string(self.conf_dir + "/new-vm/graphics_type")
|
||||
ret = self.conf.get_string(self.conf_dir + "/new-vm/graphics_type")
|
||||
if ret not in ["vnc", "spice"]:
|
||||
return "vnc"
|
||||
return ret
|
||||
def set_graphics_type(self, gtype):
|
||||
self.conf.set_string(self.conf_dir + "/new-vm/graphics_type",
|
||||
gtype.lower())
|
||||
|
|
Loading…
Reference in New Issue