virt-manager/53388de2-show-port-number-for-active-autoport-VM.patch

32 lines
1.1 KiB
Diff
Raw Normal View History

Subject: gfxdetails: Show port number for active autoport VM (bz 1081614)
From: Cole Robinson crobinso@redhat.com Sun Mar 30 17:34:26 2014 -0400
Date: Sun Mar 30 17:34:26 2014 -0400:
Git: 7f802e287c21a6395a0e9f5435c1eab78b2ce6b5
diff --git a/virtManager/gfxdetails.py b/virtManager/gfxdetails.py
index 0141f7e..d6865a8 100644
--- a/virtManager/gfxdetails.py
+++ b/virtManager/gfxdetails.py
@@ -154,15 +154,20 @@ class vmmGraphicsDetails(vmmGObjectUI):
auto = self.widget(basename + "-auto")
widget = self.widget(basename)
auto.set_inconsistent(False)
+ label = auto.get_label().split(" (")[0]
if val == -1 or gfx.autoport:
auto.set_active(True)
+ if val and val != -1:
+ label += " (%s %s)" % (_("Port"), val)
elif val is None:
auto.set_inconsistent(True)
else:
auto.set_active(False)
widget.set_value(val)
+ auto.set_label(label)
+
gtype = gfx.type
is_vnc = (gtype == "vnc")
is_sdl = (gtype == "sdl")