AppIndicator3 required with Gtk3 usage

$ ./virt-manager --debug
/usr/lib/python2.7/dist-packages/gi/overrides/GLib.py:53:
PyGIDeprecationWarning: threads_init longer needs to be called. See:
https://bugzilla.gnome.org/show_bug.cgi?id=686914
  PyGIDeprecationWarning)
2013-06-12 13:10:56,977 (cliutils:75): virt-manager startup
2013-06-12 13:10:56,978 (virt-manager:199): Launched as:
['./virt-manager', '--debug']
2013-06-12 13:10:56,978 (virt-manager:200): virt-manager version: 0.9.100
2013-06-12 13:10:56,978 (virt-manager:201): virtManager import:
<module 'virtManager' from
'/home/es/software/pubscm/virt-manager/virtManager/__init__.pyc'>
2013-06-12 13:10:57,167 (virt-manager:247): GTK version: 3.8.2
/usr/lib/python2.7/dist-packages/gobject/constants.py:24: Warning:
g_boxed_type_register_static: assertion 'g_type_from_name (name) == 0'
failed
  import gobject._gobject
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:40: Warning:
specified class size for type 'PyGtkGenericCellRenderer' is smaller
than the parent type's 'GtkCellRenderer' class size
  from gtk import _gtk
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:40: Warning:
g_type_get_qdata: assertion 'node != NULL' failed
  from gtk import _gtk
Segmentation fault (core dumped)
This commit is contained in:
Eric Shattow 2013-06-13 16:56:01 -07:00 committed by Cole Robinson
parent 8a0bee44dc
commit f2c0a77e3e

View File

@ -29,9 +29,9 @@ from virtManager.baseclass import vmmGObject
from virtManager.error import vmmErrorDialog from virtManager.error import vmmErrorDialog
try: try:
import appindicator # pylint: disable=F0401 from gi.repository import AppIndicator3 # pylint: disable=F0401
except: except:
appindicator = None AppIndicator3 = None
def build_image_menu_item(label): def build_image_menu_item(label):
@ -79,7 +79,7 @@ class vmmSystray(vmmGObject):
engine.connect("conn-removed", self.conn_removed) engine.connect("conn-removed", self.conn_removed)
# Are we using Application Indicators? # Are we using Application Indicators?
if appindicator is not None: if AppIndicator3 is not None:
self.systray_indicator = True self.systray_indicator = True
self.init_systray_menu() self.init_systray_menu()
@ -138,10 +138,10 @@ class vmmSystray(vmmGObject):
return return
if self.systray_indicator: if self.systray_indicator:
self.systray_icon = appindicator.Indicator("virt-manager", self.systray_icon = AppIndicator3.Indicator("virt-manager",
"virt-manager-icon", "virt-manager-icon",
appindicator.CATEGORY_OTHER) AppIndicator3.CATEGORY_OTHER)
self.systray_icon.set_status(appindicator.STATUS_ACTIVE) self.systray_icon.set_status(AppIndicator3.STATUS_ACTIVE)
self.systray_icon.set_menu(self.systray_menu) self.systray_icon.set_menu(self.systray_menu)
else: else:
@ -162,9 +162,9 @@ class vmmSystray(vmmGObject):
else: else:
if self.systray_indicator: if self.systray_indicator:
if do_show: if do_show:
self.systray_icon.set_status(appindicator.STATUS_ACTIVE) self.systray_icon.set_status(AppIndicator3.STATUS_ACTIVE)
else: else:
self.systray_icon.set_status(appindicator.STATUS_PASSIVE) self.systray_icon.set_status(AppIndicator3.STATUS_PASSIVE)
else: else:
self.systray_icon.set_visible(do_show) self.systray_icon.set_visible(do_show)