Update systrayUpdater
This commit is contained in:
parent
dc9b629382
commit
6fc3ffc611
|
@ -70,31 +70,29 @@ def update():
|
||||||
app = QApplication([])
|
app = QApplication([])
|
||||||
app.setQuitOnLastWindowClosed(False)
|
app.setQuitOnLastWindowClosed(False)
|
||||||
|
|
||||||
# Set up timer to update count
|
# Set up timer
|
||||||
updateTimer = QTimer()
|
updateTimer = QTimer()
|
||||||
updateTimer.timeout.connect(count)
|
updateTimer.timeout.connect(count)
|
||||||
updateTimer.singleShot(1,count) # Initially populate available updates
|
updateTimer.singleShot(1,count) # Initially populate available updates
|
||||||
updateTimer.start(wait)
|
updateTimer.start(wait)
|
||||||
|
|
||||||
# Adding items to the menu
|
# Adding items to the tray
|
||||||
tray = QSystemTrayIcon()
|
tray = QSystemTrayIcon()
|
||||||
icon = QIcon(icn)
|
icon = QIcon(icn)
|
||||||
tray.setIcon(icon)
|
tray.setIcon(icon)
|
||||||
tray.setToolTip(avail)
|
tray.setToolTip(avail)
|
||||||
tray.setVisible(True)
|
tray.setVisible(True)
|
||||||
|
|
||||||
# Creating the options
|
# Creating the menu/options
|
||||||
menu = QMenu()
|
menu = QMenu()
|
||||||
runUpdate = QAction("Run Update")
|
runUpdate = QAction("Run Update")
|
||||||
readNews = QAction("Read the News")
|
readNews = QAction("Read the News")
|
||||||
|
quit = QAction("Quit")
|
||||||
runUpdate.triggered.connect(update)
|
runUpdate.triggered.connect(update)
|
||||||
readNews.triggered.connect(news)
|
readNews.triggered.connect(news)
|
||||||
|
|
||||||
# To quit the app
|
|
||||||
quit = QAction("Quit")
|
|
||||||
quit.triggered.connect(app.quit)
|
quit.triggered.connect(app.quit)
|
||||||
|
|
||||||
# Place the app in the System Tray
|
# Place the menu in the System Tray
|
||||||
tray.setContextMenu(menu)
|
tray.setContextMenu(menu)
|
||||||
|
|
||||||
app.exec_()
|
app.exec_()
|
||||||
|
|
Loading…
Reference in New Issue