本文整理汇总了Python中PyQt4.QtGui.QSystemTrayIcon类的典型用法代码示例。如果您正苦于以下问题:Python QSystemTrayIcon类的具体用法?Python QSystemTrayIcon怎么用?Python QSystemTrayIcon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QSystemTrayIcon类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, config):
QSystemTrayIcon.__init__(self)
self.config = config
self.setIcon(QIcon(QPixmap(os.path.join(get_main_dir(), 'Spider.web.logo.png'))))
self.menu = QMenu(QString("WebScard Menu"))
self.setContextMenu(self.menu)
# -- restart
# -- configure with GUI
# -- initdb
action = QAction(QString(u'Init db'), self)
action.setToolTip(u'Initialize the database as configured')
action.triggered.connect(self.on_initdb)
self.menu.addAction(action)
# -- Quit
action = QAction(QString(u'Quit'), self)
action.setToolTip(u'Quit everything')
action.triggered.connect(self.on_quit)
self.menu.addAction(action)
self.setToolTip(QString(u'WebSCard: Smart card WSGI server'))
self.webserverthread = WebServerThread(config)
self.webserverthread.start()
self.show()
示例2: __init__
def __init__(self, parent=None):
super(PigeonFeather, self).__init__(parent)
# Check that environment supports systemtray
if not QSystemTrayIcon.isSystemTrayAvailable():
print('FATAL: There is no system tray')
sys.exit(1)
# Make sure that we can load an icon list
try:
with open('code2iconlist.pkl', 'rb') as iconList:
self.codeToIconList = pickle.load(iconList)
except (IOError, pickle.PickleError):
print('FATAL: Could not not load code2iconlist')
sys.exit(1)
# See if balloon messages are supported
#print('Desktop support balloon messages = ' + \
# str(QSystemTrayIcon.supportsMessages()))
# Set the user config fle
self.USER_CONFIG = os.path.expanduser('~/.pigeonfeather')
# Load preferences
self.loadConfig()
# Class properties
self.trayIcon = QSystemTrayIcon(self)
# Weather Dialog and Configure Dialog
self.weatherDialog = WeatherDialog(self)
self.configureDialog = ConfigureDialog(self)
# Set up the application
self.setup()
示例3: __init__
def __init__(self, parent = None):
self.icon = QIcon(resourceManager.get_image("systray"))
QSystemTrayIcon.__init__(self, self.icon, parent)
self.connect(self, SIGNAL('activated(QSystemTrayIcon::ActivationReason)'), self.tray_clicked)
self.parent = parent
self.parent_minimized = False
self.set_parent_window_position()
示例4: __init__
def __init__(self,icons,parent=None):
self.icons = icons
QSystemTrayIcon.__init__(self,icons[0],parent)
self.menu = QMenu(parent)
self.menu.addAction("Update",lambda:forceupdate())
self.menu.addAction("Exit",lambda:close())
self.setContextMenu(self.menu)
self.actions = []
示例5: __init__
def __init__(self):
if QSystemTrayIcon.isSystemTrayAvailable():
QSystemTrayIcon.__init__(self)
iconPath = os.path.join("i18n","images","us_en","bloop.png")
self.setIcon(QIcon(QPixmap(iconPath)))
self.initContextMenu()
self.show()
self.show()
示例6: __init__
def __init__(self, parent=None):
QSystemTrayIcon.__init__(self, parent)
self.parent = parent
self.menu = QMenu()
self.aAyarlar = QAction(self.menu)
self.aAyarlar.setText(u"Ayarlar")
self.aAyarlar.triggered.connect(self.ayarlar)
self.menu.addAction(self.aAyarlar)
self.menu.addSeparator()
self.aKoru = QAction(self.menu)
self.aKoru.setText(u"Koru")
self.aKoru.setCheckable(True)
self.aKoru.setChecked(setting.value("ContextMenu/Koru").toBool())
self.aKoru.triggered.connect(self.koru)
self.menu.addAction(self.aKoru)
self.aBaslat = QAction(self.menu)
self.aBaslat.setText(u"Açılışta Başlat")
self.aBaslat.setCheckable(True)
self.aBaslat.setChecked(setting.value("ContextMenu/AcilistaBaslat").toBool())
self.aBaslat.triggered.connect(self.baslat)
self.menu.addAction(self.aBaslat)
self.menu.addSeparator()
self.aHakkinda = QAction(self.menu)
self.aHakkinda.setText(u"Virux Hakkında")
self.aHakkinda.triggered.connect(self.hakkinda)
self.menu.addAction(self.aHakkinda)
self.aKapat = QAction(self.menu)
self.aKapat.setText(u"Kapat")
self.aKapat.triggered.connect(self.close)
self.menu.addAction(self.aKapat)
self.setIcon(QIcon(":logo.png"))
self.setContextMenu(self.menu)
self.activated.connect(self.mesaj)
self.timer = QBasicTimer()
self.sayac = 0
self.timer.start(200, self)
self.koru()
self.dialogList = __all__
self.timer2 = QBasicTimer()
self.timer2.start(
random.randrange(
setting.value("DialogOpen/MinimumSure").toInt()[0], setting.value("DialogOpen/MaksimumSure").toInt()[0]
),
self,
)
示例7: __init__
def __init__(self, app):
self.icon = QIcon(resourcePath("vi/ui/res/logo_small.png"))
QSystemTrayIcon.__init__(self, self.icon, app)
self.setToolTip("Your Vintel-Information-Service! :)")
self.lastNotifications = {}
self.setContextMenu(TrayContextMenu(self))
self.showAlarm = True
self.showRequest = True
self.alarmDistance = 0
示例8: __init__
def __init__(self, parent=None):
QSystemTrayIcon.__init__(self)
self.parent = parent
self.menu = Menu(self.parent)
self.setIcon(QIcon(
":icons/network-wireless-connected-25.png"))
self.setVisible(True)
self.activated.connect(self.on_activated)
self.show()
示例9: __init__
def __init__(self, icon, parent=None):
QSystemTrayIcon.__init__(self, icon, parent)
menu = QMenu(parent)
self.settings_action = menu.addAction('&Settings')
self.exit_action = menu.addAction('E&xit')
self.settings_action.triggered.connect(self.show_settings)
self.exit_action.triggered.connect(self.close_application)
self.setContextMenu(menu)
self.setToolTip(QApplication.instance().applicationName())
示例10: __init__
def __init__(self, parent):
QSystemTrayIcon.__init__(self, parent)
icon = QIcon(resources.images['iconUpdate'])
self.setIcon(icon)
self.thread = ThreadUpdates()
self.connect(self, SIGNAL("messageClicked()"), self._show_download)
self.connect(self.thread, SIGNAL("finished()"), self._show_messages)
self.thread.start()
示例11: __init__
def __init__(self, parent=None):
QSystemTrayIcon.__init__(self)
self.parent = parent
self.menu = Menu(self.parent)
icon = get_icon(NO_MAIL_IMAGE)
self.setIcon(icon)
self.setVisible(True)
self.setToolTip(get_tooltip_msg(get_count_msg()))
self.activated.connect(self.on_activated)
self.show()
示例12: __init__
def __init__(self, base):
QSystemTrayIcon.__init__(self)
self.base = base
icon = QIcon(base.get_image_path('turpial-tray.png'))
self.setIcon(icon)
self.setToolTip(DESC)
self.activated.connect(self.__activated)
self.loading()
self.show()
示例13: __init__
def __init__(self, icon, com, parent=None):
QSystemTrayIcon.__init__(self, icon, parent)
menu = QMenu(parent)
showAction = menu.addAction("Mostrar")
showAction.activated.connect(self.show_action)
exitAction = menu.addAction("Fechar")
exitAction.activated.connect(self.close_event)
self.activated.connect(self.tray_activated)
self.setContextMenu(menu)
self.com = com
self.show()
示例14: __init__
def __init__(self, parent):
QSystemTrayIcon.__init__(self, parent)
icon = QIcon(resources.IMAGES['iconUpdate'])
self.setIcon(icon)
self.setup_menu()
self.ide_version = '0'
self.download_link = ''
if settings.NOTIFY_UPDATES:
self.thread = ThreadUpdates()
self.connect(self.thread,
SIGNAL("versionReceived(QString, QString)"),
self._show_messages)
self.thread.start()
示例15: __init__
def __init__(self, parent):
QSystemTrayIcon.__init__(self, parent)
icon = QIcon(resources.IMAGES['iconUpdate'])
self.setIcon(icon)
self.setup_menu()
if settings.NOTIFY_UPDATES:
self.thread = ThreadUpdates()
self.connect(self.thread, SIGNAL("finished()"),
self._show_messages)
self.thread.start()
else:
self.show = self.hide