Linux PyQt tray application to control OctoPrint instances
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env python3
  2. # OctoTray Linux Qt System Tray OctoPrint client
  3. #
  4. # main.py
  5. #
  6. # Entry point for OctoTray application.
  7. # Depends on 'python-pyqt5'.
  8. import sys
  9. import signal
  10. from PyQt5.QtWidgets import QSystemTrayIcon, QApplication
  11. from OctoTray import OctoTray
  12. app = QApplication(sys.argv)
  13. app.setQuitOnLastWindowClosed(False)
  14. signal.signal(signal.SIGINT, signal.SIG_DFL)
  15. inSysTray = QSystemTrayIcon.isSystemTrayAvailable()
  16. if ("windowed" in sys.argv) or ("--windowed" in sys.argv) or ("-w" in sys.argv):
  17. inSysTray = False
  18. tray = OctoTray(app, inSysTray)
  19. rc = app.exec_()
  20. while rc == 42:
  21. tray.closeAll()
  22. tray = OctoTray(app, inSysTray)
  23. rc = app.exec_()
  24. sys.exit(rc)