From 2787e0ba404983b03c804ff3983a79fca4c2954f Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Sat, 16 Feb 2013 13:54:45 -0500 Subject: [PATCH] manager: Fix empty desc tooltip if pygobject is new enough --- src/virtManager/manager.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/virtManager/manager.py b/src/virtManager/manager.py index ac3003e1f..1d36fbf11 100644 --- a/src/virtManager/manager.py +++ b/src/virtManager/manager.py @@ -34,6 +34,7 @@ from virtManager.delete import vmmDeleteDialog from virtManager.graphwidgets import CellRendererSparkline from virtManager import util as util + # Number of data points for performance graphs GRAPH_LEN = 40 @@ -59,6 +60,15 @@ COL_HOST_CPU = 2 COL_DISK = 3 COL_NETWORK = 4 + +try: + import gi + gi.check_version("3.7.4") + can_set_row_none = True +except ValueError: + can_set_row_none = False + + rcstring = """ style "toolbar-style" { #GtkToolbar::button_relief = GTK_RELIEF_NONE @@ -958,9 +968,10 @@ class vmmManager(vmmGObjectUI): row[ROW_MARKUP] = self._build_vm_markup(row) if config_changed: - # XXX: This sets an empty tooltip, but required due to - # https://bugzilla.gnome.org/show_bug.cgi?id=691660 - row[ROW_HINT] = util.xml_escape(vm.get_description() or "") + desc = vm.get_description() + if not can_set_row_none: + desc = desc or "" + row[ROW_HINT] = util.xml_escape(desc) model.row_changed(row.path, row.iter)