[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [virt-tools-list] AppIndicator3 not appindicator



On 29.07.2013 20:45, Cole Robinson wrote:
> On 07/29/2013 02:38 PM, Marc Deslauriers wrote:
>> On 13-07-29 07:29 AM, Cole Robinson wrote:
>>> Thanks for trying this out and fixing my typo. Unfortunate that this is still
>>> an issue.
>>>
>>> Marc, you did the original appindicators patch, any chance you can give
>>> virt-manager git a spin and fix the issues with appindicator3 ? My guess is
>>> they are minor. If I don't hear back for a week I'll likely drop the
>>> appindicators support since it is currently broken, but I'm happy to revive it
>>> later when someone has it working.
>>>
>>> git clone git://git.fedorahosted.org/virt-manager.git
>>> cd virt-manager
>>> ./virt-manager --debug
>>> Preferences->Enable tray icon
>>
>>
>> Here you go:
>>
>>
>> From bcb0993cc9902574da2ec2e21ae960503ddfc6db Mon Sep 17 00:00:00 2001
>> From: Marc Deslauriers <marc deslauriers ubuntu com>
>> Date: Mon, 29 Jul 2013 14:25:07 -0400
>> Subject: [PATCH] systray: Switch AppIndicator code to GIR
>>
>> Switch AppIndicator code to use GObject introspection.
>> ---
>>  virtManager/systray.py | 15 +++++++++------
>>  1 file changed, 9 insertions(+), 6 deletions(-)
>>
>> diff --git a/virtManager/systray.py b/virtManager/systray.py
>> index 992a59b..d504495 100644
>> --- a/virtManager/systray.py
>> +++ b/virtManager/systray.py
>> @@ -123,7 +123,8 @@ class vmmSystray(vmmGObject):
>>          self.systray_menu.add(Gtk.SeparatorMenuItem())
>>
>>          if self.systray_indicator:
>> -            hide_item = Gtk.MenuItem("_Show Virtual Machine Manager")
>> +            hide_item = Gtk.MenuItem.new_with_mnemonic(
>> +                    _("_Show Virtual Machine Manager"))
>>              hide_item.connect("activate", self.systray_activate)
>>              self.systray_menu.add(hide_item)
>>
>> @@ -138,10 +139,10 @@ class vmmSystray(vmmGObject):
>>              return
>>
>>          if self.systray_indicator:
>> -            self.systray_icon = AppIndicator3.Indicator("virt-manager",
>> +            self.systray_icon = AppIndicator3.Indicator.new("virt-manager",
>>                                  "virt-manager-icon",
>> -                                AppIndicator3.CATEGORY_OTHER)
>> -            self.systray_icon.set_status(AppIndicator3.STATUS_ACTIVE)
>> +                                AppIndicator3.IndicatorCategory.OTHER)
>> +            self.systray_icon.set_status(AppIndicator3.IndicatorStatus.ACTIVE)
>>              self.systray_icon.set_menu(self.systray_menu)
>>
>>          else:
>> @@ -162,9 +163,11 @@ class vmmSystray(vmmGObject):
>>          else:
>>              if self.systray_indicator:
>>                  if do_show:
>> -                    self.systray_icon.set_status(AppIndicator3.STATUS_ACTIVE)
>> +                    self.systray_icon.set_status(
>> +                            AppIndicator3.IndicatorStatus.ACTIVE)
>>                  else:
>> -                    self.systray_icon.set_status(AppIndicator3.STATUS_PASSIVE)
>> +                    self.systray_icon.set_status(
>> +                            AppIndicator3.IndicatorStatus.PASSIVE)
>>              else:
>>                  self.systray_icon.set_visible(do_show)
>>
> 
> Thanks Marc! Pushed now.
> 
> - Cole
> 

With 'systray-fedora.patch' - attach,
- systray icon is displayed correctly
- left mouse button single-click on the systray icon opens and closes
  the virtual manager window
- right mouse button single-click on the systray icon displays menu
  correctly

With Marc's original patch isn't entirely the same case, on Fedora 19. ;)

http://goo.gl/FfiF89


poma


diff --git a/virtManager/systray.py b/virtManager/systray.py
index d504495..a55a06c 100644
--- a/virtManager/systray.py
+++ b/virtManager/systray.py
@@ -139,13 +139,6 @@ class vmmSystray(vmmGObject):
             return
 
         if self.systray_indicator:
-            self.systray_icon = AppIndicator3.Indicator.new("virt-manager",
-                                "virt-manager-icon",
-                                AppIndicator3.IndicatorCategory.OTHER)
-            self.systray_icon.set_status(AppIndicator3.IndicatorStatus.ACTIVE)
-            self.systray_icon.set_menu(self.systray_menu)
-
-        else:
             self.systray_icon = Gtk.StatusIcon()
             self.systray_icon.set_visible(True)
             self.systray_icon.set_property("icon-name", "virt-manager")
@@ -153,6 +146,13 @@ class vmmSystray(vmmGObject):
             self.systray_icon.connect("popup-menu", self.systray_popup)
             self.systray_icon.set_tooltip_text(_("Virtual Machine Manager"))
 
+        else:
+            self.systray_icon = AppIndicator3.Indicator.new("virt-manager",
+                                "virt-manager-icon",
+                                AppIndicator3.IndicatorCategory.OTHER)
+            self.systray_icon.set_status(AppIndicator3.IndicatorStatus.ACTIVE)
+            self.systray_icon.set_menu(self.systray_menu)
+
     def show_systray(self):
         do_show = self.config.get_view_system_tray()
         logging.debug("Showing systray: %s", do_show)







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]