Compat fixes for RHEL5 vintage gtk, python

This commit is contained in:
Cole Robinson 2011-02-15 11:38:35 -05:00
parent 2b31de9644
commit d9402c9b61
2 changed files with 9 additions and 5 deletions

View File

@ -2241,7 +2241,7 @@ class vmmDetails(vmmGObjectUI):
is_vnc = (gtype == "vnc") is_vnc = (gtype == "vnc")
is_sdl = (gtype == "sdl") is_sdl = (gtype == "sdl")
is_spice = (gtype == "spice") is_spice = (gtype == "spice")
is_other = not any([is_vnc, is_sdl, is_spice]) is_other = not (True in [is_vnc, is_sdl, is_spice])
set_title(_("%(graphicstype)s Server") % set_title(_("%(graphicstype)s Server") %
{"graphicstype" : str(gtype).upper()}) {"graphicstype" : str(gtype).upper()})

View File

@ -1060,9 +1060,7 @@ class vmmManager(vmmGObjectUI):
widgn = "menu_view_stats_network" widgn = "menu_view_stats_network"
widget = self.window.get_widget(widgn) widget = self.window.get_widget(widgn)
disabled_text = _(" (disabled)")
tool_text = "" tool_text = ""
current_text = widget.get_label().strip(disabled_text)
if conf_entry and (conf_entry == True or if conf_entry and (conf_entry == True or
conf_entry.get_value().get_bool()): conf_entry.get_value().get_bool()):
@ -1072,9 +1070,15 @@ class vmmManager(vmmGObjectUI):
widget.set_active(False) widget.set_active(False)
widget.set_sensitive(False) widget.set_sensitive(False)
tool_text = _("Disabled in preferences dialog.") tool_text = _("Disabled in preferences dialog.")
current_text = current_text + disabled_text
util.tooltip_wrapper(widget, tool_text) util.tooltip_wrapper(widget, tool_text)
# RHEL5 GTK doesn't support get_label for a checkmenuitem
if hasattr(widget, "get_label"):
disabled_text = _(" (disabled)")
current_text = widget.get_label().strip(disabled_text)
if tool_text:
current_text = current_text + disabled_text
widget.set_label(current_text) widget.set_label(current_text)
def toggle_network_traffic_visible_widget(self, *ignore): def toggle_network_traffic_visible_widget(self, *ignore):