def createTrayIcon(self): self.trayIconMenu = QtGui.QMenu(self) self.trayIconMenu.addAction(self.updateNotify) self.trayIconMenu.addSeparator() self.trayIconMenu.addAction(self.enableNotify) self.trayIconMenu.addAction(self.disableNotify) self.trayIconMenu.addSeparator() self.trayIconMenu.addAction(self.showNotify) self.trayIconMenu.addAction(self.hideNotify) self.trayIcon = QtGui.QSystemTrayIcon(self) self.trayIcon.setContextMenu(self.trayIconMenu)
def createTrayIcon(self): self.trayIconMenu = QtGui.QMenu(self) # self.trayIconMenu.addAction(self.updateNotify) # self.trayIconMenu.addSeparator() # self.trayIconMenu.addAction(self.enableNotify) self.trayIconMenu.addAction(self.show_script_editor_action) self.trayIconMenu.addSeparator() self.trayIconMenu.addAction(self.disableNotify) self.trayIconMenu.addSeparator() self.trayIconMenu.addAction(self.showNotify) self.trayIconMenu.addAction(self.hideNotify) self.trayIconMenu.addSeparator() self.trayIconMenu.addAction(self.close_app_action) self.trayIcon = QtGui.QSystemTrayIcon(self) self.trayIcon.setContextMenu(self.trayIconMenu)
def create_tray(self): self.tray_icon = QtGui.QSystemTrayIcon(self) self.tray_icon.activated.connect(self.tray_activated) icon = Qt4Gui.QIcon(':/ui_main/gliph/tactic_favicon.ico') self.tray_icon.setIcon(icon) self.tray_menu = QtGui.QMenu(self) self.show_main_window = QtGui.QAction('Show Main Window', self, triggered=self.show) self.tray_menu.addAction(self.show_main_window) self.tray_menu.addSeparator() self.close_app_action = QtGui.QAction('Exit', self, triggered=self.close_app) self.tray_menu.addAction(self.close_app_action) self.tray_icon.setContextMenu(self.tray_menu) self.tray_icon.show()