Add WebProtalManager placeHolder
This commit is contained in:
parent
f296b9a513
commit
7da7f9bc87
|
@ -68,6 +68,8 @@
|
|||
F977FAAC2366790500C17F1F /* AutoUpgardeManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F977FAAB2366790500C17F1F /* AutoUpgardeManager.swift */; };
|
||||
F977FAAE23669D6400C17F1F /* ConnectionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F977FAAD23669D6400C17F1F /* ConnectionManager.swift */; };
|
||||
F9A7C06C2306E874007163C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F9A7C06B2306E874007163C7 /* main.m */; };
|
||||
F9E754D0239CC21F00CEE7CC /* WebPortalManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9E754CF239CC21F00CEE7CC /* WebPortalManager.swift */; };
|
||||
F9E754D2239CC28D00CEE7CC /* NSAlert+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9E754D1239CC28D00CEE7CC /* NSAlert+Extension.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
|
@ -183,6 +185,8 @@
|
|||
F977FAAD23669D6400C17F1F /* ConnectionManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectionManager.swift; sourceTree = "<group>"; };
|
||||
F9A7C0692306E874007163C7 /* com.west2online.ClashX.ProxyConfigHelper */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = com.west2online.ClashX.ProxyConfigHelper; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
F9A7C06B2306E874007163C7 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
F9E754CF239CC21F00CEE7CC /* WebPortalManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebPortalManager.swift; sourceTree = "<group>"; };
|
||||
F9E754D1239CC28D00CEE7CC /* NSAlert+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSAlert+Extension.swift"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
|
@ -224,6 +228,7 @@
|
|||
4982F51E2344A216008804B0 /* Cgo+Convert.swift */,
|
||||
F9203A25236342820020D57D /* AppDelegate+..swift */,
|
||||
F92D0B29236C759100575E15 /* NSTextField+Vibrancy.swift */,
|
||||
F9E754D1239CC28D00CEE7CC /* NSAlert+Extension.swift */,
|
||||
);
|
||||
path = Extensions;
|
||||
sourceTree = "<group>";
|
||||
|
@ -249,6 +254,7 @@
|
|||
F935B2FB23085515009E4D33 /* SystemProxyManager.swift */,
|
||||
F977FAAB2366790500C17F1F /* AutoUpgardeManager.swift */,
|
||||
F977FAAD23669D6400C17F1F /* ConnectionManager.swift */,
|
||||
F9E754CF239CC21F00CEE7CC /* WebPortalManager.swift */,
|
||||
);
|
||||
path = Managers;
|
||||
sourceTree = "<group>";
|
||||
|
@ -627,6 +633,7 @@
|
|||
492C4871210EF62E004554A0 /* ClashConfig.swift in Sources */,
|
||||
492C4869210EE6B9004554A0 /* ApiRequest.swift in Sources */,
|
||||
49CF3B6520CEE06C001EBF94 /* ConfigManager.swift in Sources */,
|
||||
F9E754D0239CC21F00CEE7CC /* WebPortalManager.swift in Sources */,
|
||||
495BFB8821919B9800C8779D /* RemoteConfigManager.swift in Sources */,
|
||||
4982F51F2344A216008804B0 /* Cgo+Convert.swift in Sources */,
|
||||
49722FF1211F338B00650A41 /* Witness.swift in Sources */,
|
||||
|
@ -639,6 +646,7 @@
|
|||
499A485822ED715200F6C675 /* RemoteConfigModel.swift in Sources */,
|
||||
49D176AB23575BB20093DD7B /* ProxyGroupMenuItemView.swift in Sources */,
|
||||
4966E9E32118153A00A391FB /* NSUserNotificationCenter+Extension.swift in Sources */,
|
||||
F9E754D2239CC28D00CEE7CC /* NSAlert+Extension.swift in Sources */,
|
||||
499976C821359F0400E7BF83 /* ClashWebViewContoller.swift in Sources */,
|
||||
49D176A9235614340093DD7B /* ProxyGroupSpeedTestMenuItem.swift in Sources */,
|
||||
F976275C23634DF8000EDEFE /* LoginServiceKit.swift in Sources */,
|
||||
|
|
|
@ -346,6 +346,9 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
|||
ConnectionManager.addCloseOptionMenuItem(&experimentalMenu)
|
||||
AutoUpgardeManager.shared.setup()
|
||||
AutoUpgardeManager.shared.addChanelMenuItem(&experimentalMenu)
|
||||
if WebPortalManager.hasWebProtal {
|
||||
WebPortalManager.shared.addWebProtalMenuItem(&statusMenu)
|
||||
}
|
||||
updateExperimentalFeatureStatus()
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
//
|
||||
// NSAlert+Extension.swift
|
||||
// ClashX
|
||||
//
|
||||
// Created by yicheng on 2019/1/11.
|
||||
// Copyright © 2019 west2online. All rights reserved.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
|
||||
extension NSAlert {
|
||||
static func alert(with text: String) {
|
||||
let alert = NSAlert()
|
||||
alert.messageText = text
|
||||
alert.alertStyle = .warning
|
||||
alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
|
||||
alert.runModal()
|
||||
}
|
||||
}
|
|
@ -36,10 +36,12 @@ class AutoUpgardeManager: NSObject {
|
|||
// MARK: Public
|
||||
|
||||
func setup() {
|
||||
guard WebPortalManager.hasWebProtal == false else { return }
|
||||
SUUpdater.shared()?.delegate = self
|
||||
}
|
||||
|
||||
func addChanelMenuItem(_ menu: inout NSMenu) {
|
||||
guard WebPortalManager.hasWebProtal == false else { return }
|
||||
let upgradeMenu = NSMenu(title: NSLocalizedString("Upgrade Channel", comment: ""))
|
||||
for (_, item) in menuItems {
|
||||
upgradeMenu.addItem(item)
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// WebPortalManager.swift
|
||||
// ClashX
|
||||
//
|
||||
// Created by yicheng on 2019/1/11.
|
||||
// Copyright © 2019 west2online. All rights reserved.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
|
||||
class WebPortalManager {
|
||||
static let shared = WebPortalManager()
|
||||
static let hasWebProtal = false
|
||||
|
||||
func addWebProtalMenuItem(_ menu: inout NSMenu) {}
|
||||
}
|
|
@ -9,7 +9,7 @@
|
|||
import Cocoa
|
||||
|
||||
class RemoteConfigModel: Codable {
|
||||
let url: String
|
||||
var url: String
|
||||
let name: String
|
||||
var updateTime: Date?
|
||||
var updating = false
|
||||
|
|
Loading…
Reference in New Issue