[virt-tools-list] AppIndicator3 not appindicator

Eric Shattow lucent at gmail.com
Thu Jun 13 23:56:01 UTC 2013


Please change as needed before commit; I'm unfamiliar with Python.
Without the change, starting virt-manager results in a coredump on
Ubuntu-next (13.10)

Kind regards, Eric Shattow


$ ./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)

Patch also posted at http://paste.ubuntu.com/5759571/

Below:

PATCH AUTHOR: Eric Shattow <shadow at serverart.org>

diff --git a/virtManager/systray.py b/virtManager/systray.py
index da2baa4..fe82eac 100644
--- a/virtManager/systray.py
+++ b/virtManager/systray.py
@@ -29,9 +29,9 @@ from virtManager.baseclass import vmmGObject
 from virtManager.error import vmmErrorDialog

 try:
-    import appindicator  # pylint: disable=F0401
+    from gi.repository import AppIndicator3  # pylint: disable=F0401
 except:
-    appindicator = None
+    AppIndicator3 = None


 def build_image_menu_item(label):
@@ -79,7 +79,7 @@ class vmmSystray(vmmGObject):
         engine.connect("conn-removed", self.conn_removed)

         # Are we using Application Indicators?
-        if appindicator is not None:
+        if AppIndicator3 is not None:
             self.systray_indicator = True

         self.init_systray_menu()
@@ -138,10 +138,10 @@ class vmmSystray(vmmGObject):
             return

         if self.systray_indicator:
-            self.systray_icon = appindicator.Indicator("virt-manager",
+            self.systray_icon = AppIndicator3.Indicator("virt-manager",
                                 "virt-manager-icon",
-                                appindicator.CATEGORY_OTHER)
-            self.systray_icon.set_status(appindicator.STATUS_ACTIVE)
+                                AppIndicator3.CATEGORY_OTHER)
+            self.systray_icon.set_status(AppIndicator3.STATUS_ACTIVE)
             self.systray_icon.set_menu(self.systray_menu)

         else:
@@ -162,9 +162,9 @@ class vmmSystray(vmmGObject):
         else:
             if self.systray_indicator:
                 if do_show:
-                    self.systray_icon.set_status(appindicator.STATUS_ACTIVE)
+                    self.systray_icon.set_status(AppIndicator3.STATUS_ACTIVE)
                 else:
-                    self.systray_icon.set_status(appindicator.STATUS_PASSIVE)
+                    self.systray_icon.set_status(AppIndicator3.STATUS_PASSIVE)
             else:
                 self.systray_icon.set_visible(do_show)




More information about the virt-tools-list mailing list