Show config reload notification when edit config using xcode

This commit is contained in:
yicheng 2019-12-14 14:03:27 +08:00
parent cf78bcb834
commit e1ce6b35db
2 changed files with 4 additions and 3 deletions

View File

@ -1,11 +1,12 @@
// //
import AppKit
// ConfigFileFactory.swift // ConfigFileFactory.swift
// ClashX // ClashX
// //
// Created by CYC on 2018/8/5. // Created by CYC on 2018/8/5.
// Copyright © 2018 yichengchen. All rights reserved. // Copyright © 2018 yichengchen. All rights reserved.
// //
import AppKit
import Foundation import Foundation
import SwiftyJSON import SwiftyJSON
@ -28,7 +29,7 @@ class ConfigFileManager {
return return
} }
for event in events { for event in events {
if event.flags.contains(.ItemModified) { if event.flags.contains(.ItemModified) || event.flags.contains(.ItemRenamed) {
NSUserNotificationCenter.default NSUserNotificationCenter.default
.postConfigFileChangeDetectionNotice() .postConfigFileChangeDetectionNotice()
NotificationCenter.default NotificationCenter.default

View File

@ -36,7 +36,7 @@ class RemoteConfigViewController: NSViewController {
self.showAdd(defaultUrl: url, name: name) self.showAdd(defaultUrl: url, name: name)
}.disposed(by: disposeBag) }.disposed(by: disposeBag)
} }
override func viewWillAppear() { override func viewWillAppear() {
super.viewWillAppear() super.viewWillAppear()
NSApp.activate(ignoringOtherApps: true) NSApp.activate(ignoringOtherApps: true)