File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,20 @@ class AppDelegate: NSObject, NSApplicationDelegate {
2020 }
2121
2222 let menu = NSMenu ( )
23+ menu. addItem (
24+ NSMenuItem (
25+ title: " 設定を開く " ,
26+ action: #selector( openSettings) ,
27+ keyEquivalent: " , "
28+ ) )
29+ menu. addItem ( NSMenuItem . separator ( ) )
30+ menu. addItem (
31+ NSMenuItem (
32+ title: " 再起動 " ,
33+ action: #selector( restartBridge) ,
34+ keyEquivalent: " r "
35+ ) )
36+ menu. addItem ( NSMenuItem . separator ( ) )
2337 menu. addItem (
2438 NSMenuItem (
2539 title: " HAMLAB Bridge 終了 " ,
@@ -44,6 +58,18 @@ class AppDelegate: NSObject, NSApplicationDelegate {
4458 }
4559 }
4660
61+ @objc func openSettings( ) {
62+ if let url = URL ( string: " http://127.0.0.1:17801/settings " ) {
63+ NSWorkspace . shared. open ( url)
64+ }
65+ }
66+
67+ @objc func restartBridge( ) {
68+ bridgeProcess? . terminate ( )
69+ bridgeProcess? . waitUntilExit ( )
70+ startBridge ( )
71+ }
72+
4773 @objc func quit( ) {
4874 bridgeProcess? . terminate ( )
4975 NSApp . terminate ( nil )
You can’t perform that action at this time.
0 commit comments