def applicationDidFinishLaunching_(self, sender): logger.debug("Application did finish launching.") logger.debug("Icon file: %s", resource_path("ava/res/eavatar.png")) statusbar = NSStatusBar.systemStatusBar() self.statusitem = statusbar.statusItemWithLength_(NSVariableStatusItemLength) self.icon = NSImage.alloc().initByReferencingFile_(resource_path("res/icon.png")) self.icon.setScalesWhenResized_(True) self.icon.setSize_((20, 20)) self.statusitem.setImage_(self.icon) self.statusitem.setHighlightMode_(True) self.statusitem.setEnabled_(True) # make the menu self.menubarMenu = NSMenu.alloc().init() self.openItem = NSMenuItem.alloc().initWithTitle_action_keyEquivalent_(STR_OPEN_HELP, "openHelp:", "") self.menubarMenu.addItem_(self.openItem) self.menuItem = NSMenuItem.separatorItem() self.menubarMenu.addItem_(self.menuItem) self.quit = NSMenuItem.alloc().initWithTitle_action_keyEquivalent_(STR_EXIT, "quitApp:", "") self.menubarMenu.addItem_(self.quit) # add menu to statusitem self.statusitem.setMenu_(self.menubarMenu) self.statusitem.setToolTip_("AvaShell - running")
def applicationDidFinishLaunching_(self, sender): logger.debug("Application did finish launching.") logger.debug("Icon file: %s", resource_path('ava/res/eavatar.png')) statusbar = NSStatusBar.systemStatusBar() self.statusicon = statusbar.statusItemWithLength_( NSVariableStatusItemLength) self.icon = NSImage.alloc().initByReferencingFile_( resource_path('res/icon.png')) self.icon.setScalesWhenResized_(True) self.icon.setSize_((20, 20)) self.statusicon.setImage_(self.icon) self.statusicon.setHighlightMode_(True) self.statusicon.setEnabled_(True) #make the menu self.menubarMenu = NSMenu.alloc().init() # self.statusItem = NSMenuItem.alloc().initWithTitle_action_keyEquivalent_(self.status, None, '') # self.menubarMenu.addItem_(self.statusItem) # self.menuItem = NSMenuItem.separatorItem() # self.menubarMenu.addItem_(self.menuItem) self.openItem = NSMenuItem.alloc().initWithTitle_action_keyEquivalent_( STR_OPEN_WEBFRONT, 'openWebfront:', '') self.menubarMenu.addItem_(self.openItem) self.openItem = NSMenuItem.alloc().initWithTitle_action_keyEquivalent_( STR_OPEN_FOLDER, 'openFolder:', '') self.menubarMenu.addItem_(self.openItem) # self.openItem = NSMenuItem.alloc().initWithTitle_action_keyEquivalent_(STR_OPEN_CONSOLE, 'openConsole:', '') # self.menubarMenu.addItem_(self.openItem) self.menubarMenu.addItem_(NSMenuItem.separatorItem()) mi = self.menubarMenu.addItemWithTitle_action_keyEquivalent_( STR_STATUS_MENU, None, "") self.create_status_menu() self.menubarMenu.setSubmenu_forItem_(self.status_menu, mi) self.menubarMenu.addItem_(NSMenuItem.separatorItem()) mi = self.menubarMenu.addItemWithTitle_action_keyEquivalent_( STR_NOTICES_MENU, None, "") self.notices_menu = self.create_notices_menu() self.menubarMenu.setSubmenu_forItem_(self.notices_menu, mi) # self.menubarMenu.addItemWithTitle_action_keyEquivalent_('Clear All', 'clearNotices:', '') self.menubarMenu.addItem_(NSMenuItem.separatorItem()) self.quit = NSMenuItem.alloc().initWithTitle_action_keyEquivalent_( STR_EXIT, 'quitApp:', '') self.menubarMenu.addItem_(self.quit) #add menu to statusitem self.statusicon.setMenu_(self.menubarMenu) self.statusicon.setToolTip_(STR_STATUS)
def applicationDidFinishLaunching_(self, sender): logger.debug("Application did finish launching.") logger.debug("Icon file: %s", resource_path('ava/res/eavatar.png')) statusbar = NSStatusBar.systemStatusBar() self.statusitem = statusbar.statusItemWithLength_( NSVariableStatusItemLength) self.icon = NSImage.alloc().initByReferencingFile_( resource_path('res/icon.png')) self.icon.setScalesWhenResized_(True) self.icon.setSize_((20, 20)) self.statusitem.setImage_(self.icon) self.statusitem.setHighlightMode_(True) self.statusitem.setEnabled_(True) #make the menu self.menubarMenu = NSMenu.alloc().init() self.openItem = NSMenuItem.alloc().initWithTitle_action_keyEquivalent_( STR_OPEN_HELP, 'openHelp:', '') self.menubarMenu.addItem_(self.openItem) self.menuItem = NSMenuItem.separatorItem() self.menubarMenu.addItem_(self.menuItem) self.quit = NSMenuItem.alloc().initWithTitle_action_keyEquivalent_( STR_EXIT, 'quitApp:', '') self.menubarMenu.addItem_(self.quit) #add menu to statusitem self.statusitem.setMenu_(self.menubarMenu) self.statusitem.setToolTip_(u'AvaShell - running')
def __init__(self, shell): self.shell = shell self.ind = appindicator.Indicator.new("AvaShell-indicator", resource_path("res/icon.png"), appindicator.IndicatorCategory.APPLICATION_STATUS) self.ind.set_icon_theme_path(resource_path('res/')) self.ind.set_status(appindicator.IndicatorStatus.ACTIVE) self.ind.set_attention_icon("icon.png") self.menu_setup() self.ind.set_menu(self.menu)
def applicationDidFinishLaunching_(self, sender): logger.debug("Application did finish launching.") logger.debug("Icon file: %s", resource_path('ava/res/eavatar.png')) statusbar = NSStatusBar.systemStatusBar() self.statusicon = statusbar.statusItemWithLength_(NSVariableStatusItemLength) self.icon = NSImage.alloc().initByReferencingFile_(resource_path('res/icon.png')) self.icon.setScalesWhenResized_(True) self.icon.setSize_((20, 20)) self.statusicon.setImage_(self.icon) self.statusicon.setHighlightMode_(True) self.statusicon.setEnabled_(True) #make the menu self.menubarMenu = NSMenu.alloc().init() # self.statusItem = NSMenuItem.alloc().initWithTitle_action_keyEquivalent_(self.status, None, '') # self.menubarMenu.addItem_(self.statusItem) # self.menuItem = NSMenuItem.separatorItem() # self.menubarMenu.addItem_(self.menuItem) self.openItem = NSMenuItem.alloc().initWithTitle_action_keyEquivalent_(STR_OPEN_WEBFRONT, 'openWebfront:', '') self.menubarMenu.addItem_(self.openItem) self.openItem = NSMenuItem.alloc().initWithTitle_action_keyEquivalent_(STR_OPEN_FOLDER, 'openFolder:', '') self.menubarMenu.addItem_(self.openItem) # self.openItem = NSMenuItem.alloc().initWithTitle_action_keyEquivalent_(STR_OPEN_CONSOLE, 'openConsole:', '') # self.menubarMenu.addItem_(self.openItem) self.menubarMenu.addItem_(NSMenuItem.separatorItem()) mi = self.menubarMenu.addItemWithTitle_action_keyEquivalent_(STR_STATUS_MENU, None, "") self.create_status_menu() self.menubarMenu.setSubmenu_forItem_(self.status_menu, mi) self.menubarMenu.addItem_(NSMenuItem.separatorItem()) mi = self.menubarMenu.addItemWithTitle_action_keyEquivalent_(STR_NOTICES_MENU, None, "") self.notices_menu = self.create_notices_menu() self.menubarMenu.setSubmenu_forItem_(self.notices_menu, mi) # self.menubarMenu.addItemWithTitle_action_keyEquivalent_('Clear All', 'clearNotices:', '') self.menubarMenu.addItem_(NSMenuItem.separatorItem()) self.quit = NSMenuItem.alloc().initWithTitle_action_keyEquivalent_(STR_EXIT, 'quitApp:', '') self.menubarMenu.addItem_(self.quit) #add menu to statusitem self.statusicon.setMenu_(self.menubarMenu) self.statusicon.setToolTip_(STR_STATUS)
def __init__(self): super(Shell, self).__init__() self.app = QApplication(sys.argv) self.app.setQuitOnLastWindowClosed(False) # 1 self.icon = QIcon(resource_path('res/icon.png')) self.menu = None self.wnd = MainWnd(self, self.icon)
def __init__(self, shell): self.shell = shell self.ind = appindicator.Indicator.new( "EAvatar-indicator", resource_path("res/icon.png"), appindicator.IndicatorCategory.APPLICATION_STATUS) self.ind.set_icon_theme_path(resource_path('res/')) self.ind.set_status(appindicator.IndicatorStatus.ACTIVE) self.ind.set_attention_icon("icon.png") self.notices_menu = None self.status_menu = None self.old_status_item = None self.menu_setup() self.ind.set_menu(self.menu) self.notification = None Notify.init("EAvatar")
def __init__(self, shell): self.shell = shell self.ind = appindicator.Indicator.new("EAvatar-indicator", resource_path("res/icon.png"), appindicator.IndicatorCategory.APPLICATION_STATUS) self.ind.set_icon_theme_path(resource_path('res/')) self.ind.set_status(appindicator.IndicatorStatus.ACTIVE) self.ind.set_attention_icon("icon.png") self.notices_menu = None self.status_menu = None self.old_status_item = None self.menu_setup() self.ind.set_menu(self.menu) self.notification = None Notify.init("EAvatar")
def notify(self, msg, title="Ava Message"): if self.notification is None: self.notification = Notify.Notification.new(title, msg, resource_path("res/icon.png")) self.notification.set_app_name("EAvatar") else: self.notification.update(title, msg) self.notification.set_timeout(3) self.notification.show()
def notify(self, msg, title="Ava Message"): if self.notification is None: self.notification = Notify.Notification.new( title, msg, resource_path("res/icon.png")) self.notification.set_app_name("EAvatar") else: self.notification.update(title, msg) self.notification.set_timeout(3) self.notification.show()
def __init__(self, s): self.shell = s self.icons = itertools.cycle(glob.glob(resource_path("res/*.ico"))) self.hover_text = STR_STATUS self.icon = self.icons.next() self.default_menu_index = 0 self.notify_id = None self.hicon = None self.refresh_icon() self.notices_menu = win32gui.CreateMenu() self.status_menu = self._create_status_menu() self.notice_index = -1
def __init__(self, s): self.shell = s self.icons = itertools.cycle(glob.glob(resource_path('res/*.ico'))) self.hover_text = STR_STATUS self.menu_options = ((STR_OPEN_HELP, None, None, _ID_OPEN_HELP), ("-", None, None, 1025), (STR_EXIT, None, None, _ID_QUIT),) self.icon = self.icons.next() self.default_menu_index = 0 self.notify_id = None self.hicon = None self.refresh_icon()