File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -87,20 +87,25 @@ def __init__(
8787 self .manager = manager
8888 self .testing = testing
8989
90+ self .root_url = "http://localhost:{port}" .format (port = 5666 if self .testing else 5600 )
91+ self .activated .connect (self .on_activated )
92+
9093 self ._build_rootmenu ()
9194
95+ def on_activated (self , reason : QSystemTrayIcon .ActivationReason ):
96+ if reason == QSystemTrayIcon .DoubleClick :
97+ open_webui (self .root_url )
98+
9299 def _build_rootmenu (self ) -> None :
93100 menu = QMenu (self ._parent )
94101
95- root_url = "http://localhost:{port}" .format (port = 5666 if self .testing else 5600 )
96-
97102 if self .testing :
98103 menu .addAction ("Running in testing mode" ) # .setEnabled(False)
99104 menu .addSeparator ()
100105
101106 # openWebUIIcon = QIcon.fromTheme("open")
102- menu .addAction ("Open Dashboard" , lambda : open_webui (root_url ))
103- menu .addAction ("Open API Browser" , lambda : open_apibrowser (root_url ))
107+ menu .addAction ("Open Dashboard" , lambda : open_webui (self . root_url ))
108+ menu .addAction ("Open API Browser" , lambda : open_apibrowser (self . root_url ))
104109
105110 menu .addSeparator ()
106111
You can’t perform that action at this time.
0 commit comments