Exemple #1
0
 def load(self):
   """ Load and start the tray """
   menu = self.getMenu()
   if sys.platform == 'darwin':
     import cloudvibe.platform.darwin.tray as tray
     tray.load(menu)
   elif sys.platform == 'win32':
     import cloudvibe.platform.win32.win_sys_tray_icon as tray
     tray.load(menu)
Exemple #2
0
 def load(self):
     """ Load and start the tray """
     menu = self.getMenu()
     if sys.platform == 'darwin':
         import cloudvibe.platform.darwin.tray as tray
         tray.load(menu)
     elif sys.platform == 'win32':
         import cloudvibe.platform.win32.win_sys_tray_icon as tray
         tray.load(menu)
Exemple #3
0
    self.callHandlers("site")

  def getMenu(self):
    return {
      "sync": ("Sync Now", self.onSync),
      "site": ("Visit Cloudvibe Website", self.onSite),
      "quit": ("Quit", None),
    }
    
  def load(self):
    """ Load and start the tray """
    menu = self.getMenu()
    if sys.platform == 'darwin':
      import cloudvibe.platform.darwin.tray as tray
      tray.load(menu)
    elif sys.platform == 'win32':
      import cloudvibe.platform.win32.win_sys_tray_icon as tray
      tray.load(menu)

if __name__ == '__main__':
  tray = Tray()
  def sync():
    print "sync"
  def site():
    print "site"
  tray.on("sync", sync)
  tray.on("site", site)
  tray.load()


Exemple #4
0
    def getMenu(self):
        return {
            "sync": ("Sync Now", self.onSync),
            "site": ("Visit Cloudvibe Website", self.onSite),
            "quit": ("Quit", None),
        }

    def load(self):
        """ Load and start the tray """
        menu = self.getMenu()
        if sys.platform == 'darwin':
            import cloudvibe.platform.darwin.tray as tray
            tray.load(menu)
        elif sys.platform == 'win32':
            import cloudvibe.platform.win32.win_sys_tray_icon as tray
            tray.load(menu)


if __name__ == '__main__':
    tray = Tray()

    def sync():
        print "sync"

    def site():
        print "site"

    tray.on("sync", sync)
    tray.on("site", site)
    tray.load()