Esempio n. 1
0
 def statusIconInit(self):
     if self.statusIconMode == 2:
         useAppIndicator = ui.useAppIndicator
         if useAppIndicator:
             try:
                 import appindicator
             except ImportError:
                 useAppIndicator = False
         if useAppIndicator:
             from scal2.ui_gtk.starcal2_appindicator import IndicatorStatusIconWrapper
             self.sicon = IndicatorStatusIconWrapper(self)
         else:
             self.sicon = gtk.StatusIcon()
             ##self.sicon.set_blinking(True) ## for Alarms ## some problem with gnome-shell
             #self.sicon.set_name('starcal2')
             ## Warning: g_object_notify: object class `GtkStatusIcon' has no property named `name'
             self.sicon.set_title(core.APP_DESC)
             self.sicon.set_visible(True)  ## is needed ????????
             self.sicon.connect('button-press-event',
                                self.statusIconButtonPress)
             self.sicon.connect('activate', self.statusIconClicked)
             self.sicon.connect('popup-menu', self.statusIconPopup)
     else:
         self.sicon = None