-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui.py
More file actions
38 lines (31 loc) · 910 Bytes
/
ui.py
File metadata and controls
38 lines (31 loc) · 910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import sys
from QtCore import *
from QtGui import *
class App:
def __init__(self):
# Create a Qt application
self.app = QApplication(sys.argv)
icon = QIcon("jenkins_favicon.png")
menu = QMenu()
settingAction = menu.addAction("setting")
settingAction.triggered.connect(self.setting)
exitAction = menu.addAction("exit")
exitAction.triggered.connect(sys.exit)
self.tray = QSystemTrayIcon()
self.tray.setIcon(icon)
self.tray.setContextMenu(menu)
self.tray.show()
self.tray.setToolTip("unko!")
self.tray.showMessage("hoge", "moge")
self.tray.showMessage("fuga", "moge")
def run(self):
# Enter Qt application main loop
self.app.exec_()
sys.exit()
def setting(self):
self.dialog = QDialog()
self.dialog.setWindowTitle("Setting Dialog")
self.dialog.show()
if __name__ == "__main__":
app = App()
app.run()